From d49a6f06416bb1ea94b46c2166b97bcfa339ab47 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 4 Dec 2008 21:01:26 +0000 Subject: [PATCH] Starting migrating old builderDefs packages to builderDefsPackage style. svn path=/nixpkgs/trunk/; revision=13591 --- pkgs/tools/security/bmrsa/11.nix | 66 ++++++++++--------- pkgs/top-level/all-packages.nix | 4 +- pkgs/top-level/template-composing-builder.nix | 14 ++-- 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/pkgs/tools/security/bmrsa/11.nix b/pkgs/tools/security/bmrsa/11.nix index 69febaa6d2a7..7d6f04422f55 100644 --- a/pkgs/tools/security/bmrsa/11.nix +++ b/pkgs/tools/security/bmrsa/11.nix @@ -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"; + }; } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8a1cf4b5ab6..ec4391d83d3c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { diff --git a/pkgs/top-level/template-composing-builder.nix b/pkgs/top-level/template-composing-builder.nix index f29eef105370..b7b3db268b5d 100644 --- a/pkgs/top-level/template-composing-builder.nix +++ b/pkgs/top-level/template-composing-builder.nix @@ -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 = {