about summary refs log tree commit diff
path: root/pkgs/test/stdenv
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2022-12-13 01:10:52 +0200
committerArtturin <Artturin@artturin.com>2022-12-13 01:12:20 +0200
commit630bb71ac5216135f4f576f03be465ccdc16d46a (patch)
treefe8ba6406698f00bcdeff27c765da19ad9740064 /pkgs/test/stdenv
parentb3717f6c143be42b3abb8f18302901df5372fbe9 (diff)
stdenv: sort defaultNativeBuildInputs alphabetically
Diffstat (limited to 'pkgs/test/stdenv')
-rw-r--r--pkgs/test/stdenv/hooks.nix136
1 files changed, 66 insertions, 70 deletions
diff --git a/pkgs/test/stdenv/hooks.nix b/pkgs/test/stdenv/hooks.nix
index de6b294fc847a..7f25d7dbd2db0 100644
--- a/pkgs/test/stdenv/hooks.nix
+++ b/pkgs/test/stdenv/hooks.nix
@@ -3,35 +3,7 @@
 # ordering should match defaultNativeBuildInputs
 
 {
-  move-docs = stdenv.mkDerivation {
-    name = "test-move-docs";
-    buildCommand = ''
-      mkdir -p $out/{man,doc,info}
-      touch $out/{man,doc,info}/foo
-      cat $out/{man,doc,info}/foo
-
-      _moveToShare
-
-      (cat $out/share/{man,doc,info}/foo 2>/dev/null && echo "man,doc,info were moved") || (echo "man,doc,info were not moved" && exit 1)
-    '';
-  };
-  make-symlinks-relative = stdenv.mkDerivation {
-    name = "test-make-symlinks-relative";
-    buildCommand = ''
-      mkdir -p $out/{bar,baz}
-      source1="$out/bar/foo"
-      destination1="$out/baz/foo"
-      echo foo > $source1
-      ln -s $source1 $destination1
-      echo "symlink before patching: $(readlink $destination1)"
-
-      _makeSymlinksRelative
-
-      echo "symlink after patching: $(readlink $destination1)"
-      ([[ -e $destination1 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
-      ([[ $(readlink $destination1) == "../bar/foo" ]] && echo "absolute symlink was made relative") || (echo "symlink was not made relative" && exit 1)
-    '';
-  };
+  # TODO: add audit-tmpdir
   compress-man-pages =
     let
       manFile = pkgs.writeText "small-man" ''
@@ -49,8 +21,66 @@
         [[ -e $out/share/man/small-man.1.gz ]]
       '';
     };
+  make-symlinks-relative = stdenv.mkDerivation {
+    name = "test-make-symlinks-relative";
+    buildCommand = ''
+      mkdir -p $out/{bar,baz}
+      source1="$out/bar/foo"
+      destination1="$out/baz/foo"
+      echo foo > $source1
+      ln -s $source1 $destination1
+      echo "symlink before patching: $(readlink $destination1)"
 
-  # TODO: add strip
+      _makeSymlinksRelative
+
+      echo "symlink after patching: $(readlink $destination1)"
+      ([[ -e $destination1 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
+      ([[ $(readlink $destination1) == "../bar/foo" ]] && echo "absolute symlink was made relative") || (echo "symlink was not made relative" && exit 1)
+    '';
+  };
+  move-docs = stdenv.mkDerivation {
+    name = "test-move-docs";
+    buildCommand = ''
+      mkdir -p $out/{man,doc,info}
+      touch $out/{man,doc,info}/foo
+      cat $out/{man,doc,info}/foo
+
+      _moveToShare
+
+      (cat $out/share/{man,doc,info}/foo 2>/dev/null && echo "man,doc,info were moved") || (echo "man,doc,info were not moved" && exit 1)
+    '';
+  };
+  move-lib64 = stdenv.mkDerivation {
+    name = "test-move-lib64";
+    buildCommand = ''
+      mkdir -p $out/lib64
+      touch $out/lib64/foo
+      cat $out/lib64/foo
+
+      _moveLib64
+
+      # check symlink
+      [[ -h $out/lib64 ]]
+      ([[ -e $out/lib64 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
+      [[ -e $out/lib/foo ]]
+    '';
+  };
+  move-sbin = stdenv.mkDerivation {
+    name = "test-move-sbin";
+    buildCommand = ''
+      mkdir -p $out/sbin
+      touch $out/sbin/foo
+      cat $out/sbin/foo
+
+      _moveSbin
+
+      # check symlink
+      [[ -h $out/sbin ]]
+      ([[ -e $out/sbin ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
+      [[ -e $out/bin/foo ]]
+    '';
+  };
+  # TODO: add multiple-outputs
   # TODO: move patch-shebangs test from pkgs/test/patch-shebangs/default.nix to here
   prune-libtool-files =
     let
@@ -71,40 +101,14 @@
         grep "^old_library='''" $out/lib/libFoo.la
       '';
     };
-  # TODO: add audit-tmpdir
-  # TODO: add multiple-outputs
-  move-sbin = stdenv.mkDerivation {
-    name = "test-move-sbin";
-    buildCommand = ''
-      mkdir -p $out/sbin
-      touch $out/sbin/foo
-      cat $out/sbin/foo
-
-      _moveSbin
-
-      # check symlink
-      [[ -h $out/sbin ]]
-      ([[ -e $out/sbin ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
-      [[ -e $out/bin/foo ]]
-    '';
-  };
-
-  move-lib64 = stdenv.mkDerivation {
-    name = "test-move-lib64";
+  reproducible-builds = stdenv.mkDerivation {
+    name = "test-reproducible-builds";
     buildCommand = ''
-      mkdir -p $out/lib64
-      touch $out/lib64/foo
-      cat $out/lib64/foo
-
-      _moveLib64
-
-      # check symlink
-      [[ -h $out/lib64 ]]
-      ([[ -e $out/lib64 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
-      [[ -e $out/lib/foo ]]
+      # can't be tested more precisely because the value of random-seed changes depending on the output
+      [[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
+      touch $out
     '';
   };
-
   set-source-date-epoch-to-latest = stdenv.mkDerivation {
     name = "test-set-source-date-epoch-to-latest";
     buildCommand = ''
@@ -118,13 +122,5 @@
       touch $out
     '';
   };
-
-  reproducible-builds = stdenv.mkDerivation {
-    name = "test-reproducible-builds";
-    buildCommand = ''
-      # can't be tested more precisely because the value of random-seed changes depending on the output
-      [[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
-      touch $out
-    '';
-  };
+  # TODO: add strip
 }