···1+<chapter xmlns="http://docbook.org/ns/docbook"
2+ xmlns:xlink="http://www.w3.org/1999/xlink"
3+ xml:id="chap-platform-nodes">
4+5+<title>Platform Notes</title>
6+7+<section xml:id="sec-darwin">
8+9+<title>Darwin (macOS)</title>
10+<para>Some common issues when packaging software for darwin:</para>
11+12+<itemizedlist>
13+14+ <listitem>
15+ <para>
16+ The darwin <literal>stdenv</literal> uses clang instead of gcc.
17+ When referring to the compiler <varname>$CC</varname> or <command>cc</command>
18+ will work in both cases. Some builds hardcode gcc/g++ in their
19+ build scripts, that can usually be fixed with using something
20+ like <literal>makeFlags = [ "CC=cc" ];</literal> or by patching
21+ the build scripts.
22+ </para>
23+24+ <programlisting>
25+ stdenv.mkDerivation {
26+ name = "libfoo-1.2.3";
27+ # ...
28+ buildPhase = ''
29+ $CC -o hello hello.c
30+ '';
31+ }
32+ </programlisting>
33+ </listitem>
34+35+ <listitem>
36+ <para>
37+ On darwin libraries are linked using absolute paths, libraries
38+ are resolved by their <literal>install_name</literal> at link
39+ time. Sometimes packages won't set this correctly causing the
40+ library lookups to fail at runtime. This can be fixed by adding
41+ extra linker flags or by running <command>install_name_tool -id</command>
42+ during the <function>fixupPhase</function>.
43+ </para>
44+45+ <programlisting>
46+ stdenv.mkDerivation {
47+ name = "libfoo-1.2.3";
48+ # ...
49+ makeFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/libfoo.dylib";
50+ }
51+ </programlisting>
52+ </listitem>
53+54+ <listitem>
55+ <para>
56+ Some packages assume xcode is available and use <command>xcrun</command>
57+ to resolve build tools like <command>clang</command>, etc.
58+ This causes errors like <code>xcode-select: error: no developer tools were found at '/Applications/Xcode.app'</code>
59+ while the build doesn't actually depend on xcode.
60+ </para>
61+62+ <programlisting>
63+ stdenv.mkDerivation {
64+ name = "libfoo-1.2.3";
65+ # ...
66+ prePatch = ''
67+ substituteInPlace Makefile \
68+ --replace '/usr/bin/xcrun clang' clang
69+ '';
70+ }
71+ </programlisting>
72+73+ <para>
74+ The package <literal>xcbuild</literal> can be used to build projects
75+ that really depend on Xcode, however projects that build some kind of
76+ graphical interface won't work without using Xcode in an impure way.
77+ </para>
78+ </listitem>
79+80+</itemizedlist>
81+</section>
82+83+</chapter>
···338 # Type-check the remaining definitions, and merge them.
339 mergedValue = foldl' (res: def:
340 if type.check def.value then res
341- else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.description}.")
342 (type.merge loc defsFinal) defsFinal;
343344 isDefined = defsFinal != [];
···338 # Type-check the remaining definitions, and merge them.
339 mergedValue = foldl' (res: def:
340 if type.check def.value then res
341+ else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'.")
342 (type.merge loc defsFinal) defsFinal;
343344 isDefined = defsFinal != [];
-14
lib/systems/platforms.nix
···2rec {
3 pcBase = {
4 name = "pc";
5- uboot = null;
6 kernelHeadersBaseConfig = "defconfig";
7 kernelBaseConfig = "defconfig";
8 # Build whatever possible as a module, if not stated in the extra config.
···50 kernelTarget = "uImage";
51 # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
52 #kernelDTB = true;
53-54- # XXX can be anything non-null, pkgs actually only cares if it is set or not
55- uboot = "pogoplug4";
56 };
5758 sheevaplug = {
···162 '';
163 kernelMakeFlags = [ "LOADADDR=0x0200000" ];
164 kernelTarget = "uImage";
165- uboot = "sheevaplug";
166- # Only for uboot = uboot :
167- ubootConfig = "sheevaplug_config";
168 kernelDTB = true; # Beyond 3.10
169 gcc = {
170 arch = "armv5te";
···251 LATENCYTOP y
252 '';
253 kernelTarget = "zImage";
254- uboot = null;
255 gcc = {
256 arch = "armv6";
257 fpu = "vfp";
···342 XEN? n
343 '';
344 kernelTarget = "zImage";
345- uboot = null;
346 };
347348 scaleway-c1 = armv7l-hf-multiplatform // {
···374 kernelMakeFlags = [ "LOADADDR=0x10800000" ];
375 kernelTarget = "uImage";
376 kernelDTB = true;
377- uboot = true; #XXX: any non-null value here is needed so that mkimage is present to build kernelTarget uImage
378 gcc = {
379 cpu = "cortex-a9";
380 fpu = "neon";
···464 FTRACE n
465 '';
466 kernelTarget = "vmlinux";
467- uboot = null;
468 gcc = {
469 arch = "loongson2f";
470 abi = "n32";
···477 kernelAutoModules = false;
478 kernelExtraConfig = ""; # TBD kernel config
479 kernelTarget = "zImage";
480- uboot = null;
481 };
482483 armv7l-hf-multiplatform = {
···489 kernelDTB = true;
490 kernelAutoModules = true;
491 kernelPreferBuiltin = true;
492- uboot = null;
493 kernelTarget = "zImage";
494 kernelExtraConfig = ''
495 # Fix broken sunxi-sid nvmem driver.
···552 # which our initrd builder can't currently do easily.
553 USB_XHCI_TEGRA m
554 '';
555- uboot = null;
556 kernelTarget = "Image";
557 gcc = {
558 arch = "armv8-a";
···2rec {
3 pcBase = {
4 name = "pc";
05 kernelHeadersBaseConfig = "defconfig";
6 kernelBaseConfig = "defconfig";
7 # Build whatever possible as a module, if not stated in the extra config.
···49 kernelTarget = "uImage";
50 # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
51 #kernelDTB = true;
00052 };
5354 sheevaplug = {
···158 '';
159 kernelMakeFlags = [ "LOADADDR=0x0200000" ];
160 kernelTarget = "uImage";
000161 kernelDTB = true; # Beyond 3.10
162 gcc = {
163 arch = "armv5te";
···244 LATENCYTOP y
245 '';
246 kernelTarget = "zImage";
0247 gcc = {
248 arch = "armv6";
249 fpu = "vfp";
···334 XEN? n
335 '';
336 kernelTarget = "zImage";
0337 };
338339 scaleway-c1 = armv7l-hf-multiplatform // {
···365 kernelMakeFlags = [ "LOADADDR=0x10800000" ];
366 kernelTarget = "uImage";
367 kernelDTB = true;
0368 gcc = {
369 cpu = "cortex-a9";
370 fpu = "neon";
···454 FTRACE n
455 '';
456 kernelTarget = "vmlinux";
0457 gcc = {
458 arch = "loongson2f";
459 abi = "n32";
···466 kernelAutoModules = false;
467 kernelExtraConfig = ""; # TBD kernel config
468 kernelTarget = "zImage";
0469 };
470471 armv7l-hf-multiplatform = {
···477 kernelDTB = true;
478 kernelAutoModules = true;
479 kernelPreferBuiltin = true;
0480 kernelTarget = "zImage";
481 kernelExtraConfig = ''
482 # Fix broken sunxi-sid nvmem driver.
···539 # which our initrd builder can't currently do easily.
540 USB_XHCI_TEGRA m
541 '';
0542 kernelTarget = "Image";
543 gcc = {
544 arch = "armv8-a";
+11-1
lib/tests/modules.sh
···61checkConfigOutput "false" config.enable ./declare-enable.nix
62checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix
63000000000064# Check mkForce without submodules.
65set -- config.enable ./declare-enable.nix ./define-enable.nix
66checkConfigOutput "true" "$@"
···126# Check coerced value.
127checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
128checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
129-checkConfigError 'The option value .* in .* is not a string or integer.' config.value ./declare-coerced-value.nix ./define-value-list.nix
130131cat <<EOF
132====== module tests ======
···61checkConfigOutput "false" config.enable ./declare-enable.nix
62checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix
6364+# Check integer types.
65+# unsigned
66+checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix
67+checkConfigError 'The option value .* in .* is not of type.*unsigned integer.*' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
68+# positive
69+checkConfigError 'The option value .* in .* is not of type.*positive integer.*' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
70+# between
71+checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix
72+checkConfigError 'The option value .* in .* is not of type.*between.*-21 and 43.*inclusive.*' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix
73+74# Check mkForce without submodules.
75set -- config.enable ./declare-enable.nix ./define-enable.nix
76checkConfigOutput "true" "$@"
···136# Check coerced value.
137checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
138checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
139+checkConfigError 'The option value .* in .* is not.*string or signed integer.*' config.value ./declare-coerced-value.nix ./define-value-list.nix
140141cat <<EOF
142====== module tests ======
···18import re
19import requests
20import toolz
21+from concurrent.futures import ThreadPoolExecutor as pool
2223INDEX = "https://pypi.io/pypi"
24"""url of PyPI"""
···236237 packages = map(os.path.abspath, args.package)
238239+ with pool() as p:
240+ count = list(p.map(_update, packages))
241242 logging.info("{} package(s) updated".format(sum(count)))
243
+65-6
nixos/doc/manual/development/option-types.xml
···23 <literal>false</literal>.</para></listitem>
24 </varlistentry>
25 <varlistentry>
26- <term><varname>types.int</varname></term>
27- <listitem><para>An integer.</para></listitem>
28- </varlistentry>
29- <varlistentry>
30 <term><varname>types.path</varname></term>
31 <listitem><para>A filesystem path, defined as anything that when coerced to
32 a string starts with a slash. Even if derivations can be considered as
···39 </varlistentry>
40</variablelist>
4142-<para>String related types:</para>
00000000000000000000000000000000000000000000000000004344<variablelist>
45 <varlistentry>
···6869 <section><title>Value Types</title>
7071- <para>Value types are type that take a value parameter.</para>
7273<variablelist>
74 <varlistentry>
···83 <listitem><para>A string with a custom separator
84 <replaceable>sep</replaceable>, e.g. <literal>types.separatedString
85 "|"</literal>.</para></listitem>
0000000000086 </varlistentry>
87 <varlistentry>
88 <term><varname>types.submodule</varname> <replaceable>o</replaceable></term>
···23 <literal>false</literal>.</para></listitem>
24 </varlistentry>
25 <varlistentry>
000026 <term><varname>types.path</varname></term>
27 <listitem><para>A filesystem path, defined as anything that when coerced to
28 a string starts with a slash. Even if derivations can be considered as
···35 </varlistentry>
36</variablelist>
3738+<para>Integer-related types:</para>
39+40+<variablelist>
41+ <varlistentry>
42+ <term><varname>types.int</varname></term>
43+ <listitem><para>A signed integer.</para></listitem>
44+ </varlistentry>
45+ <varlistentry>
46+ <term>
47+ <varname>types.ints.{s8, s16, s32}</varname>
48+ </term>
49+ <listitem>
50+ <para>Signed integers with a fixed length (8, 16 or 32 bits).
51+ They go from
52+ <inlineequation><mathphrase>−2<superscript>n</superscript>/2</mathphrase>
53+ </inlineequation> to <inlineequation>
54+ <mathphrase>2<superscript>n</superscript>/2−1</mathphrase>
55+ </inlineequation>
56+ respectively (e.g. <literal>−128</literal> to <literal>127</literal>
57+ for 8 bits).
58+ </para></listitem>
59+ </varlistentry>
60+ <varlistentry>
61+ <term>
62+ <varname>types.ints.unsigned</varname>
63+ </term>
64+ <listitem><para>An unsigned integer (that is >= 0).
65+ </para></listitem>
66+ </varlistentry>
67+ <varlistentry>
68+ <term>
69+ <varname>types.ints.{u8, u16, u32}</varname>
70+ </term>
71+ <listitem>
72+ <para>Unsigned integers with a fixed length (8, 16 or 32 bits).
73+ They go from
74+ <inlineequation><mathphrase>0</mathphrase></inlineequation> to <inlineequation>
75+ <mathphrase>2<superscript>n</superscript>−1</mathphrase>
76+ </inlineequation>
77+ respectively (e.g. <literal>0</literal> to <literal>255</literal>
78+ for 8 bits).
79+ </para></listitem>
80+ </varlistentry>
81+ <varlistentry>
82+ <term>
83+ <varname>types.ints.positive</varname>
84+ </term>
85+ <listitem><para>A positive integer (that is > 0).
86+ </para></listitem>
87+ </varlistentry>
88+</variablelist>
89+90+<para>String-related types:</para>
9192<variablelist>
93 <varlistentry>
···116117 <section><title>Value Types</title>
118119+ <para>Value types are types that take a value parameter.</para>
120121<variablelist>
122 <varlistentry>
···131 <listitem><para>A string with a custom separator
132 <replaceable>sep</replaceable>, e.g. <literal>types.separatedString
133 "|"</literal>.</para></listitem>
134+ </varlistentry>
135+ <varlistentry>
136+ <term>
137+ <varname>types.ints.between</varname>
138+ <replaceable>lowest</replaceable>
139+ <replaceable>highest</replaceable>
140+ </term>
141+ <listitem><para>An integer between <replaceable>lowest</replaceable>
142+ and <replaceable>highest</replaceable> (both inclusive).
143+ Useful for creating types like <literal>types.port</literal>.
144+ </para></listitem>
145 </varlistentry>
146 <varlistentry>
147 <term><varname>types.submodule</varname> <replaceable>o</replaceable></term>
-8
nixos/doc/manual/release-notes/rl-1803.xml
···90 That means that old configuration is not overwritten by default when update to the znc options are made.
91 </para>
92 </listitem>
93- <listitem>
94- <para>
95- The option <option>services.xserver.desktopManager.default</option> is now <literal>none</literal> by default.
96- An assertion failure is thrown if WM's and DM's default are <literal>none</literal>.
97- To explicitly run a plain X session without and DM or WM, the newly introduced option <option>services.xserver.plainX</option>
98- must be set to true.
99- </para>
100- </listitem>
101</itemizedlist>
102103</section>
···90 That means that old configuration is not overwritten by default when update to the znc options are made.
91 </para>
92 </listitem>
0000000093</itemizedlist>
9495</section>
···193 theme = mkDefault "breeze";
194 };
19500000196 security.pam.services.kde = { allowNullPassword = true; };
197198 # Doing these one by one seems silly, but we currently lack a better
···193 theme = mkDefault "breeze";
194 };
195196+ boot.plymouth = {
197+ theme = mkDefault "breeze";
198+ themePackages = mkDefault [ pkgs.breeze-plymouth ];
199+ };
200+201 security.pam.services.kde = { allowNullPassword = true; };
202203 # Doing these one by one seems silly, but we currently lack a better
-12
nixos/modules/services/x11/xserver.nix
···161 '';
162 };
163164- plainX = mkOption {
165- type = types.bool;
166- default = false;
167- description = ''
168- Whether the X11 session can be plain (without DM/WM) and
169- the Xsession script will be used as fallback or not.
170- '';
171- };
172-173 autorun = mkOption {
174 type = types.bool;
175 default = true;
···561 + "${toString (length primaryHeads)} heads set to primary: "
562 + concatMapStringsSep ", " (x: x.output) primaryHeads;
563 })
564- { assertion = cfg.desktopManager.default == "none" && cfg.windowManager.default == "none" -> cfg.plainX;
565- message = "Either the desktop manager or the window manager shouldn't be `none`! To explicitly allow this, you can also set `services.xserver.plainX` to `true`.";
566- }
567 ];
568569 environment.etc =
···14 else throw "ImageMagick is not supported on this platform.";
1516 cfg = {
17- version = "6.9.9-20";
18- sha256 = "1pz8clmhnq26vdsp1j21czq3nfbvrmfdz30k7na7w4vh7wqxsrx1";
19 patches = [];
20 }
21 # Freeze version on mingw so we don't need to port the patch too often.
···14 else throw "ImageMagick is not supported on this platform.";
1516 cfg = {
17+ version = "6.9.9-21";
18+ sha256 = "0241g3c207rawn61bz8rc5gz55k5mi2b0n3zlwa0jv9xczlkd6a9";
19 patches = [];
20 }
21 # Freeze version on mingw so we don't need to port the patch too often.
···1+# TODO
2+# - consider writing a script to convert spkgs to nix packages, similar to vim
3+# or cabal2nix. This would allow a more efficient and "cleaner" build, greater
4+# flexibility and the possibility to select which dependencies to add and which
5+# to remove. It would also allow to use system packages for some dependencies
6+# and recompile others (optimized for the system) without recompiling everything.
7+# - add optdeps:
8+# - imagemagick
9+# - texlive full for documentation
10+# - ...
11+# - further seperate build outputs. Also maybe run `make doc`.
12+# Configure flags like --bindir and --libdir oculd also be used for that, see
13+# ./configure --help`.
14+15+# Other resources:
16+# - https://wiki.debian.org/DebianScience/Sage
17+# - https://github.com/cschwan/sage-on-gentoo
18+# - https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
19+20+{ stdenv
21+, fetchurl
22+, perl
23+, gfortran
24+, python
25+, autoreconfHook
26+, gettext
27, which
28+, texlive
29+, hevea
30}:
3132stdenv.mkDerivation rec {
33+ version = "8.0";
34+ name = "sage-${version}";
3536 src = fetchurl {
37+ # Note that the source is *not* fetched from github, since that doesn't
38+ # the upstream folder with all the source tarballs of the spkgs.
39+ # If those are not present they are fetched at build time, which breaks
40+ # when building in a sandbox (and probably only works if you install the
41+ # latest sage version).
42+ urls = [
43+ "http://mirrors.mit.edu/sage/src/sage-${version}.tar.gz"
44+ "ftp://ftp.fu-berlin.de/unix/misc/sage/src/sage-${version}.tar.gz"
45+ "http://sagemath.polytechnic.edu.na/src/sage-${version}.tar.gz"
46+ "ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/src/sage-${version}.tar.gz"
47+ "http://sagemath.mirror.ac.za/src/sage-${version}.tar.gz"
48+ "http://ftp.leg.uct.ac.za/pub/packages/sage/src/sage-${version}.tar.gz"
49+ "http://mirror.ufs.ac.za/sagemath/src/sage-${version}.tar.gz"
50+ "http://mirrors-usa.go-parts.com/sage/sagemath/src/sage-${version}.tar.gz"
51+ "http://www.cecm.sfu.ca/sage/src/sage-${version}.tar.gz"
52+ "http://files.sagemath.org/src/sage-${version}.tar.gz"
53+ "http://mirrors.xmission.com/sage/src/sage-${version}.tar.gz"
54+ "http://sagemath.c3sl.ufpr.br/src/sage-${version}.tar.gz"
55+ "http://linorg.usp.br/sage/src/sage-${version}.tar.gz"
56+ "http://mirror.hust.edu.cn/sagemath/src/sage-${version}.tar.gz"
57+ "http://ftp.iitm.ac.in/sage/src/sage-${version}.tar.gz"
58+ "http://ftp.kaist.ac.kr/sage/src/sage-${version}.tar.gz"
59+ "http://ftp.riken.jp/sagemath/src/sage-${version}.tar.gz"
60+ "http://mirrors.tuna.tsinghua.edu.cn/sagemath/src/sage-${version}.tar.gz"
61+ "http://mirrors.ustc.edu.cn/sagemath/src/sage-${version}.tar.gz"
62+ "http://ftp.tsukuba.wide.ad.jp/software/sage/src/sage-${version}.tar.gz"
63+ "http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/src/sage-${version}.tar.gz"
64+ "http://mirror.yandex.ru/mirrors/sage.math.washington.edu/src/sage-${version}.tar.gz"
65+ "http://mirror.aarnet.edu.au/pub/sage/src/sage-${version}.tar.gz"
66+ "http://sage.mirror.garr.it/mirrors/sage/src/sage-${version}.tar.gz"
67+ "http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-${version}.tar.gz"
68+ "http://mirror.switch.ch/mirror/sagemath/src/sage-${version}.tar.gz"
69+ "https://mirrors.up.pt/pub/sage/src/sage-${version}.tar.gz"
70+ "http://www-ftp.lip6.fr/pub/math/sagemath/src/sage-${version}.tar.gz"
71+ "http://ftp.ntua.gr/pub/sagemath/src/sage-${version}.tar.gz"
72+ ];
73+ sha256 = "1a9rhb8jby6fdqa2s7n2fl9jwqqlsl7qz7dbpbwvg6jwlrvni7fg";
74+ };
75+76+ postPatch = ''
77+ substituteAllInPlace src/bin/sage-env
78+ '';
79+80+ installPhase = ''
81+ # Sage installs during first `make`, `make install` is no-op and just takes time.
82+ '';
8384+ outputs = [ "out" "doc" ];
8586+ buildInputs = [
87+ perl # needed for the build
88+ python # needed for the build
89+ gfortran # needed to build giac
90+ autoreconfHook # needed to configure sage with prefix
91+ gettext # needed to build the singular spkg
92+ hevea # needed to build the docs of the giac spkg
93+ which # needed in configure of mpir
94+ # needed to build the docs of the giac spkg
95+ (texlive.combine { inherit (texlive)
96+ scheme-basic
97+ collection-pstricks # needed by giac
98+ times # font needed by giac
99+ stmaryrd # needed by giac
100+ babel-greek # optional for giac, otherwise throws a bunch of latex command not founds
101+ ;
102+ })
103+ ];
104105+ patches = [
106+ # fix usages of /bin/rm
107+ ./spkg-singular.patch
108+ # help python find the crypt library
109+ ./spkg-python2.patch
110+ ./spkg-python3.patch
111+ # fix usages of /usr/bin/perl
112+ ./spkg-git.patch
113+ # fix usages of /bin/cp and add necessary argument to function call
114+ ./spkg-giac.patch
115+ # environment
116+ ./env.patch
117+ ];
118119 enableParallelBuilding = true;
120121+ hardeningDisable = [
122+ "format" # needed to build palp, for lines like `printf(ctime(&_NFL->TIME))`
123+ # TODO could be patched with `sed s|printf(ctime(\(.*\)))|%s... or fixed upstream
124+ ];
125126 preConfigure = ''
127 export SAGE_NUM_THREADS=$NIX_BUILD_CORES
128 export SAGE_ATLAS_ARCH=fast
129+130+ export HOME=$out/sage-home
131+ mkdir -p $out/sage-home
132+133+ mkdir -p "$out"
134+135+ # we need to keep the source around
136+ dir="$PWD"
137+ cd ..
138+ mv "$dir" "$out/sage-root"
139+140+ cd "$out/sage-root" # build in target dir, since `make` is also `make install`
141 '';
142143+ # for reference: http://doc.sagemath.org/html/en/installation/source.html
144+ preBuild = ''
145+ # TODO do this conditionally
146+ export SAGE_SPKG_INSTALL_DOCS='no'
147+ patchShebangs build
148+ '';
149+150+ postBuild = ''
151+ rm -r "$out/sage-root/upstream" # don't keep the sources of all the spkgs
152+ rm -r "$out/sage-root/src/build"
153+ rm -rf "$out/sage-root/src/.git"
154+ rm -r "$out/sage-root/logs"
155+ # Fix dependency cycle between out and doc
156+ rm -f "$out/sage-root/config.status"
157+ rm -f "$out/sage-root/build/make/Makefile-auto"
158+ rm -f "$out/sage-home/.sage/gap/libgap-workspace-"*
159+ '';
160+161+ # TODO there are some doctest failures, which seem harmless.
162+ # We should figure out a way to fix the failures or ignore only those tests.
163+ doCheck = false;
164165+ checkTarget = "ptestalllong"; # all long tests in parallell
166+ preCheck = ''
167+ export SAGE_TIMEOUT=0 # no timeout
168+ export SAGE_TIMEOUT_LONG=0 # no timeout
169+ '';
170171 meta = {
172 homepage = http://www.sagemath.org;
173 description = "A free open source mathematics software system";
174+ # taken from the homepage
175+ longDescription = ''
176+ SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers.
177+ Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.
178+ '';
179 license = stdenv.lib.licenses.gpl2Plus;
180+ platforms = stdenv.lib.platforms.linux;
181+ maintainers = with stdenv.lib.maintainers; [ timokau ];
182 };
183}
+22
pkgs/applications/science/math/sage/env.patch
···0000000000000000000000
···1+diff --git a/src/bin/sage-env b/src/bin/sage-env
2+index ead308f861..ed8db9f9b7 100644
3+--- a/src/bin/sage-env
4++++ b/src/bin/sage-env
5+@@ -111,6 +111,8 @@ resolvelinks() {
6+ }
7+8+9++SAGE_ROOT="@out@/sage-root"
10++
11+ # New value for SAGE_ROOT: either SAGE_ROOT (if given)
12+ # or a guessed value based on pwd.
13+ if [ -n "$SAGE_ROOT" ]; then
14+@@ -185,6 +187,8 @@ fi
15+ export SAGE_ENV_SOURCED=$SAGE_ENV_VERSION
16+17+ export SAGE_ROOT="$NEW_SAGE_ROOT"
18++export SAGE_LOCAL='@out@/'
19++export PYTHONPATH="@out@/lib/python2.7/site-packages:$PYTHONPATH"
20+21+22+ # sage-env must know where the Sage's script files are.
···1+#! /usr/bin/env nix-shell
2+#! nix-shell -i bash -p curl go-pup
3+4+# Fetches a list of all available source mirrors from the sage homepage.
5+# Note that the list is sorted by country, but fetchurl doesn't offer an option
6+# to customize mirror preference.
7+8+curl -s http://www.sagemath.org/download-source.html \
9+ | pup 'table#mirror' \
10+ | pup 'a attr{href}' \
11+ | sed -e 's/index\.html/sage-${version}.tar.gz/'
···1+source $stdenv/setup
2+3+# Curl flags to handle redirects, not use EPSV, handle cookies for
4+# servers to need them during redirects, and work on SSL without a
5+# certificate (this isn't a security problem because we check the
6+# cryptographic hash of the output anyway).
7+8+set -o noglob
9+10+curl="curl \
11+ --location \
12+ --max-redirs 20 \
13+ --retry 2 \
14+ --disable-epsv \
15+ --cookie-jar cookies \
16+ --insecure \
17+ --speed-time 5 \
18+ -# \
19+ --fail \
20+ $curlOpts \
21+ $NIX_CURL_FLAGS"
22+23+finish() {
24+ runHook postFetch
25+ set +o noglob
26+ exit 0
27+}
28+29+ipfs_add() {
30+ if curl --retry 0 --head --silent "localhost:5001" > /dev/null; then
31+ echo "[0m[01;36m=IPFS=[0m add $ipfs"
32+ tar --owner=root --group=root -cWf "source.tar" $(echo *)
33+ res=$(curl -# -F "file=@source.tar" "localhost:5001/api/v0/tar/add" | sed 's/.*"Hash":"\(.*\)".*/\1/')
34+ if [ $ipfs != $res ]; then
35+ echo "\`ipfs tar add' results in $res when $ipfs is expected"
36+ exit 1
37+ fi
38+ rm "source.tar"
39+ fi
40+}
41+42+echo
43+44+mkdir download
45+cd download
46+47+if curl --retry 0 --head --silent "localhost:5001" > /dev/null; then
48+ curlexit=18;
49+ echo "[0m[01;36m=IPFS=[0m get $ipfs"
50+ # if we get error code 18, resume partial download
51+ while [ $curlexit -eq 18 ]; do
52+ # keep this inside an if statement, since on failure it doesn't abort the script
53+ if $curl -C - "http://localhost:5001/api/v0/tar/cat?arg=$ipfs" --output "$ipfs.tar"; then
54+ unpackFile "$ipfs.tar"
55+ rm "$ipfs.tar"
56+ set +o noglob
57+ mv $(echo *) "$out"
58+ finish
59+ else
60+ curlexit=$?;
61+ fi
62+ done
63+fi
64+65+if test -n "$url"; then
66+ curlexit=18;
67+ echo "Downloading $url"
68+ while [ $curlexit -eq 18 ]; do
69+ # keep this inside an if statement, since on failure it doesn't abort the script
70+ if $curl "$url" -O; then
71+ set +o noglob
72+ tmpfile=$(echo *)
73+ unpackFile $tmpfile
74+ rm $tmpfile
75+ ipfs_add
76+ mv $(echo *) "$out"
77+ finish
78+ else
79+ curlexit=$?;
80+ fi
81+ done
82+fi
83+84+echo "[01;31merror:[0m cannot download $ipfs from ipfs or the given url"
85+echo
86+set +o noglob
87+exit 1
···1-{ stdenv, fetchurl, sbcl }:
0023-stdenv.mkDerivation rec {
0004 name = "acl2-${version}";
5- version = "v6-5";
67- src = fetchurl {
8- url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
9- sha256 = "19kfclgpdyms016s06pjf3icj3mx9jlcj8vfgpbx2ac4ls0ir36g";
10- name = "acl2-${version}.tar.gz";
011 };
1213- buildInputs = [ sbcl ];
00001415 phases = "unpackPhase installPhase";
16···1819 installPhase = ''
20 mkdir -p $out/share/${installSuffix}
021 cp -R . $out/share/${installSuffix}
22 cd $out/share/${installSuffix}
23- make 'LISP=${sbcl}/bin/sbcl --dynamic-space-size 2000'
24- make 'LISP=${sbcl}/bin/sbcl --dynamic-space-size 2000' regression
25- make LISP=${sbcl}/bin/sbcl TAGS
26- mkdir -p $out/bin
000027 cp saved_acl2 $out/bin/acl2
28 '';
2930 meta = {
31 description = "An interpreter and a prover for a Lisp dialect";
32- maintainers = with stdenv.lib.maintainers; [ raskin ];
000000000000000000000033 platforms = stdenv.lib.platforms.linux;
34 };
35}
···1+{ stdenv, fetchFromGitHub,
2+ # perl, which, nettools,
3+ sbcl }:
45+let hashes = {
6+ "7.4" = "04jb789nks9llwysxz1zw9pq1dh0j39b5fcmivcc4bq9v9cga2l1";
7+};
8+in stdenv.mkDerivation rec {
9 name = "acl2-${version}";
10+ version = "7.4";
1112+ src = fetchFromGitHub {
13+ owner = "acl2-devel";
14+ repo = "acl2-devel";
15+ rev = "${version}";
16+ sha256 = hashes."${version}";
17 };
1819+ buildInputs = [ sbcl
20+ # which perl nettools
21+ ];
22+23+ enableParallelBuilding = true;
2425 phases = "unpackPhase installPhase";
26···2829 installPhase = ''
30 mkdir -p $out/share/${installSuffix}
31+ mkdir -p $out/bin
32 cp -R . $out/share/${installSuffix}
33 cd $out/share/${installSuffix}
34+35+ # make ACL2 image
36+ make LISP=${sbcl}/bin/sbcl
37+38+ # The community books don't build properly under Nix yet.
39+ rm -rf books
40+ #make ACL2=$out/share/saved_acl2 USE_QUICKLISP=1 regression-everything
41+42 cp saved_acl2 $out/bin/acl2
43 '';
4445 meta = {
46 description = "An interpreter and a prover for a Lisp dialect";
47+ longDescription = ''
48+ ACL2 is a logic and programming language in which you can model
49+ computer systems, together with a tool to help you prove
50+ properties of those models. "ACL2" denotes "A Computational
51+ Logic for Applicative Common Lisp".
52+53+ ACL2 is part of the Boyer-Moore family of provers, for which its
54+ authors have received the 2005 ACM Software System Award.
55+56+ NOTE: In nixpkgs, the community books that usually ship with
57+ ACL2 have been removed because it is not currently possible to
58+ build them with Nix.
59+ '';
60+ homepage = http://www.cs.utexas.edu/users/moore/acl2/;
61+ downloadPage = https://github.com/acl2-devel/acl2-devel/releases;
62+ # There are a bunch of licenses in the community books, but since
63+ # they currently get deleted during the build, we don't mention
64+ # their licenses here. ACL2 proper is released under a BSD
65+ # 3-clause license.
66+ #license = with stdenv.lib.licenses;
67+ #[ free bsd3 mit gpl2 llgpl21 cc0 publicDomain ];
68+ license = stdenv.lib.licenses.bsd3;
69+ maintainers = with stdenv.lib.maintainers; [ kini raskin ];
70 platforms = stdenv.lib.platforms.linux;
71 };
72}
···1+{ stdenv, fetchurl, autoconf213, pkgconfig, perl, python2, zip, which, readline, icu, zlib, nspr }:
2+3+stdenv.mkDerivation rec {
4+ version = "52.2.1gnome1";
5+ name = "spidermonkey-${version}";
6+7+ # the release notes point to some guys home directory, see
8+ # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38
9+ # probably it would be more ideal to pull a particular tag/revision
10+ # from the mercurial repo
11+ src = fetchurl {
12+ url = "mirror://gnome/teams/releng/tarballs-needing-help/mozjs/mozjs-${version}.tar.gz";
13+ sha256 = "1bxhz724s1ch1c0kdlzlg9ylhg1mk8kbhdgfkax53fyvn51pjs9i";
14+ };
15+16+ buildInputs = [ readline icu zlib nspr ];
17+ nativeBuildInputs = [ autoconf213 pkgconfig perl which python2 zip ];
18+19+ postUnpack = "sourceRoot=\${sourceRoot}/js/src";
20+21+ preConfigure = ''
22+ export CXXFLAGS="-fpermissive"
23+ export LIBXUL_DIST=$out
24+ export PYTHON="${python2.interpreter}"
25+ '';
26+27+ configureFlags = [
28+ "--enable-threadsafe"
29+ "--with-system-nspr"
30+ "--with-system-zlib"
31+ "--with-system-icu"
32+ "--with-intl-api"
33+ "--enable-readline"
34+35+ # enabling these because they're wanted by 0ad. They may or may
36+ # not be good defaults for other uses.
37+ "--enable-gcgenerational"
38+ "--enable-shared-js"
39+ ];
40+41+ # This addresses some build system bug. It's quite likely to be safe
42+ # to re-enable parallel builds if the source revision changes.
43+ enableParallelBuilding = true;
44+45+ postFixup = ''
46+ # The headers are symlinks to a directory that doesn't get put
47+ # into $out, so they end up broken. Fix that by just resolving the
48+ # symlinks.
49+ for i in $(find $out -type l); do
50+ cp --remove-destination "$(readlink "$i")" "$i";
51+ done
52+ '';
53+54+ meta = with stdenv.lib; {
55+ description = "Mozilla's JavaScript engine written in C/C++";
56+ homepage = https://developer.mozilla.org/en/SpiderMonkey;
57+ # TODO: MPL/GPL/LGPL tri-license.
58+59+ maintainers = [ maintainers.abbradar ];
60+ platforms = platforms.linux;
61+ };
62+}
···17 inherit (stdenv.lib) optional optionalString;
18in
19stdenv.mkDerivation rec {
20- name = "gst-plugins-bad-1.10.4";
2122 meta = with stdenv.lib; {
23 description = "Gstreamer Bad Plugins";
24- homepage = "http://gstreamer.freedesktop.org";
25 longDescription = ''
26 a set of plug-ins that aren't up to par compared to the
27 rest. They might be close to being good quality, but they're missing
···3435 src = fetchurl {
36 url = "${meta.homepage}/src/gst-plugins-bad/${name}.tar.xz";
37- sha256 = "0rk9rlzf2b0hjw5hwbadz53yh4ls7vm3w3cshsa3n8isdd8axp93";
38 };
3940 outputs = [ "out" "dev" ];
···17 inherit (stdenv.lib) optional optionalString;
18in
19stdenv.mkDerivation rec {
20+ name = "gst-plugins-bad-1.12.2";
2122 meta = with stdenv.lib; {
23 description = "Gstreamer Bad Plugins";
24+ homepage = "https://gstreamer.freedesktop.org";
25 longDescription = ''
26 a set of plug-ins that aren't up to par compared to the
27 rest. They might be close to being good quality, but they're missing
···3435 src = fetchurl {
36 url = "${meta.homepage}/src/gst-plugins-bad/${name}.tar.xz";
37+ sha256 = "0dwyq03g2m0p16dwx8q5qvjn5x9ia72h21sf87mp97gmwkfpwb4w";
38 };
3940 outputs = [ "out" "dev" ];
···78 meta = with stdenv.lib; {
9 description = "Gstreamer Non-Linear Multimedia Editing Plugins";
10- homepage = "http://gstreamer.freedesktop.org";
11 longDescription = ''
12 Gnonlin is a library built on top of GStreamer which provides
13 support for writing non-linear audio and video editing
···78 meta = with stdenv.lib; {
9 description = "Gstreamer Non-Linear Multimedia Editing Plugins";
10+ homepage = "https://gstreamer.freedesktop.org";
11 longDescription = ''
12 Gnonlin is a library built on top of GStreamer which provides
13 support for writing non-linear audio and video editing
···5}:
67stdenv.mkDerivation rec {
8- name = "gst-plugins-ugly-1.10.4";
910 meta = with stdenv.lib; {
11 description = "Gstreamer Ugly Plugins";
12- homepage = "http://gstreamer.freedesktop.org";
13 longDescription = ''
14 a set of plug-ins that have good quality and correct functionality,
15 but distributing them might pose problems. The license on either
···2223 src = fetchurl {
24 url = "${meta.homepage}/src/gst-plugins-ugly/${name}.tar.xz";
25- sha256 = "0ngsiwcsz3jd08id4mc0qiy2q1n7h2kkvdnh3r1vm725m1ycg1k3";
26 };
2728 outputs = [ "out" "dev" ];
···5}:
67stdenv.mkDerivation rec {
8+ name = "gst-plugins-ugly-1.12.2";
910 meta = with stdenv.lib; {
11 description = "Gstreamer Ugly Plugins";
12+ homepage = "https://gstreamer.freedesktop.org";
13 longDescription = ''
14 a set of plug-ins that have good quality and correct functionality,
15 but distributing them might pose problems. The license on either
···2223 src = fetchurl {
24 url = "${meta.homepage}/src/gst-plugins-ugly/${name}.tar.xz";
25+ sha256 = "0rplyp1qk359c97ig9i2vc1v34g92khd8dslwfipva1ypwmr9hqw";
26 };
2728 outputs = [ "out" "dev" ];
···1---- configure.ac 2016-05-27 14:00:25.248388226 +0200
2-+++ configure.ac 2016-05-27 14:01:28.228943416 +0200
3-@@ -214,7 +214,8 @@ AM_CONDITIONAL(BUILD_DOCS, [test "x$buil
4- # Used by the udev rules so we can use callouts during testing without
5- # installing everything first. Default is the empty string so the installed
6- # rule will use udev's default path. Override is in udev/Makefile.am
7--AC_SUBST(UDEV_TEST_PATH, "")
8-+UDEV_TEST_PATH="${UDEV_DIR}/"
9-+AC_SUBST(UDEV_TEST_PATH)
10- AC_PATH_PROG(SED, [sed])
1112- AC_CONFIG_FILES([Makefile
00000
···2122 enableParallelBuilding = true;
2324- doCheck = true;
25 checkTarget = "test";
2627 meta = with stdenv.lib; {
···2122 enableParallelBuilding = true;
2324+ doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
25 checkTarget = "test";
2627 meta = with stdenv.lib; {
+3-3
pkgs/development/libraries/librsvg/default.nix
···6# no introspection by default, it's too big
78stdenv.mkDerivation rec {
9- name = "librsvg-2.40.17";
1011 src = fetchurl {
12- url = "mirror://gnome/sources/librsvg/2.40/${name}.tar.xz";
13- sha256 = "1k39gyf7f5m9x0jvpcxvfcqswdb04xhm1lbwbjabn1f4xk5wbxp6";
14 };
1516 NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
···6# no introspection by default, it's too big
78stdenv.mkDerivation rec {
9+ name = "librsvg-2.40.19";
1011 src = fetchurl {
12+ url = "mirror://gnome/sources/librsvg/2.40/librsvg-2.40.18.tar.xz";
13+ sha256 = "0k2nbd4g31qinkdfd8r5c5ih2ixl85fbkgkqqh9747lwr24c9j5z";
14 };
1516 NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
+1-1
pkgs/development/libraries/libtiff/default.nix
···2930 enableParallelBuilding = true;
3132- doCheck = true;
3334 meta = with stdenv.lib; {
35 description = "Library and utilities for working with the TIFF image file format";
···2930 enableParallelBuilding = true;
3132+ doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
3334 meta = with stdenv.lib; {
35 description = "Library and utilities for working with the TIFF image file format";
···2223 # XXX: There are test failures on non-GNU systems, see
24 # http://lists.gnu.org/archive/html/bug-libunistring/2010-02/msg00004.html .
25- doCheck = stdenv ? glibc;
2627 meta = {
28 homepage = http://www.gnu.org/software/libunistring/;
···2223 # XXX: There are test failures on non-GNU systems, see
24 # http://lists.gnu.org/archive/html/bug-libunistring/2010-02/msg00004.html .
25+ doCheck = (stdenv ? glibc) && (stdenv.hostPlatform == stdenv.buildPlatform);
2627 meta = {
28 homepage = http://www.gnu.org/software/libunistring/;
···61 '';
62 });
6364- fast-cli = nodePackages.fast-cli.override (oldAttrs: {
65 preRebuild = ''
66 # Simply ignore the phantomjs --version check. It seems to need a display but it is safe to ignore
67 sed -i -e "s|console.error('Error verifying phantomjs, continuing', err)|console.error('Error verifying phantomjs, continuing', err); return true;|" node_modules/phantomjs-prebuilt/lib/util.js
···61 '';
62 });
6364+ fast-cli = nodePackages."fast-cli-1.x".override (oldAttrs: {
65 preRebuild = ''
66 # Simply ignore the phantomjs --version check. It seems to need a display but it is safe to ignore
67 sed -i -e "s|console.error('Error verifying phantomjs, continuing', err)|console.error('Error verifying phantomjs, continuing', err); return true;|" node_modules/phantomjs-prebuilt/lib/util.js
···14buildPythonPackage rec {
15 pname = "Cython";
16 name = "${pname}-${version}";
17- version = "0.27.2";
1819 src = fetchPypi {
20 inherit pname version;
21- sha256 = "265dacf64ed8c0819f4be9355c39beaa13dc2ad2f85237a2c4e478f5ce644b48";
22 };
2324 # With Python 2.x on i686-linux or 32-bit ARM this test fails because the
···14buildPythonPackage rec {
15 pname = "Cython";
16 name = "${pname}-${version}";
17+ version = "0.27.3";
1819 src = fetchPypi {
20 inherit pname version;
21+ sha256 = "6a00512de1f2e3ce66ba35c5420babaef1fe2d9c43a8faab4080b0dbcc26bc64";
22 };
2324 # With Python 2.x on i686-linux or 32-bit ARM this test fails because the
···12 name = "${pname}-${version}";
1314 src = fetchPypi {
15+ inherit pname;
16+ # FIXME when updating to the next version: The tarball on pypi is called
17+ # "meliae-0.4.0.tar.gz" while the version within that tarball is
18+ # "0.4.0.final.0".
19+ version = "0.4.0";
20 sha256 = "976519ab02aaa6a8fb5f596dc4dd9f64fc9510b00e054979566e51c9be7cec99";
21 };
22
···79Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install
80this into your user profile.
810000000000000000082## Updating the package set
8384```bash
···79Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install
80this into your user profile.
8182+Alternatively, you can create a self-contained `shell.nix` without the need to
83+modify any configuration files:
84+85+```nix
86+{ pkgs ? import <nixpkgs> {}
87+}:
88+89+pkgs.rstudioWrapper.override {
90+ packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ];
91+}
92+93+```
94+95+Executing `nix-shell` will then drop you into an environment equivalent to the
96+one above. If you need additional packages just add them to the list and
97+re-enter the shell.
98+99## Updating the package set
100101```bash
···1+#!/bin/sh
2+3+###########################################################################
4+# /usr/bin/service
5+#
6+# A convenient wrapper for the /etc/init.d init scripts.
7+#
8+# This script is a modified version of the /sbin/service utility found on
9+# Red Hat/Fedora systems (licensed GPLv2+).
10+#
11+# Copyright (C) 2006 Red Hat, Inc. All rights reserved.
12+# Copyright (C) 2008 Canonical Ltd.
13+# * August 2008 - Dustin Kirkland <kirkland@canonical.com>
14+# Copyright (C) 2013 Michael Stapelberg <stapelberg@debian.org>
15+#
16+# This program is free software; you can redistribute it and/or modify
17+# it under the terms of the GNU General Public License as published by
18+# the Free Software Foundation; either version 2 of the License, or
19+# (at your option) any later version.
20+#
21+# This program is distributed in the hope that it will be useful,
22+# but WITHOUT ANY WARRANTY; without even the implied warranty of
23+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+# GNU General Public License for more details.
25+#
26+# You should have received a copy of the GNU General Public License
27+# along with this program; if not, write to the Free Software
28+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29+#
30+# On Debian GNU/Linux systems, the complete text of the GNU General
31+# Public License can be found in `/usr/share/common-licenses/GPL-2'.
32+###########################################################################
33+34+35+is_ignored_file() {
36+ case "$1" in
37+ skeleton | README | *.dpkg-dist | *.dpkg-old | rc | rcS | single | reboot | bootclean.sh)
38+ return 0
39+ ;;
40+ esac
41+ return 1
42+}
43+44+VERSION=$(@coreutils@/bin/basename $0)" ver. 0.91-ubuntu1"
45+USAGE="Usage: "$(@coreutils@/bin/basename $0)" < option > | --status-all | \
46+[ service_name [ command | --full-restart ] ]"
47+SERVICE=
48+ACTION=
49+SERVICEDIR="/etc/init.d"
50+OPTIONS=
51+is_systemd=
52+53+54+if [ $# -eq 0 ]; then
55+ echo "${USAGE}" >&2
56+ exit 1
57+fi
58+59+if [ -d /run/systemd/system ]; then
60+ is_systemd=1
61+fi
62+63+cd /
64+while [ $# -gt 0 ]; do
65+ case "${1}" in
66+ --help | -h | --h* )
67+ echo "${USAGE}" >&2
68+ exit 0
69+ ;;
70+ --version | -V )
71+ echo "${VERSION}" >&2
72+ exit 0
73+ ;;
74+ *)
75+ if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
76+ if [ -d "${SERVICEDIR}" ]; then
77+ cd ${SERVICEDIR}
78+ for SERVICE in * ; do
79+ case "${SERVICE}" in
80+ functions | halt | killall | single| linuxconf| kudzu)
81+ ;;
82+ *)
83+ if ! is_ignored_file "${SERVICE}" \
84+ && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
85+ out=$(env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status 2>&1)
86+ retval=$?
87+ if echo "$out" | egrep -iq "usage:"; then
88+ #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
89+ echo " [ ? ] $SERVICE" 1>&2
90+ continue
91+ else
92+ if [ "$retval" = "0" -a -n "$out" ]; then
93+ #printf " %s %-60s %s\n" "[+]" "$SERVICE:" "running"
94+ echo " [ + ] $SERVICE"
95+ continue
96+ else
97+ #printf " %s %-60s %s\n" "[-]" "$SERVICE:" "NOT running"
98+ echo " [ - ] $SERVICE"
99+ continue
100+ fi
101+ fi
102+ #env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status
103+ fi
104+ ;;
105+ esac
106+ done
107+ else
108+ systemctl $sctl_args list-units
109+ fi
110+ exit 0
111+ elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
112+ SERVICE="${1}"
113+ # On systems using systemd, we just perform a normal restart:
114+ # A restart with systemd is already a full restart.
115+ if [ -n "$is_systemd" ]; then
116+ ACTION="restart"
117+ else
118+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
119+ env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" stop
120+ env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" start
121+ exit $?
122+ fi
123+ fi
124+ elif [ -z "${SERVICE}" ]; then
125+ SERVICE="${1}"
126+ elif [ -z "${ACTION}" ]; then
127+ ACTION="${1}"
128+ else
129+ OPTIONS="${OPTIONS} ${1}"
130+ fi
131+ shift
132+ ;;
133+ esac
134+done
135+136+# Operate against system upstart, not session
137+unset UPSTART_SESSION
138+if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
139+ && initctl version 2>/dev/null | grep -q upstart \
140+ && initctl status ${SERVICE} 2>/dev/null 1>/dev/null
141+then
142+ # Upstart configuration exists for this job and we're running on upstart
143+ case "${ACTION}" in
144+ start|stop|status|reload)
145+ # Action is a valid upstart action
146+ exec ${ACTION} ${SERVICE} ${OPTIONS}
147+ ;;
148+ restart|force-reload)
149+ # Map restart to the usual sysvinit behavior.
150+ # Map force-reload to restart as per Debian policy 9.3.2,
151+ # since there is no way to know if "reload" is supported
152+ stop ${SERVICE} ${OPTIONS} || :
153+ exec start ${SERVICE} ${OPTIONS}
154+ ;;
155+ esac
156+fi
157+158+159+run_via_sysvinit() {
160+ # Otherwise, use the traditional sysvinit
161+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
162+ exec env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" ${ACTION} ${OPTIONS}
163+ else
164+ echo "${SERVICE}: unrecognized service" >&2
165+ exit 1
166+ fi
167+}
168+169+update_openrc_started_symlinks() {
170+ # maintain the symlinks of /run/openrc/started so that
171+ # rc-status works with the service command as well
172+ if [ -d /run/openrc/started ] ; then
173+ case "${ACTION}" in
174+ start)
175+ if [ ! -h /run/openrc/started/$SERVICE ] ; then
176+ ln -s $SERVICEDIR/$SERVICE /run/openrc/started/$SERVICE || true
177+ fi
178+ ;;
179+ stop)
180+ rm /run/openrc/started/$SERVICE || true
181+ ;;
182+ esac
183+ fi
184+}
185+186+# When this machine is running systemd, standard service calls are turned into
187+# systemctl calls.
188+if [ -n "$is_systemd" ]
189+then
190+ UNIT="${SERVICE%.sh}.service"
191+ # avoid deadlocks during bootup and shutdown from units/hooks
192+ # which call "invoke-rc.d service reload" and similar, since
193+ # the synchronous wait plus systemd's normal behaviour of
194+ # transactionally processing all dependencies first easily
195+ # causes dependency loops
196+ if ! systemctl --quiet is-active multi-user.target; then
197+ sctl_args="--job-mode=ignore-dependencies"
198+ fi
199+200+ case "${ACTION}" in
201+ restart|status)
202+ exec systemctl $sctl_args ${ACTION} ${UNIT}
203+ ;;
204+ start|stop)
205+ # Follow the principle of least surprise for SysV people:
206+ # When running "service foo stop" and foo happens to be a service that
207+ # has one or more .socket files, we also stop the .socket units.
208+ # Users who need more control will use systemctl directly.
209+ for unit in $(systemctl list-unit-files --full --type=socket 2>/dev/null | sed -ne 's/\.socket\s*[a-z]*\s*$/.socket/p'); do
210+ if [ "$(systemctl -p Triggers show $unit)" = "Triggers=${UNIT}" ]; then
211+ systemctl $sctl_args ${ACTION} $unit
212+ fi
213+ done
214+ exec systemctl $sctl_args ${ACTION} ${UNIT}
215+ ;;
216+ reload)
217+ _canreload="$(SYSTEMCTL -p CanReload show ${UNIT} 2>/dev/null)"
218+ if [ "$_canreload" = "CanReload=no" ]; then
219+ # The reload action falls back to the sysv init script just in case
220+ # the systemd service file does not (yet) support reload for a
221+ # specific service.
222+ run_via_sysvinit
223+ else
224+ exec systemctl $sctl_args reload "${UNIT}"
225+ fi
226+ ;;
227+ force-stop)
228+ exec systemctl --signal=KILL kill "${UNIT}"
229+ ;;
230+ force-reload)
231+ _canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)"
232+ if [ "$_canreload" = "CanReload=no" ]; then
233+ exec systemctl $sctl_args restart "${UNIT}"
234+ else
235+ exec systemctl $sctl_args reload "${UNIT}"
236+ fi
237+ ;;
238+ *)
239+ # We try to run non-standard actions by running
240+ # the init script directly.
241+ run_via_sysvinit
242+ ;;
243+ esac
244+fi
245+246+update_openrc_started_symlinks
247+run_via_sysvinit
···1+{ stdenv, fetchurl, libX11 }:
2+3+stdenv.mkDerivation rec {
4+ name = "xosview2-${version}";
5+ version = "2.2.2";
6+7+ src = fetchurl {
8+ url = "mirror://sourceforge/xosview/${name}.tar.gz";
9+ sha256 = "3502e119a5305ff2396f559340132910807351c7d4e375f13b5c338404990406";
10+ };
11+12+ # The software failed to buid with this enabled; it seemed tests were not implemented
13+ doCheck = false;
14+15+ buildInputs = [ libX11 ];
16+17+ meta = with stdenv.lib; {
18+ description = "Lightweight program that gathers information from your operating system and displays it in graphical form";
19+ longDescription = ''
20+ xosview is a lightweight program that gathers information from your
21+ operating system and displays it in graphical form. It attempts to show
22+ you in a quick glance an overview of how your system resources are being
23+ utilized.
24+25+ It can be configured to be nothing more than a small strip showing a
26+ couple of parameters on a desktop task bar. Or it can display dozens of
27+ meters and rolling graphical charts over your entire screen.
28+29+ Since xosview renders all graphics with core X11 drawing methods, you can
30+ run it on one machine and display it on another. This works even if your
31+ other host is an operating system not running an X server inside a
32+ virtual machine running on a physically different host. If you can
33+ connect to it on a network, then you can popup an xosview instance and
34+ monitor what is going on.
35+ '';
36+ homepage = "http://xosview.sourceforge.net/index.html";
37+ license = licenses.gpl1;
38+ maintainers = [ maintainers.SeanZicari ];
39+ platforms = platforms.all;
40+ };
41+}
···1+{ stdenv, fetchurl, perl }:
2+3+stdenv.mkDerivation rec {
4+ name = "nat-traverse-${version}";
5+ version = "0.7";
6+7+ src = fetchurl {
8+ url = "https://www.speicherleck.de/iblech/nat-traverse/nat-traverse-${version}.tar.bz2";
9+ sha256 = "0knwnqsjwv7sa5wjb863ghabs7s269a73qwkmxpsbngjw9s0j2ih";
10+ };
11+12+ nativeBuildInputs = [ perl ];
13+14+ installPhase = ''
15+ mkdir -p $out/bin $out/share/man/man1
16+ cp nat-traverse $out/bin
17+ gzip -c nat-traverse.1 > $out/share/man/man1/nat-traverse.1.gz
18+ '';
19+20+ meta = with stdenv.lib; {
21+ description = "NAT gateway traversal utility";
22+ longDescription = ''
23+ nat-traverse establishes direct connections between nodes which are
24+ behind NAT gateways, i.e. hosts which do not have public IP addresses.
25+ This is done using an UDP NAT traversal technique. Additionally, it's
26+ possible to setup a small VPN by using pppd on top of nat-traverse.
27+28+ nat-traverse does not need an external server on the Internet, and it
29+ isn't necessary to reconfigure the involved NAT gateways, either.
30+ nat-traverse works out-of-the-box.
31+ '';
32+ homepage = https://www.speicherleck.de/iblech/nat-traverse/;
33+ license = licenses.gpl3Plus;
34+ platforms = platforms.all;
35+ maintainers = [ maintainers.iblech ];
36+ };
37+}