From 5d6f12dbcf73178606f949fb5064742b49f2a4a0 Mon Sep 17 00:00:00 2001 From: Neil Mayhew Date: Sat, 5 Mar 2022 12:22:46 -0700 Subject: [PATCH] alan: init at 3.0beta8 --- pkgs/development/compilers/alan/default.nix | 48 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/compilers/alan/default.nix diff --git a/pkgs/development/compilers/alan/default.nix b/pkgs/development/compilers/alan/default.nix new file mode 100644 index 000000000000..61f7b1c0f7b8 --- /dev/null +++ b/pkgs/development/compilers/alan/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchFromGitHub +, cgreen, openjdk, pkg-config, which +}: + +stdenv.mkDerivation rec { + pname = "alan"; + version = "3.0beta8"; + + src = fetchFromGitHub { + owner = "alan-if"; + repo = "alan"; + rev = "v${version}"; + sha256 = "0zfg1frmb4yl39hk8h733bmlwk4rkikzfhvv7j34cxpdpsp7spzl"; + }; + + postPatch = '' + patchShebangs --build bin + # The Makefiles have complex CFLAGS that don't allow separate control of optimization + sed -i 's/-O0/-O2/g' compiler/Makefile.common + sed -i 's/-Og/-O2/g' interpreter/Makefile.common + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/alan/examples + # Build the release tarball + make package + # The release tarball isn't split up into subdirectories + tar -xf alan*.tgz --strip-components=1 -C $out/share/alan + mv $out/share/alan/*.alan $out/share/alan/examples + chmod a-x $out/share/alan/examples/*.alan + mv $out/share/alan/{alan,arun} $out/bin + # a2a3 isn't included in the release tarball + cp bin/a2a3 $out/bin + ''; + + nativeBuildInputs = [ + cgreen + openjdk pkg-config which + ]; + + meta = with lib; { + homepage = "https://www.alanif.se/"; + description = "The Alan interactive fiction language"; + license = licenses.artistic2; + platforms = platforms.linux; + maintainers = with maintainers; [ neilmayhew ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 22d842be9220..9c1a30c18f0f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11896,6 +11896,8 @@ with pkgs; jdk = jdk8; }; + alan = callPackage ../development/compilers/alan { }; + algol68g = callPackage ../development/compilers/algol68g { }; armips = callPackage ../development/compilers/armips { };