bam: reimplement using mkDerivation

+19 -46
+19 -46
pkgs/development/tools/build-managers/bam/default.nix
··· 1 - x@{builderDefsPackage 2 - , lua5, python 3 - , ...}: 4 - builderDefsPackage 5 - (a : 6 - let 7 - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 8 - []; 1 + { stdenv, fetchurl, lua5, python }: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "bam-${version}"; 5 + version = "0.4.0"; 9 6 10 - buildInputs = map (n: builtins.getAttr n x) 11 - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); 12 - sourceInfo = rec { 13 - baseName="bam"; 14 - version="0.4.0"; 15 - name="${baseName}-${version}"; 16 - url="http://github.com/downloads/matricks/bam/${name}.tar.bz2"; 17 - hash="0z90wvyd4nfl7mybdrv9dsd4caaikc6fxw801b72gqi1m9q0c0sn"; 18 - }; 19 - in 20 - rec { 21 - src = a.fetchurl { 22 - url = sourceInfo.url; 23 - sha256 = sourceInfo.hash; 7 + src = fetchurl { 8 + url = "http://github.com/downloads/matricks/bam/${name}.tar.bz2"; 9 + sha256 = "0z90wvyd4nfl7mybdrv9dsd4caaikc6fxw801b72gqi1m9q0c0sn"; 24 10 }; 25 11 26 - inherit (sourceInfo) name version; 27 - inherit buildInputs; 12 + buildInputs = [ lua5 python ]; 28 13 29 - /* doConfigure should be removed if not needed */ 30 - phaseNames = ["check" "doDeploy"]; 31 - 32 - build = a.fullDepEntry '' 33 - sh make_unix.sh 34 - '' ["minInit" "doUnpack" "addInputs"]; 14 + buildPhase = ''${stdenv.shell} make_unix.sh''; 35 15 36 - check = a.fullDepEntry '' 37 - python scripts/test.py 38 - '' ["build" "addInputs"]; 16 + checkPhase = ''${python.interpreter} scripts/test.py''; 39 17 40 - doDeploy = a.fullDepEntry '' 18 + installPhase = '' 41 19 mkdir -p "$out/share/bam" 42 20 cp -r docs examples tests "$out/share/bam" 43 21 mkdir -p "$out/bin" 44 22 cp bam "$out/bin" 45 - '' ["minInit" "defEnsureDir" "build"]; 23 + ''; 46 24 47 - meta = { 25 + meta = with stdenv.lib; { 48 26 description = "Yet another build manager"; 49 - maintainers = with a.lib.maintainers; 27 + maintainers = with maintainers; 50 28 [ 51 29 raskin 52 30 ]; 53 - platforms = with a.lib.platforms; 54 - linux; 55 - license = a.lib.licenses.free; 56 - }; 57 - passthru = { 58 - updateInfo = { 59 - downloadPage = "http://matricks.github.com/bam/"; 60 - }; 31 + platforms = platforms.linux; 32 + license = licenses.free; 33 + downloadPage = "http://matricks.github.com/bam/"; 61 34 }; 62 - }) x 35 + }