Created
November 11, 2017 10:16
-
-
Save abbradar/4233f2a8cf1a4747fe51160494d44cd7 to your computer and use it in GitHub Desktop.
Test for makeWrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, makeWrapper }: | |
stdenv.mkDerivation { | |
name = "make-wrapper-test"; | |
buildInputs = [ makeWrapper ]; | |
buildCommand = '' | |
mkdir -p $out/bin | |
cat > $out/bin/test <<EOF | |
#!${stdenv.shell} | |
echo "FOO=\$FOO" | |
echo "BAR=\$BAR" | |
echo "BAZ=\$BAZ" | |
echo "QUZ=\$QUZ" | |
EOF | |
chmod +x $out/bin/test | |
cat > test-contents <<EOF | |
test1 | |
$test2 test3 | |
test4 | |
EOF | |
wrapProgram $out/bin/test \ | |
--set FOO 'ahaha $ \' \ | |
--set BAR 'ahaha $ \' \ | |
--set BAZ 'ahaha $ \' \ | |
--set QUZ 'ahaha $ \' \ | |
--prefix FOO ' ' 'bar '"'"'$baz' \ | |
--suffix BAR ' ' 'bar '"'"'$baz' \ | |
--prefix-contents BAZ '$' test-contents \ | |
--suffix-contents QUZ '$' test-contents | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment