Merge pull request #7529 from joachifm/trivial-builderDefs

Some trivial builderDefs->mkDerivation translations
This commit is contained in:
Pascal Wittmann 2015-04-25 11:32:12 +02:00
commit 8e86ec5bf0
5 changed files with 64 additions and 135 deletions

View file

@ -1,50 +1,27 @@
x@{builderDefsPackage { stdenv, fetchurl, jre }:
, jre, unzip
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); name = "vue-${version}";
sourceInfo = rec { version = "3.2.2";
baseName="vue"; src = fetchurl {
version="3.2.2"; url = "releases.atech.tufts.edu/jenkins/job/VUE/64/deployedArtifacts/download/artifact.2";
name="${baseName}-${version}"; sha256 = "0sb1kgan8fvph2cqfxk3906cwx5wy83zni2vlz4zzi6yg4zvfxld";
url="releases.atech.tufts.edu/jenkins/job/VUE/64/deployedArtifacts/download/artifact.2";
hash="0sb1kgan8fvph2cqfxk3906cwx5wy83zni2vlz4zzi6yg4zvfxld";
};
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
sha256 = sourceInfo.hash;
}; };
inherit (sourceInfo) name version; phases = "installPhase";
inherit buildInputs;
/* doConfigure should be removed if not needed */ installPhase = ''
phaseNames = ["doDeploy"];
doDeploy = a.fullDepEntry ''
mkdir -p "$out"/{share/vue,bin} mkdir -p "$out"/{share/vue,bin}
cp ${src} "$out/share/vue/vue.jar" cp ${src} "$out/share/vue/vue.jar"
echo '#!${a.stdenv.shell}' >> "$out/bin/vue" echo '#!${stdenv.shell}' >> "$out/bin/vue"
echo '${a.jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue" echo '${jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue"
chmod a+x "$out/bin/vue" chmod a+x "$out/bin/vue"
'' ["addInputs" "defEnsureDir"]; '';
meta = { meta = {
description = "Visual Understanding Environment - mind mapping software"; description = "Visual Understanding Environment - mind mapping software";
maintainers = with a.lib.maintainers; maintainers = with stdenv.lib.maintainers; [ raskin ];
[ platforms = with stdenv.lib.platforms; linux;
raskin license = stdenv.lib.licenses.free; # Apache License fork, actually
];
platforms = with a.lib.platforms;
linux;
license = a.lib.licenses.free; # Apache License fork, actually
}; };
}) x }

View file

@ -1,37 +1,28 @@
{ builderDefs, scons, pkgconfig, gtk, bzip2, libglade, openssl, libX11, boost, zlib }: { stdenv, fetchurl, scons, pkgconfig, gtk, bzip2, libglade, openssl
, libX11, boost, zlib, libnotify }:
with builderDefs;
let localDefs = builderDefs.passthru.function ((rec {
src = /* put a fetchurl here */
fetchurl {
url = http://launchpad.net/linuxdcpp/1.1/1.1.0/+download/linuxdcpp-1.1.0.tar.bz2;
sha256 = "66012740e9347a2e994c8af5609c40ebf3f86f767258e071a03ef39a2314298a";
};
buildInputs = [scons pkgconfig gtk bzip2 libglade
openssl libX11 boost];
configureFlags = [];
doScons = fullDepEntry (''
mkdir -p $out
export NIX_LDFLAGS="$NIX_LDFLAGS -lX11";
for i in gettext xgettext msgfmt msgcat; do
echo > $i
chmod a+x $i
done
export PATH=$PATH:$PWD
scons PREFIX=$out
scons PREFIX=$out install
'') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
}));
in with localDefs;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "ldcpp-1.1.0"; name = "ldcpp-1.1.0";
builder = writeScript (name + "-builder") src = fetchurl {
(textClosure localDefs url = http://launchpad.net/linuxdcpp/1.1/1.1.0/+download/linuxdcpp-1.1.0.tar.bz2;
[doScons doForceShare doPropagate]); sha256 = "12i92hirmwryl1qy0n3jfrpziwzb82f61xca9jcjwyilx502f0b6";
};
buildInputs = [ scons pkgconfig gtk bzip2 libglade openssl libX11 boost libnotify ];
installPhase = ''
export NIX_LDFLAGS="$NIX_LDFLAGS -lX11";
touch gettext xgettext msgfmt msgcat
chmod +x gettext xgettext msgfmt msgcat
export PATH=$PATH:$PWD
mkdir -p $out
scons PREFIX=$out
scons PREFIX=$out install
'';
meta = { meta = {
description = "Linux DC++ - Direct Connect client"; description = "Direct Connect client";
license = stdenv.lib.licenses.gpl2;
}; };
} }

