git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #104450 from anna328p/lc3tools

lc3tools: init at 0.12

commit91e6ee02c74745afe997bd49a34d16d40d174f91 authorMaximilian Bosch <maximilian@mbosch.me> dateSun 29 Nov 2020, 18:39 (6 years ago) parente0ee7432ed27dc
3 files changed+72
pkgs/development/tools/lc3tools/0001-mangle-configure.patch+29 pkgs/development/tools/lc3tools/default.nix+42 pkgs/top-level/all-packages.nix+1
pkgs/development/tools/lc3tools/0001-mangle-configure.patchnew file+29
@@ -0,0 +1,29 @@
1+diff --git a/configure b/configure
2+index 46f9af4..dfc1b3e 100755
3+--- a/configure
4++++ b/configure
5+@@ -17,10 +17,11 @@ esac
6+
7+ # Some binaries that we'll need, and the places that we might find them.
8+
9+-binlist="uname flex gcc wish rm cp mkdir chmod sed"
10+-pathlist="/bin /usr/bin /usr/local/bin /sw/bin /usr/x116/bin /usr/X11R6/bin"
11+-libpathlist="/lib /usr/lib /usr/local/lib"
12+-incpathlist="/include /usr/include /usr/local/include"
13++IFS=:
14++binlist="uname:flex:gcc:wish:rm:cp:mkdir:chmod:sed"
15++pathlist=$PATH
16++libpathlist=$LIBS
17++incpathlist=$INCLUDES
18+
19+
20+ # Find the binaries (or die trying).
21+@@ -55,7 +56,7 @@ case `$uname -s` in
22+ echo "Configuring for Cygwin..."
23+ ;;
24+ Linux*) echo "Configuring for Linux..."
25+- OS_SIM_LIBS="-lcurses"
26++ # OS_SIM_LIBS="-lcurses"
27+ ;;
28+ SunOS*) echo "Configuring for Solaris..."
29+ OS_SIM_LIBS="-lcurses -lsocket -lnsl"
pkgs/development/tools/lc3tools/default.nixnew file+42
@@ -0,0 +1,42 @@
1+{ stdenv, fetchurl, unzip, flex, tk, ncurses, readline }:
2+
3+stdenv.mkDerivation {
4+ pname = "lc3tools";
5+ version = "0.12";
6+
7+ src = fetchurl {
8+ url = "https://highered.mheducation.com/sites/dl/free/0072467509/104652/lc3tools_v12.zip";
9+ hash = "sha256-PTM0ole8pHiJmUaahjPwcBQY8/hVVgQhADZ4bSABt3I=";
10+ };
11+
12+ patches = [
13+ # the original configure looks for things in the FHS path
14+ # I have modified it to take environment vars
15+ ./0001-mangle-configure.patch
16+ ];
17+
18+ nativeBuildInputs = [ unzip ];
19+ buildInputs = [ flex tk ncurses readline ];
20+
21+ # lumetta published this a while ago but handrolled his configure
22+ # jank in the original packaging makes this necessary:
23+ LIBS = "${flex}/lib:${ncurses}/lib:${readline}/lib";
24+ INCLUDES = "${flex}/include:${ncurses}/include:${readline}/include";
25+
26+ # it doesn't take `--prefix`
27+ prefixKey = "--installdir ";
28+
29+ postInstall = ''
30+ rm $out/{COPYING,NO_WARRANTY,README}
31+ mkdir -p $out/{bin,share/lc3tools}
32+
33+ mv -t $out/share/lc3tools $out/lc3os*
34+ mv -t $out/bin $out/lc3*
35+ '';
36+
37+ meta = with stdenv.lib; {
38+ description = "Toolchain and emulator for the LC-3 architecture";
39+ license = licenses.gpl2;
40+ maintainers = with maintainers; [ anna328p ];
41+ };
42+}
pkgs/top-level/all-packages.nix+1
@@ -28688,4 +28688,5 @@ in
2868828688
2868928689 psftools = callPackage ../os-specific/linux/psftools {};
2869028690
28691+ lc3tools = callPackage ../development/tools/lc3tools {};
2869128692}