diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix new file mode 100644 index 000000000000..25b476f68c06 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/tools/lc3tools/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl, unzip, flex, tk, ncurses, readline }: + +stdenv.mkDerivation { + pname = "lc3tools"; + version = "0.12"; + + src = fetchurl { + url = "https://highered.mheducation.com/sites/dl/free/0072467509/104652/lc3tools_v12.zip"; + hash = "sha256-PTM0ole8pHiJmUaahjPwcBQY8/hVVgQhADZ4bSABt3I="; + }; + + patches = [ + # the original configure looks for things in the FHS path + # I have modified it to take environment vars + ./0001-mangle-configure.patch + ]; + + nativeBuildInputs = [ unzip ]; + buildInputs = [ flex tk ncurses readline ]; + + # lumetta published this a while ago but handrolled his configure + # jank in the original packaging makes this necessary: + LIBS = "${flex}/lib:${ncurses}/lib:${readline}/lib"; + INCLUDES = "${flex}/include:${ncurses}/include:${readline}/include"; + + # it doesn't take `--prefix` + prefixKey = "--installdir "; + + postInstall = '' + rm $out/{COPYING,NO_WARRANTY,README} + mkdir -p $out/{bin,share/lc3tools} + + mv -t $out/share/lc3tools $out/lc3os* + mv -t $out/bin $out/lc3* + ''; + + meta = with stdenv.lib; { + description = "Toolchain and emulator for the LC-3 architecture"; + license = licenses.gpl2; + maintainers = with maintainers; [ anna328p ]; + }; +} |