View file

@ -1,38 +1,28 @@
a : { stdenv, fetchcvs }:
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "2009-05-27" a; stdenv.mkDerivation rec {
buildInputs = with a; [ name = "libffcall-${version}";
version = "2009-05-27";
]; src = fetchcvs {
in
rec {
src = a.fetchcvs {
cvsRoot = ":pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall"; cvsRoot = ":pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall";
module = "ffcall"; module = "ffcall";
date = version; date = version;
sha256 = "91bcb5a20c85a9ccab45886aae8fdbbcf1f20f995ef898e8bdd2964448daf724"; sha256 = "097pv94495njppl9iy2yk47z5wdwvf7swsl88nmwrac51jibbg4i";
}; };
inherit buildInputs; configurePhase = ''
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doConfigure" "doMakeInstall"];
doConfigure = a.fullDepEntry (''
for i in ./configure */configure; do for i in ./configure */configure; do
cwd="$PWD" cwd="$PWD"
cd "$(dirname "$i")"; cd "$(dirname "$i")";
( test -f Makefile && make distclean ) || true ( test -f Makefile && make distclean ) || true
./configure --prefix=$out ./configure --prefix=$out
cd "$cwd" cd "$cwd"
done done
'') a.doConfigure.deps; '';
name = "libffcall-" + version;
meta = { meta = {
description = "Foreign function call library"; description = "Foreign function call library";
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.unix;
}; };
} }

View file

@ -1,47 +1,20 @@
x@{builderDefsPackage { stdenv, fetchurl }:
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); name = "ioping-${version}";
sourceInfo = rec { version = "0.9";
baseName="ioping"; src = fetchurl {
version = "0.9"; url = "https://github.com/koct9i/ioping/releases/download/v${version}/${name}.tar.gz";
name="${baseName}-${version}";
url="https://docs.google.com/uc?id=0B_PlDc2qaehFWWtLZ3Z3N1ltdm8&export=download";
};
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
name = "${sourceInfo.name}.tar.gz";
sha256 = "0pbp7b3304y9yyv2w41l3898h5q8w77hnnnq1vz8qz4qfl4467lm"; sha256 = "0pbp7b3304y9yyv2w41l3898h5q8w77hnnnq1vz8qz4qfl4467lm";
}; };
inherit (sourceInfo) name version; makeFlags = "PREFIX=$(out)";
inherit buildInputs;
/* doConfigure should be removed if not needed */ meta = with stdenv.lib; {
phaseNames = ["doMakeInstall"]; description = "Disk I/O latency measuring tool";
makeFlags = [ maintainers = with maintainers; [ raskin ];
''PREFIX="$out"'' platforms = with platforms; unix;
]; license = licenses.gpl3Plus;
homepage = https://github.com/koct9i/ioping;
meta = {
description = "Filesystem IO delay time measurer";
maintainers = with a.lib.maintainers;
[
raskin
];
platforms = with a.lib.platforms;
linux;
license = a.lib.licenses.gpl3Plus;
homepage = "http://code.google.com/p/ioping/";
inherit version;
}; };
}) x }

View file

@ -6475,9 +6475,7 @@ let
libfixposix = callPackage ../development/libraries/libfixposix {}; libfixposix = callPackage ../development/libraries/libfixposix {};
libffcall = builderDefsPackage (import ../development/libraries/libffcall) { libffcall = callPackage ../development/libraries/libffcall { };
inherit fetchcvs;
};
libffi = callPackage ../development/libraries/libffi { }; libffi = callPackage ../development/libraries/libffi { };