git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'master' into staging

... to get the openssl mass rebuild: 942dbf89c.

commit061758490fe8f411604e5aefdf258ed576946120 authorVladimír Čunát <vcunat@gmail.com> dateFri 14 Oct 2016, 13:16 (10 years ago) parent6eeea6e6351c4d
46 files changed+806−453
pkgs/applications/graphics/ImageMagick/default.nix+2−2 pkgs/applications/graphics/PythonMagick/default.nix+3−3 pkgs/applications/graphics/gimp/plugins/default.nix+1 pkgs/applications/graphics/graphicsmagick/default.nix+18−4 pkgs/applications/version-management/git-and-tools/git/ssl-cert-file.patch+5−2 pkgs/applications/version-management/smartgithg/default.nix+5−6 pkgs/build-support/docker/default.nix+305−147 pkgs/build-support/docker/examples.nix+108 pkgs/build-support/vm/default.nix+12−11 pkgs/development/compilers/pakcs/case-insensitive.patch+19 pkgs/development/compilers/pakcs/default.nix+5−2 pkgs/development/compilers/swi-prolog/default.nix+16−3 pkgs/development/interpreters/mujs/default.nix+3−3 pkgs/development/libraries/libsodium/default.nix+2−2 pkgs/development/libraries/libuecc/default.nix+24 pkgs/development/libraries/openssl/default.nix+1 pkgs/development/libraries/openssl/nix-ssl-cert-file.patch+15 pkgs/development/libraries/unixODBC/default.nix+1−1 pkgs/development/r-modules/README.md+24 pkgs/development/ruby-modules/bundler-env/default.nix+59−13 pkgs/development/tools/misc/gdb/default.nix+3 pkgs/development/tools/misc/intltool/default.nix+1−1 pkgs/development/tools/misc/travis/default.nix+5−20 pkgs/development/web/nodejs/nodejs.nix+3−2 pkgs/development/web/nodejs/v4.nix+2−2 pkgs/development/web/nodejs/v6.nix+9−3 pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_c_symbols−3 pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols−31 pkgs/os-specific/linux/powertop/default.nix+7−5 pkgs/servers/monitoring/riemann-dash/default.nix+5−17 pkgs/stdenv/darwin/make-bootstrap-tools.nix+18−29 pkgs/tools/bluetooth/blueman/default.nix+3−2 pkgs/tools/misc/fluentd/default.nix+3−5 pkgs/tools/misc/lolcat/default.nix+3−5 pkgs/tools/networking/curl/default.nix+2 pkgs/tools/networking/curl/nix-ssl-cert-file.patch+14 pkgs/tools/networking/fastd/default.nix+26 pkgs/tools/networking/sshpass/default.nix+4−4 pkgs/tools/package-management/fpm/default.nix+2−6 pkgs/tools/system/foreman/default.nix+5−20 pkgs/tools/system/hiera-eyaml/default.nix+5−18 pkgs/tools/text/shfmt/default.nix+3−3 pkgs/tools/typesetting/asciidoctor/default.nix+2−12 pkgs/top-level/all-packages.nix+12−11 pkgs/top-level/php-packages.nix+4−13 pkgs/top-level/release.nix+37−42
pkgs/applications/graphics/ImageMagick/default.nix+2−2
@@ -11,8 +11,8 @@ let
1111 else throw "ImageMagick is not supported on this platform.";
1212
1313 cfg = {
14− version = "6.9.5-10";
15− sha256 = "0cxjzqzca80vf6sfx4z9zq4wq2w0vy9ajp9kf88jb4na8mwsn198";
14+ version = "6.9.6-2";
15+ sha256 = "139h9lycxw3lszn052m34xm0rqyanin4nb529vxjcrkkzqilh91r";
1616 patches = [];
1717 }
1818 # Freeze version on mingw so we don't need to port the patch too often.
pkgs/applications/graphics/PythonMagick/default.nix+3−3
@@ -2,7 +2,7 @@
22
33let
44
5− version = "0.9.12";
5+ version = "0.9.14";
66
77in
88
@@ -10,8 +10,8 @@ stdenv.mkDerivation rec {
1010 name = "pythonmagick-${version}";
1111
1212 src = fetchurl {
13− url = "http://www.imagemagick.org/download/python/releases/PythonMagick-${version}.tar.xz";
14− sha256 = "1l1kr3d7l40fkxgs6mrlxj65alv2jizm9hhgg9i9g90a8qj8642b";
13+ url = "mirror://imagemagick/python/releases/PythonMagick-${version}.tar.xz";
14+ sha256 = "1flkdfi3c19wy2qcfzax1cqvmmri10rvmhc2y85gmagqvv01zz22";
1515 };
1616
1717 buildInputs = [python boost pkgconfig imagemagick];
pkgs/applications/graphics/gimp/plugins/default.nix+1
@@ -57,6 +57,7 @@ rec {
5757 sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \
5858 -e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure
5959 '';
60+ hardeningDisable = [ "format" ];
6061 meta = with stdenv.lib; {
6162 description = "The GIMP Animation Package";
6263 homepage = http://www.gimp.org;
pkgs/applications/graphics/graphicsmagick/default.nix+18−4
@@ -1,6 +1,6 @@
1−{stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
2−, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz
3−, libX11, libwebp, quantumdepth ? 8}:
1+{ stdenv, fetchurl, fetchpatch, bzip2, freetype, graphviz, ghostscript
2+, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
3+, libwebp, quantumdepth ? 8 }:
44
55let version = "1.3.25"; in
66
@@ -12,7 +12,21 @@ stdenv.mkDerivation {
1212 sha256 = "17xcc7pfcmiwpfr1g8ys5a7bdnvqzka53vg3kkzhwwz0s99gljyn";
1313 };
1414
15− patches = [ ./disable-popen.patch ];
15+ patches = [
16+ ./disable-popen.patch
17+ (fetchpatch {
18+ url = "https://sources.debian.net/data/main/g/graphicsmagick/1.3.25-4/debian/patches/CVE-2016-7996_CVE-2016-7997.patch";
19+ sha256 = "0xsby2z8n7cnnln7szjznq7iaabq323wymvdjra59yb41aix74r2";
20+ })
21+ (fetchpatch {
22+ url = "https://sources.debian.net/data/main/g/graphicsmagick/1.3.25-4/debian/patches/CVE-2016-7800_part1.patch";
23+ sha256 = "02s0x9bkbnm5wrd0d2x9ld4d9z5xqpfk310lyylyr5zlnhqxmwgn";
24+ })
25+ (fetchpatch {
26+ url = "https://sources.debian.net/data/main/g/graphicsmagick/1.3.25-4/debian/patches/CVE-2016-7800_part2.patch";
27+ sha256 = "1h4xv3i1aq5avsd584rwa5sa7ca8f7w9ggmh7j2llqq5kymwsv5f";
28+ })
29+ ];
1630
1731 configureFlags = [
1832 "--enable-shared"
pkgs/applications/version-management/git-and-tools/git/ssl-cert-file.patch+5−2
@@ -1,11 +1,14 @@
11diff -ru git-2.7.4-orig/http.c git-2.7.4/http.c
22--- git-2.7.4-orig/http.c 2016-03-17 21:47:59.000000000 +0100
33+++ git-2.7.4/http.c 2016-04-12 11:38:33.187070848 +0200
4−@@ -544,6 +544,7 @@
4+@@ -544,6 +544,10 @@
55 #if LIBCURL_VERSION_NUM >= 0x070908
66 set_from_env(&ssl_capath, "GIT_SSL_CAPATH");
77 #endif
8−+ set_from_env(&ssl_cainfo, "SSL_CERT_FILE");
8++ if (getenv("NIX_SSL_CERT_FILE"))
9++ set_from_env(&ssl_cainfo, "NIX_SSL_CERT_FILE");
10++ else
11++ set_from_env(&ssl_cainfo, "SSL_CERT_FILE");
912 set_from_env(&ssl_cainfo, "GIT_SSL_CAINFO");
1013
1114 set_from_env(&user_agent, "GIT_HTTP_USER_AGENT");
pkgs/applications/version-management/smartgithg/default.nix+5−6
@@ -8,17 +8,16 @@
88
99stdenv.mkDerivation rec {
1010 name = "smartgithg-${version}";
11− version = "7_1_2";
11+ version = "8_0_3";
1212
1313 src = fetchurl {
1414 url = "http://www.syntevo.com/static/smart/download/smartgit/smartgit-linux-${version}.tar.gz";
15− sha256 = "18jw4g2akhj6h9w8378kacv7ws35ndcnc3kkhci9iypwy432ak8d";
15+ sha256 = "1ghxjg5dm22kwfrq26nqp4qhh6h7f4l4fnf1cx9cksd30ypwy223";
1616 };
1717
18− buildInputs = [
19− makeWrapper
20− jre
21− ];
18+ nativeBuildInputs = [ makeWrapper ];
19+
20+ buildInputs = [ jre ];
2221
2322 buildCommand = let
2423 pkg_path = "$out/${name}";
pkgs/build-support/docker/default.nix+305−147
@@ -1,12 +1,36 @@
1−{ stdenv, lib, callPackage, runCommand, writeReferencesToFile, writeText, vmTools, writeScript
2−, docker, shadow, utillinux, coreutils, jshon, e2fsprogs, go, pigz, findutils }:
1+{
2+ callPackage,
3+ coreutils,
4+ docker,
5+ e2fsprogs,
6+ findutils,
7+ go,
8+ jshon,
9+ lib,
10+ pkgs,
11+ pigz,
12+ runCommand,
13+ rsync,
14+ shadow,
15+ stdenv,
16+ storeDir ? builtins.storeDir,
17+ utillinux,
18+ vmTools,
19+ writeReferencesToFile,
20+ writeScript,
21+ writeText,
22+}:
323
424# WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
5−
25+
626rec {
727
28+ examples = import ./examples.nix {
29+ inherit pkgs buildImage pullImage shadowSetup;
30+ };
31+
832 pullImage = callPackage ./pull.nix {};
9−
33+
1034 # We need to sum layer.tar, not a directory, hence tarsum instead of nix-hash.
1135 # And we cannot untar it, because then we cannot preserve permissions ecc.
1236 tarsum = runCommand "tarsum" {
@@ -23,110 +47,138 @@ rec {
2347
2448 cp tarsum $out
2549 '';
26−
50+
2751 # buildEnv creates symlinks to dirs, which is hard to edit inside the overlay VM
28− mergeDrvs = { drvs, onlyDeps ? false }:
52+ mergeDrvs = {
53+ derivations,
54+ onlyDeps ? false
55+ }:
2956 runCommand "merge-drvs" {
30− inherit drvs onlyDeps;
57+ inherit derivations onlyDeps;
3158 } ''
32− if [ -n "$onlyDeps" ]; then
33− echo $drvs > $out
59+ if [[ -n "$onlyDeps" ]]; then
60+ echo $derivations > $out
3461 exit 0
3562 fi
36−
63+
3764 mkdir $out
38− for drv in $drvs; do
39− echo Merging $drv
40− if [ -d "$drv" ]; then
41− cp -drf --preserve=mode -f $drv/* $out/
65+ for derivation in $derivations; do
66+ echo "Merging $derivation..."
67+ if [[ -d "$derivation" ]]; then
68+ # If it's a directory, copy all of its contents into $out.
69+ cp -drf --preserve=mode -f $derivation/* $out/
4270 else
71+ # Otherwise treat the derivation as a tarball and extract it
72+ # into $out.
4373 tar -C $out -xpf $drv || true
4474 fi
4575 done
4676 '';
47−
48− shellScript = text:
49− writeScript "script.sh" ''
50− #!${stdenv.shell}
51− set -e
52− export PATH=${coreutils}/bin:/bin
53−
54− ${text}
55− '';
5677
78+ # Helper for setting up the base files for managing users and
79+ # groups, only if such files don't exist already. It is suitable for
80+ # being used in a runAsRoot script.
5781 shadowSetup = ''
5882 export PATH=${shadow}/bin:$PATH
5983 mkdir -p /etc/pam.d
60− if [ ! -f /etc/passwd ]; then
84+ if [[ ! -f /etc/passwd ]]; then
6185 echo "root:x:0:0::/root:/bin/sh" > /etc/passwd
6286 echo "root:!x:::::::" > /etc/shadow
6387 fi
64− if [ ! -f /etc/group ]; then
88+ if [[ ! -f /etc/group ]]; then
6589 echo "root:x:0:" > /etc/group
6690 echo "root:x::" > /etc/gshadow
6791 fi
68− if [ ! -f /etc/pam.d/other ]; then
92+ if [[ ! -f /etc/pam.d/other ]]; then
6993 cat > /etc/pam.d/other <<EOF
70−account sufficient pam_unix.so
71−auth sufficient pam_rootok.so
72−password requisite pam_unix.so nullok sha512
73−session required pam_unix.so
74−EOF
94+ account sufficient pam_unix.so
95+ auth sufficient pam_rootok.so
96+ password requisite pam_unix.so nullok sha512
97+ session required pam_unix.so
98+ EOF
7599 fi
76− if [ ! -f /etc/login.defs ]; then
100+ if [[ ! -f /etc/login.defs ]]; then
77101 touch /etc/login.defs
78102 fi
79103 '';
80104
81− runWithOverlay = { name , fromImage ? null, fromImageName ? null, fromImageTag ? null
82− , diskSize ? 1024, preMount ? "", postMount ? "", postUmount ? "" }:
105+ # Run commands in a virtual machine.
106+ runWithOverlay = {
107+ name,
108+ fromImage ? null,
109+ fromImageName ? null,
110+ fromImageTag ? null,
111+ diskSize ? 1024,
112+ preMount ? "",
113+ postMount ? "",
114+ postUmount ? ""
115+ }:
83116 vmTools.runInLinuxVM (
84117 runCommand name {
85− preVM = vmTools.createEmptyImage { size = diskSize; fullName = "docker-run-disk"; };
86−
118+ preVM = vmTools.createEmptyImage {
119+ size = diskSize;
120+ fullName = "docker-run-disk";
121+ };
87122 inherit fromImage fromImageName fromImageTag;
88−
89− buildInputs = [ utillinux e2fsprogs jshon ];
123+
124+ buildInputs = [ utillinux e2fsprogs jshon rsync ];
90125 } ''
91126 rm -rf $out
92−
127+
93128 mkdir disk
94129 mkfs /dev/${vmTools.hd}
95130 mount /dev/${vmTools.hd} disk
96131 cd disk
97132
98− if [ -n "$fromImage" ]; then
99− echo Unpacking base image
133+ if [[ -n "$fromImage" ]]; then
134+ echo "Unpacking base image..."
100135 mkdir image
101136 tar -C image -xpf "$fromImage"
102137
103− if [ -z "$fromImageName" ]; then
104− fromImageName=$(jshon -k < image/repositories|head -n1)
138+ # If the image name isn't set, read it from the image repository json.
139+ if [[ -z "$fromImageName" ]]; then
140+ fromImageName=$(jshon -k < image/repositories | head -n 1)
141+ echo "From-image name wasn't set. Read $fromImageName."
105142 fi
106− if [ -z "$fromImageTag" ]; then
107− fromImageTag=$(jshon -e $fromImageName -k < image/repositories|head -n1)
143+
144+ # If the tag isn't set, use the name as an index into the json
145+ # and read the first key found.
146+ if [[ -z "$fromImageTag" ]]; then
147+ fromImageTag=$(jshon -e $fromImageName -k < image/repositories \
148+ | head -n1)
149+ echo "From-image tag wasn't set. Read $fromImageTag."
108150 fi
109− parentID=$(jshon -e $fromImageName -e $fromImageTag -u < image/repositories)
151+
152+ # Use the name and tag to get the parent ID field.
153+ parentID=$(jshon -e $fromImageName -e $fromImageTag -u \
154+ < image/repositories)
110155 fi
111156
157+ # Unpack all of the parent layers into the image.
112158 lowerdir=""
113− while [ -n "$parentID" ]; do
114− echo Unpacking layer $parentID
159+ while [[ -n "$parentID" ]]; do
160+ echo "Unpacking layer $parentID"
115161 mkdir -p image/$parentID/layer
116162 tar -C image/$parentID/layer -xpf image/$parentID/layer.tar
117163 rm image/$parentID/layer.tar
118164
119165 find image/$parentID/layer -name ".wh.*" -exec bash -c 'name="$(basename {}|sed "s/^.wh.//")"; mknod "$(dirname {})/$name" c 0 0; rm {}' \;
120166
167+ # Get the next lower directory and continue the loop.
121168 lowerdir=$lowerdir''${lowerdir:+:}image/$parentID/layer
122− parentID=$(cat image/$parentID/json|(jshon -e parent -u 2>/dev/null || true))
169+ parentID=$(cat image/$parentID/json \
170+ | (jshon -e parent -u 2>/dev/null || true))
123171 done
124172
125173 mkdir work
126174 mkdir layer
127175 mkdir mnt
128176
129− ${preMount}
177+ ${lib.optionalString (preMount != "") ''
178+ # Execute pre-mount steps
179+ echo "Executing pre-mount steps..."
180+ ${preMount}
181+ ''}
130182
131183 if [ -n "$lowerdir" ]; then
132184 mount -t overlay overlay -olowerdir=$lowerdir,workdir=work,upperdir=layer mnt
@@ -134,13 +186,19 @@ EOF
134186 mount --bind layer mnt
135187 fi
136188
137− ${postMount}
138−
189+ ${lib.optionalString (postMount != "") ''
190+ # Execute post-mount steps
191+ echo "Executing post-mount steps..."
192+ ${postMount}
193+ ''}
194+
139195 umount mnt
140196
141− pushd layer
142− find . -type c -exec bash -c 'name="$(basename {})"; touch "$(dirname {})/.wh.$name"; rm "{}"' \;
143− popd
197+ (
198+ cd layer
199+ cmd='name="$(basename {})"; touch "$(dirname {})/.wh.$name"; rm "{}"'
200+ find . -type c -exec bash -c "$cmd" \;
201+ )
144202
145203 ${postUmount}
146204 '');
@@ -150,76 +208,148 @@ EOF
150208 inherit name fromImage fromImageName fromImageTag diskSize;
151209
152210 postMount = ''
153− echo Packing raw image
211+ echo "Packing raw image..."
154212 tar -C mnt --mtime=0 -cf $out .
155213 '';
156214 };
157−
158− mkPureLayer = { baseJson, contents ? null, extraCommands ? "" }:
159− runCommand "docker-layer" {
215+
216+
217+ # Create an executable shell script which has the coreutils in its
218+ # PATH. Since root scripts are executed in a blank environment, even
219+ # things like `ls` or `echo` will be missing.
220+ shellScript = name: text:
221+ writeScript name ''
222+ #!${stdenv.shell}
223+ set -e
224+ export PATH=${coreutils}/bin:/bin
225+ ${text}
226+ '';
227+
228+ # Create a "layer" (set of files).
229+ mkPureLayer = {
230+ # Name of the layer
231+ name,
232+ # JSON containing configuration and metadata for this layer.
233+ baseJson,
234+ # Files to add to the layer.
235+ contents ? null,
236+ # Additional commands to run on the layer before it is tar'd up.
237+ extraCommands ? ""
238+ }:
239+ runCommand "docker-layer-${name}" {
160240 inherit baseJson contents extraCommands;
161241
162− buildInputs = [ jshon ];
163− } ''
242+ buildInputs = [ jshon rsync ];
243+ }
244+ ''
164245 mkdir layer
165− if [ -n "$contents" ]; then
166− echo Adding contents
167− for c in $contents; do
168− cp -drf $c/* layer/
169− chmod -R ug+w layer/
246+ if [[ -n "$contents" ]]; then
247+ echo "Adding contents..."
248+ for item in $contents; do
249+ echo "Adding $item"
250+ rsync -a $item/ layer/
170251 done
252+ else
253+ echo "No contents to add to layer."
254+ fi
255+
256+ if [[ -n $extraCommands ]]; then
257+ (cd layer; eval "$extraCommands")
171258 fi
172259
173− pushd layer
174− ${extraCommands}
175− popd
176−
177− echo Packing layer
260+ # Tar up the layer and throw it into 'layer.tar'.
261+ echo "Packing layer..."
178262 mkdir $out
179263 tar -C layer --mtime=0 -cf $out/layer.tar .
180− ts=$(${tarsum} < $out/layer.tar)
181− cat ${baseJson} | jshon -s "$ts" -i checksum > $out/json
264+
265+ # Compute a checksum of the tarball.
266+ echo "Computing layer checksum..."
267+ tarsum=$(${tarsum} < $out/layer.tar)
268+
269+ # Add a 'checksum' field to the JSON, with the value set to the
270+ # checksum of the tarball.
271+ cat ${baseJson} | jshon -s "$tarsum" -i checksum > $out/json
272+
273+ # Indicate to docker that we're using schema version 1.0.
182274 echo -n "1.0" > $out/VERSION
275+
276+ echo "Finished building layer '${name}'"
183277 '';
184278
185− mkRootLayer = { runAsRoot, baseJson, fromImage ? null, fromImageName ? null, fromImageTag ? null
186− , diskSize ? 1024, contents ? null, extraCommands ? "" }:
187− let runAsRootScript = writeScript "run-as-root.sh" runAsRoot;
279+ # Make a "root" layer; required if we need to execute commands as a
280+ # privileged user on the image. The commands themselves will be
281+ # performed in a virtual machine sandbox.
282+ mkRootLayer = {
283+ # Name of the image.
284+ name,
285+ # Script to run as root. Bash.
286+ runAsRoot,
287+ # Files to add to the layer. If null, an empty layer will be created.
288+ contents ? null,
289+ # JSON containing configuration and metadata for this layer.
290+ baseJson,
291+ # Existing image onto which to append the new layer.
292+ fromImage ? null,
293+ # Name of the image we're appending onto.
294+ fromImageName ? null,
295+ # Tag of the image we're appending onto.
296+ fromImageTag ? null,
297+ # How much disk to allocate for the temporary virtual machine.
298+ diskSize ? 1024,
299+ # Commands (bash) to run on the layer; these do not require sudo.
300+ extraCommands ? ""
301+ }:
302+ # Generate an executable script from the `runAsRoot` text.
303+ let runAsRootScript = shellScript "run-as-root.sh" runAsRoot;
188304 in runWithOverlay {
189− name = "docker-layer";
190−
305+ name = "docker-layer-${name}";
306+
191307 inherit fromImage fromImageName fromImageTag diskSize;
192308
193− preMount = lib.optionalString (contents != null) ''
194− echo Adding contents
195− for c in ${builtins.toString contents}; do
196− cp -drf $c/* layer/
197− chmod -R ug+w layer/
309+ preMount = lib.optionalString (contents != null && contents != []) ''
310+ echo "Adding contents..."
311+ for item in ${toString contents}; do
312+ echo "Adding $item..."
313+ rsync -a $item/ layer/
198314 done
199315 '';
200316
201317 postMount = ''
202− mkdir -p mnt/{dev,proc,sys,nix/store}
318+ mkdir -p mnt/{dev,proc,sys} mnt${storeDir}
319+
320+ # Mount /dev, /sys and the nix store as shared folders.
203321 mount --rbind /dev mnt/dev
204322 mount --rbind /sys mnt/sys
205− mount --rbind /nix/store mnt/nix/store
323+ mount --rbind ${storeDir} mnt${storeDir}
206324
325+ # Execute the run as root script. See 'man unshare' for
326+ # details on what's going on here; basically this command
327+ # means that the runAsRootScript will be executed in a nearly
328+ # completely isolated environment.
207329 unshare -imnpuf --mount-proc chroot mnt ${runAsRootScript}
208− umount -R mnt/dev mnt/sys mnt/nix/store
209− rmdir --ignore-fail-on-non-empty mnt/dev mnt/proc mnt/sys mnt/nix/store mnt/nix
330+
331+ # Unmount directories and remove them.
332+ umount -R mnt/dev mnt/sys mnt${storeDir}
333+ rmdir --ignore-fail-on-non-empty \
334+ mnt/dev mnt/proc mnt/sys mnt${storeDir} \
335+ mnt$(dirname ${storeDir})
210336 '';
211−
337+
212338 postUmount = ''
213− pushd layer
214− ${extraCommands}
215− popd
339+ (cd layer; eval "${extraCommands}")
216340
217− echo Packing layer
341+ echo "Packing layer..."
218342 mkdir $out
219343 tar -C layer --mtime=0 -cf $out/layer.tar .
344+
345+ # Compute the tar checksum and add it to the output json.
346+ echo "Computing checksum..."
220347 ts=$(${tarsum} < $out/layer.tar)
221348 cat ${baseJson} | jshon -s "$ts" -i checksum > $out/json
349+ # Indicate to docker that we're using schema version 1.0.
222350 echo -n "1.0" > $out/VERSION
351+
352+ echo "Finished building layer '${name}'"
223353 '';
224354 };
225355
@@ -229,116 +359,144 @@ EOF
229359 # 4. compute the layer id
230360 # 5. put the layer in the image
231361 # 6. repack the image
232− buildImage = args@{ name, tag ? "latest"
233− , fromImage ? null, fromImageName ? null, fromImageTag ? null
234− , contents ? null, config ? null, runAsRoot ? null
235− , diskSize ? 1024, extraCommands ? "" }:
362+ buildImage = args@{
363+ # Image name.
364+ name,
365+ # Image tag.
366+ tag ? "latest",
367+ # Parent image, to append to.
368+ fromImage ? null,
369+ # Name of the parent image; will be read from the image otherwise.
370+ fromImageName ? null,
371+ # Tag of the parent image; will be read from the image otherwise.
372+ fromImageTag ? null,
373+ # Files to put on the image (a nix store path or list of paths).
374+ contents ? null,
375+ # Docker config; e.g. what command to run on the container.
376+ config ? null,
377+ # Optional bash script to run on the files prior to fixturizing the layer.
378+ extraCommands ? "",
379+ # Optional bash script to run as root on the image when provisioning.
380+ runAsRoot ? null,
381+ # Size of the virtual machine disk to provision when building the image.
382+ diskSize ? 1024,
383+ }:
236384
237385 let
238−
239386 baseName = baseNameOf name;
240387
388+ # Create a JSON blob of the configuration. Set the date to unix zero.
241389 baseJson = writeText "${baseName}-config.json" (builtins.toJSON {
242− created = "1970-01-01T00:00:01Z";
243− architecture = "amd64";
244− os = "linux";
245− config = config;
390+ created = "1970-01-01T00:00:01Z";
391+ architecture = "amd64";
392+ os = "linux";
393+ config = config;
246394 });
247395
248− layer = (if runAsRoot == null
249− then mkPureLayer { inherit baseJson contents extraCommands; }
250− else mkRootLayer { inherit baseJson fromImage fromImageName fromImageTag contents runAsRoot diskSize extraCommands; });
251− result = runCommand "${baseName}.tar.gz" {
396+ layer =
397+ if runAsRoot == null
398+ then mkPureLayer { inherit name baseJson contents extraCommands; }
399+ else mkRootLayer { inherit name baseJson fromImage fromImageName
400+ fromImageTag contents runAsRoot diskSize
401+ extraCommands; };
402+ result = runCommand "docker-image-${baseName}.tar.gz" {
252403 buildInputs = [ jshon pigz coreutils findutils ];
253−
254404 imageName = name;
255405 imageTag = tag;
256406 inherit fromImage baseJson;
257−
258407 layerClosure = writeReferencesToFile layer;
259−
260− passthru = {
261− buildArgs = args;
262− };
408+ passthru.buildArgs = args;
409+ passthru.layer = layer;
263410 } ''
264411 # Print tar contents:
265412 # 1: Interpreted as relative to the root directory
266413 # 2: With no trailing slashes on directories
267− # This is useful for ensuring that the output matches the values generated by the "find" command
414+ # This is useful for ensuring that the output matches the
415+ # values generated by the "find" command
268416 ls_tar() {
269− for f in $(tar -tf $1 | xargs realpath -ms --relative-to=.); do
270− if [ "$f" != "." ]; then
271− echo "/$f"
272− fi
273− done
417+ for f in $(tar -tf $1 | xargs realpath -ms --relative-to=.); do
418+ if [[ "$f" != "." ]]; then
419+ echo "/$f"
420+ fi
421+ done
274422 }
275−
423+
276424 mkdir image
277425 touch baseFiles
278− if [ -n "$fromImage" ]; then
279− echo Unpacking base image
426+ if [[ -n "$fromImage" ]]; then
427+ echo "Unpacking base image..."
280428 tar -C image -xpf "$fromImage"
281−
282− if [ -z "$fromImageName" ]; then
429+
430+ if [[ -z "$fromImageName" ]]; then
283431 fromImageName=$(jshon -k < image/repositories|head -n1)
284432 fi
285− if [ -z "$fromImageTag" ]; then
286− fromImageTag=$(jshon -e $fromImageName -k < image/repositories|head -n1)
433+ if [[ -z "$fromImageTag" ]]; then
434+ fromImageTag=$(jshon -e $fromImageName -k \
435+ < image/repositories|head -n1)
287436 fi
288− parentID=$(jshon -e $fromImageName -e $fromImageTag -u < image/repositories)
289−
437+ parentID=$(jshon -e $fromImageName -e $fromImageTag -u \
438+ < image/repositories)
439+
290440 for l in image/*/layer.tar; do
291− ls_tar $l >> baseFiles
441+ ls_tar image/*/layer.tar >> baseFiles
292442 done
293443 fi
294444
295445 chmod -R ug+rw image
296−
446+
297447 mkdir temp
298448 cp ${layer}/* temp/
299449 chmod ug+w temp/*
300450
451+ echo "$(dirname ${storeDir})" >> layerFiles
452+ echo '${storeDir}' >> layerFiles
301453 for dep in $(cat $layerClosure); do
302− find $dep -path "${layer}" -prune -o -print >> layerFiles
454+ find $dep >> layerFiles
303455 done
304456
305− if [ -s layerFiles ]; then
306− # FIXME: might not be /nix/store
307− echo '/nix' >> layerFiles
308− echo '/nix/store' >> layerFiles
309− fi
310−
311− echo Adding layer
457+ echo "Adding layer..."
458+ # Record the contents of the tarball with ls_tar.
312459 ls_tar temp/layer.tar >> baseFiles
313− comm <(sort -u baseFiles) <(sort -u layerFiles) -1 -3 > newFiles
314− tar -rpf temp/layer.tar --mtime=0 --no-recursion --files-from newFiles 2>/dev/null || true
315460
316− echo Adding meta
317−
318− if [ -n "$parentID" ]; then
461+ # Get the files in the new layer which were *not* present in
462+ # the old layer, and record them as newFiles.
463+ comm <(sort -n baseFiles|uniq) \
464+ <(sort -n layerFiles|uniq|grep -v ${layer}) -1 -3 > newFiles
465+ # Append the new files to the layer.
466+ tar -rpf temp/layer.tar --mtime=0 --no-recursion --files-from newFiles
467+
468+ echo "Adding meta..."
469+
470+ # If we have a parentID, add it to the json metadata.
471+ if [[ -n "$parentID" ]]; then
319472 cat temp/json | jshon -s "$parentID" -i parent > tmpjson
320473 mv tmpjson temp/json
321474 fi
322−
475+
476+ # Take the sha256 sum of the generated json and use it as the layer ID.
477+ # Compute the size and add it to the json under the 'Size' field.
323478 layerID=$(sha256sum temp/json|cut -d ' ' -f 1)
324479 size=$(stat --printf="%s" temp/layer.tar)
325480 cat temp/json | jshon -s "$layerID" -i id -n $size -i Size > tmpjson
326481 mv tmpjson temp/json
327482
483+ # Use the temp folder we've been working on to create a new image.
328484 mv temp image/$layerID
329−
485+
486+ # Store the json under the name image/repositories.
330487 jshon -n object \
331488 -n object -s "$layerID" -i "$imageTag" \
332489 -i "$imageName" > image/repositories
333490
491+ # Make the image read-only.
334492 chmod -R a-w image
335493
336− echo Cooking the image
494+ echo "Cooking the image..."
337495 tar -C image --mtime=0 -c . | pigz -nT > $out
496+
497+ echo "Finished."
338498 '';
339499
340500 in
341−
342− result;
343−
501+ result;
344502}
pkgs/build-support/docker/examples.nixnew file+108
@@ -0,0 +1,108 @@
1+# Examples of using the docker tools to build packages.
2+#
3+# This file defines several docker images. In order to use an image,
4+# build its derivation with `nix-build`, and then load the result with
5+# `docker load`. For example:
6+#
7+# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
8+# $ docker load < result
9+
10+{ pkgs, buildImage, pullImage, shadowSetup }:
11+
12+rec {
13+ # 1. basic example
14+ bash = buildImage {
15+ name = "bash";
16+ contents = pkgs.bashInteractive;
17+ };
18+
19+ # 2. service example, layered on another image
20+ redis = buildImage {
21+ name = "redis";
22+ tag = "latest";
23+
24+ # for example's sake, we can layer redis on top of bash or debian
25+ fromImage = bash;
26+ # fromImage = debian;
27+
28+ contents = pkgs.redis;
29+ runAsRoot = ''
30+ mkdir -p /data
31+ '';
32+
33+ config = {
34+ Cmd = [ "/bin/redis-server" ];
35+ WorkingDir = "/data";
36+ Volumes = {
37+ "/data" = {};
38+ };
39+ };
40+ };
41+
42+ # 3. another service example
43+ nginx = let
44+ nginxPort = "80";
45+ nginxConf = pkgs.writeText "nginx.conf" ''
46+ user nginx nginx;
47+ daemon off;
48+ error_log /dev/stdout info;
49+ pid /dev/null;
50+ events {}
51+ http {
52+ access_log /dev/stdout;
53+ server {
54+ listen ${nginxPort};
55+ index index.html;
56+ location / {
57+ root ${nginxWebRoot};
58+ }
59+ }
60+ }
61+ '';
62+ nginxWebRoot = pkgs.writeTextDir "index.html" ''
63+ <html><body><h1>Hello from NGINX</h1></body></html>
64+ '';
65+ in
66+ buildImage {
67+ name = "nginx-container";
68+ contents = pkgs.nginx;
69+
70+ runAsRoot = ''
71+ #!${pkgs.stdenv.shell}
72+ ${shadowSetup}
73+ groupadd --system nginx
74+ useradd --system --gid nginx nginx
75+ '';
76+
77+ config = {
78+ Cmd = [ "nginx" "-c" nginxConf ];
79+ ExposedPorts = {
80+ "${nginxPort}/tcp" = {};
81+ };
82+ };
83+ };
84+
85+ # 4. example of pulling an image. could be used as a base for other images
86+ #
87+ # ***** Currently broken, getting 404s. Perhaps the docker API has changed?
88+ #
89+ #
90+ # debian = pullImage {
91+ # imageName = "debian";
92+ # imageTag = "jessie";
93+ # # this hash will need change if the tag is updated at docker hub
94+ # sha256 = "18kd495lc2k35h03bpcbdjnix17nlqbwf6nmq3sb161blf0dk14q";
95+ # };
96+
97+ # 5. example of multiple contents, emacs and vi happily coexisting
98+ editors = buildImage {
99+ name = "editors";
100+ contents = [
101+ pkgs.coreutils
102+ pkgs.bash
103+ pkgs.emacs
104+ pkgs.vim
105+ pkgs.nano
106+ ];
107+ };
108+}
pkgs/build-support/vm/default.nix+12−11
@@ -1,6 +1,7 @@
11{ pkgs
22, kernel ? pkgs.linux
33, img ? "bzImage"
4+, storeDir ? builtins.storeDir
45, rootModules ?
56 [ "virtio_pci" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "rtc_cmos" ]
67}:
@@ -128,8 +129,8 @@ rec {
128129 mount -t devpts none /fs/dev/pts
129130
130131 echo "mounting Nix store..."
131− mkdir -p /fs/nix/store
132− mount -t 9p store /fs/nix/store -o trans=virtio,version=9p2000.L,cache=loose
132+ mkdir -p /fs${storeDir}
133+ mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose
133134
134135 mkdir -p /fs/tmp /fs/run /fs/var
135136 mount -t tmpfs -o "mode=1777" none /fs/tmp
@@ -172,7 +173,7 @@ rec {
172173 # apparent KVM > 1.5.2 bug.
173174 ${pkgs.utillinux}/bin/hwclock -s
174175
175− export NIX_STORE=/nix/store
176+ export NIX_STORE=${storeDir}
176177 export NIX_BUILD_TOP=/tmp
177178 export TMPDIR=/tmp
178179 export PATH=/empty
@@ -220,7 +221,7 @@ rec {
220221 ${lib.optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
221222 -nographic -no-reboot \
222223 -device virtio-rng-pci \
223− -virtfs local,path=/nix/store,security_model=none,mount_tag=store \
224+ -virtfs local,path=${storeDir},security_model=none,mount_tag=store \
224225 -virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
225226 -drive file=$diskImage,if=virtio,cache=unsafe,werror=report \
226227 -kernel ${kernel}/${img} \
@@ -298,7 +299,7 @@ rec {
298299
299300 /* Run a derivation in a Linux virtual machine (using Qemu/KVM). By
300301 default, there is no disk image; the root filesystem is a tmpfs,
301− and /nix/store is shared with the host (via the 9P protocol).
302+ and the nix store is shared with the host (via the 9P protocol).
302303 Thus, any pure Nix derivation should run unmodified, e.g. the
303304 call
304305
@@ -434,8 +435,8 @@ rec {
434435 chroot=$(type -tP chroot)
435436
436437 # Make the Nix store available in /mnt, because that's where the RPMs live.
437− mkdir -p /mnt/nix/store
438− ${utillinux}/bin/mount -o bind /nix/store /mnt/nix/store
438+ mkdir -p /mnt${storeDir}
439+ ${utillinux}/bin/mount -o bind ${storeDir} /mnt${storeDir}
439440
440441 # Newer distributions like Fedora 18 require /lib etc. to be
441442 # symlinked to /usr.
@@ -474,7 +475,7 @@ rec {
474475
475476 rm /mnt/.debug
476477
477− ${utillinux}/bin/umount /mnt/nix/store /mnt/tmp ${lib.optionalString unifiedSystemDir "/mnt/proc"}
478+ ${utillinux}/bin/umount /mnt${storeDir} /mnt/tmp ${lib.optionalString unifiedSystemDir "/mnt/proc"}
478479 ${utillinux}/bin/umount /mnt
479480 '';
480481
@@ -604,8 +605,8 @@ rec {
604605 done
605606
606607 # Make the Nix store available in /mnt, because that's where the .debs live.
607− mkdir -p /mnt/inst/nix/store
608− ${utillinux}/bin/mount -o bind /nix/store /mnt/inst/nix/store
608+ mkdir -p /mnt/inst${storeDir}
609+ ${utillinux}/bin/mount -o bind ${storeDir} /mnt/inst${storeDir}
609610 ${utillinux}/bin/mount -o bind /proc /mnt/proc
610611 ${utillinux}/bin/mount -o bind /dev /mnt/dev
611612
@@ -653,7 +654,7 @@ rec {
653654
654655 rm /mnt/.debug
655656
656− ${utillinux}/bin/umount /mnt/inst/nix/store
657+ ${utillinux}/bin/umount /mnt/inst${storeDir}
657658 ${utillinux}/bin/umount /mnt/proc
658659 ${utillinux}/bin/umount /mnt/dev
659660 ${utillinux}/bin/umount /mnt
pkgs/development/compilers/pakcs/case-insensitive.patchnew file+19
@@ -0,0 +1,19 @@
1+--- www/Makefile.orig 2016-10-10 21:04:36.000000000 +0300
2++++ pakcs-1.14.0/www/Makefile 2016-10-10 21:07:56.000000000 +0300
3+@@ -6,7 +6,7 @@ all: submitform Registry
4+ submitform: SubmitForm.curry $(LIBDIR)/HtmlCgi.curry \
5+ $(LIBDIR)/NamedSocket.curry $(LIBDIR)/CPNS.curry
6+ $(REPL) $(REPL_OPTS) :load SubmitForm :save :q
7+- mv SubmitForm submitform
8++ mv SubmitForm submitform.orig && mv submitform.orig submitform
9+
10+ Registry: Registry.curry $(LIBDIR)/HtmlCgi.curry
11+ $(REPL) $(REPL_OPTS) :load Registry :save :q
12+--- currytools/erd2curry/Makefile.orig 2016-10-10 21:13:49.000000000 +0300
13++++ pakcs-1.14.0/currytools/erd2curry/Makefile 2016-10-10 21:21:14.000000000 +0300
14+@@ -32,4 +32,4 @@ uninstall: clean
15+ erd2curry: $(DEPS)
16+ # create saved state for top-level function "main":
17+ $(REPL) $(REPL_OPTS) :load ERD2Curry :save "main \"$(CURDIR)\"" :q
18+- mv ERD2Curry $@
19++ mv ERD2Curry $@.orig && mv $@.orig $@
pkgs/development/compilers/pakcs/default.nix+5−2
@@ -82,7 +82,10 @@ stdenv.mkDerivation rec {
8282
8383 buildInputs = [ swiPrologLocked makeWrapper glibcLocales rlwrap tk which ];
8484
85− patches = [ ./adjust-buildsystem.patch ];
85+ patches = [
86+ ./adjust-buildsystem.patch
87+ ./case-insensitive.patch
88+ ];
8689
8790 configurePhase = ''
8891 # Phony HOME.
@@ -151,6 +154,6 @@ stdenv.mkDerivation rec {
151154 '';
152155
153156 maintainers = [ stdenv.lib.maintainers.gnidorah ];
154− platforms = stdenv.lib.platforms.linux;
157+ platforms = stdenv.lib.platforms.unix;
155158 };
156159}
pkgs/development/compilers/swi-prolog/default.nix+16−3
@@ -1,6 +1,6 @@
11{ stdenv, fetchurl, gmp, readline, openssl, libjpeg, unixODBC, zlib
22, libXinerama, libXft, libXpm, libSM, libXt, freetype, pkgconfig
3−, fontconfig
3+, fontconfig, makeWrapper ? stdenv.isDarwin
44}:
55
66let
@@ -15,7 +15,8 @@ stdenv.mkDerivation {
1515 };
1616
1717 buildInputs = [ gmp readline openssl libjpeg unixODBC libXinerama
18− libXft libXpm libSM libXt zlib freetype pkgconfig fontconfig ];
18+ libXft libXpm libSM libXt zlib freetype pkgconfig fontconfig ]
19+ ++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
1920
2021 hardeningDisable = [ "format" ];
2122
@@ -23,12 +24,24 @@ stdenv.mkDerivation {
2324
2425 buildFlags = "world";
2526
27+ # For macOS: still not fixed in upstream: "abort trap 6" when called
28+ # through symlink, so wrap binary.
29+ # We reinvent wrapProgram here but omit argv0 pass in order to not
30+ # break PAKCS package build. This is also safe for SWI-Prolog, since
31+ # there is no wrapping environment and hence no need to spoof $0
32+ postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
33+ local prog="$out/bin/swipl"
34+ local hidden="$(dirname "$prog")/.$(basename "$prog")"-wrapped
35+ mv $prog $hidden
36+ makeWrapper $hidden $prog
37+ '';
38+
2639 meta = {
2740 homepage = http://www.swi-prolog.org/;
2841 description = "A Prolog compiler and interpreter";
2942 license = "LGPL";
3043
31− platforms = stdenv.lib.platforms.linux;
44+ platforms = stdenv.lib.platforms.unix;
3245 maintainers = [ stdenv.lib.maintainers.peti ];
3346 };
3447}
pkgs/development/interpreters/mujs/default.nix+3−3
@@ -1,12 +1,12 @@
11{ stdenv, fetchgit, clang }:
22
33stdenv.mkDerivation rec {
4− name = "mujs-2016-02-22";
4+ name = "mujs-2016-09-21";
55
66 src = fetchgit {
77 url = git://git.ghostscript.com/mujs.git;
8− rev = "624f975aae6b451e35406d8cdde808626052ce2c";
9− sha256 = "0cab7x73v380wklpkbrc1k4iyh4q2jyx3zxbymlfi1spmrpn6skl";
8+ rev = "5c337af4b3df80cf967e4f9f6a21522de84b392a";
9+ sha256 = "1x5g6nycggc83md2dbr2nahjbkkmmn64bg25a8hih7z72sw41dgw";
1010 };
1111
1212 buildInputs = [ clang ];
pkgs/development/libraries/libsodium/default.nix+2−2
@@ -1,11 +1,11 @@
11{ stdenv, fetchurl }:
22
33stdenv.mkDerivation rec {
4− name = "libsodium-1.0.10";
4+ name = "libsodium-1.0.11";
55
66 src = fetchurl {
77 url = "https://download.libsodium.org/libsodium/releases/${name}.tar.gz";
8− sha256 = "1gn45g956lyz8l6iq187yc6l627vyivyp8qc5dkr6dnhdnlqddvi";
8+ sha256 = "0rf7z6bgpnf8lyz8sph4h43fbb28pmj4dgybf0hsxxj97kdljid1";
99 };
1010
1111 outputs = [ "out" "dev" ];
pkgs/development/libraries/libuecc/default.nixnew file+24
@@ -0,0 +1,24 @@
1+{ stdenv, fetchgit, cmake }:
2+
3+stdenv.mkDerivation rec {
4+ version = "7";
5+ name = "libuecc-${version}";
6+
7+ src = fetchgit {
8+ url = "git://git.universe-factory.net/libuecc";
9+ rev = "refs/tags/v${version}";
10+ sha256 = "1sm05aql75sh13ykgsv3ns4x4zzw9lvzid6misd22gfgf6r9n5fs";
11+ };
12+
13+ buildInputs = [ cmake ];
14+
15+ enableParallelBuilding = true;
16+
17+ meta = with stdenv.lib; {
18+ description = "Very small Elliptic Curve Cryptography library";
19+ homepage = https://git.universe-factory.net/libuecc;
20+ license = licenses.bsd2;
21+ platforms = platforms.unix;
22+ maintainers = with maintainers; [ fpletz ];
23+ };
24+}
pkgs/development/libraries/openssl/default.nix+1
@@ -19,6 +19,7 @@ let
1919
2020 patches =
2121 (args.patches or [])
22+ ++ [ ./nix-ssl-cert-file.patch ]
2223 ++ optional (versionOlder version "1.1.0") ./use-etc-ssl-certs.patch
2324 ++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch
2425 ++ optional
pkgs/development/libraries/openssl/nix-ssl-cert-file.patchnew file+15
@@ -0,0 +1,15 @@
1+diff -ru -x '*~' openssl-1.0.2j-orig/crypto/x509/by_file.c openssl-1.0.2j/crypto/x509/by_file.c
2+--- openssl-1.0.2j-orig/crypto/x509/by_file.c 2016-09-26 11:49:07.000000000 +0200
3++++ openssl-1.0.2j/crypto/x509/by_file.c 2016-10-13 16:54:31.400288302 +0200
4+@@ -97,7 +97,10 @@
5+ switch (cmd) {
6+ case X509_L_FILE_LOAD:
7+ if (argl == X509_FILETYPE_DEFAULT) {
8+- file = (char *)getenv(X509_get_default_cert_file_env());
9++ file = (char *)getenv("NIX_SSL_CERT_FILE");
10++ if (!file)
11++ file = (char *)getenv(X509_get_default_cert_file_env());
12++ fprintf(stderr, "OPEN %s", file);
13+ if (file)
14+ ok = (X509_load_cert_crl_file(ctx, file,
15+ X509_FILETYPE_PEM) != 0);
pkgs/development/libraries/unixODBC/default.nix+1−1
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
1515 description = "ODBC driver manager for Unix";
1616 homepage = http://www.unixodbc.org/;
1717 license = licenses.lgpl2;
18− platforms = platforms.linux;
18+ platforms = platforms.unix;
1919 };
2020}
pkgs/development/r-modules/README.md+24
@@ -29,6 +29,30 @@ profile. The set of available libraries can be discovered by running the
2929command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that
3030output is the name that has to be passed to rWrapper in the code snipped above.
3131
32+However, if you'd like to add a file to your project source to make the
33+environment available for other contributors, you can create a `default.nix`
34+file like so:
35+```nix
36+let
37+ pkgs = import <nixpkgs> {};
38+ stdenv = pkgs.stdenv;
39+in with pkgs; {
40+ myProject = stdenv.mkDerivation {
41+ name = "myProject";
42+ version = "1";
43+ src = if pkgs.lib.inNixShell then null else nix;
44+
45+ buildInputs = with rPackages; [
46+ R
47+ ggplot2
48+ knitr
49+ ];
50+ };
51+}
52+```
53+and then run `nix-shell .` to be dropped into a shell with those packages
54+available.
55+
3256## Updating the package set
3357
3458```bash
pkgs/development/ruby-modules/bundler-env/default.nix+59−13
@@ -6,7 +6,14 @@
66, tree
77}@defs:
88
9−{ name, gemset, gemfile, lockfile, ruby ? defs.ruby, gemConfig ? defaultGemConfig
9+{ name ? null
10+, pname ? null
11+, gemdir ? null
12+, gemfile ? null
13+, lockfile ? null
14+, gemset ? null
15+, ruby ? defs.ruby
16+, gemConfig ? defaultGemConfig
1017, postBuild ? null
1118, document ? []
1219, meta ? {}
@@ -16,54 +23,95 @@
1623}@args:
1724
1825let
19− importedGemset = import gemset;
26+ drvName =
27+ if name != null then name
28+ else if pname != null then "${toString pname}-${mainGem.version}"
29+ else throw "bundlerEnv: either pname or name must be set";
30+
31+ mainGem =
32+ if pname == null then null
33+ else gems."${pname}" or (throw "bundlerEnv: gem ${pname} not found");
34+
35+ gemfile' =
36+ if gemfile == null then gemdir + "/Gemfile"
37+ else gemfile;
38+
39+ lockfile' =
40+ if lockfile == null then gemdir + "/Gemfile.lock"
41+ else lockfile;
42+
43+ gemset' =
44+ if gemset == null then gemdir + "/gemset.nix"
45+ else gemset;
46+
47+ importedGemset = import gemset';
48+
2049 filteredGemset = (lib.filterAttrs (name: attrs:
2150 if (builtins.hasAttr "groups" attrs)
2251 then (builtins.any (gemGroup: builtins.any (group: group == gemGroup) groups) attrs.groups)
2352 else true
2453 ) importedGemset);
54+
2555 applyGemConfigs = attrs:
2656 (if gemConfig ? "${attrs.gemName}"
2757 then attrs // gemConfig."${attrs.gemName}" attrs
2858 else attrs);
59+
2960 configuredGemset = lib.flip lib.mapAttrs filteredGemset (name: attrs:
3061 applyGemConfigs (attrs // { inherit ruby; gemName = name; })
3162 );
63+
3264 hasBundler = builtins.hasAttr "bundler" filteredGemset;
33− bundler = if hasBundler then gems.bundler else defs.bundler.override (attrs: { inherit ruby; });
65+
66+ bundler =
67+ if hasBundler then gems.bundler
68+ else defs.bundler.override (attrs: { inherit ruby; });
69+
3470 gems = lib.flip lib.mapAttrs configuredGemset (name: attrs:
3571 buildRubyGem ((removeAttrs attrs ["source"]) // attrs.source // {
3672 inherit ruby;
3773 gemName = name;
3874 gemPath = map (gemName: gems."${gemName}") (attrs.dependencies or []);
3975 }));
76+
4077 # We have to normalize the Gemfile.lock, otherwise bundler tries to be
4178 # helpful by doing so at run time, causing executables to immediately bail
4279 # out. Yes, I'm serious.
4380 confFiles = runCommand "gemfile-and-lockfile" {} ''
4481 mkdir -p $out
45− cp ${gemfile} $out/Gemfile
46− cp ${lockfile} $out/Gemfile.lock
82+ cp ${gemfile'} $out/Gemfile
83+ cp ${lockfile'} $out/Gemfile.lock
4784 '';
85+
4886 envPaths = lib.attrValues gems ++ lib.optional (!hasBundler) bundler;
87+
88+ binPaths = if mainGem != null then [ mainGem ] else envPaths;
89+
4990 bundlerEnv = buildEnv {
50− inherit name ignoreCollisions;
91+ inherit ignoreCollisions;
92+
93+ name = drvName;
94+
5195 paths = envPaths;
5296 pathsToLink = [ "/lib" ];
97+
5398 postBuild = ''
5499 ${ruby}/bin/ruby ${./gen-bin-stubs.rb} \
55100 "${ruby}/bin/ruby" \
56101 "${confFiles}/Gemfile" \
57102 "$out/${ruby.gemPath}" \
58103 "${bundler}/${ruby.gemPath}" \
59− ${lib.escapeShellArg envPaths} \
104+ ${lib.escapeShellArg binPaths} \
60105 ${lib.escapeShellArg groups}
61106 '' + lib.optionalString (postBuild != null) postBuild;
107+
108+ meta = { platforms = ruby.meta.platforms; } // meta;
109+
62110 passthru = rec {
63− inherit ruby bundler meta gems;
111+ inherit ruby bundler gems;
64112
65113 wrappedRuby = stdenv.mkDerivation {
66− name = "wrapped-ruby-${name}";
114+ name = "wrapped-ruby-${drvName}";
67115 nativeBuildInputs = [ makeWrapper ];
68116 buildCommand = ''
69117 mkdir -p $out/bin
@@ -87,7 +135,7 @@ let
87135 require 'bundler/setup'
88136 '';
89137 in stdenv.mkDerivation {
90− name = "interactive-${name}-environment";
138+ name = "interactive-${drvName}-environment";
91139 nativeBuildInputs = [ wrappedRuby bundlerEnv ];
92140 shellHook = ''
93141 export OLD_IRBRC="$IRBRC"
@@ -102,7 +150,5 @@ let
102150 };
103151 };
104152 };
105−
106153in
107−
108−bundlerEnv
154+ bundlerEnv
pkgs/development/tools/misc/gdb/default.nix+3
@@ -43,6 +43,9 @@ stdenv.mkDerivation rec {
4343
4444 enableParallelBuilding = true;
4545
46+ # darwin build fails with format hardening since v7.12
47+ hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
48+
4649 configureFlags = with stdenv.lib;
4750 [ "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
4851 "--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
pkgs/development/tools/misc/intltool/default.nix+1−1
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
1313 patches = [(fetchpatch {
1414 name = "perl-5.22.patch";
1515 url = "https://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/intltool"
16− + "/debian/patches/perl5.22-regex-fixes?revision=47255&view=co";
16+ + "/debian/patches/perl5.22-regex-fixes?revision=47258&view=co";
1717 sha256 = "17clqczb9fky7hp8czxa0fy82b5478irvz4f3fnans3sqxl95hx3";
1818 })];
1919
pkgs/development/tools/misc/travis/default.nix+5−20
@@ -1,29 +1,14 @@
1−{ stdenv, lib, bundlerEnv, ruby }:
1+{ lib, bundlerEnv, ruby }:
22
3−stdenv.mkDerivation rec {
4− name = "travis-${version}";
5− version = env.gems.travis.version;
6−
7− env = bundlerEnv {
8− inherit ruby;
9− name = "${name}-gems";
10− gemset = ./gemset.nix;
11− gemfile = ./Gemfile;
12− lockfile = ./Gemfile.lock;
13− };
14−
15− phases = ["installPhase"];
16−
17− installPhase = ''
18− mkdir -p $out/bin
19− ln -s ${env}/bin/travis $out/bin/travis
20− '';
3+bundlerEnv {
4+ inherit ruby;
5+ pName = "travis";
6+ gemdir = ./.;
217
228 meta = with lib; {
239 description = "CLI and Ruby client library for Travis CI";
2410 homepage = https://github.com/travis-ci/travis.rb;
2511 license = licenses.mit;
2612 maintainers = with maintainers; [ zimbatm ];
27− platforms = ruby.meta.platforms;
2813 };
2914}
pkgs/development/web/nodejs/nodejs.nix+3−2
@@ -6,7 +6,8 @@
66, preBuild ? ""
77, extraConfigFlags ? []
88, extraBuildInputs ? []
9−, ...
9+, patches ? [],
10+ ...
1011}:
1112
1213assert stdenv.system != "armv5tel-linux";
@@ -44,7 +45,7 @@ in stdenv.mkDerivation {
4445 PATH=$out/bin:$PATH patchShebangs $out
4546 '';
4647
47− patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
48+ patches = patches ++ stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
4849
4950 buildInputs = extraBuildInputs
5051 ++ [ python which zlib libuv openssl ]
pkgs/development/web/nodejs/v4.nix+2−2
@@ -4,9 +4,9 @@
44}@args:
55
66import ./nodejs.nix (args // rec {
7− version = "4.4.6";
7+ version = "4.6.0";
88 src = fetchurl {
99 url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.xz";
10− sha256 = "0f6bbfbea525469c91932b1aac35e0810e6bcda96f1c720e42a433942ee66106";
10+ sha256 = "1566q1kkv8j30fgqx8sm2h8323f38wwpa1hfb10gr6z46jyhv4a2";
1111 };
1212})
pkgs/development/web/nodejs/v6.nix+9−3
@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
2−, pkgconfig, runCommand, which, libtool
2+, pkgconfig, runCommand, which, libtool, fetchpatch
33, callPackage
44, darwin ? null
55}@args:
@@ -8,12 +8,18 @@ let
88 inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
99
1010in import ./nodejs.nix (args // rec {
11− version = "6.7.0";
12− sha256 = "1r9vvnczjczqs29ja8gmbqgsfgkg0dph4qkaxb3yh7mb98r2ic6f";
11+ version = "6.8.0";
12+ sha256 = "13arzwki13688hr1lh871y06lrk019g4hkasmg11arm8j1dcwcpq";
1313 extraBuildInputs = stdenv.lib.optionals stdenv.isDarwin
1414 [ CoreServices ApplicationServices ];
1515 preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
1616 sed -i -e "s|tr1/type_traits|type_traits|g" \
1717 -e "s|std::tr1|std|" src/util.h
1818 '';
19+ patches = [
20+ (fetchpatch {
21+ url = "https://github.com/nodejs/node/commit/fc164acbbb700fd50ab9c04b47fc1b2687e9c0f4.patch";
22+ sha256 = "1rms3n09622xmddn013yvf5c6p3s8w8s0d2h813zs8c1l15k4k1i";
23+ })
24+ ];
1925})
pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_c_symbols−3
@@ -234,8 +234,6 @@ __os_assert_log_ctx
234234__os_assumes_log
235235__os_assumes_log_ctx
236236__os_avoid_tail_call
237−__os_crash
238−__os_crash_callback
239237__os_debug_log
240238__os_debug_log_error_str
241239__putenvp
@@ -267,7 +265,6 @@ __unsetenvp
267265__utmpxname
268266_a64l
269267_abort
270−_abort_report_np
271268_abs
272269_acl_add_flag_np
273270_acl_add_perm
pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols−31
@@ -57,7 +57,6 @@ ___ioctl
5757___iopolicysys
5858___kdebug_trace
5959___kdebug_trace64
60−___kdebug_trace_string
6160___kernelVersionNumber
6261___kernelVersionString
6362___kill
@@ -82,7 +81,6 @@ ___mac_set_file
8281___mac_set_link
8382___mac_set_proc
8483___mac_syscall
85−___microstackshot
8684___mkdir_extended
8785___mkfifo_extended
8886___mmap
@@ -107,8 +105,6 @@ ___posix_spawn
107105___pread_nocancel
108106___proc_info
109107___process_policy
110−___pselect
111−___pselect_nocancel
112108___psynch_cvbroad
113109___psynch_cvclrprepost
114110___psynch_cvsignal
@@ -181,7 +177,6 @@ ___sigsuspend
181177___sigsuspend_nocancel
182178___sigwait
183179___socketpair
184−___stack_snapshot_with_config
185180___stat64_extended
186181___stat_extended
187182___syscall
@@ -198,7 +193,6 @@ ___vfork
198193___wait4
199194___wait4_nocancel
200195___waitid_nocancel
201−___work_interval_ctl
202196___workq_kernreturn
203197___workq_open
204198___write_nocancel
@@ -418,7 +412,6 @@ _getsockopt
418412_getuid
419413_getwgroups_np
420414_getxattr
421−_grab_pgo_data
422415_guarded_close_np
423416_guarded_kqueue_np
424417_guarded_open_dprotected_np
@@ -429,7 +422,6 @@ _guarded_writev_np
429422_host_create_mach_voucher
430423_host_default_memory_manager
431424_host_get_UNDServer
432−_host_get_atm_diagnostic_flag
433425_host_get_boot_info
434426_host_get_clock_control
435427_host_get_clock_service
@@ -454,7 +446,6 @@ _host_security_set_task_token
454446_host_self
455447_host_self_trap
456448_host_set_UNDServer
457−_host_set_atm_diagnostic_flag
458449_host_set_exception_ports
459450_host_set_special_port
460451_host_statistics
@@ -470,10 +461,8 @@ _ioctl
470461_issetugid
471462_kas_info
472463_kdebug_trace
473−_kdebug_trace_string
474464_kevent
475465_kevent64
476−_kevent_qos
477466_kext_request
478467_kill
479468_kmod_control
@@ -510,7 +499,6 @@ _mach_host_self
510499_mach_init
511500_mach_make_memory_entry
512501_mach_make_memory_entry_64
513−_mach_memory_info
514502_mach_memory_object_memory_entry
515503_mach_memory_object_memory_entry_64
516504_mach_msg
@@ -647,7 +635,6 @@ _munlock
647635_munlockall
648636_munmap
649637_necp_match_policy
650−_netagent_trigger
651638_netname_check_in
652639_netname_check_out
653640_netname_look_up
@@ -686,7 +673,6 @@ _posix_spawn_file_actions_addopen
686673_posix_spawn_file_actions_destroy
687674_posix_spawn_file_actions_init
688675_posix_spawnattr_destroy
689−_posix_spawnattr_get_darwin_role_np
690676_posix_spawnattr_get_qos_clamp_np
691677_posix_spawnattr_getbinpref_np
692678_posix_spawnattr_getcpumonitor
@@ -698,7 +684,6 @@ _posix_spawnattr_getprocesstype_np
698684_posix_spawnattr_getsigdefault
699685_posix_spawnattr_getsigmask
700686_posix_spawnattr_init
701−_posix_spawnattr_set_darwin_role_np
702687_posix_spawnattr_set_importancewatch_port_np
703688_posix_spawnattr_set_qos_clamp_np
704689_posix_spawnattr_setauditsessionport_np
@@ -734,10 +719,8 @@ _proc_importance_assertion_begin_with_msg
734719_proc_importance_assertion_complete
735720_proc_kmsgbuf
736721_proc_libversion
737−_proc_list_uptrs
738722_proc_listallpids
739723_proc_listchildpids
740−_proc_listcoalitions
741724_proc_listpgrppids
742725_proc_listpids
743726_proc_listpidspath
@@ -898,15 +881,6 @@ _sigsuspend$NOCANCEL
898881_socket
899882_socket_delegate
900883_socketpair
901−_stackshot_capture_with_config
902−_stackshot_config_create
903−_stackshot_config_dealloc
904−_stackshot_config_dealloc_buffer
905−_stackshot_config_get_stackshot_buffer
906−_stackshot_config_get_stackshot_size
907−_stackshot_config_set_flags
908−_stackshot_config_set_pid
909−_stackshot_config_set_size_hint
910884_stat
911885_stat$INODE64
912886_stat64
@@ -973,7 +947,6 @@ _thread_depress_abort
973947_thread_get_assignment
974948_thread_get_exception_ports
975949_thread_get_mach_voucher
976−_thread_get_register_pointer_values
977950_thread_get_special_port
978951_thread_get_state
979952_thread_info
@@ -1040,10 +1013,6 @@ _waitevent
10401013_waitid
10411014_waitid$NOCANCEL
10421015_watchevent
1043−_work_interval_create
1044−_work_interval_destroy
1045−_work_interval_notify
1046−_work_interval_notify_simple
10471016_write
10481017_write$NOCANCEL
10491018_writev
pkgs/os-specific/linux/powertop/default.nix+7−5
@@ -8,17 +8,19 @@ stdenv.mkDerivation rec {
88 sha256 = "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8";
99 };
1010
11− buildInputs = [ gettext libnl ncurses pciutils pkgconfig zlib ];
11+ nativeBuildInputs = [ pkgconfig ];
12+ buildInputs = [ gettext libnl ncurses pciutils zlib ];
1213
1314 postPatch = ''
1415 substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
1516 substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "xset"
1617 '';
1718
18− meta = {
19+ meta = with stdenv.lib; {
1920 description = "Analyze power consumption on Intel-based laptops";
20− license = stdenv.lib.licenses.gpl2;
21− maintainers = [ stdenv.lib.maintainers.chaoflow ];
22− platforms = stdenv.lib.platforms.linux;
21+ homepage = https://01.org/powertop;
22+ license = licenses.gpl2;
23+ maintainers = with maintainers; [ chaoflow fpletz ];
24+ platforms = platforms.linux;
2325 };
2426}
pkgs/servers/monitoring/riemann-dash/default.nix+5−17
@@ -1,21 +1,9 @@
1−{ bundlerEnv, lib, stdenv }:
1+{ bundlerEnv, lib, ruby }:
22
3−let
4− name = "riemann-dash-${env.gems.riemann-dash.version}";
5−
6− env = bundlerEnv {
7− inherit name;
8− gemfile = ./Gemfile;
9− lockfile = ./Gemfile.lock;
10− gemset = ./gemset.nix;
11− };
12−
13−in stdenv.mkDerivation {
14− inherit name;
15− buildCommand = ''
16− mkdir -p $out/bin
17− ln -s ${env}/bin/riemann-dash $out/bin/riemann-dash
18− '';
3+bundlerEnv {
4+ inherit ruby;
5+ pName = "riemann-dash";
6+ gemdir = ./.;
197
208 meta = with lib; {
219 description = "A javascript, websockets-powered dashboard for Riemann";
pkgs/stdenv/darwin/make-bootstrap-tools.nix+18−29
@@ -1,8 +1,10 @@
1−{ system ? builtins.currentSystem }:
1+{ pkgspath ? ../../.., test-pkgspath ? pkgspath, system ? builtins.currentSystem }:
22
3−with import ../../.. { inherit system; };
3+with import pkgspath { inherit system; };
44
5−rec {
5+let
6+ llvmPackages = llvmPackages_37;
7+in rec {
68 coreutils_ = coreutils.override (args: {
79 # We want coreutils without ACL support.
810 aclSupport = false;
@@ -19,17 +21,15 @@ rec {
1921 buildInputs = [nukeReferences cpio];
2022
2123 buildCommand = ''
22− mkdir -p $out/bin $out/lib
24+ mkdir -p $out/bin $out/lib $out/lib/system
2325
24− # Our (fake) loader
25− cp -d ${darwin.dyld}/lib/dyld $out/lib/
26−
27− # C standard library stuff
28− cp -d ${darwin.Libsystem}/lib/*.o $out/lib/
29− cp -d ${darwin.Libsystem}/lib/*.dylib $out/lib/
26+ # We're not going to bundle the actual libSystem.dylib; instead we reconstruct it on
27+ # the other side. See the notes in stdenv/darwin/default.nix for more information.
28+ # We also need the .o files for various low-level boot stuff.
29+ cp -d ${darwin.Libsystem}/lib/*.o $out/lib
30+ cp -d ${darwin.Libsystem}/lib/system/*.dylib $out/lib/system
3031
3132 # Resolv is actually a link to another package, so let's copy it properly
32− rm $out/lib/libresolv.9.dylib
3333 cp -L ${darwin.Libsystem}/lib/libresolv.9.dylib $out/lib
3434
3535 cp -rL ${darwin.Libsystem}/include $out
@@ -78,11 +78,11 @@ rec {
7878
7979 cp -rL ${llvmPackages.clang-unwrapped}/lib/clang $out/lib
8080
81− cp -d ${libcxx}/lib/libc++*.dylib $out/lib
82− cp -d ${libcxxabi}/lib/libc++abi*.dylib $out/lib
81+ cp -d ${llvmPackages.libcxx}/lib/libc++*.dylib $out/lib
82+ cp -d ${llvmPackages.libcxxabi}/lib/libc++abi*.dylib $out/lib
8383
8484 mkdir $out/include
85− cp -rd ${libcxx}/include/c++ $out/include
85+ cp -rd ${llvmPackages.libcxx}/include/c++ $out/include
8686
8787 cp -d ${icu.out}/lib/libicu*.dylib $out/lib
8888 cp -d ${zlib.out}/lib/libz.* $out/lib
@@ -107,33 +107,26 @@ rec {
107107 done
108108 }
109109
110− fix_dyld() {
111− # This is clearly a hack. Once we have an install_name_tool-alike that can patch dyld, this will be nicer.
112− ${perl}/bin/perl -i -0777 -pe 's/\/nix\/store\/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-dyld-239\.4\/lib\/dyld/\/usr\/lib\/dyld\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/sg' "$1"
113− }
114−
115110 # Strip executables even further
116111 for i in $out/bin/*; do
117112 if test -x $i -a ! -L $i; then
118113 chmod +w $i
119−
120− fix_dyld $i
121114 strip $i || true
122115 fi
123116 done
124117
125118 for i in $out/bin/* $out/lib/*.dylib $out/lib/clang/*/lib/darwin/*.dylib $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation; do
126− if test -x $i -a ! -L $i; then
119+ if test -x "$i" -a ! -L "$i"; then
127120 echo "Adding rpath to $i"
128121 rpathify $i
129122 fi
130123 done
131124
132125 nuke-refs $out/lib/*
126+ nuke-refs $out/lib/system/*
133127 nuke-refs $out/lib/clang/*/lib/darwin/*
134128 nuke-refs $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
135129
136− set -x
137130 mkdir $out/.pack
138131 mv $out/* $out/.pack
139132 mv $out/.pack $out/pack
@@ -148,10 +141,6 @@ rec {
148141 strip $out/on-server/*
149142 nuke-refs $out/on-server/*
150143
151− for i in $out/on-server/*; do
152− fix_dyld $i
153− done
154−
155144 (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
156145 '';
157146
@@ -294,8 +283,8 @@ rec {
294283
295284 # The ultimate test: bootstrap a whole stdenv from the tools specified above and get a package set out of it
296285 test-pkgs = let
297− stdenv = import ./. { inherit system bootstrapFiles; };
298− in import ../../.. {
286+ stdenv = import (test-pkgspath + "/pkgs/stdenv/darwin") { inherit system bootstrapFiles; };
287+ in import test-pkgspath {
299288 inherit system;
300289 bootStdenv = stdenv.stdenvDarwin;
301290 };
pkgs/tools/bluetooth/blueman/default.nix+3−2
@@ -1,6 +1,6 @@
11{ stdenv, lib, fetchurl, intltool, pkgconfig, pythonPackages, bluez, polkit, gtk3
22, obex_data_server, xdg_utils, libnotify, dconf, gsettings_desktop_schemas, dnsmasq, dhcp
3−, withPulseAudio ? true, libpulseaudio }:
3+, hicolor_icon_theme , withPulseAudio ? true, libpulseaudio }:
44
55let
66 binPath = lib.makeBinPath [ xdg_utils dnsmasq dhcp ];
@@ -16,7 +16,8 @@ in stdenv.mkDerivation rec {
1616
1717 nativeBuildInputs = [ intltool pkgconfig pythonPackages.wrapPython pythonPackages.cython ];
1818
19− buildInputs = [ bluez gtk3 pythonPackages.python libnotify dconf gsettings_desktop_schemas ]
19+ buildInputs = [ bluez gtk3 pythonPackages.python libnotify dconf
20+ gsettings_desktop_schemas hicolor_icon_theme ]
2021 ++ pythonPath
2122 ++ lib.optional withPulseAudio libpulseaudio;
2223
pkgs/tools/misc/fluentd/default.nix+3−5
@@ -1,12 +1,10 @@
11{ stdenv, lib, bundlerEnv, ruby, curl }:
22
33bundlerEnv {
4− name = "fluentd-0.14.0";
5−
64 inherit ruby;
7− gemfile = ./Gemfile;
8− lockfile = ./Gemfile.lock;
9− gemset = ./gemset.nix;
5+
6+ pname = "fluentd";
7+ gemdir = ./.;
108
119 meta = with lib; {
1210 description = "A data collector";
pkgs/tools/misc/lolcat/default.nix+3−5
@@ -2,12 +2,10 @@
22, pkgconfig, which }:
33
44bundlerEnv {
5− name = "lolcat-42.1.0";
6−
75 inherit ruby;
8− gemfile = ./Gemfile;
9− lockfile = ./Gemfile.lock;
10− gemset = ./gemset.nix;
6+
7+ pname = "lolcat";
8+ gemdir = ./.;
119
1210 meta = with lib; {
1311 description = "A rainbow version of cat";
pkgs/tools/networking/curl/default.nix+2
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
2525 sha256 = "1v6q83qsrf7dgp3y5fa5vkppgqyy82pnsk8z9b4047b6fvclfwvv";
2626 };
2727
28+ patches = [ ./nix-ssl-cert-file.patch ];
29+
2830 outputs = [ "bin" "dev" "out" "man" "devdoc" ];
2931
3032 nativeBuildInputs = [ pkgconfig perl ];
pkgs/tools/networking/curl/nix-ssl-cert-file.patchnew file+14
@@ -0,0 +1,14 @@
1+diff -ru -x '*~' curl-7.50.3-orig/src/tool_operate.c curl-7.50.3/src/tool_operate.c
2+--- curl-7.50.3-orig/src/tool_operate.c 2016-09-06 23:25:06.000000000 +0200
3++++ curl-7.50.3/src/tool_operate.c 2016-10-14 11:51:48.999943142 +0200
4+@@ -269,7 +269,9 @@
5+ capath_from_env = true;
6+ }
7+ else {
8+- env = curlx_getenv("SSL_CERT_FILE");
9++ env = curlx_getenv("NIX_SSL_CERT_FILE");
10++ if(!env)
11++ env = curlx_getenv("SSL_CERT_FILE");
12+ if(env) {
13+ config->cacert = strdup(env);
14+ if(!config->cacert) {
pkgs/tools/networking/fastd/default.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv, fetchgit, cmake, bison, pkgconfig
2+, libuecc, libsodium, libcap, json_c }:
3+
4+stdenv.mkDerivation rec {
5+ version = "18";
6+ name = "fastd-${version}";
7+
8+ src = fetchgit {
9+ url = "git://git.universe-factory.net/fastd";
10+ rev = "refs/tags/v${version}";
11+ sha256 = "0c9v3igv3812b3jr7jk75a2np658yy00b3i4kpbpdjgvqzc1jrq8";
12+ };
13+
14+ nativeBuildInputs = [ pkgconfig bison cmake ];
15+ buildInputs = [ libuecc libsodium libcap json_c ];
16+
17+ enableParallelBuilding = true;
18+
19+ meta = with stdenv.lib; {
20+ description = "Fast and Secure Tunneling Daemon";
21+ homepage = https://projects.universe-factory.net/projects/fastd/wiki;
22+ license = with licenses; [ bsd2 bsd3 ];
23+ platforms = platforms.linux;
24+ maintainers = with maintainers; [ fpletz ];
25+ };
26+}
pkgs/tools/networking/sshpass/default.nix+4−4
@@ -2,13 +2,13 @@
22
33stdenv.mkDerivation rec {
44 name = "sshpass-${version}";
5− version = "1.05";
6−
5+ version = "1.06";
6+
77 src = fetchurl {
88 url = "mirror://sourceforge/sshpass/sshpass-${version}.tar.gz";
9− sha256 = "0gj8r05h1hy01vh4csygyw21z2hcxb72qcxkxxi3y34alr98gxy3";
9+ sha256 = "0q7fblaczb7kwbsz0gdy9267z0sllzgmf0c7z5c9mf88wv74ycn6";
1010 };
11−
11+
1212 meta = {
1313 homepage = http://sourceforge.net/projects/sshpass/;
1414 description = "Non-interactive ssh password auth";
pkgs/tools/package-management/fpm/default.nix+2−6
@@ -1,13 +1,9 @@
11{ lib, bundlerEnv, ruby }:
22
33bundlerEnv rec {
4− name = "fpm-${version}";
5−
6− version = (import gemset).fpm.version;
74 inherit ruby;
8− gemfile = ./Gemfile;
9− lockfile = ./Gemfile.lock;
10− gemset = ./gemset.nix;
5+ pname = "fpm";
6+ gemdir = ./.;
117
128 meta = with lib; {
139 description = "Tool to build packages for multiple platforms with ease";
pkgs/tools/system/foreman/default.nix+5−20
@@ -1,24 +1,9 @@
1−{ stdenv, lib, ruby, bundlerEnv, makeWrapper }:
1+{ bundlerEnv, lib, ruby }:
22
3−stdenv.mkDerivation rec {
4− name = "foreman-${env.gems.foreman.version}";
5−
6− env = bundlerEnv {
7− inherit ruby;
8− name = "${name}-gems";
9− gemfile = ./Gemfile;
10− lockfile = ./Gemfile.lock;
11− gemset = ./gemset.nix;
12− };
13−
14− phases = ["installPhase"];
15−
16− nativeBuildInputs = [ makeWrapper ];
17−
18− installPhase = ''
19− mkdir -p $out/bin
20− makeWrapper ${env}/bin/foreman $out/bin/foreman
21− '';
3+bundlerEnv {
4+ inherit ruby;
5+ pName = "foreman";
6+ gemdir = ./.;
227
238 meta = with lib; {
249 description = "Process manager for applications with multiple components";
pkgs/tools/system/hiera-eyaml/default.nix+5−18
@@ -1,22 +1,9 @@
1−{ lib, bundlerEnv, stdenv }:
1+{ lib, bundlerEnv, ruby }:
22
3−let
4− name = "hiera-eyaml-${env.gems.hiera-eyaml.version}";
5−
6− env = bundlerEnv {
7− inherit name;
8− gemfile = ./Gemfile;
9− lockfile = ./Gemfile.lock;
10− gemset = ./gemset.nix;
11− };
12−
13−in stdenv.mkDerivation {
14− inherit name;
15−
16− buildCommand = ''
17− mkdir -p $out/bin
18− ln -s ${env}/bin/eyaml $out/bin/eyaml
19− '';
3+bundlerEnv {
4+ inherit ruby;
5+ pName = "hiera-eyaml";
6+ gemdir = ./.;
207
218 meta = with lib; {
229 description = "Per-value asymmetric encryption of sensitive data for Hiera";
pkgs/tools/text/shfmt/default.nix+3−3
@@ -2,8 +2,8 @@
22
33buildGoPackage rec {
44 name = "shfmt-${version}";
5− version = "2016-06-16";
6− rev = "8add0072d6abdc892e4617c95e8bba21ebe0beeb";
5+ version = "0.2.0";
6+ rev = "v${version}";
77
88 goPackagePath = "github.com/mvdan/sh";
99
@@ -11,7 +11,7 @@ buildGoPackage rec {
1111 owner = "mvdan";
1212 repo = "sh";
1313 inherit rev;
14− sha256 = "1m2lkcw6m5gdqjp17m01d822cj1p04qk6hm9m94ni2x19f16qs8m";
14+ sha256 = "07jf9v6583vvmk07fp7xdlnh7rvgl6f06ib2588g3xf1wk9vrq3d";
1515 };
1616
1717 meta = with stdenv.lib; {
pkgs/tools/typesetting/asciidoctor/default.nix+2−12
@@ -1,19 +1,9 @@
11{ stdenv, lib, bundlerEnv, ruby_2_2, curl }:
22
33bundlerEnv rec {
4− name = "asciidoctor-${version}";
5− version = "1.5.4";
6−
4+ pname = "asciidoctor";
75 ruby = ruby_2_2;
8− gemfile = ./Gemfile;
9− lockfile = ./Gemfile.lock;
10− gemset = ./gemset.nix;
11−
12− # Delete dependencies' executables
13− postBuild = ''
14− find $out/bin -type f -not -wholename '*bin/asciidoctor*' -print0 \
15− | xargs -0 rm
16− '';
6+ gemdir = ./.;
177
188 meta = with lib; {
199 description = "A faster Asciidoc processor written in Ruby";
pkgs/top-level/all-packages.nix+12−11
@@ -1567,6 +1567,8 @@ in
15671567 pillow;
15681568 };
15691569
1570+ fastd = callPackage ../tools/networking/fastd { };
1571+
15701572 fatsort = callPackage ../tools/filesystems/fatsort { };
15711573
15721574 fcitx = callPackage ../tools/inputmethods/fcitx {
@@ -2306,7 +2308,7 @@ in
23062308 less = callPackage ../tools/misc/less { };
23072309
23082310 lf = callPackage ../tools/misc/lf {};
2309−
2311+
23102312 lhasa = callPackage ../tools/compression/lhasa {};
23112313
23122314 libcpuid = callPackage ../tools/misc/libcpuid { };
@@ -2418,10 +2420,6 @@ in
24182420 libtool = darwin.cctools;
24192421 };
24202422
2421− nodejs-5_x = callPackage ../development/web/nodejs/v5.nix {
2422− libtool = darwin.cctools;
2423− };
2424−
24252423 nodejs-6_x = callPackage ../development/web/nodejs/v6.nix {
24262424 libtool = darwin.cctools;
24272425 };
@@ -2435,10 +2433,6 @@ in
24352433 nodejs = pkgs.nodejs-6_x;
24362434 };
24372435
2438− nodePackages_5_x = callPackage ../development/node-packages/default-v5.nix {
2439− nodejs = pkgs.nodejs-5_x;
2440− };
2441−
24422436 nodePackages_4_x = callPackage ../development/node-packages/default-v4.nix {
24432437 nodejs = pkgs.nodejs-4_x;
24442438 };
@@ -5280,7 +5274,10 @@ in
52805274 erlangR16 = callPackage ../development/interpreters/erlang/R16.nix {
52815275 inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
52825276 };
5283− erlangR16_odbc = callPackage ../development/interpreters/erlang/R16.nix { odbcSupport = true; };
5277+ erlangR16_odbc = callPackage ../development/interpreters/erlang/R16.nix {
5278+ inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
5279+ odbcSupport = true;
5280+ };
52845281 erlangR17 = callPackage ../development/interpreters/erlang/R17.nix {
52855282 inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
52865283 };
@@ -8165,6 +8162,8 @@ in
81658162
81668163 libu2f-server = callPackage ../development/libraries/libu2f-server { };
81678164
8165+ libuecc = callPackage ../development/libraries/libuecc { };
8166+
81688167 libui = callPackage ../development/libraries/libui { };
81698168
81708169 libunity = callPackage ../development/libraries/libunity { };
@@ -15043,7 +15042,9 @@ in
1504315042 gtk = gtk2;
1504415043 };
1504515044
15046− kodiPlain = callPackage ../applications/video/kodi { };
15045+ kodiPlain = callPackage ../applications/video/kodi {
15046+ libva = libva-full;
15047+ };
1504715048 xbmcPlain = kodiPlain;
1504815049
1504915050 kodiPlugins = recurseIntoAttrs (callPackage ../applications/video/kodi/plugins.nix {
pkgs/top-level/php-packages.nix+4−13
@@ -23,20 +23,11 @@ let
2323 sha256 = "0r5pfbjbmdj46h20jm3iqmy969qd27ajyf0phjhgykv6j0cqjlgd";
2424 };
2525
26− imagick = if isPhp7 then imagick34 else imagick31;
27−
28− imagick31 = assert !isPhp7; buildPecl {
29− name = "imagick-3.1.2";
30− sha256 = "14vclf2pqcgf3w8nzqbdw0b9v30q898344c84jdbw2sa62n6k1sj";
31− configureFlags = "--with-imagick=${pkgs.imagemagick.dev}";
32− buildInputs = [ pkgs.pkgconfig ];
33− };
34−
35− imagick34 = buildPecl {
36− name = "imagick-3.4.0RC4";
37− sha256 = "0fdkzdv3r8sm6y1x11kp3rxsimq6zf15xvi0mhn57svmnan4zh0i";
26+ imagick = buildPecl {
27+ name = "imagick-3.4.3RC1";
28+ sha256 = "0siyxpszjz6s095s2g2854bhprjq49rf22v6syjiwvndg1pc9fsh";
3829 configureFlags = "--with-imagick=${pkgs.imagemagick.dev}";
39− buildInputs = [ pkgs.pkgconfig ];
30+ nativeBuildInputs = [ pkgs.pkgconfig ];
4031 };
4132
4233 # No support for PHP 7 yet
pkgs/top-level/release.nix+37−42
@@ -21,57 +21,52 @@ with import ./release-lib.nix { inherit supportedSystems scrubJobs; };
2121
2222let
2323
24− unstable = pkgs.releaseTools.aggregate
25− { name = "nixpkgs-${jobs.tarball.version}";
26− meta.description = "Release-critical builds for the Nixpkgs unstable channel";
27− constituents =
28− [ jobs.tarball
29− jobs.metrics
30− jobs.manual
31− jobs.lib-tests
32− jobs.stdenv.x86_64-linux
33− jobs.stdenv.i686-linux
34− jobs.stdenv.x86_64-darwin
35− jobs.linux.x86_64-linux
36− jobs.linux.i686-linux
37− jobs.python.x86_64-linux
38− jobs.python.i686-linux
39− jobs.python.x86_64-darwin
40− jobs.python3.x86_64-linux
41− jobs.python3.i686-linux
42− jobs.python3.x86_64-darwin
43− # Many developers use nix-repl
44− jobs.nix-repl.x86_64-linux
45− jobs.nix-repl.i686-linux
46− jobs.nix-repl.x86_64-darwin
47− # Needed by travis-ci to test PRs
48− jobs.nox.i686-linux
49− jobs.nox.x86_64-linux
50− jobs.nox.x86_64-darwin
51− # Ensure that X11/GTK+ are in order.
52− jobs.thunderbird.x86_64-linux
53− jobs.thunderbird.i686-linux
54− # Ensure that basic stuff works on darwin
55− jobs.git.x86_64-darwin
56− jobs.mysql.x86_64-darwin
57− jobs.vim.x86_64-darwin
58− ] ++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools;
59− };
60−
6124 lib = pkgs.lib;
6225
6326 jobs =
64− rec { tarball = import ./make-tarball.nix { inherit pkgs nixpkgs officialRelease; };
27+ { tarball = import ./make-tarball.nix { inherit pkgs nixpkgs officialRelease; };
6528
6629 metrics = import ./metrics.nix { inherit pkgs nixpkgs; };
6730
6831 manual = import ../../doc;
6932 lib-tests = import ../../lib/tests/release.nix { inherit nixpkgs; };
7033
71− # for consistency with NixOS tested job
72− tested = unstable;
73− inherit unstable;
74−
34+ unstable = pkgs.releaseTools.aggregate
35+ { name = "nixpkgs-${jobs.tarball.version}";
36+ meta.description = "Release-critical builds for the Nixpkgs unstable channel";
37+ constituents =
38+ [ jobs.tarball
39+ jobs.metrics
40+ jobs.manual
41+ jobs.lib-tests
42+ jobs.stdenv.x86_64-linux
43+ jobs.stdenv.i686-linux
44+ jobs.stdenv.x86_64-darwin
45+ jobs.linux.x86_64-linux
46+ jobs.linux.i686-linux
47+ jobs.python.x86_64-linux
48+ jobs.python.i686-linux
49+ jobs.python.x86_64-darwin
50+ jobs.python3.x86_64-linux
51+ jobs.python3.i686-linux
52+ jobs.python3.x86_64-darwin
53+ # Many developers use nix-repl
54+ jobs.nix-repl.x86_64-linux
55+ jobs.nix-repl.i686-linux
56+ jobs.nix-repl.x86_64-darwin
57+ # Needed by travis-ci to test PRs
58+ jobs.nox.i686-linux
59+ jobs.nox.x86_64-linux
60+ jobs.nox.x86_64-darwin
61+ # Ensure that X11/GTK+ are in order.
62+ jobs.thunderbird.x86_64-linux
63+ jobs.thunderbird.i686-linux
64+ # Ensure that basic stuff works on darwin
65+ jobs.git.x86_64-darwin
66+ jobs.mysql.x86_64-darwin
67+ jobs.vim.x86_64-darwin
68+ ] ++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools;
69+ };
7570
7671 stdenvBootstrapTools.i686-linux =
7772 { inherit (import ../stdenv/linux/make-bootstrap-tools.nix { system = "i686-linux"; }) dist test; };