[Nix-dev] Patching uname in stdenv?

Marc Weber marco-oweber at gmx.de
Wed Aug 17 16:52:04 CEST 2011


> Why they want the kernel version?
Don't ask me. I have't had time to debug it. All I found out was that it
python configured itself to use different modules and some fail.

for older xulunner which got removed there were similar problems.

It looked to me like they are configuring based on target (linux vs darwin ...)

and they all expected linux-2.X with increasing X forever without a major version bump.

Patches for postfix (newer version than current nixpkgs), obsolete xulrunner
and valgrind failed:

POSTFIX failed [1]
xulrunner failed [2]
valgrind failed [3]

[1]
-------------------- pkgs/servers/mail/postfix/default.nix --------------------
index 773f113..f779964 100644
@@ -56,7 +56,11 @@ stdenv.mkDerivation {
 
   buildInputs = [db4 openssl cyrus_sasl perl];
   
-  patches = [./postfix-2.2.9-db.patch ./postfix-2.2.9-lib.patch];
+  patches = [
+    ./postfix-2.2.9-db.patch
+    ./postfix-2.2.9-lib.patch
+    ./postfix-linux-3.0.patch
+  ];
   
   inherit glibc;
 }

-------------- pkgs/servers/mail/postfix/postfix-linux-3.0.patch --------------
new file mode 100644
index 0000000..bee1c4c
@@ -0,0 +1,14 @@
+diff --git a/makedefs b/makedefs
+index 4faa430..965ceb3 100644
+--- a/makedefs
++++ b/makedefs
+@@ -108,6 +108,9 @@ case $# in
+  *) echo usage: $0 [system release] 1>&2; exit 1;;
+ esac
+ 
++# don't think that linux 3.0 introduced important changes
++ if [ "$SYSTEM" == "Linux" ] &&  [ "${RELEASE##3*}" == "" ]; then RELEASE=2; fi
++
+ case "$SYSTEM.$RELEASE" in
+    SCO_SV.3.2)	SYSTYPE=SCO5
+ 		# Use the native compiler by default

[2]

------------ pkgs/applications/networking/browsers/firefox/3.6.nix ------------
index 2d472ce..a4e82a4 100644
@@ -45,6 +45,13 @@ rec {
     
     inherit src;
 
+    # make it compile on linux-3.0. Is there more that has to be changed ?
+    postUnpack = ''
+      ( cd mozilla-*
+        [ -f security/coreconf/Linux3.0.mk ] || cp security/coreconf/Linux2.6.mk security/coreconf/Linux3.0.mk
+      )
+    '';
+
     patches = [
       # Loongson2f related patches:
       ./xulrunner-chromium-mips.patch

------------ pkgs/applications/networking/browsers/firefox/4.0.nix ------------
index 6d988fb..4452595 100644
@@ -54,6 +54,14 @@ rec {
     
     inherit src;
 
+    # make it compile on linux-3.0. Is there more that has to be changed ?
+    postUnpack = ''
+      ( cd mozilla-*
+        [ -f security/coreconf/Linux3.0.mk ] || cp security/coreconf/Linux2.6.mk security/coreconf/Linux3.0.mk
+      )
+    '';
+
+
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
         python dbus dbus_glib pango freetype fontconfig xlibs.libXi


[3]
+  # linux 3.0 hack
+  preConfigure = ''sed -i '/as_fn_error "Valgrind works on kernels 2.4, 2.6"/d' configure'';
+



More information about the nix-dev mailing list