summary refs log tree commit diff
path: root/pkgs/development/tools/parsing/flex
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-07-23 17:35:23 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-07-24 19:40:46 -0400
commit1833a04aed4ba5658b71bf7a88492829fc882d6d (patch)
tree331e0592efc18150b714cd0d25a6359d4e9a6720 /pkgs/development/tools/parsing/flex
parent4116754f4583b2f7502c05aa52d4fe09eafad253 (diff)
downloadnixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar.gz
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar.bz2
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar.lz
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar.xz
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.tar.zst
nixlib-1833a04aed4ba5658b71bf7a88492829fc882d6d.zip
flex: Don't use crossAttrs
Diffstat (limited to 'pkgs/development/tools/parsing/flex')
-rw-r--r--pkgs/development/tools/parsing/flex/2.5.35.nix10
-rw-r--r--pkgs/development/tools/parsing/flex/2.6.1.nix21
2 files changed, 13 insertions, 18 deletions
diff --git a/pkgs/development/tools/parsing/flex/2.5.35.nix b/pkgs/development/tools/parsing/flex/2.5.35.nix
index 4f78b0c71c16..1062a361413c 100644
--- a/pkgs/development/tools/parsing/flex/2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/2.5.35.nix
@@ -12,12 +12,10 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ m4 ];
 
-  crossAttrs = {
-    preConfigure = ''
-      export ac_cv_func_malloc_0_nonnull=yes
-      export ac_cv_func_realloc_0_nonnull=yes
-    '';
-  };
+  preConfigure = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
 
   meta = {
     branch = "2.5.35";
diff --git a/pkgs/development/tools/parsing/flex/2.6.1.nix b/pkgs/development/tools/parsing/flex/2.6.1.nix
index f27fac9bcb5d..954c2bbcb245 100644
--- a/pkgs/development/tools/parsing/flex/2.6.1.nix
+++ b/pkgs/development/tools/parsing/flex/2.6.1.nix
@@ -12,22 +12,19 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ m4 ];
 
+  preConfigure = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
   postConfigure = stdenv.lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
     sed -i Makefile -e 's/-no-undefined//;'
   '';
 
-  crossAttrs = {
-
-    # disable tests which can't run on build machine
-    postPatch = ''
-      substituteInPlace Makefile.in --replace "tests" " ";
-    '';
-
-    preConfigure = ''
-      export ac_cv_func_malloc_0_nonnull=yes
-      export ac_cv_func_realloc_0_nonnull=yes
-    '';
-  };
+  # disable tests which can't run on build machine
+  postPatch = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    substituteInPlace Makefile.in --replace "tests" " ";
+  '';
 
   meta = {
     homepage = https://github.com/westes/flex;