From a4834a3e849ab47dff83e4e6a29281eb4e87919f Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 9 Oct 2014 11:13:29 +0200 Subject: [PATCH 01/13] chicken: Implement support for bootstrap-builds This is necessary in order to apply custom patches, as chicken needs a bootstrap build to regenerate *.c files. This is also necessary when building from git. --- .../development/compilers/chicken/default.nix | 24 ++++++++++++++++++- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/chicken/default.nix b/pkgs/development/compilers/chicken/default.nix index 8fd99973cbc1..9e2fbc368fcb 100644 --- a/pkgs/development/compilers/chicken/default.nix +++ b/pkgs/development/compilers/chicken/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, bootstrap-chicken ? null }: let version = "4.9.0.1"; @@ -20,6 +20,28 @@ stdenv.mkDerivation { buildFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib"; installFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib"; + # We need a bootstrap-chicken to regenerate the c-files after + # applying a patch to add support for CHICKEN_REPOSITORY_EXTRA + patches = stdenv.lib.ifEnable (bootstrap-chicken != null) [ + ./0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch + ]; + + buildInputs = stdenv.lib.ifEnable (bootstrap-chicken != null) [ + bootstrap-chicken + ]; + + preBuild = stdenv.lib.ifEnable (bootstrap-chicken != null) '' + # Backup the build* files - those are generated from hostname, + # git-tag, etc. and we don't need/want that + mkdir -p build-backup + mv buildid buildbranch buildtag.h build-backup + + # Regenerate eval.c after the patch + make spotless $buildFlags + + mv build-backup/* . + ''; + meta = { homepage = http://www.call-cc.org/; license = "BSD"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c29ca8a04701..33b9b86e8414 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2791,7 +2791,9 @@ let bigloo = callPackage ../development/compilers/bigloo { }; - chicken = callPackage ../development/compilers/chicken { }; + chicken = callPackage ../development/compilers/chicken { + bootstrap-chicken = chicken.override { bootstrap-chicken = null; }; + }; ccl = builderDefsPackage ../development/compilers/ccl {}; From e47428d0e2bd314c330356865f9a56234afa7af7 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 9 Oct 2014 20:49:15 +0200 Subject: [PATCH 02/13] Infrastructure to build chicken eggs. --- pkgs/build-support/fetchegg/builder.sh | 9 ++ pkgs/build-support/fetchegg/default.nix | 28 ++++ ...1-Introduce-CHICKEN_REPOSITORY_EXTRA.patch | 130 ++++++++++++++++++ .../development/compilers/chicken/default.nix | 13 +- .../compilers/chicken/eggDerivation.nix | 40 ++++++ .../compilers/chicken/setup-hook.sh | 7 + pkgs/top-level/all-packages.nix | 4 + 7 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 pkgs/build-support/fetchegg/builder.sh create mode 100644 pkgs/build-support/fetchegg/default.nix create mode 100644 pkgs/development/compilers/chicken/0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch create mode 100644 pkgs/development/compilers/chicken/eggDerivation.nix create mode 100644 pkgs/development/compilers/chicken/setup-hook.sh diff --git a/pkgs/build-support/fetchegg/builder.sh b/pkgs/build-support/fetchegg/builder.sh new file mode 100644 index 000000000000..204661063090 --- /dev/null +++ b/pkgs/build-support/fetchegg/builder.sh @@ -0,0 +1,9 @@ +source $stdenv/setup + +header "exporting egg ${eggName} (version $version) into $out" + +mkdir -p $out +chicken-install -r "${eggName}:${version}" +cp -r ${eggName}/* $out/ + +stopNest diff --git a/pkgs/build-support/fetchegg/default.nix b/pkgs/build-support/fetchegg/default.nix new file mode 100644 index 000000000000..223d2098c770 --- /dev/null +++ b/pkgs/build-support/fetchegg/default.nix @@ -0,0 +1,28 @@ +# Fetches a chicken egg from henrietta using `chicken-install -r' +# See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html + +{ stdenv, chicken }: +{ name, version, md5 ? "", sha256 ? "" }: + +stdenv.mkDerivation { + name = "chicken-${name}-export"; + builder = ./builder.sh; + buildInputs = [ chicken ]; + + outputHashAlgo = if sha256 == "" then "md5" else "sha256"; + outputHashMode = "recursive"; + outputHash = if sha256 == "" then md5 else sha256; + + inherit version; + + eggName = name; + + impureEnvVars = [ + # We borrow these environment variables from the caller to allow + # easy proxy configuration. This is impure, but a fixed-output + # derivation like fetchurl is allowed to do so since its result is + # by definition pure. + "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" + ]; +} + diff --git a/pkgs/development/compilers/chicken/0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch b/pkgs/development/compilers/chicken/0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch new file mode 100644 index 000000000000..0962c9cf46d3 --- /dev/null +++ b/pkgs/development/compilers/chicken/0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch @@ -0,0 +1,130 @@ +From 752dff853186dc334c519a86fa92f087795fea02 Mon Sep 17 00:00:00 2001 +From: Moritz Heidkamp +Date: Wed, 1 Oct 2014 22:41:30 +0200 +Subject: [PATCH] Introduce CHICKEN_REPOSITORY_EXTRA + +This environment variable works like CHICKEN_REPOSITORY but supports +multiple paths separated by `:'. Those paths are searched after +CHICKEN_REPOSITORY when loading extensions via `require-library' and +friends. It can be accessed and changed at runtime via the new procedure +`repository-extra-paths' which is analog to `repository-path'. +--- + chicken-install.scm | 11 +++++++---- + chicken.import.scm | 1 + + eval.scm | 37 +++++++++++++++++++++++++++++++------ + 3 files changed, 39 insertions(+), 10 deletions(-) + +diff --git a/chicken-install.scm b/chicken-install.scm +index 2ef6ef4..b5c6bf8 100644 +--- a/chicken-install.scm ++++ b/chicken-install.scm +@@ -109,10 +109,10 @@ + (define *show-foreign-depends* #f) + (define *hacks* '()) + +- (define (repo-path) ++ (define (repo-paths) + (if (and *cross-chicken* (not *host-extension*)) +- (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" C_BINARY_VERSION)) +- (repository-path))) ++ (list (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" C_BINARY_VERSION))) ++ (cons (repository-path) (repository-extra-paths)))) + + (define (get-prefix #!optional runtime) + (cond ((and *cross-chicken* +@@ -757,7 +757,10 @@ + "installed extension has no information about which egg it belongs to" + (pathname-file sf)) + #f)))) +- (glob (make-pathname (repo-path) "*" "setup-info"))) ++ (append-map ++ (lambda (path) ++ (glob (make-pathname path "*" "setup-info"))) ++ (repo-paths))) + equal?)) + + (define (list-available-extensions trans locn) +diff --git a/chicken.import.scm b/chicken.import.scm +index baa7316..2839b16 100644 +--- a/chicken.import.scm ++++ b/chicken.import.scm +@@ -201,6 +201,7 @@ + repl + repl-prompt + repository-path ++ repository-extra-paths + require + reset + reset-handler +diff --git a/eval.scm b/eval.scm +index bbcd86c..838588d 100644 +--- a/eval.scm ++++ b/eval.scm +@@ -81,6 +81,7 @@ + (define-constant source-file-extension ".scm") + (define-constant setup-file-extension "setup-info") + (define-constant repository-environment-variable "CHICKEN_REPOSITORY") ++(define-constant repository-extra-environment-variable "CHICKEN_REPOSITORY_EXTRA") + (define-constant prefix-environment-variable "CHICKEN_PREFIX") + + ; these are actually in unit extras, but that is used by default +@@ -1180,6 +1181,25 @@ + + (define repository-path ##sys#repository-path) + ++(define ##sys#repository-extra-paths ++ (let* ((repaths (get-environment-variable repository-extra-environment-variable)) ++ (repaths (if repaths ++ (let ((len (string-length repaths))) ++ (let loop ((i 0) (offset 0) (res '())) ++ (cond ((> i len) ++ (reverse res)) ++ ((or (= i len) (eq? #\: (string-ref repaths i))) ++ (loop (+ i 1) (+ i 1) (cons (substring repaths offset i) res))) ++ (else ++ (loop (+ i 1) offset res))))) ++ '()))) ++ (lambda (#!optional val) ++ (if val ++ (set! repaths val) ++ repaths)))) ++ ++(define repository-extra-paths ##sys#repository-extra-paths) ++ + (define ##sys#setup-mode #f) + + (define ##sys#find-extension +@@ -1197,6 +1217,7 @@ + (let loop ((paths (##sys#append + (if ##sys#setup-mode '(".") '()) + (if rp (list rp) '()) ++ (##sys#repository-extra-paths) + (if inc? ##sys#include-pathnames '()) + (if ##sys#setup-mode '() '("."))) )) + (and (pair? paths) +@@ -1256,12 +1277,16 @@ + [string-append string-append] + [read read] ) + (lambda (id loc) +- (and-let* ((rp (##sys#repository-path))) +- (let* ((p (##sys#canonicalize-extension-path id loc)) +- (rpath (string-append rp "/" p ".")) ) +- (cond ((file-exists? (string-append rpath setup-file-extension)) +- => (cut with-input-from-file <> read) ) +- (else #f) ) ) ) ) )) ++ (let loop ((rpaths (cons (##sys#repository-path) (##sys#repository-extra-paths)))) ++ (and (pair? rpaths) ++ (let ((rp (car rpaths))) ++ (if (not rp) ++ (loop (cdr rpaths)) ++ (let* ((p (##sys#canonicalize-extension-path id loc)) ++ (rpath (string-append rp "/" p ".")) ) ++ (cond ((file-exists? (string-append rpath setup-file-extension)) ++ => (cut with-input-from-file <> read) ) ++ (else (loop (cdr rpaths))) ) )) ))) ) )) + + (define (extension-information ext) + (##sys#extension-information ext 'extension-information) ) +-- +2.1.0 + diff --git a/pkgs/development/compilers/chicken/default.nix b/pkgs/development/compilers/chicken/default.nix index 9e2fbc368fcb..cac55efd5208 100644 --- a/pkgs/development/compilers/chicken/default.nix +++ b/pkgs/development/compilers/chicken/default.nix @@ -8,29 +8,34 @@ let else if isBSD then "bsd" else if isSunOS then "solaris" else "linux"; # Should be a sane default + lib = stdenv.lib; in stdenv.mkDerivation { name = "chicken-${version}"; + binaryVersion = 7; + src = fetchurl { url = "http://code.call-cc.org/releases/4.9.0/chicken-${version}.tar.gz"; sha256 = "0598mar1qswfd8hva9nqs88zjn02lzkqd8fzdd21dz1nki1prpq4"; }; + setupHook = lib.ifEnable (bootstrap-chicken != null) ./setup-hook.sh; + buildFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib"; installFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib"; # We need a bootstrap-chicken to regenerate the c-files after # applying a patch to add support for CHICKEN_REPOSITORY_EXTRA - patches = stdenv.lib.ifEnable (bootstrap-chicken != null) [ + patches = lib.ifEnable (bootstrap-chicken != null) [ ./0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch ]; - buildInputs = stdenv.lib.ifEnable (bootstrap-chicken != null) [ + buildInputs = lib.ifEnable (bootstrap-chicken != null) [ bootstrap-chicken ]; - preBuild = stdenv.lib.ifEnable (bootstrap-chicken != null) '' + preBuild = lib.ifEnable (bootstrap-chicken != null) '' # Backup the build* files - those are generated from hostname, # git-tag, etc. and we don't need/want that mkdir -p build-backup @@ -42,6 +47,8 @@ stdenv.mkDerivation { mv build-backup/* . ''; + # TODO: Assert csi -R files -p '(pathname-file (repository-path))' == binaryVersion + meta = { homepage = http://www.call-cc.org/; license = "BSD"; diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix new file mode 100644 index 000000000000..f9a3da83eaba --- /dev/null +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchegg, chicken, makeWrapper }: +{ name, src +, buildInputs ? [] +, chickenInstallFlags ? [] +, cscOptions ? [] +, ...} @ args: + +let + libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/"; +in +stdenv.mkDerivation ({ + name = "chicken-${name}"; + propagatedBuildInputs = buildInputs ++ [ chicken ]; + propagatedUserEnvPkgs = buildInputs ++ [ chicken ]; + buildInputs = [ makeWrapper ]; + + CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions; + + CHICKEN_REPOSITORY = libPath; + CHICKEN_INSTALL_PREFIX = "$out"; + + installPhase = '' + runHook preInstall + + chicken-install -p $out ${stdenv.lib.concatStringsSep " " chickenInstallFlags} + + runHook postInstall + ''; + + postInstall = '' + for f in $out/bin/* + do + wrapProgram $f \ + --set CHICKEN_REPOSITORY $CHICKEN_REPOSITORY \ + --prefix CHICKEN_REPOSITORY_EXTRA : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_EXTRA" \ + --prefix CHICKEN_INCLUDE_PATH \; \"$CHICKEN_INCLUDE_PATH\;$out/share/\" \ + --prefix PATH : "$out/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" + done + ''; +} // (builtins.removeAttrs args ["name" "buildInputs"])) diff --git a/pkgs/development/compilers/chicken/setup-hook.sh b/pkgs/development/compilers/chicken/setup-hook.sh new file mode 100644 index 000000000000..8d6b990a7e05 --- /dev/null +++ b/pkgs/development/compilers/chicken/setup-hook.sh @@ -0,0 +1,7 @@ +addChickenRepositoryPath() { + addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_EXTRA "$1/lib/chicken/7/" + # addToSearchPathWithCustomDelimiter \; CHICKEN_INCLUDE_PATH "$1/share/" + export CHICKEN_INCLUDE_PATH="$1/share;$CHICKEN_INCLUDE_PATH" +} + +envHooks=(${envHooks[@]} addChickenRepositoryPath) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 33b9b86e8414..8fc0dbe17316 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2791,6 +2791,10 @@ let bigloo = callPackage ../development/compilers/bigloo { }; + fetchegg = callPackage ../build-support/fetchegg { }; + + eggDerivation = callPackage ../development/compilers/chicken/eggDerivation.nix { }; + chicken = callPackage ../development/compilers/chicken { bootstrap-chicken = chicken.override { bootstrap-chicken = null; }; }; From 172e55c7fcbf3de9fa6799ce520dc5b7b0a08ede Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 9 Oct 2014 21:59:17 +0200 Subject: [PATCH 03/13] Implement patches.nix to override parts of a derivation --- pkgs/development/compilers/chicken/eggDerivation.nix | 10 +++++++++- pkgs/development/compilers/chicken/patches.nix | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/chicken/patches.nix diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix index f9a3da83eaba..9a7c56da11a0 100644 --- a/pkgs/development/compilers/chicken/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -7,6 +7,14 @@ let libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/"; + patches = import ./patches.nix; + lib = stdenv.lib; + baseName = (builtins.parseDrvName name).name; + patch = if builtins.hasAttr baseName patches + then + builtins.getAttr baseName patches + else + {}; in stdenv.mkDerivation ({ name = "chicken-${name}"; @@ -37,4 +45,4 @@ stdenv.mkDerivation ({ --prefix PATH : "$out/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" done ''; -} // (builtins.removeAttrs args ["name" "buildInputs"])) +} // (builtins.removeAttrs args ["name" "buildInputs"]) // patch) diff --git a/pkgs/development/compilers/chicken/patches.nix b/pkgs/development/compilers/chicken/patches.nix new file mode 100644 index 000000000000..9fdda9b6d9fe --- /dev/null +++ b/pkgs/development/compilers/chicken/patches.nix @@ -0,0 +1,10 @@ +{ + setup-helper = { + preBuild = '' + substituteInPlace setup-helper.setup \ + --replace "(chicken-home)" \"$out/share/\" + + cat setup-helper.setup + ''; + }; +} From 6157cc0c293d5e03bf4c8423cbda9b6f9bd081dc Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 9 Oct 2014 22:01:21 +0200 Subject: [PATCH 04/13] rename patches -> overrides --- pkgs/development/compilers/chicken/eggDerivation.nix | 8 ++++---- .../compilers/chicken/{patches.nix => overrides.nix} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename pkgs/development/compilers/chicken/{patches.nix => overrides.nix} (100%) diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix index 9a7c56da11a0..b3c96171478d 100644 --- a/pkgs/development/compilers/chicken/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -7,12 +7,12 @@ let libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/"; - patches = import ./patches.nix; + overrides = import ./overrides.nix; lib = stdenv.lib; baseName = (builtins.parseDrvName name).name; - patch = if builtins.hasAttr baseName patches + override = if builtins.hasAttr baseName overrides then - builtins.getAttr baseName patches + builtins.getAttr baseName overrides else {}; in @@ -45,4 +45,4 @@ stdenv.mkDerivation ({ --prefix PATH : "$out/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" done ''; -} // (builtins.removeAttrs args ["name" "buildInputs"]) // patch) +} // (builtins.removeAttrs args ["name" "buildInputs"]) // override) diff --git a/pkgs/development/compilers/chicken/patches.nix b/pkgs/development/compilers/chicken/overrides.nix similarity index 100% rename from pkgs/development/compilers/chicken/patches.nix rename to pkgs/development/compilers/chicken/overrides.nix From 9ab1666ff08eff2d6091cfa8c2698de4522c5ec7 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 9 Oct 2014 22:14:38 +0200 Subject: [PATCH 05/13] Add chicken to PATH of wrapped chicken binaries. --- pkgs/development/compilers/chicken/eggDerivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix index b3c96171478d..6ccacb668322 100644 --- a/pkgs/development/compilers/chicken/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation ({ --set CHICKEN_REPOSITORY $CHICKEN_REPOSITORY \ --prefix CHICKEN_REPOSITORY_EXTRA : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_EXTRA" \ --prefix CHICKEN_INCLUDE_PATH \; \"$CHICKEN_INCLUDE_PATH\;$out/share/\" \ - --prefix PATH : "$out/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" + --prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" done ''; } // (builtins.removeAttrs args ["name" "buildInputs"]) // override) From 36c5ec58c48ca751fb80aec4d737b6f39a6f6956 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Tue, 14 Oct 2014 00:41:03 +0200 Subject: [PATCH 06/13] New package: egg2nix. Generates nix-expressions from Chicken Scheme Eggs. --- .../tools/egg2nix/chicken-eggs.nix | 361 ++++++++++++++++++ .../tools/egg2nix/chicken-eggs.scm | 6 + pkgs/development/tools/egg2nix/default.nix | 32 ++ pkgs/top-level/all-packages.nix | 3 + 4 files changed, 402 insertions(+) create mode 100644 pkgs/development/tools/egg2nix/chicken-eggs.nix create mode 100644 pkgs/development/tools/egg2nix/chicken-eggs.scm create mode 100644 pkgs/development/tools/egg2nix/default.nix diff --git a/pkgs/development/tools/egg2nix/chicken-eggs.nix b/pkgs/development/tools/egg2nix/chicken-eggs.nix new file mode 100644 index 000000000000..3e7127ac3cbd --- /dev/null +++ b/pkgs/development/tools/egg2nix/chicken-eggs.nix @@ -0,0 +1,361 @@ +{ pkgs, stdenv }: +rec { +inherit (pkgs) eggDerivation fetchegg; + +versions = eggDerivation { + name = "versions-1.15"; + + src = fetchegg { + name = "versions"; + version = "1.15"; + sha256 = "0qs9yq0jvz9cfd2vwvf1ya8wxxxqghhai57x0w3ywi0h4afbqivm"; + }; + + buildInputs = [ + eggdoc + ]; +}; + + +matchable = eggDerivation { + name = "matchable-3.3"; + + src = fetchegg { + name = "matchable"; + version = "3.3"; + sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990"; + }; + + buildInputs = [ + + ]; +}; + + +http-client = eggDerivation { + name = "http-client-0.7.1"; + + src = fetchegg { + name = "http-client"; + version = "0.7.1"; + sha256 = "1s03zgmb7kb99ld0f2ylqgicrab9qgza53fkgsqvg7bh5njmzhxr"; + }; + + buildInputs = [ + intarweb + uri-common + message-digest + md5 + string-utils + sendfile + ]; +}; + + +sxml-transforms = eggDerivation { + name = "sxml-transforms-1.4.1"; + + src = fetchegg { + name = "sxml-transforms"; + version = "1.4.1"; + sha256 = "1igm3h1nm1i5mwm2akk105v5k96azjm1vnl637l3l5w2yycc76a2"; + }; + + buildInputs = [ + + ]; +}; + + +eggdoc = eggDerivation { + name = "eggdoc-1.3.1"; + + src = fetchegg { + name = "eggdoc"; + version = "1.3.1"; + sha256 = "17ypr5sl2vnnzqxipybmjkm7d5wlsbp7fyq25qr6phgil8axafww"; + }; + + buildInputs = [ + sxml-transforms + ]; +}; + + +sendfile = eggDerivation { + name = "sendfile-1.7.29"; + + src = fetchegg { + name = "sendfile"; + version = "1.7.29"; + sha256 = "1dc02cbkx5kixhbqjy26g6gs680vy7krc9qis1p1v4aa0b2lgj7k"; + }; + + buildInputs = [ + + ]; +}; + + +setup-helper = eggDerivation { + name = "setup-helper-1.5.4"; + + src = fetchegg { + name = "setup-helper"; + version = "1.5.4"; + sha256 = "1k644y0md2isdcvazqfm4nyc8rh3dby6b0j3r4na4w8ryspqp6gj"; + }; + + buildInputs = [ + + ]; +}; + + +check-errors = eggDerivation { + name = "check-errors-1.13.0"; + + src = fetchegg { + name = "check-errors"; + version = "1.13.0"; + sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi"; + }; + + buildInputs = [ + setup-helper + ]; +}; + + +synch = eggDerivation { + name = "synch-2.1.2"; + + src = fetchegg { + name = "synch"; + version = "2.1.2"; + sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; +}; + + +record-variants = eggDerivation { + name = "record-variants-0.5.1"; + + src = fetchegg { + name = "record-variants"; + version = "0.5.1"; + sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h"; + }; + + buildInputs = [ + + ]; +}; + + +miscmacros = eggDerivation { + name = "miscmacros-2.96"; + + src = fetchegg { + name = "miscmacros"; + version = "2.96"; + sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc"; + }; + + buildInputs = [ + + ]; +}; + + +lookup-table = eggDerivation { + name = "lookup-table-1.13.5"; + + src = fetchegg { + name = "lookup-table"; + version = "1.13.5"; + sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb"; + }; + + buildInputs = [ + setup-helper + check-errors + miscmacros + record-variants + synch + ]; +}; + + +string-utils = eggDerivation { + name = "string-utils-1.2.4"; + + src = fetchegg { + name = "string-utils"; + version = "1.2.4"; + sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1"; + }; + + buildInputs = [ + setup-helper + miscmacros + lookup-table + check-errors + ]; +}; + + +blob-utils = eggDerivation { + name = "blob-utils-1.0.3"; + + src = fetchegg { + name = "blob-utils"; + version = "1.0.3"; + sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml"; + }; + + buildInputs = [ + setup-helper + string-utils + ]; +}; + + +variable-item = eggDerivation { + name = "variable-item-1.3.1"; + + src = fetchegg { + name = "variable-item"; + version = "1.3.1"; + sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; +}; + + +message-digest = eggDerivation { + name = "message-digest-3.1.0"; + + src = fetchegg { + name = "message-digest"; + version = "3.1.0"; + sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s"; + }; + + buildInputs = [ + setup-helper + miscmacros + check-errors + variable-item + blob-utils + string-utils + ]; +}; + + +md5 = eggDerivation { + name = "md5-3.1.0"; + + src = fetchegg { + name = "md5"; + version = "3.1.0"; + sha256 = "0bka43nx8x9b0b079qpvml2fl20km19ny0qjmhwzlh6rwmzazj2a"; + }; + + buildInputs = [ + message-digest + ]; +}; + + +defstruct = eggDerivation { + name = "defstruct-1.6"; + + src = fetchegg { + name = "defstruct"; + version = "1.6"; + sha256 = "0lsgl32nmb5hxqiii4r3292cx5vqh50kp6v062nfiyid9lhrj0li"; + }; + + buildInputs = [ + + ]; +}; + + +uri-generic = eggDerivation { + name = "uri-generic-2.41"; + + src = fetchegg { + name = "uri-generic"; + version = "2.41"; + sha256 = "1r5jbzjllbnmhm5n0m3fcx0g6dc2c2jzp1dcndkfmxz0cl99zxac"; + }; + + buildInputs = [ + matchable + defstruct + ]; +}; + + +uri-common = eggDerivation { + name = "uri-common-1.4"; + + src = fetchegg { + name = "uri-common"; + version = "1.4"; + sha256 = "01ds1gixcn4rz657x3hr4rhw2496hsjff42ninw0k39l8i1cbh7c"; + }; + + buildInputs = [ + uri-generic + defstruct + matchable + ]; +}; + + +base64 = eggDerivation { + name = "base64-3.3.1"; + + src = fetchegg { + name = "base64"; + version = "3.3.1"; + sha256 = "0wmldiwwg1jpcn07wb906nc53si5j7sa83wgyq643xzqcx4v4x1d"; + }; + + buildInputs = [ + + ]; +}; + + +intarweb = eggDerivation { + name = "intarweb-1.3"; + + src = fetchegg { + name = "intarweb"; + version = "1.3"; + sha256 = "0izlby78c25py29bdcbc0vapb6h7xgchqrzi6i51d0rb3mnwy88h"; + }; + + buildInputs = [ + defstruct + uri-common + base64 + ]; +}; + +} + + diff --git a/pkgs/development/tools/egg2nix/chicken-eggs.scm b/pkgs/development/tools/egg2nix/chicken-eggs.scm new file mode 100644 index 000000000000..119b06703259 --- /dev/null +++ b/pkgs/development/tools/egg2nix/chicken-eggs.scm @@ -0,0 +1,6 @@ +( + ;; Eggs used by egg2nix + versions + matchable + http-client + ) diff --git a/pkgs/development/tools/egg2nix/default.nix b/pkgs/development/tools/egg2nix/default.nix new file mode 100644 index 000000000000..f3312cf3e0f7 --- /dev/null +++ b/pkgs/development/tools/egg2nix/default.nix @@ -0,0 +1,32 @@ +{ stdenv, eggDerivation, fetchurl, chickenEggs }: + +# Note: This mostly reimplements the default.nix already contained in +# the tarball. Is there a nicer way than duplicating code? + +eggDerivation { + src = fetchurl { + url = "https://github.com/the-kenny/egg2nix/archive/0.1.tar.gz"; + sha256 = "0x1vg70rwvd4dbgp8wynlff36cnq1h9ncpag0xgn5jq0miqfr57j"; + }; + + name = "egg2nix-0.1"; + buildInputs = with chickenEggs; [ + versions matchable http-client + ]; + + installPhase = '' + mkdir -p $out/bin/ + mv egg2nix.scm $out/bin/egg2nix + chmod +x $out/bin/egg2nix + + runHook postInstall #important - wraps the stuff in $out/bin/ + ''; + + meta = { + description = "Generate nix-expression from Chicken Scheme eggs"; + homepage = https://github.com/the-kenny/egg2nix; + license = stdenv.lib.licenses.bsd3; + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.the-kenny ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fc0dbe17316..77d489b9b0d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2799,6 +2799,9 @@ let bootstrap-chicken = chicken.override { bootstrap-chicken = null; }; }; + chickenEggs = callPackage ../development/tools/egg2nix/chicken-eggs.nix { }; + egg2nix = callPackage ../development/tools/egg2nix {}; + ccl = builderDefsPackage ../development/compilers/ccl {}; clang = wrapClang llvmPackages.clang; From 8d5fe133bd546bab8cb929ff10df30d9b4f44197 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Wed, 15 Oct 2014 12:07:31 +0200 Subject: [PATCH 07/13] eggDerivation: Move postInstall into installPhase. --- pkgs/development/compilers/chicken/eggDerivation.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix index 6ccacb668322..97ce9d9be79b 100644 --- a/pkgs/development/compilers/chicken/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -32,10 +32,6 @@ stdenv.mkDerivation ({ chicken-install -p $out ${stdenv.lib.concatStringsSep " " chickenInstallFlags} - runHook postInstall - ''; - - postInstall = '' for f in $out/bin/* do wrapProgram $f \ @@ -44,5 +40,7 @@ stdenv.mkDerivation ({ --prefix CHICKEN_INCLUDE_PATH \; \"$CHICKEN_INCLUDE_PATH\;$out/share/\" \ --prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" done + + runHook postInstall ''; } // (builtins.removeAttrs args ["name" "buildInputs"]) // override) From 710765f9d94442c49dfb43f496f89139064972f7 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Thu, 16 Oct 2014 23:25:20 +0200 Subject: [PATCH 08/13] Pass chickenEggs as a parameter to egg2nix. Those eggs are specific to egg2nix - it's unwise to make them public. --- pkgs/top-level/all-packages.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 77d489b9b0d2..dd389e6c6504 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2799,8 +2799,9 @@ let bootstrap-chicken = chicken.override { bootstrap-chicken = null; }; }; - chickenEggs = callPackage ../development/tools/egg2nix/chicken-eggs.nix { }; - egg2nix = callPackage ../development/tools/egg2nix {}; + egg2nix = callPackage ../development/tools/egg2nix { + chickenEggs = callPackage ../development/tools/egg2nix/chicken-eggs.nix { }; + }; ccl = builderDefsPackage ../development/compilers/ccl {}; From f46e83da8642d5a800e064ecdf486d38830735b6 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Fri, 17 Oct 2014 17:26:36 +0200 Subject: [PATCH 09/13] Wrap chicken so it can find gcc. --- pkgs/development/compilers/chicken/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/chicken/default.nix b/pkgs/development/compilers/chicken/default.nix index cac55efd5208..0e210343a72f 100644 --- a/pkgs/development/compilers/chicken/default.nix +++ b/pkgs/development/compilers/chicken/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, bootstrap-chicken ? null }: +{ stdenv, fetchurl, makeWrapper, bootstrap-chicken ? null }: let version = "4.9.0.1"; @@ -31,9 +31,11 @@ stdenv.mkDerivation { ./0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch ]; - buildInputs = lib.ifEnable (bootstrap-chicken != null) [ + buildInputs = [ + makeWrapper + ] ++ (lib.ifEnable (bootstrap-chicken != null) [ bootstrap-chicken - ]; + ]); preBuild = lib.ifEnable (bootstrap-chicken != null) '' # Backup the build* files - those are generated from hostname, @@ -47,6 +49,14 @@ stdenv.mkDerivation { mv build-backup/* . ''; + postInstall = '' + for f in $out/bin/* + do + wrapProgram $f \ + --prefix PATH : ${stdenv.gcc}/bin + done + ''; + # TODO: Assert csi -R files -p '(pathname-file (repository-path))' == binaryVersion meta = { From 6ff97809c5fd27cefc3e68a6d001333bb8a3a231 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Sat, 18 Oct 2014 02:07:38 +0200 Subject: [PATCH 10/13] egg2nix: Update to 0.2. Also regenerate chicken-eggs.nix - the changeset is quite big, but subsequent changes will be smaller as egg2nix now sorts its output. --- .../tools/egg2nix/chicken-eggs.nix | 499 ++++++++---------- .../tools/egg2nix/chicken-eggs.scm | 10 +- pkgs/development/tools/egg2nix/default.nix | 16 +- 3 files changed, 225 insertions(+), 300 deletions(-) diff --git a/pkgs/development/tools/egg2nix/chicken-eggs.nix b/pkgs/development/tools/egg2nix/chicken-eggs.nix index 3e7127ac3cbd..4ec9e0daa47a 100644 --- a/pkgs/development/tools/egg2nix/chicken-eggs.nix +++ b/pkgs/development/tools/egg2nix/chicken-eggs.nix @@ -1,361 +1,296 @@ { pkgs, stdenv }: rec { -inherit (pkgs) eggDerivation fetchegg; + inherit (pkgs) eggDerivation fetchegg; -versions = eggDerivation { - name = "versions-1.15"; + base64 = eggDerivation { + name = "base64-3.3.1"; - src = fetchegg { - name = "versions"; - version = "1.15"; - sha256 = "0qs9yq0jvz9cfd2vwvf1ya8wxxxqghhai57x0w3ywi0h4afbqivm"; + src = fetchegg { + name = "base64"; + version = "3.3.1"; + sha256 = "0wmldiwwg1jpcn07wb906nc53si5j7sa83wgyq643xzqcx4v4x1d"; + }; + + buildInputs = [ + + ]; }; - buildInputs = [ - eggdoc - ]; -}; + blob-utils = eggDerivation { + name = "blob-utils-1.0.3"; + src = fetchegg { + name = "blob-utils"; + version = "1.0.3"; + sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml"; + }; -matchable = eggDerivation { - name = "matchable-3.3"; - - src = fetchegg { - name = "matchable"; - version = "3.3"; - sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990"; + buildInputs = [ + setup-helper + string-utils + ]; }; - buildInputs = [ - - ]; -}; + check-errors = eggDerivation { + name = "check-errors-1.13.0"; + src = fetchegg { + name = "check-errors"; + version = "1.13.0"; + sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi"; + }; -http-client = eggDerivation { - name = "http-client-0.7.1"; - - src = fetchegg { - name = "http-client"; - version = "0.7.1"; - sha256 = "1s03zgmb7kb99ld0f2ylqgicrab9qgza53fkgsqvg7bh5njmzhxr"; + buildInputs = [ + setup-helper + ]; }; - buildInputs = [ - intarweb - uri-common - message-digest - md5 - string-utils - sendfile - ]; -}; + defstruct = eggDerivation { + name = "defstruct-1.6"; + src = fetchegg { + name = "defstruct"; + version = "1.6"; + sha256 = "0lsgl32nmb5hxqiii4r3292cx5vqh50kp6v062nfiyid9lhrj0li"; + }; -sxml-transforms = eggDerivation { - name = "sxml-transforms-1.4.1"; - - src = fetchegg { - name = "sxml-transforms"; - version = "1.4.1"; - sha256 = "1igm3h1nm1i5mwm2akk105v5k96azjm1vnl637l3l5w2yycc76a2"; + buildInputs = [ + + ]; }; - buildInputs = [ - - ]; -}; + http-client = eggDerivation { + name = "http-client-0.7.1"; + src = fetchegg { + name = "http-client"; + version = "0.7.1"; + sha256 = "1s03zgmb7kb99ld0f2ylqgicrab9qgza53fkgsqvg7bh5njmzhxr"; + }; -eggdoc = eggDerivation { - name = "eggdoc-1.3.1"; - - src = fetchegg { - name = "eggdoc"; - version = "1.3.1"; - sha256 = "17ypr5sl2vnnzqxipybmjkm7d5wlsbp7fyq25qr6phgil8axafww"; + buildInputs = [ + intarweb + uri-common + message-digest + md5 + string-utils + sendfile + ]; }; - buildInputs = [ - sxml-transforms - ]; -}; + intarweb = eggDerivation { + name = "intarweb-1.3"; + src = fetchegg { + name = "intarweb"; + version = "1.3"; + sha256 = "0izlby78c25py29bdcbc0vapb6h7xgchqrzi6i51d0rb3mnwy88h"; + }; -sendfile = eggDerivation { - name = "sendfile-1.7.29"; - - src = fetchegg { - name = "sendfile"; - version = "1.7.29"; - sha256 = "1dc02cbkx5kixhbqjy26g6gs680vy7krc9qis1p1v4aa0b2lgj7k"; + buildInputs = [ + defstruct + uri-common + base64 + ]; }; - buildInputs = [ - - ]; -}; + lookup-table = eggDerivation { + name = "lookup-table-1.13.5"; + src = fetchegg { + name = "lookup-table"; + version = "1.13.5"; + sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb"; + }; -setup-helper = eggDerivation { - name = "setup-helper-1.5.4"; - - src = fetchegg { - name = "setup-helper"; - version = "1.5.4"; - sha256 = "1k644y0md2isdcvazqfm4nyc8rh3dby6b0j3r4na4w8ryspqp6gj"; + buildInputs = [ + setup-helper + check-errors + miscmacros + record-variants + synch + ]; }; - buildInputs = [ - - ]; -}; + matchable = eggDerivation { + name = "matchable-3.3"; + src = fetchegg { + name = "matchable"; + version = "3.3"; + sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990"; + }; -check-errors = eggDerivation { - name = "check-errors-1.13.0"; - - src = fetchegg { - name = "check-errors"; - version = "1.13.0"; - sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi"; + buildInputs = [ + + ]; }; - buildInputs = [ - setup-helper - ]; -}; + md5 = eggDerivation { + name = "md5-3.1.0"; + src = fetchegg { + name = "md5"; + version = "3.1.0"; + sha256 = "0bka43nx8x9b0b079qpvml2fl20km19ny0qjmhwzlh6rwmzazj2a"; + }; -synch = eggDerivation { - name = "synch-2.1.2"; - - src = fetchegg { - name = "synch"; - version = "2.1.2"; - sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00"; + buildInputs = [ + message-digest + ]; }; - buildInputs = [ - setup-helper - check-errors - ]; -}; + message-digest = eggDerivation { + name = "message-digest-3.1.0"; + src = fetchegg { + name = "message-digest"; + version = "3.1.0"; + sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s"; + }; -record-variants = eggDerivation { - name = "record-variants-0.5.1"; - - src = fetchegg { - name = "record-variants"; - version = "0.5.1"; - sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h"; + buildInputs = [ + setup-helper + miscmacros + check-errors + variable-item + blob-utils + string-utils + ]; }; - buildInputs = [ - - ]; -}; + miscmacros = eggDerivation { + name = "miscmacros-2.96"; + src = fetchegg { + name = "miscmacros"; + version = "2.96"; + sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc"; + }; -miscmacros = eggDerivation { - name = "miscmacros-2.96"; - - src = fetchegg { - name = "miscmacros"; - version = "2.96"; - sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc"; + buildInputs = [ + + ]; }; - buildInputs = [ - - ]; -}; + record-variants = eggDerivation { + name = "record-variants-0.5.1"; + src = fetchegg { + name = "record-variants"; + version = "0.5.1"; + sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h"; + }; -lookup-table = eggDerivation { - name = "lookup-table-1.13.5"; - - src = fetchegg { - name = "lookup-table"; - version = "1.13.5"; - sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb"; + buildInputs = [ + + ]; }; - buildInputs = [ - setup-helper - check-errors - miscmacros - record-variants - synch - ]; -}; + sendfile = eggDerivation { + name = "sendfile-1.7.29"; + src = fetchegg { + name = "sendfile"; + version = "1.7.29"; + sha256 = "1dc02cbkx5kixhbqjy26g6gs680vy7krc9qis1p1v4aa0b2lgj7k"; + }; -string-utils = eggDerivation { - name = "string-utils-1.2.4"; - - src = fetchegg { - name = "string-utils"; - version = "1.2.4"; - sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1"; + buildInputs = [ + + ]; }; - buildInputs = [ - setup-helper - miscmacros - lookup-table - check-errors - ]; -}; + setup-helper = eggDerivation { + name = "setup-helper-1.5.4"; + src = fetchegg { + name = "setup-helper"; + version = "1.5.4"; + sha256 = "1k644y0md2isdcvazqfm4nyc8rh3dby6b0j3r4na4w8ryspqp6gj"; + }; -blob-utils = eggDerivation { - name = "blob-utils-1.0.3"; - - src = fetchegg { - name = "blob-utils"; - version = "1.0.3"; - sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml"; + buildInputs = [ + + ]; }; - buildInputs = [ - setup-helper - string-utils - ]; -}; + string-utils = eggDerivation { + name = "string-utils-1.2.4"; + src = fetchegg { + name = "string-utils"; + version = "1.2.4"; + sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1"; + }; -variable-item = eggDerivation { - name = "variable-item-1.3.1"; - - src = fetchegg { - name = "variable-item"; - version = "1.3.1"; - sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n"; + buildInputs = [ + setup-helper + miscmacros + lookup-table + check-errors + ]; }; - buildInputs = [ - setup-helper - check-errors - ]; -}; + synch = eggDerivation { + name = "synch-2.1.2"; + src = fetchegg { + name = "synch"; + version = "2.1.2"; + sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00"; + }; -message-digest = eggDerivation { - name = "message-digest-3.1.0"; - - src = fetchegg { - name = "message-digest"; - version = "3.1.0"; - sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s"; + buildInputs = [ + setup-helper + check-errors + ]; }; - buildInputs = [ - setup-helper - miscmacros - check-errors - variable-item - blob-utils - string-utils - ]; -}; + uri-common = eggDerivation { + name = "uri-common-1.4"; + src = fetchegg { + name = "uri-common"; + version = "1.4"; + sha256 = "01ds1gixcn4rz657x3hr4rhw2496hsjff42ninw0k39l8i1cbh7c"; + }; -md5 = eggDerivation { - name = "md5-3.1.0"; - - src = fetchegg { - name = "md5"; - version = "3.1.0"; - sha256 = "0bka43nx8x9b0b079qpvml2fl20km19ny0qjmhwzlh6rwmzazj2a"; + buildInputs = [ + uri-generic + defstruct + matchable + ]; }; - buildInputs = [ - message-digest - ]; -}; + uri-generic = eggDerivation { + name = "uri-generic-2.41"; + src = fetchegg { + name = "uri-generic"; + version = "2.41"; + sha256 = "1r5jbzjllbnmhm5n0m3fcx0g6dc2c2jzp1dcndkfmxz0cl99zxac"; + }; -defstruct = eggDerivation { - name = "defstruct-1.6"; - - src = fetchegg { - name = "defstruct"; - version = "1.6"; - sha256 = "0lsgl32nmb5hxqiii4r3292cx5vqh50kp6v062nfiyid9lhrj0li"; + buildInputs = [ + matchable + defstruct + ]; }; - buildInputs = [ - - ]; -}; + variable-item = eggDerivation { + name = "variable-item-1.3.1"; + src = fetchegg { + name = "variable-item"; + version = "1.3.1"; + sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n"; + }; -uri-generic = eggDerivation { - name = "uri-generic-2.41"; - - src = fetchegg { - name = "uri-generic"; - version = "2.41"; - sha256 = "1r5jbzjllbnmhm5n0m3fcx0g6dc2c2jzp1dcndkfmxz0cl99zxac"; + buildInputs = [ + setup-helper + check-errors + ]; }; - - buildInputs = [ - matchable - defstruct - ]; -}; - - -uri-common = eggDerivation { - name = "uri-common-1.4"; - - src = fetchegg { - name = "uri-common"; - version = "1.4"; - sha256 = "01ds1gixcn4rz657x3hr4rhw2496hsjff42ninw0k39l8i1cbh7c"; - }; - - buildInputs = [ - uri-generic - defstruct - matchable - ]; -}; - - -base64 = eggDerivation { - name = "base64-3.3.1"; - - src = fetchegg { - name = "base64"; - version = "3.3.1"; - sha256 = "0wmldiwwg1jpcn07wb906nc53si5j7sa83wgyq643xzqcx4v4x1d"; - }; - - buildInputs = [ - - ]; -}; - - -intarweb = eggDerivation { - name = "intarweb-1.3"; - - src = fetchegg { - name = "intarweb"; - version = "1.3"; - sha256 = "0izlby78c25py29bdcbc0vapb6h7xgchqrzi6i51d0rb3mnwy88h"; - }; - - buildInputs = [ - defstruct - uri-common - base64 - ]; -}; - } - diff --git a/pkgs/development/tools/egg2nix/chicken-eggs.scm b/pkgs/development/tools/egg2nix/chicken-eggs.scm index 119b06703259..aae0c3f7a625 100644 --- a/pkgs/development/tools/egg2nix/chicken-eggs.scm +++ b/pkgs/development/tools/egg2nix/chicken-eggs.scm @@ -1,6 +1,4 @@ -( - ;; Eggs used by egg2nix - versions - matchable - http-client - ) +;; Eggs used by egg2nix +matchable +http-client + diff --git a/pkgs/development/tools/egg2nix/default.nix b/pkgs/development/tools/egg2nix/default.nix index f3312cf3e0f7..7b1cc682d3bf 100644 --- a/pkgs/development/tools/egg2nix/default.nix +++ b/pkgs/development/tools/egg2nix/default.nix @@ -5,23 +5,15 @@ eggDerivation { src = fetchurl { - url = "https://github.com/the-kenny/egg2nix/archive/0.1.tar.gz"; - sha256 = "0x1vg70rwvd4dbgp8wynlff36cnq1h9ncpag0xgn5jq0miqfr57j"; + url = "https://github.com/the-kenny/egg2nix/archive/0.2.tar.gz"; + sha256 = "051nsy30diapcl687pyfrvcyqh5h55fijqjhykra2nah30bmf0k0"; }; - name = "egg2nix-0.1"; + name = "egg2nix-0.2"; buildInputs = with chickenEggs; [ - versions matchable http-client + matchable http-client ]; - installPhase = '' - mkdir -p $out/bin/ - mv egg2nix.scm $out/bin/egg2nix - chmod +x $out/bin/egg2nix - - runHook postInstall #important - wraps the stuff in $out/bin/ - ''; - meta = { description = "Generate nix-expression from Chicken Scheme eggs"; homepage = https://github.com/the-kenny/egg2nix; From 3a0a3893129d61badd11bda8c093e1553e46c99a Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 27 Oct 2014 01:13:23 +0100 Subject: [PATCH 11/13] Update egg2nix to 0.3. --- pkgs/development/tools/egg2nix/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/egg2nix/default.nix b/pkgs/development/tools/egg2nix/default.nix index 7b1cc682d3bf..2d9fc57e88f7 100644 --- a/pkgs/development/tools/egg2nix/default.nix +++ b/pkgs/development/tools/egg2nix/default.nix @@ -3,19 +3,22 @@ # Note: This mostly reimplements the default.nix already contained in # the tarball. Is there a nicer way than duplicating code? +let + version = "0.3"; +in eggDerivation { src = fetchurl { - url = "https://github.com/the-kenny/egg2nix/archive/0.2.tar.gz"; - sha256 = "051nsy30diapcl687pyfrvcyqh5h55fijqjhykra2nah30bmf0k0"; + url = "https://github.com/the-kenny/egg2nix/archive/${version}.tar.gz"; + sha256 = "1sv6v5a3a17lsyx1i9ajlvix0v8yzl0nnvv9da9c1k349w0fdijv"; }; - name = "egg2nix-0.2"; + name = "egg2nix-${version}"; buildInputs = with chickenEggs; [ matchable http-client ]; meta = { - description = "Generate nix-expression from Chicken Scheme eggs"; + description = "Generate nix-expression from CHICKEN scheme eggs"; homepage = https://github.com/the-kenny/egg2nix; license = stdenv.lib.licenses.bsd3; platforms = stdenv.lib.platforms.unix; From 44624b40ef801dd1467a436905ebf05777b86821 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 27 Oct 2014 12:47:45 +0100 Subject: [PATCH 12/13] egg2nix: Update to 0.4. Let's hope this is the latest version. --- pkgs/development/tools/egg2nix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/egg2nix/default.nix b/pkgs/development/tools/egg2nix/default.nix index 2d9fc57e88f7..dd1c00116e4d 100644 --- a/pkgs/development/tools/egg2nix/default.nix +++ b/pkgs/development/tools/egg2nix/default.nix @@ -4,12 +4,12 @@ # the tarball. Is there a nicer way than duplicating code? let - version = "0.3"; + version = "0.4"; in eggDerivation { src = fetchurl { url = "https://github.com/the-kenny/egg2nix/archive/${version}.tar.gz"; - sha256 = "1sv6v5a3a17lsyx1i9ajlvix0v8yzl0nnvv9da9c1k349w0fdijv"; + sha256 = "1xn79fgqxg0i47asjah31zi56v60is1n8d0cy8w4gbj0i41z7pvm"; }; name = "egg2nix-${version}"; From 685734f76f69c5a0446c2e0a7aac1ce44ef761a7 Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 27 Oct 2014 13:18:35 +0100 Subject: [PATCH 13/13] egg2nix: Fix transitive dependencies. These are also dependencies of http-client, but egg2nix uses them itself too. --- pkgs/development/tools/egg2nix/chicken-eggs.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/egg2nix/chicken-eggs.scm b/pkgs/development/tools/egg2nix/chicken-eggs.scm index aae0c3f7a625..d847ae9e29b9 100644 --- a/pkgs/development/tools/egg2nix/chicken-eggs.scm +++ b/pkgs/development/tools/egg2nix/chicken-eggs.scm @@ -1,4 +1,5 @@ ;; Eggs used by egg2nix -matchable http-client - +intarweb +matchable +uri-common