Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 cgreen, 6 openjdk, 7 pkg-config, 8 which, 9}: 10 11stdenv.mkDerivation (finalAttrs: { 12 pname = "alan"; 13 version = "3.0beta8"; 14 15 src = fetchFromGitHub { 16 owner = "alan-if"; 17 repo = "alan"; 18 tag = "v${finalAttrs.version}"; 19 sha256 = "sha256-9F99rr7tdkaGPHtD92ecmUxO6xrjQDRhGtSTVbMLz30="; 20 }; 21 22 postPatch = '' 23 patchShebangs --build bin 24 # The Makefiles have complex CFLAGS that don't allow separate control of optimization 25 sed -i 's/-O0/-O2/g' compiler/Makefile.common 26 sed -i 's/-Og/-O2/g' interpreter/Makefile.common 27 ''; 28 29 installPhase = '' 30 runHook preInstall 31 32 mkdir -p $out/bin $out/share/alan/examples 33 # Build the release tarball 34 make package 35 # The release tarball isn't split up into subdirectories 36 tar -xf alan*.tgz --strip-components=1 -C $out/share/alan 37 mv $out/share/alan/*.alan $out/share/alan/examples 38 chmod a-x $out/share/alan/examples/*.alan 39 mv $out/share/alan/{alan,arun} $out/bin 40 # a2a3 isn't included in the release tarball 41 cp bin/a2a3 $out/bin 42 43 runHook postInstall 44 ''; 45 46 nativeBuildInputs = [ 47 cgreen 48 openjdk 49 pkg-config 50 which 51 ]; 52 53 meta = { 54 homepage = "https://www.alanif.se/"; 55 description = "Alan interactive fiction language"; 56 license = lib.licenses.artistic2; 57 platforms = lib.platforms.linux; 58 maintainers = with lib.maintainers; [ neilmayhew ]; 59 }; 60})