Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 57 lines 1.6 kB view raw
1{ stdenv, fetchurl, gmp 2, withEmacsSupport ? true 3, withContrib ? true }: 4 5let 6 versionPkg = "0.3.13" ; 7 8 contrib = fetchurl { 9 url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz"; 10 sha256 = "5f64172b2df08c8563b01febc32b582b2d7b59c0c514bd2beb727e69bb8e24ee"; 11 }; 12 13 postInstallContrib = stdenv.lib.optionalString withContrib 14 '' 15 local contribDir=$out/lib/ats2-postiats-*/ ; 16 mkdir -p $contribDir ; 17 tar -xzf "${contrib}" --strip-components 1 -C $contribDir ; 18 ''; 19 20 postInstallEmacs = stdenv.lib.optionalString withEmacsSupport 21 '' 22 local siteLispDir=$out/share/emacs/site-lisp/ats2 ; 23 mkdir -p $siteLispDir ; 24 install -m 0644 -v ./utils/emacs/*.el $siteLispDir ; 25 ''; 26in 27 28stdenv.mkDerivation rec { 29 pname = "ats2"; 30 version = versionPkg; 31 32 src = fetchurl { 33 url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz"; 34 sha256 = "0056ff5bfa55c9b9831dce004e7b1b9e7a98d56a9d8ae49d827f9fd0ef823c23"; 35 }; 36 37 buildInputs = [ gmp ]; 38 39 setupHook = with stdenv.lib; 40 let 41 hookFiles = 42 [ ./setup-hook.sh ] 43 ++ optional withContrib ./setup-contrib-hook.sh; 44 in 45 builtins.toFile "setupHook.sh" 46 (concatMapStringsSep "\n" builtins.readFile hookFiles); 47 48 postInstall = postInstallContrib + postInstallEmacs; 49 50 meta = with stdenv.lib; { 51 description = "Functional programming language with dependent types"; 52 homepage = "http://www.ats-lang.org"; 53 license = licenses.gpl3Plus; 54 platforms = platforms.linux; 55 maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ]; 56 }; 57}