about summary refs log tree commit diff
path: root/pkgs/tools/misc/cowsay
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2018-12-04 00:19:37 +0100
committerFlorian Klink <flokli@flokli.de>2018-12-04 00:23:44 +0100
commitfae81f322e045a996c2108aa61996e31b2af64d1 (patch)
treed5b9dc62cf4bef1276e0f2507dd6ce28f35277ce /pkgs/tools/misc/cowsay
parent7c73f53d836af32624468e8de7730be1f033667c (diff)
cowsay: fix cross
The install.sh script looks for all perls in $PATH, tries to execute
these to test whether that perl is "good", if it is, takes it and
puts it into the shebang.

This obviously can't work for cross. As installation seems to be pretty
trivial, do it in a custom install phase.
Diffstat (limited to 'pkgs/tools/misc/cowsay')
-rw-r--r--pkgs/tools/misc/cowsay/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/tools/misc/cowsay/default.nix b/pkgs/tools/misc/cowsay/default.nix
index 4d55b70d007bf..6b5c9c5139449 100644
--- a/pkgs/tools/misc/cowsay/default.nix
+++ b/pkgs/tools/misc/cowsay/default.nix
@@ -11,8 +11,18 @@ stdenv.mkDerivation rec{
 
   buildInputs = [ perl ];
 
+  postBuild = ''
+    substituteInPlace cowsay --replace "%BANGPERL%" "!${perl}/bin/perl" \
+      --replace "%PREFIX%" "$out"
+  '';
+
   installPhase = ''
-    bash ./install.sh $out
+    mkdir -p $out/{bin,man/man1,share/cows}
+    install -m755 cowsay $out/bin/cowsay
+    ln -s cowsay $out/bin/cowthink
+    install -m644 cowsay.1 $out/man/man1/cowsay.1
+    ln -s cowsay.1 $out/man/man1/cowthink.1
+    install -m644 cows/* -t $out/share/cows/
   '';
 
   meta = with stdenv.lib; {