mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
dadc7eb329
Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
35 lines
868 B
Nix
35 lines
868 B
Nix
{ stdenv, fetchurl, tcl, tcllib, runtimeShell }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "tcl2048-0.4.0";
|
|
|
|
src = fetchurl {
|
|
url = https://raw.githubusercontent.com/dbohdan/2048.tcl/v0.4.0/2048.tcl;
|
|
sha256 = "53f5503efd7f029b2614b0f9b1e3aac6c0342735a3c9b811d74a5135fee3e89e";
|
|
};
|
|
|
|
phases = "installPhase";
|
|
|
|
installPhase = ''
|
|
mkdir -pv $out/bin
|
|
cp $src $out/2048.tcl
|
|
cat > $out/bin/2048 << EOF
|
|
#!${runtimeShell}
|
|
|
|
# wrapper for tcl2048
|
|
export TCLLIBPATH="${tcllib}/lib/tcllib${tcllib.version}"
|
|
${tcl}/bin/tclsh $out/2048.tcl
|
|
EOF
|
|
|
|
chmod +x $out/bin/2048
|
|
'';
|
|
|
|
meta = {
|
|
homepage = https://github.com/dbohdan/2048.tcl;
|
|
description = "The game of 2048 implemented in Tcl";
|
|
license = stdenv.lib.licenses.mit;
|
|
platforms = stdenv.lib.platforms.all;
|
|
maintainers = with stdenv.lib.maintainers; [ dbohdan ];
|
|
};
|
|
}
|