stdenv: sort defaultNativeBuildInputs alphabetically
This commit is contained in:
parent
b3717f6c14
commit
630bb71ac5
2 changed files with 76 additions and 79 deletions
|
@ -57,19 +57,20 @@ argsStdenv@{ name ? "stdenv", preHook ? "", initialPath
|
|||
|
||||
let
|
||||
defaultNativeBuildInputs = extraNativeBuildInputs ++
|
||||
[ ../../build-support/setup-hooks/move-docs.sh
|
||||
../../build-support/setup-hooks/make-symlinks-relative.sh
|
||||
../../build-support/setup-hooks/compress-man-pages.sh
|
||||
../../build-support/setup-hooks/strip.sh
|
||||
../../build-support/setup-hooks/patch-shebangs.sh
|
||||
../../build-support/setup-hooks/prune-libtool-files.sh
|
||||
[
|
||||
../../build-support/setup-hooks/audit-tmpdir.sh
|
||||
../../build-support/setup-hooks/compress-man-pages.sh
|
||||
../../build-support/setup-hooks/make-symlinks-relative.sh
|
||||
../../build-support/setup-hooks/move-docs.sh
|
||||
../../build-support/setup-hooks/move-lib64.sh
|
||||
../../build-support/setup-hooks/move-sbin.sh
|
||||
../../build-support/setup-hooks/move-systemd-user-units.sh
|
||||
../../build-support/setup-hooks/multiple-outputs.sh
|
||||
../../build-support/setup-hooks/move-sbin.sh
|
||||
../../build-support/setup-hooks/move-lib64.sh
|
||||
../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh
|
||||
../../build-support/setup-hooks/patch-shebangs.sh
|
||||
../../build-support/setup-hooks/prune-libtool-files.sh
|
||||
../../build-support/setup-hooks/reproducible-builds.sh
|
||||
../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh
|
||||
../../build-support/setup-hooks/strip.sh
|
||||
] ++ lib.optionals hasCC [ cc ];
|
||||
|
||||
defaultBuildInputs = extraBuildInputs;
|
||||
|
|
|
@ -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";
|
||||
reproducible-builds = stdenv.mkDerivation {
|
||||
name = "test-reproducible-builds";
|
||||
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 ]]
|
||||
# can't be tested more precisely because the value of random-seed changes depending on the output
|
||||
[[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
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 ]]
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue