summary refs log tree commit diff
path: root/pkgs/servers/x11/xorg
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-13 11:31:24 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-14 23:30:37 -0400
commit330ca731e88ec015181c43d92ae8f7c77cf0226a (patch)
tree1e840031c407cd50702ff78d05daca2f28c45c46 /pkgs/servers/x11/xorg
parentd7160f39bd46e8ee86e95cbaf7a8f3d5685ab30c (diff)
downloadnixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.gz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.bz2
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.lz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.xz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.zst
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.zip
treewide: Get rid of all uses of crossConfig
The hack of using `crossConfig` to enforce stricter handling of
dependencies is replaced with a dedicated `strictDeps` for that purpose.
(Experience has shown that my punning was a terrible idea that made more
difficult and embarrising to teach teach.)

Now that is is clear, a few packages now use `strictDeps`, to fix
various bugs:

 - bintools-wrapper and cc-wrapper
Diffstat (limited to 'pkgs/servers/x11/xorg')
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix31
1 files changed, 19 insertions, 12 deletions
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 18189ba2e68d..42831dc40642 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -5,11 +5,9 @@ let
   inherit (stdenv) lib isDarwin;
   inherit (lib) overrideDerivation;
 
-  setMalloc0ReturnsNullCrossCompiling = ''
-    if test -n "$crossConfig"; then
-      configureFlags="$configureFlags --enable-malloc0returnsnull";
-    fi
-  '';
+  malloc0ReturnsNullCrossFlag = stdenv.lib.optional
+    (stdenv.hostPlatform != stdenv.buildPlatform)
+    "--enable-malloc0returnsnull";
 
   gitRelease = { libName, version, rev, sha256 } : attrs : attrs // {
     name = libName + "-" + version;
@@ -101,7 +99,9 @@ in
 
   libX11 = attrs: attrs // {
     outputs = [ "out" "dev" "man" ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling + ''
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
+    preConfigure = ''
       sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
     '';
     postInstall =
@@ -138,16 +138,19 @@ in
 
   libXxf86vm = attrs: attrs // {
     outputs = [ "out" "dev" ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling;
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
   };
 
   # Propagate some build inputs because of header file dependencies.
   # Note: most of these are in Requires.private, so maybe builder.sh
   # should propagate them automatically.
   libXt = attrs: attrs // {
-    preConfigure = setMalloc0ReturnsNullCrossCompiling + ''
+    preConfigure = ''
       sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
     '';
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
     propagatedBuildInputs = [ xorg.libSM ];
     CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
     outputs = [ "out" "dev" "devdoc" ];
@@ -188,7 +191,8 @@ in
   libXft = attrs: attrs // {
     outputs = [ "out" "dev" ];
     propagatedBuildInputs = [ xorg.libXrender args.freetype args.fontconfig ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling;
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
     # the include files need ft2build.h, and Requires.private isn't enough for us
     postInstall = ''
       sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc"
@@ -198,7 +202,8 @@ in
   libXext = attrs: attrs // {
     outputs = [ "out" "dev" "man" "doc" ];
     propagatedBuildInputs = [ xorg.xproto xorg.libXau ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling;
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
   };
 
   libXfixes = attrs: attrs // {
@@ -221,7 +226,8 @@ in
 
   libXrandr = attrs: attrs // {
     outputs = [ "out" "dev" ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling;
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
     propagatedBuildInputs = [xorg.libXrender];
   };
 
@@ -232,8 +238,9 @@ in
 
   libXrender = attrs: attrs // {
     outputs = [ "out" "dev" "doc" ];
+    configureFlags = attrs.configureFlags or []
+      ++ malloc0ReturnsNullCrossFlag;
     propagatedBuildInputs = [ xorg.renderproto ];
-    preConfigure = setMalloc0ReturnsNullCrossCompiling;
   };
 
   libXres = attrs: attrs // {