statically linked Nix. This should come in handy for installers...I hope...
svn path=/nixpkgs/trunk/; revision=6016
This commit is contained in:
parent
0ac74d23dc
commit
aefc9586ec
14
pkgs/misc/nix-static/builder.sh
Normal file
14
pkgs/misc/nix-static/builder.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
source $stdenv/setup
|
||||||
|
|
||||||
|
configureFlags="\
|
||||||
|
--with-store-dir=$storeDir --localstatedir=$stateDir \
|
||||||
|
--with-aterm=$aterm --with-bdb=$bdb \
|
||||||
|
--disable-init-state"
|
||||||
|
|
||||||
|
preConfigure() {
|
||||||
|
autoreconf
|
||||||
|
}
|
||||||
|
|
||||||
|
preConfigure=preConfigure
|
||||||
|
|
||||||
|
genericBuild
|
23
pkgs/misc/nix-static/default.nix
Normal file
23
pkgs/misc/nix-static/default.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ stdenv, fetchurl, aterm, bdb, perl, curl, autoconf, automake, libtool
|
||||||
|
, storeDir ? "/nix/store"
|
||||||
|
, stateDir ? "/nix/var"
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert aterm != null && bdb != null && perl != null;
|
||||||
|
# assert bdb.version >= 4.2
|
||||||
|
# assert aterm.version >= 2.0
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "nix-0.10pre5896";
|
||||||
|
builder = ./builder.sh;
|
||||||
|
src = fetchurl {
|
||||||
|
url = http://nix.cs.uu.nl/dist/nix/nix-0.10pre5896/nix-0.10pre5896.tar.bz2;
|
||||||
|
md5 = "509d4a452cbf2894a86184b5eaf45abd";
|
||||||
|
};
|
||||||
|
buildInputs = [aterm bdb perl curl autoconf automake libtool];
|
||||||
|
inherit storeDir stateDir aterm bdb;
|
||||||
|
|
||||||
|
# uncomment if you want to be able to use nix-prefetch-url when NIX_ROOT
|
||||||
|
# is set
|
||||||
|
patches = [./nix-0.10pre5679.patch ./nix-0.10pre5896-static.patch];
|
||||||
|
}
|
25
pkgs/misc/nix-static/nix-0.10pre5679.patch
Normal file
25
pkgs/misc/nix-static/nix-0.10pre5679.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
diff -ruN nix-0.10pre5679/scripts/nix-prefetch-url.in nix-0.10pre5679.new/scripts/nix-prefetch-url.in
|
||||||
|
--- nix-0.10pre5679/scripts/nix-prefetch-url.in 2006-07-11 13:24:20.000000000 +0200
|
||||||
|
+++ nix-0.10pre5679.new/scripts/nix-prefetch-url.in 2006-08-01 11:54:02.000000000 +0200
|
||||||
|
@@ -39,10 +39,10 @@
|
||||||
|
|
||||||
|
tmpPath=/tmp/nix-prefetch-url-$$ # !!! security?
|
||||||
|
tmpFile=$tmpPath/$name
|
||||||
|
- mkdir $tmpPath
|
||||||
|
+ mkdir -p $NIX_ROOT/$tmpPath
|
||||||
|
|
||||||
|
# Perform the download.
|
||||||
|
- @curl@ --fail --location --max-redirs 20 "$url" > $tmpFile
|
||||||
|
+ @curl@ --fail --location --max-redirs 20 "$url" > $NIX_ROOT/$tmpFile
|
||||||
|
|
||||||
|
# Compute the hash.
|
||||||
|
hash=$(@bindir@/nix-hash --type "$hashType" $hashFormat --flat $tmpFile)
|
||||||
|
@@ -51,7 +51,7 @@
|
||||||
|
# Add the downloaded file to the Nix store.
|
||||||
|
finalPath=$(@bindir@/nix-store --add-fixed "$hashType" $tmpFile)
|
||||||
|
|
||||||
|
- if test -n "$tmpPath"; then rm -rf $tmpPath || true; fi
|
||||||
|
+ if test -n "$NIX_ROOT/$tmpPath"; then rm -rf $NIX_ROOT/$tmpPath || true; fi
|
||||||
|
|
||||||
|
if test -n "$expHash" -a "$expHash" != "$hash"; then
|
||||||
|
echo "hash mismatch for URL \`$url'"
|
55
pkgs/misc/nix-static/nix-0.10pre5896-static.patch
Normal file
55
pkgs/misc/nix-static/nix-0.10pre5896-static.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
diff -ruN nix-0.10pre5896/src/nix-env/Makefile.am nix-0.10pre5896.new/src/nix-env/Makefile.am
|
||||||
|
--- nix-0.10pre5896/src/nix-env/Makefile.am 2006-07-24 20:39:47.000000000 +0200
|
||||||
|
+++ nix-0.10pre5896.new/src/nix-env/Makefile.am 2006-08-02 12:16:34.000000000 +0200
|
||||||
|
@@ -5,6 +5,7 @@
|
||||||
|
nix_env_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \
|
||||||
|
../libstore/libstore.la ../libutil/libutil.la \
|
||||||
|
../boost/format/libformat.la ${bdb_lib} ${aterm_lib}
|
||||||
|
+nix_env_LDFLAGS = -all-static
|
||||||
|
|
||||||
|
main.o: help.txt.hh
|
||||||
|
|
||||||
|
diff -ruN nix-0.10pre5896/src/nix-hash/Makefile.am nix-0.10pre5896.new/src/nix-hash/Makefile.am
|
||||||
|
--- nix-0.10pre5896/src/nix-hash/Makefile.am 2006-07-24 20:39:47.000000000 +0200
|
||||||
|
+++ nix-0.10pre5896.new/src/nix-hash/Makefile.am 2006-08-02 12:16:50.000000000 +0200
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
nix_hash_SOURCES = nix-hash.cc help.txt
|
||||||
|
nix_hash_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
|
||||||
|
../boost/format/libformat.la ${bdb_lib} ${aterm_lib}
|
||||||
|
+nix_hash_LDFLAGS = -all-static
|
||||||
|
|
||||||
|
nix-hash.o: help.txt.hh
|
||||||
|
|
||||||
|
diff -ruN nix-0.10pre5896/src/nix-instantiate/Makefile.am nix-0.10pre5896.new/src/nix-instantiate/Makefile.am
|
||||||
|
--- nix-0.10pre5896/src/nix-instantiate/Makefile.am 2006-07-24 20:39:47.000000000 +0200
|
||||||
|
+++ nix-0.10pre5896.new/src/nix-instantiate/Makefile.am 2006-08-02 12:17:09.000000000 +0200
|
||||||
|
@@ -4,6 +4,7 @@
|
||||||
|
nix_instantiate_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \
|
||||||
|
../libstore/libstore.la ../libutil/libutil.la \
|
||||||
|
../boost/format/libformat.la ${bdb_lib} ${aterm_lib}
|
||||||
|
+nix_instantiate_LDFLAGS = -all-static
|
||||||
|
|
||||||
|
main.o: help.txt.hh
|
||||||
|
|
||||||
|
diff -ruN nix-0.10pre5896/src/nix-log2xml/Makefile.am nix-0.10pre5896.new/src/nix-log2xml/Makefile.am
|
||||||
|
--- nix-0.10pre5896/src/nix-log2xml/Makefile.am 2006-07-24 20:39:47.000000000 +0200
|
||||||
|
+++ nix-0.10pre5896.new/src/nix-log2xml/Makefile.am 2006-08-02 12:17:26.000000000 +0200
|
||||||
|
@@ -1,6 +1,7 @@
|
||||||
|
bin_PROGRAMS = nix-log2xml
|
||||||
|
|
||||||
|
nix_log2xml_SOURCES = log2xml.cc
|
||||||
|
+nix_log2xml_LDFLAGS = -all-static
|
||||||
|
|
||||||
|
%.xml: %.log nix-log2xml
|
||||||
|
./nix-log2xml < $< > $@
|
||||||
|
diff -ruN nix-0.10pre5896/src/nix-store/Makefile.am nix-0.10pre5896.new/src/nix-store/Makefile.am
|
||||||
|
--- nix-0.10pre5896/src/nix-store/Makefile.am 2006-07-24 20:39:47.000000000 +0200
|
||||||
|
+++ nix-0.10pre5896.new/src/nix-store/Makefile.am 2006-08-02 12:17:45.000000000 +0200
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
nix_store_SOURCES = main.cc dotgraph.cc dotgraph.hh help.txt
|
||||||
|
nix_store_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
|
||||||
|
../boost/format/libformat.la ${bdb_lib} ${aterm_lib}
|
||||||
|
+nix_store_LDFLAGS = -all-static
|
||||||
|
|
||||||
|
main.o: help.txt.hh
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user