Starting migrating old builderDefs packages to builderDefsPackage style.

svn path=/nixpkgs/trunk/; revision=13591
This commit is contained in:
Michael Raskin 2008-12-04 21:01:26 +00:00
parent 2b2bb11f32
commit d49a6f0641
3 changed files with 45 additions and 39 deletions

View File

@ -1,32 +1,38 @@
args : with args; with builderDefs;
let localDefs = builderDefs.passthru.function (rec {
src = /* put a fetchurl here */
fetchurl {
url = http://prdownloads.sourceforge.net/sourceforge/bmrsa/bmrsa11.zip;
sha256 = "0ksd9xkvm9lkvj4yl5sl0zmydp1wn3xhc55b28gj70gi4k75kcl4";
};
args :
let
lib = args.lib;
fetchurl = args.fetchurl;
FullDepEntry = args.FullDepEntry;
buildInputs = [unzip];
configureFlags = [];
doUnpack = FullDepEntry (''
mkdir bmrsa
cd bmrsa
unzip ${src}
sed -e 's/gcc/g++/' -i Makefile
ensureDir $out/bin
echo -e 'install:\n\tcp bmrsa '$out'/bin' >> Makefile
'') ["minInit" "addInputs" "defEnsureDir"];
});
in with localDefs;
stdenv.mkDerivation rec {
name = "bmrsa-"+version;
builder = writeScript (name + "-builder")
(textClosure localDefs
[doMakeInstall doForceShare doPropagate]);
meta = {
description = "
RSA utility.
";
inherit src;
};
version = lib.getAttr ["version"] "" args;
buildInputs = with args; [
unzip
];
in
rec {
src = fetchurl {
url = "http://prdownloads.sourceforge.net/sourceforge/bmrsa/bmrsa${version}.zip";
sha256 = "0ksd9xkvm9lkvj4yl5sl0zmydp1wn3xhc55b28gj70gi4k75kcl4";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be specified separately */
phaseNames = ["doMakeInstall"];
doUnpack = FullDepEntry (''
mkdir bmrsa
cd bmrsa
unzip ${src}
sed -e 's/gcc/g++/' -i Makefile
ensureDir $out/bin
echo -e 'install:\n\tcp bmrsa '$out'/bin' >> Makefile
'') ["minInit" "addInputs" "defEnsureDir"];
name = "bmrsa-"+version;
meta = {
description = "RSA utility";
};
}

View File

@ -556,8 +556,8 @@ let
inherit fetchurl stdenv python wxPython26;
};
bmrsa = composedArgsAndFun (selectVersion ../tools/security/bmrsa "11") {
inherit builderDefs unzip;
bmrsa = builderDefsPackage (selectVersion ../tools/security/bmrsa "11") {
inherit unzip;
};
bogofilter = import ../tools/misc/bogofilter {

View File

@ -1,10 +1,10 @@
args :
a :
let
lib = args.lib;
fetchurl = args.fetchurl;
lib = a.lib;
fetchurl = a.fetchurl;
version = lib.getAttr ["version"] "" args;
buildInputs = with args; [
version = lib.getAttr ["version"] "" a;
buildInputs = with a; [
];
in
@ -14,8 +14,8 @@ rec {
inherit buildInputs;
configureFlags = [];
/* doConfigure should be specified separately */
phaseNames = ["doMakeInstall"];
/* doConfigure should be removed if not needed */
phaseNames = ["doConfigure" "doMakeInstall"];
name = "${abort "Specify name"}-" + version;
meta = {