···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xml:id="chap-platform-nodes">
44+55+<title>Platform Notes</title>
66+77+<section xml:id="sec-darwin">
88+99+<title>Darwin (macOS)</title>
1010+<para>Some common issues when packaging software for darwin:</para>
1111+1212+<itemizedlist>
1313+1414+ <listitem>
1515+ <para>
1616+ The darwin <literal>stdenv</literal> uses clang instead of gcc.
1717+ When referring to the compiler <varname>$CC</varname> or <command>cc</command>
1818+ will work in both cases. Some builds hardcode gcc/g++ in their
1919+ build scripts, that can usually be fixed with using something
2020+ like <literal>makeFlags = [ "CC=cc" ];</literal> or by patching
2121+ the build scripts.
2222+ </para>
2323+2424+ <programlisting>
2525+ stdenv.mkDerivation {
2626+ name = "libfoo-1.2.3";
2727+ # ...
2828+ buildPhase = ''
2929+ $CC -o hello hello.c
3030+ '';
3131+ }
3232+ </programlisting>
3333+ </listitem>
3434+3535+ <listitem>
3636+ <para>
3737+ On darwin libraries are linked using absolute paths, libraries
3838+ are resolved by their <literal>install_name</literal> at link
3939+ time. Sometimes packages won't set this correctly causing the
4040+ library lookups to fail at runtime. This can be fixed by adding
4141+ extra linker flags or by running <command>install_name_tool -id</command>
4242+ during the <function>fixupPhase</function>.
4343+ </para>
4444+4545+ <programlisting>
4646+ stdenv.mkDerivation {
4747+ name = "libfoo-1.2.3";
4848+ # ...
4949+ makeFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/libfoo.dylib";
5050+ }
5151+ </programlisting>
5252+ </listitem>
5353+5454+ <listitem>
5555+ <para>
5656+ Some packages assume xcode is available and use <command>xcrun</command>
5757+ to resolve build tools like <command>clang</command>, etc.
5858+ This causes errors like <code>xcode-select: error: no developer tools were found at '/Applications/Xcode.app'</code>
5959+ while the build doesn't actually depend on xcode.
6060+ </para>
6161+6262+ <programlisting>
6363+ stdenv.mkDerivation {
6464+ name = "libfoo-1.2.3";
6565+ # ...
6666+ prePatch = ''
6767+ substituteInPlace Makefile \
6868+ --replace '/usr/bin/xcrun clang' clang
6969+ '';
7070+ }
7171+ </programlisting>
7272+7373+ <para>
7474+ The package <literal>xcbuild</literal> can be used to build projects
7575+ that really depend on Xcode, however projects that build some kind of
7676+ graphical interface won't work without using Xcode in an impure way.
7777+ </para>
7878+ </listitem>
7979+8080+</itemizedlist>
8181+</section>
8282+8383+</chapter>
···338338 # Type-check the remaining definitions, and merge them.
339339 mergedValue = foldl' (res: def:
340340 if type.check def.value then res
341341- else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.description}.")
341341+ else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'.")
342342 (type.merge loc defsFinal) defsFinal;
343343344344 isDefined = defsFinal != [];
-14
lib/systems/platforms.nix
···22rec {
33 pcBase = {
44 name = "pc";
55- uboot = null;
65 kernelHeadersBaseConfig = "defconfig";
76 kernelBaseConfig = "defconfig";
87 # Build whatever possible as a module, if not stated in the extra config.
···5049 kernelTarget = "uImage";
5150 # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
5251 #kernelDTB = true;
5353-5454- # XXX can be anything non-null, pkgs actually only cares if it is set or not
5555- uboot = "pogoplug4";
5652 };
57535854 sheevaplug = {
···162158 '';
163159 kernelMakeFlags = [ "LOADADDR=0x0200000" ];
164160 kernelTarget = "uImage";
165165- uboot = "sheevaplug";
166166- # Only for uboot = uboot :
167167- ubootConfig = "sheevaplug_config";
168161 kernelDTB = true; # Beyond 3.10
169162 gcc = {
170163 arch = "armv5te";
···251244 LATENCYTOP y
252245 '';
253246 kernelTarget = "zImage";
254254- uboot = null;
255247 gcc = {
256248 arch = "armv6";
257249 fpu = "vfp";
···342334 XEN? n
343335 '';
344336 kernelTarget = "zImage";
345345- uboot = null;
346337 };
347338348339 scaleway-c1 = armv7l-hf-multiplatform // {
···374365 kernelMakeFlags = [ "LOADADDR=0x10800000" ];
375366 kernelTarget = "uImage";
376367 kernelDTB = true;
377377- uboot = true; #XXX: any non-null value here is needed so that mkimage is present to build kernelTarget uImage
378368 gcc = {
379369 cpu = "cortex-a9";
380370 fpu = "neon";
···464454 FTRACE n
465455 '';
466456 kernelTarget = "vmlinux";
467467- uboot = null;
468457 gcc = {
469458 arch = "loongson2f";
470459 abi = "n32";
···477466 kernelAutoModules = false;
478467 kernelExtraConfig = ""; # TBD kernel config
479468 kernelTarget = "zImage";
480480- uboot = null;
481469 };
482470483471 armv7l-hf-multiplatform = {
···489477 kernelDTB = true;
490478 kernelAutoModules = true;
491479 kernelPreferBuiltin = true;
492492- uboot = null;
493480 kernelTarget = "zImage";
494481 kernelExtraConfig = ''
495482 # Fix broken sunxi-sid nvmem driver.
···552539 # which our initrd builder can't currently do easily.
553540 USB_XHCI_TEGRA m
554541 '';
555555- uboot = null;
556542 kernelTarget = "Image";
557543 gcc = {
558544 arch = "armv8-a";
+11-1
lib/tests/modules.sh
···6161checkConfigOutput "false" config.enable ./declare-enable.nix
6262checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix
63636464+# Check integer types.
6565+# unsigned
6666+checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix
6767+checkConfigError 'The option value .* in .* is not of type.*unsigned integer.*' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
6868+# positive
6969+checkConfigError 'The option value .* in .* is not of type.*positive integer.*' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
7070+# between
7171+checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix
7272+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
7373+6474# Check mkForce without submodules.
6575set -- config.enable ./declare-enable.nix ./define-enable.nix
6676checkConfigOutput "true" "$@"
···126136# Check coerced value.
127137checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
128138checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
129129-checkConfigError 'The option value .* in .* is not a string or integer.' config.value ./declare-coerced-value.nix ./define-value-list.nix
139139+checkConfigError 'The option value .* in .* is not.*string or signed integer.*' config.value ./declare-coerced-value.nix ./define-value-list.nix
130140131141cat <<EOF
132142====== module tests ======
···108108 };
109109110110 int = mkOptionType rec {
111111- name = "int";
112112- description = "integer";
113113- check = isInt;
114114- merge = mergeOneOption;
115115- };
111111+ name = "int";
112112+ description = "signed integer";
113113+ check = isInt;
114114+ merge = mergeOneOption;
115115+ };
116116+117117+ # Specialized subdomains of int
118118+ ints =
119119+ let
120120+ betweenDesc = lowest: highest:
121121+ "${toString lowest} and ${toString highest} (both inclusive)";
122122+ between = lowest: highest: assert lowest <= highest;
123123+ addCheck int (x: x >= lowest && x <= highest) // {
124124+ name = "intBetween";
125125+ description = "integer between ${betweenDesc lowest highest}";
126126+ };
127127+ ign = lowest: highest: name: docStart:
128128+ between lowest highest // {
129129+ inherit name;
130130+ description = docStart + "; between ${betweenDesc lowest highest}";
131131+ };
132132+ unsign = bit: range: ign 0 (range - 1)
133133+ "unsignedInt${toString bit}" "${toString bit} bit unsigned integer";
134134+ sign = bit: range: ign (0 - (range / 2)) (range / 2 - 1)
135135+ "signedInt${toString bit}" "${toString bit} bit signed integer";
136136+137137+ in rec {
138138+ /* An int with a fixed range.
139139+ *
140140+ * Example:
141141+ * (ints.between 0 100).check (-1)
142142+ * => false
143143+ * (ints.between 0 100).check (101)
144144+ * => false
145145+ * (ints.between 0 0).check 0
146146+ * => true
147147+ */
148148+ inherit between;
149149+150150+ unsigned = addCheck types.int (x: x >= 0) // {
151151+ name = "unsignedInt";
152152+ description = "unsigned integer, meaning >=0";
153153+ };
154154+ positive = addCheck types.int (x: x > 0) // {
155155+ name = "positiveInt";
156156+ description = "positive integer, meaning >0";
157157+ };
158158+ u8 = unsign 8 256;
159159+ u16 = unsign 16 65536;
160160+ # the biggest int a 64-bit Nix accepts is 2^63 - 1 (9223372036854775808), for a 32-bit Nix it is 2^31 - 1 (2147483647)
161161+ # the smallest int a 64-bit Nix accepts is -2^63 (-9223372036854775807), for a 32-bit Nix it is -2^31 (-2147483648)
162162+ # u32 = unsign 32 4294967296;
163163+ # u64 = unsign 64 18446744073709551616;
164164+165165+ s8 = sign 8 256;
166166+ s16 = sign 16 65536;
167167+ # s32 = sign 32 4294967296;
168168+ };
116169117170 str = mkOptionType {
118171 name = "str";
···172225 };
173226174227 # drop this in the future:
175175- list = builtins.trace "`types.list' is deprecated; use `types.listOf' instead" types.listOf;
228228+ list = builtins.trace "`types.list` is deprecated; use `types.listOf` instead" types.listOf;
176229177230 listOf = elemType: mkOptionType rec {
178231 name = "listOf";
···189242 ).optionalValue
190243 ) def.value
191244 else
192192- throw "The option value `${showOption loc}' in `${def.file}' is not a list.") defs)));
245245+ throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
193246 getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
194247 getSubModules = elemType.getSubModules;
195248 substSubModules = m: listOf (elemType.substSubModules m);
···260313 let nrNulls = count (def: def.value == null) defs; in
261314 if nrNulls == length defs then null
262315 else if nrNulls != 0 then
263263- throw "The option `${showOption loc}' is defined both null and not null, in ${showFiles (getFiles defs)}."
316316+ throw "The option `${showOption loc}` is defined both null and not null, in ${showFiles (getFiles defs)}."
264317 else elemType.merge loc defs;
265318 getSubOptions = elemType.getSubOptions;
266319 getSubModules = elemType.getSubModules;
+3-1
maintainers/scripts/update-python-libraries
···1818import re
1919import requests
2020import toolz
2121+from concurrent.futures import ThreadPoolExecutor as pool
21222223INDEX = "https://pypi.io/pypi"
2324"""url of PyPI"""
···235236236237 packages = map(os.path.abspath, args.package)
237238238238- count = list(map(_update, packages))
239239+ with pool() as p:
240240+ count = list(p.map(_update, packages))
239241240242 logging.info("{} package(s) updated".format(sum(count)))
241243
+65-6
nixos/doc/manual/development/option-types.xml
···2323 <literal>false</literal>.</para></listitem>
2424 </varlistentry>
2525 <varlistentry>
2626- <term><varname>types.int</varname></term>
2727- <listitem><para>An integer.</para></listitem>
2828- </varlistentry>
2929- <varlistentry>
3026 <term><varname>types.path</varname></term>
3127 <listitem><para>A filesystem path, defined as anything that when coerced to
3228 a string starts with a slash. Even if derivations can be considered as
···3935 </varlistentry>
4036</variablelist>
41374242-<para>String related types:</para>
3838+<para>Integer-related types:</para>
3939+4040+<variablelist>
4141+ <varlistentry>
4242+ <term><varname>types.int</varname></term>
4343+ <listitem><para>A signed integer.</para></listitem>
4444+ </varlistentry>
4545+ <varlistentry>
4646+ <term>
4747+ <varname>types.ints.{s8, s16, s32}</varname>
4848+ </term>
4949+ <listitem>
5050+ <para>Signed integers with a fixed length (8, 16 or 32 bits).
5151+ They go from
5252+ <inlineequation><mathphrase>−2<superscript>n</superscript>/2</mathphrase>
5353+ </inlineequation> to <inlineequation>
5454+ <mathphrase>2<superscript>n</superscript>/2−1</mathphrase>
5555+ </inlineequation>
5656+ respectively (e.g. <literal>−128</literal> to <literal>127</literal>
5757+ for 8 bits).
5858+ </para></listitem>
5959+ </varlistentry>
6060+ <varlistentry>
6161+ <term>
6262+ <varname>types.ints.unsigned</varname>
6363+ </term>
6464+ <listitem><para>An unsigned integer (that is >= 0).
6565+ </para></listitem>
6666+ </varlistentry>
6767+ <varlistentry>
6868+ <term>
6969+ <varname>types.ints.{u8, u16, u32}</varname>
7070+ </term>
7171+ <listitem>
7272+ <para>Unsigned integers with a fixed length (8, 16 or 32 bits).
7373+ They go from
7474+ <inlineequation><mathphrase>0</mathphrase></inlineequation> to <inlineequation>
7575+ <mathphrase>2<superscript>n</superscript>−1</mathphrase>
7676+ </inlineequation>
7777+ respectively (e.g. <literal>0</literal> to <literal>255</literal>
7878+ for 8 bits).
7979+ </para></listitem>
8080+ </varlistentry>
8181+ <varlistentry>
8282+ <term>
8383+ <varname>types.ints.positive</varname>
8484+ </term>
8585+ <listitem><para>A positive integer (that is > 0).
8686+ </para></listitem>
8787+ </varlistentry>
8888+</variablelist>
8989+9090+<para>String-related types:</para>
43914492<variablelist>
4593 <varlistentry>
···6811669117 <section><title>Value Types</title>
701187171- <para>Value types are type that take a value parameter.</para>
119119+ <para>Value types are types that take a value parameter.</para>
7212073121<variablelist>
74122 <varlistentry>
···83131 <listitem><para>A string with a custom separator
84132 <replaceable>sep</replaceable>, e.g. <literal>types.separatedString
85133 "|"</literal>.</para></listitem>
134134+ </varlistentry>
135135+ <varlistentry>
136136+ <term>
137137+ <varname>types.ints.between</varname>
138138+ <replaceable>lowest</replaceable>
139139+ <replaceable>highest</replaceable>
140140+ </term>
141141+ <listitem><para>An integer between <replaceable>lowest</replaceable>
142142+ and <replaceable>highest</replaceable> (both inclusive).
143143+ Useful for creating types like <literal>types.port</literal>.
144144+ </para></listitem>
86145 </varlistentry>
87146 <varlistentry>
88147 <term><varname>types.submodule</varname> <replaceable>o</replaceable></term>
-8
nixos/doc/manual/release-notes/rl-1803.xml
···9090 That means that old configuration is not overwritten by default when update to the znc options are made.
9191 </para>
9292 </listitem>
9393- <listitem>
9494- <para>
9595- The option <option>services.xserver.desktopManager.default</option> is now <literal>none</literal> by default.
9696- An assertion failure is thrown if WM's and DM's default are <literal>none</literal>.
9797- To explicitly run a plain X session without and DM or WM, the newly introduced option <option>services.xserver.plainX</option>
9898- must be set to true.
9999- </para>
100100- </listitem>
10193</itemizedlist>
1029410395</section>
···1414 else throw "ImageMagick is not supported on this platform.";
15151616 cfg = {
1717- version = "6.9.9-20";
1818- sha256 = "1pz8clmhnq26vdsp1j21czq3nfbvrmfdz30k7na7w4vh7wqxsrx1";
1717+ version = "6.9.9-21";
1818+ sha256 = "0241g3c207rawn61bz8rc5gz55k5mi2b0n3zlwa0jv9xczlkd6a9";
1919 patches = [];
2020 }
2121 # Freeze version on mingw so we don't need to port the patch too often.
···2233stdenv.mkDerivation rec {
44 name = "yices-${version}";
55- version = "2.5.3";
55+ version = "2.5.4";
6677 src = fetchurl {
88 url = "https://github.com/SRI-CSL/yices2/archive/Yices-${version}.tar.gz";
99 name = "${name}-src.tar.gz";
1010- sha256 = "0a3zzbvmgyiljzqn6xmc037gismm779p696jywk09j2pqbvp52ac";
1010+ sha256 = "1k8wmlddi3zv5kgg6xbch3a0s0xqsmsfc7y6z8zrgcyhswl36h7p";
1111 };
12121313- patchPhase = ''patchShebangs tests/regress/check.sh'';
1414-1515- configureFlags = [ "--with-static-gmp=${gmp-static.out}/lib/libgmp.a"
1616- "--with-static-gmp-include-dir=${gmp-static.dev}/include"
1717- "--enable-mcsat"
1818- ];
1913 nativeBuildInputs = [ autoreconfHook ];
2020- buildInputs = [ gmp-static gperf libpoly ];
1414+ buildInputs = [ gmp-static gperf libpoly ];
1515+ configureFlags =
1616+ [ "--with-static-gmp=${gmp-static.out}/lib/libgmp.a"
1717+ "--with-static-gmp-include-dir=${gmp-static.dev}/include"
1818+ "--enable-mcsat"
1919+ ];
21202221 enableParallelBuilding = true;
2322 doCheck = true;
2323+2424+ # Usual shenanigans
2525+ patchPhase = ''patchShebangs tests/regress/check.sh'';
24262527 # Includes a fix for the embedded soname being libyices.so.2.5, but
2626- # only installing the libyices.so.2.5.1 file.
2828+ # only installing the libyices.so.2.5.x file.
2729 installPhase = ''
2830 make install LDCONFIG=true
2929- (cd $out/lib && ln -s -f libyices.so.2.5.3 libyices.so.2.5)
3131+ (cd $out/lib && ln -s -f libyices.so.${version} libyices.so.2.5)
3032 '';
31333234 meta = with stdenv.lib; {
3335 description = "A high-performance theorem prover and SMT solver";
3436 homepage = "http://yices.csl.sri.com";
3537 license = licenses.gpl3;
3636- platforms = platforms.linux ++ platforms.darwin;
3838+ platforms = with platforms; linux ++ darwin;
3739 maintainers = [ maintainers.thoughtpolice ];
3840 };
3941}
+157-16
pkgs/applications/science/math/sage/default.nix
···11-{ stdenv, fetchurl, m4, perl, gfortran, texlive, ffmpeg, tk, gnused_422
22-, imagemagick, liblapack, python, openssl, libpng
11+# TODO
22+# - consider writing a script to convert spkgs to nix packages, similar to vim
33+# or cabal2nix. This would allow a more efficient and "cleaner" build, greater
44+# flexibility and the possibility to select which dependencies to add and which
55+# to remove. It would also allow to use system packages for some dependencies
66+# and recompile others (optimized for the system) without recompiling everything.
77+# - add optdeps:
88+# - imagemagick
99+# - texlive full for documentation
1010+# - ...
1111+# - further seperate build outputs. Also maybe run `make doc`.
1212+# Configure flags like --bindir and --libdir oculd also be used for that, see
1313+# ./configure --help`.
1414+1515+# Other resources:
1616+# - https://wiki.debian.org/DebianScience/Sage
1717+# - https://github.com/cschwan/sage-on-gentoo
1818+# - https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
1919+2020+{ stdenv
2121+, fetchurl
2222+, perl
2323+, gfortran
2424+, python
2525+, autoreconfHook
2626+, gettext
327, which
2828+, texlive
2929+, hevea
430}:
531632stdenv.mkDerivation rec {
77- name = "sage-6.8";
3333+ version = "8.0";
3434+ name = "sage-${version}";
835936 src = fetchurl {
1010- url = "http://old.files.sagemath.org/src-old/${name}.tar.gz";
1111- sha256 = "102mrzzi215g1xn5zgcv501x9sghwg758jagx2jixvg1rj2jijj9";
3737+ # Note that the source is *not* fetched from github, since that doesn't
3838+ # the upstream folder with all the source tarballs of the spkgs.
3939+ # If those are not present they are fetched at build time, which breaks
4040+ # when building in a sandbox (and probably only works if you install the
4141+ # latest sage version).
4242+ urls = [
4343+ "http://mirrors.mit.edu/sage/src/sage-${version}.tar.gz"
4444+ "ftp://ftp.fu-berlin.de/unix/misc/sage/src/sage-${version}.tar.gz"
4545+ "http://sagemath.polytechnic.edu.na/src/sage-${version}.tar.gz"
4646+ "ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/src/sage-${version}.tar.gz"
4747+ "http://sagemath.mirror.ac.za/src/sage-${version}.tar.gz"
4848+ "http://ftp.leg.uct.ac.za/pub/packages/sage/src/sage-${version}.tar.gz"
4949+ "http://mirror.ufs.ac.za/sagemath/src/sage-${version}.tar.gz"
5050+ "http://mirrors-usa.go-parts.com/sage/sagemath/src/sage-${version}.tar.gz"
5151+ "http://www.cecm.sfu.ca/sage/src/sage-${version}.tar.gz"
5252+ "http://files.sagemath.org/src/sage-${version}.tar.gz"
5353+ "http://mirrors.xmission.com/sage/src/sage-${version}.tar.gz"
5454+ "http://sagemath.c3sl.ufpr.br/src/sage-${version}.tar.gz"
5555+ "http://linorg.usp.br/sage/src/sage-${version}.tar.gz"
5656+ "http://mirror.hust.edu.cn/sagemath/src/sage-${version}.tar.gz"
5757+ "http://ftp.iitm.ac.in/sage/src/sage-${version}.tar.gz"
5858+ "http://ftp.kaist.ac.kr/sage/src/sage-${version}.tar.gz"
5959+ "http://ftp.riken.jp/sagemath/src/sage-${version}.tar.gz"
6060+ "http://mirrors.tuna.tsinghua.edu.cn/sagemath/src/sage-${version}.tar.gz"
6161+ "http://mirrors.ustc.edu.cn/sagemath/src/sage-${version}.tar.gz"
6262+ "http://ftp.tsukuba.wide.ad.jp/software/sage/src/sage-${version}.tar.gz"
6363+ "http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/src/sage-${version}.tar.gz"
6464+ "http://mirror.yandex.ru/mirrors/sage.math.washington.edu/src/sage-${version}.tar.gz"
6565+ "http://mirror.aarnet.edu.au/pub/sage/src/sage-${version}.tar.gz"
6666+ "http://sage.mirror.garr.it/mirrors/sage/src/sage-${version}.tar.gz"
6767+ "http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-${version}.tar.gz"
6868+ "http://mirror.switch.ch/mirror/sagemath/src/sage-${version}.tar.gz"
6969+ "https://mirrors.up.pt/pub/sage/src/sage-${version}.tar.gz"
7070+ "http://www-ftp.lip6.fr/pub/math/sagemath/src/sage-${version}.tar.gz"
7171+ "http://ftp.ntua.gr/pub/sagemath/src/sage-${version}.tar.gz"
7272+ ];
7373+ sha256 = "1a9rhb8jby6fdqa2s7n2fl9jwqqlsl7qz7dbpbwvg6jwlrvni7fg";
7474+ };
7575+7676+ postPatch = ''
7777+ substituteAllInPlace src/bin/sage-env
7878+ '';
7979+8080+ installPhase = ''
8181+ # Sage installs during first `make`, `make install` is no-op and just takes time.
8282+ '';
12831313- };
8484+ outputs = [ "out" "doc" ];
14851515- buildInputs = [ m4 perl gfortran texlive.combined.scheme-basic ffmpeg gnused_422 tk imagemagick liblapack
1616- python openssl libpng which ];
8686+ buildInputs = [
8787+ perl # needed for the build
8888+ python # needed for the build
8989+ gfortran # needed to build giac
9090+ autoreconfHook # needed to configure sage with prefix
9191+ gettext # needed to build the singular spkg
9292+ hevea # needed to build the docs of the giac spkg
9393+ which # needed in configure of mpir
9494+ # needed to build the docs of the giac spkg
9595+ (texlive.combine { inherit (texlive)
9696+ scheme-basic
9797+ collection-pstricks # needed by giac
9898+ times # font needed by giac
9999+ stmaryrd # needed by giac
100100+ babel-greek # optional for giac, otherwise throws a bunch of latex command not founds
101101+ ;
102102+ })
103103+ ];
171041818- patches = [ ./spkg-singular.patch ./spkg-python.patch ./spkg-git.patch ];
105105+ patches = [
106106+ # fix usages of /bin/rm
107107+ ./spkg-singular.patch
108108+ # help python find the crypt library
109109+ ./spkg-python2.patch
110110+ ./spkg-python3.patch
111111+ # fix usages of /usr/bin/perl
112112+ ./spkg-git.patch
113113+ # fix usages of /bin/cp and add necessary argument to function call
114114+ ./spkg-giac.patch
115115+ # environment
116116+ ./env.patch
117117+ ];
1911820119 enableParallelBuilding = true;
211202222- hardeningDisable = [ "format" ];
121121+ hardeningDisable = [
122122+ "format" # needed to build palp, for lines like `printf(ctime(&_NFL->TIME))`
123123+ # TODO could be patched with `sed s|printf(ctime(\(.*\)))|%s... or fixed upstream
124124+ ];
2312524126 preConfigure = ''
25127 export SAGE_NUM_THREADS=$NIX_BUILD_CORES
26128 export SAGE_ATLAS_ARCH=fast
2727- mkdir -p $out/sageHome
2828- export HOME=$out/sageHome
2929- export CPPFLAGS="-P"
129129+130130+ export HOME=$out/sage-home
131131+ mkdir -p $out/sage-home
132132+133133+ mkdir -p "$out"
134134+135135+ # we need to keep the source around
136136+ dir="$PWD"
137137+ cd ..
138138+ mv "$dir" "$out/sage-root"
139139+140140+ cd "$out/sage-root" # build in target dir, since `make` is also `make install`
30141 '';
311423232- preBuild = "patchShebangs build";
143143+ # for reference: http://doc.sagemath.org/html/en/installation/source.html
144144+ preBuild = ''
145145+ # TODO do this conditionally
146146+ export SAGE_SPKG_INSTALL_DOCS='no'
147147+ patchShebangs build
148148+ '';
149149+150150+ postBuild = ''
151151+ rm -r "$out/sage-root/upstream" # don't keep the sources of all the spkgs
152152+ rm -r "$out/sage-root/src/build"
153153+ rm -rf "$out/sage-root/src/.git"
154154+ rm -r "$out/sage-root/logs"
155155+ # Fix dependency cycle between out and doc
156156+ rm -f "$out/sage-root/config.status"
157157+ rm -f "$out/sage-root/build/make/Makefile-auto"
158158+ rm -f "$out/sage-home/.sage/gap/libgap-workspace-"*
159159+ '';
160160+161161+ # TODO there are some doctest failures, which seem harmless.
162162+ # We should figure out a way to fix the failures or ignore only those tests.
163163+ doCheck = false;
331643434- installPhase = ''DESTDIR=$out make install'';
165165+ checkTarget = "ptestalllong"; # all long tests in parallell
166166+ preCheck = ''
167167+ export SAGE_TIMEOUT=0 # no timeout
168168+ export SAGE_TIMEOUT_LONG=0 # no timeout
169169+ '';
3517036171 meta = {
37172 homepage = http://www.sagemath.org;
38173 description = "A free open source mathematics software system";
174174+ # taken from the homepage
175175+ longDescription = ''
176176+ 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.
177177+ Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.
178178+ '';
39179 license = stdenv.lib.licenses.gpl2Plus;
4040- broken = true;
180180+ platforms = stdenv.lib.platforms.linux;
181181+ maintainers = with stdenv.lib.maintainers; [ timokau ];
41182 };
42183}
+22
pkgs/applications/science/math/sage/env.patch
···11+diff --git a/src/bin/sage-env b/src/bin/sage-env
22+index ead308f861..ed8db9f9b7 100644
33+--- a/src/bin/sage-env
44++++ b/src/bin/sage-env
55+@@ -111,6 +111,8 @@ resolvelinks() {
66+ }
77+88+99++SAGE_ROOT="@out@/sage-root"
1010++
1111+ # New value for SAGE_ROOT: either SAGE_ROOT (if given)
1212+ # or a guessed value based on pwd.
1313+ if [ -n "$SAGE_ROOT" ]; then
1414+@@ -185,6 +187,8 @@ fi
1515+ export SAGE_ENV_SOURCED=$SAGE_ENV_VERSION
1616+1717+ export SAGE_ROOT="$NEW_SAGE_ROOT"
1818++export SAGE_LOCAL='@out@/'
1919++export PYTHONPATH="@out@/lib/python2.7/site-packages:$PYTHONPATH"
2020+2121+2222+ # sage-env must know where the Sage's script files are.
···11+#! /usr/bin/env nix-shell
22+#! nix-shell -i bash -p curl go-pup
33+44+# Fetches a list of all available source mirrors from the sage homepage.
55+# Note that the list is sorted by country, but fetchurl doesn't offer an option
66+# to customize mirror preference.
77+88+curl -s http://www.sagemath.org/download-source.html \
99+ | pup 'table#mirror' \
1010+ | pup 'a attr{href}' \
1111+ | sed -e 's/index\.html/sage-${version}.tar.gz/'
···11+source $stdenv/setup
22+33+# Curl flags to handle redirects, not use EPSV, handle cookies for
44+# servers to need them during redirects, and work on SSL without a
55+# certificate (this isn't a security problem because we check the
66+# cryptographic hash of the output anyway).
77+88+set -o noglob
99+1010+curl="curl \
1111+ --location \
1212+ --max-redirs 20 \
1313+ --retry 2 \
1414+ --disable-epsv \
1515+ --cookie-jar cookies \
1616+ --insecure \
1717+ --speed-time 5 \
1818+ -# \
1919+ --fail \
2020+ $curlOpts \
2121+ $NIX_CURL_FLAGS"
2222+2323+finish() {
2424+ runHook postFetch
2525+ set +o noglob
2626+ exit 0
2727+}
2828+2929+ipfs_add() {
3030+ if curl --retry 0 --head --silent "localhost:5001" > /dev/null; then
3131+ echo "[0m[01;36m=IPFS=[0m add $ipfs"
3232+ tar --owner=root --group=root -cWf "source.tar" $(echo *)
3333+ res=$(curl -# -F "file=@source.tar" "localhost:5001/api/v0/tar/add" | sed 's/.*"Hash":"\(.*\)".*/\1/')
3434+ if [ $ipfs != $res ]; then
3535+ echo "\`ipfs tar add' results in $res when $ipfs is expected"
3636+ exit 1
3737+ fi
3838+ rm "source.tar"
3939+ fi
4040+}
4141+4242+echo
4343+4444+mkdir download
4545+cd download
4646+4747+if curl --retry 0 --head --silent "localhost:5001" > /dev/null; then
4848+ curlexit=18;
4949+ echo "[0m[01;36m=IPFS=[0m get $ipfs"
5050+ # if we get error code 18, resume partial download
5151+ while [ $curlexit -eq 18 ]; do
5252+ # keep this inside an if statement, since on failure it doesn't abort the script
5353+ if $curl -C - "http://localhost:5001/api/v0/tar/cat?arg=$ipfs" --output "$ipfs.tar"; then
5454+ unpackFile "$ipfs.tar"
5555+ rm "$ipfs.tar"
5656+ set +o noglob
5757+ mv $(echo *) "$out"
5858+ finish
5959+ else
6060+ curlexit=$?;
6161+ fi
6262+ done
6363+fi
6464+6565+if test -n "$url"; then
6666+ curlexit=18;
6767+ echo "Downloading $url"
6868+ while [ $curlexit -eq 18 ]; do
6969+ # keep this inside an if statement, since on failure it doesn't abort the script
7070+ if $curl "$url" -O; then
7171+ set +o noglob
7272+ tmpfile=$(echo *)
7373+ unpackFile $tmpfile
7474+ rm $tmpfile
7575+ ipfs_add
7676+ mv $(echo *) "$out"
7777+ finish
7878+ else
7979+ curlexit=$?;
8080+ fi
8181+ done
8282+fi
8383+8484+echo "[01;31merror:[0m cannot download $ipfs from ipfs or the given url"
8585+echo
8686+set +o noglob
8787+exit 1
+52
pkgs/build-support/fetchipfs/default.nix
···11+{ stdenv
22+, curl
33+}:
44+55+{ ipfs
66+, url ? ""
77+, curlOpts ? ""
88+, outputHash ? ""
99+, outputHashAlgo ? ""
1010+, md5 ? ""
1111+, sha1 ? ""
1212+, sha256 ? ""
1313+, sha512 ? ""
1414+, meta ? {}
1515+, port ? "8080"
1616+, postFetch ? ""
1717+}:
1818+1919+assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0;
2020+2121+let
2222+2323+ hasHash = (outputHash != "" && outputHashAlgo != "")
2424+ || md5 != "" || sha1 != "" || sha256 != "" || sha512 != "";
2525+2626+in
2727+2828+if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" else stdenv.mkDerivation {
2929+ name = ipfs;
3030+ builder = ./builder.sh;
3131+ buildInputs = [ curl ];
3232+3333+ # New-style output content requirements.
3434+ outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
3535+ if sha512 != "" then "sha512" else if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
3636+ outputHash = if outputHash != "" then outputHash else
3737+ if sha512 != "" then sha512 else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
3838+3939+ outputHashMode = "recursive";
4040+4141+ inherit curlOpts
4242+ postFetch
4343+ ipfs
4444+ url
4545+ port;
4646+4747+ # Doing the download on a remote machine just duplicates network
4848+ # traffic, so don't do that.
4949+ preferLocalBuild = true;
5050+5151+ inherit meta;
5252+}
···11-{ stdenv, fetchurl, sbcl }:
11+{ stdenv, fetchFromGitHub,
22+ # perl, which, nettools,
33+ sbcl }:
2433-stdenv.mkDerivation rec {
55+let hashes = {
66+ "7.4" = "04jb789nks9llwysxz1zw9pq1dh0j39b5fcmivcc4bq9v9cga2l1";
77+};
88+in stdenv.mkDerivation rec {
49 name = "acl2-${version}";
55- version = "v6-5";
1010+ version = "7.4";
61177- src = fetchurl {
88- url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
99- sha256 = "19kfclgpdyms016s06pjf3icj3mx9jlcj8vfgpbx2ac4ls0ir36g";
1010- name = "acl2-${version}.tar.gz";
1212+ src = fetchFromGitHub {
1313+ owner = "acl2-devel";
1414+ repo = "acl2-devel";
1515+ rev = "${version}";
1616+ sha256 = hashes."${version}";
1117 };
12181313- buildInputs = [ sbcl ];
1919+ buildInputs = [ sbcl
2020+ # which perl nettools
2121+ ];
2222+2323+ enableParallelBuilding = true;
14241525 phases = "unpackPhase installPhase";
1626···18281929 installPhase = ''
2030 mkdir -p $out/share/${installSuffix}
3131+ mkdir -p $out/bin
2132 cp -R . $out/share/${installSuffix}
2233 cd $out/share/${installSuffix}
2323- make 'LISP=${sbcl}/bin/sbcl --dynamic-space-size 2000'
2424- make 'LISP=${sbcl}/bin/sbcl --dynamic-space-size 2000' regression
2525- make LISP=${sbcl}/bin/sbcl TAGS
2626- mkdir -p $out/bin
3434+3535+ # make ACL2 image
3636+ make LISP=${sbcl}/bin/sbcl
3737+3838+ # The community books don't build properly under Nix yet.
3939+ rm -rf books
4040+ #make ACL2=$out/share/saved_acl2 USE_QUICKLISP=1 regression-everything
4141+2742 cp saved_acl2 $out/bin/acl2
2843 '';
29443045 meta = {
3146 description = "An interpreter and a prover for a Lisp dialect";
3232- maintainers = with stdenv.lib.maintainers; [ raskin ];
4747+ longDescription = ''
4848+ ACL2 is a logic and programming language in which you can model
4949+ computer systems, together with a tool to help you prove
5050+ properties of those models. "ACL2" denotes "A Computational
5151+ Logic for Applicative Common Lisp".
5252+5353+ ACL2 is part of the Boyer-Moore family of provers, for which its
5454+ authors have received the 2005 ACM Software System Award.
5555+5656+ NOTE: In nixpkgs, the community books that usually ship with
5757+ ACL2 have been removed because it is not currently possible to
5858+ build them with Nix.
5959+ '';
6060+ homepage = http://www.cs.utexas.edu/users/moore/acl2/;
6161+ downloadPage = https://github.com/acl2-devel/acl2-devel/releases;
6262+ # There are a bunch of licenses in the community books, but since
6363+ # they currently get deleted during the build, we don't mention
6464+ # their licenses here. ACL2 proper is released under a BSD
6565+ # 3-clause license.
6666+ #license = with stdenv.lib.licenses;
6767+ #[ free bsd3 mit gpl2 llgpl21 cc0 publicDomain ];
6868+ license = stdenv.lib.licenses.bsd3;
6969+ maintainers = with stdenv.lib.maintainers; [ kini raskin ];
3370 platforms = stdenv.lib.platforms.linux;
3471 };
3572}
···11+{ stdenv, fetchurl, autoconf213, pkgconfig, perl, python2, zip, which, readline, icu, zlib, nspr }:
22+33+stdenv.mkDerivation rec {
44+ version = "52.2.1gnome1";
55+ name = "spidermonkey-${version}";
66+77+ # the release notes point to some guys home directory, see
88+ # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38
99+ # probably it would be more ideal to pull a particular tag/revision
1010+ # from the mercurial repo
1111+ src = fetchurl {
1212+ url = "mirror://gnome/teams/releng/tarballs-needing-help/mozjs/mozjs-${version}.tar.gz";
1313+ sha256 = "1bxhz724s1ch1c0kdlzlg9ylhg1mk8kbhdgfkax53fyvn51pjs9i";
1414+ };
1515+1616+ buildInputs = [ readline icu zlib nspr ];
1717+ nativeBuildInputs = [ autoconf213 pkgconfig perl which python2 zip ];
1818+1919+ postUnpack = "sourceRoot=\${sourceRoot}/js/src";
2020+2121+ preConfigure = ''
2222+ export CXXFLAGS="-fpermissive"
2323+ export LIBXUL_DIST=$out
2424+ export PYTHON="${python2.interpreter}"
2525+ '';
2626+2727+ configureFlags = [
2828+ "--enable-threadsafe"
2929+ "--with-system-nspr"
3030+ "--with-system-zlib"
3131+ "--with-system-icu"
3232+ "--with-intl-api"
3333+ "--enable-readline"
3434+3535+ # enabling these because they're wanted by 0ad. They may or may
3636+ # not be good defaults for other uses.
3737+ "--enable-gcgenerational"
3838+ "--enable-shared-js"
3939+ ];
4040+4141+ # This addresses some build system bug. It's quite likely to be safe
4242+ # to re-enable parallel builds if the source revision changes.
4343+ enableParallelBuilding = true;
4444+4545+ postFixup = ''
4646+ # The headers are symlinks to a directory that doesn't get put
4747+ # into $out, so they end up broken. Fix that by just resolving the
4848+ # symlinks.
4949+ for i in $(find $out -type l); do
5050+ cp --remove-destination "$(readlink "$i")" "$i";
5151+ done
5252+ '';
5353+5454+ meta = with stdenv.lib; {
5555+ description = "Mozilla's JavaScript engine written in C/C++";
5656+ homepage = https://developer.mozilla.org/en/SpiderMonkey;
5757+ # TODO: MPL/GPL/LGPL tri-license.
5858+5959+ maintainers = [ maintainers.abbradar ];
6060+ platforms = platforms.linux;
6161+ };
6262+}
···1717 inherit (stdenv.lib) optional optionalString;
1818in
1919stdenv.mkDerivation rec {
2020- name = "gst-plugins-bad-1.10.4";
2020+ name = "gst-plugins-bad-1.12.2";
21212222 meta = with stdenv.lib; {
2323 description = "Gstreamer Bad Plugins";
2424- homepage = "http://gstreamer.freedesktop.org";
2424+ homepage = "https://gstreamer.freedesktop.org";
2525 longDescription = ''
2626 a set of plug-ins that aren't up to par compared to the
2727 rest. They might be close to being good quality, but they're missing
···34343535 src = fetchurl {
3636 url = "${meta.homepage}/src/gst-plugins-bad/${name}.tar.xz";
3737- sha256 = "0rk9rlzf2b0hjw5hwbadz53yh4ls7vm3w3cshsa3n8isdd8axp93";
3737+ sha256 = "0dwyq03g2m0p16dwx8q5qvjn5x9ia72h21sf87mp97gmwkfpwb4w";
3838 };
39394040 outputs = [ "out" "dev" ];
···7788 meta = with stdenv.lib; {
99 description = "Gstreamer Non-Linear Multimedia Editing Plugins";
1010- homepage = "http://gstreamer.freedesktop.org";
1010+ homepage = "https://gstreamer.freedesktop.org";
1111 longDescription = ''
1212 Gnonlin is a library built on top of GStreamer which provides
1313 support for writing non-linear audio and video editing
···66# no introspection by default, it's too big
7788stdenv.mkDerivation rec {
99- name = "librsvg-2.40.17";
99+ name = "librsvg-2.40.19";
10101111 src = fetchurl {
1212- url = "mirror://gnome/sources/librsvg/2.40/${name}.tar.xz";
1313- sha256 = "1k39gyf7f5m9x0jvpcxvfcqswdb04xhm1lbwbjabn1f4xk5wbxp6";
1212+ url = "mirror://gnome/sources/librsvg/2.40/librsvg-2.40.18.tar.xz";
1313+ sha256 = "0k2nbd4g31qinkdfd8r5c5ih2ixl85fbkgkqqh9747lwr24c9j5z";
1414 };
15151616 NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
+1-1
pkgs/development/libraries/libtiff/default.nix
···29293030 enableParallelBuilding = true;
31313232- doCheck = true;
3232+ doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
33333434 meta = with stdenv.lib; {
3535 description = "Library and utilities for working with the TIFF image file format";
···1414buildPythonPackage rec {
1515 pname = "Cython";
1616 name = "${pname}-${version}";
1717- version = "0.27.2";
1717+ version = "0.27.3";
18181919 src = fetchPypi {
2020 inherit pname version;
2121- sha256 = "265dacf64ed8c0819f4be9355c39beaa13dc2ad2f85237a2c4e478f5ce644b48";
2121+ sha256 = "6a00512de1f2e3ce66ba35c5420babaef1fe2d9c43a8faab4080b0dbcc26bc64";
2222 };
23232424 # With Python 2.x on i686-linux or 32-bit ARM this test fails because the
···1212 name = "${pname}-${version}";
13131414 src = fetchPypi {
1515- inherit pname version;
1515+ inherit pname;
1616+ # FIXME when updating to the next version: The tarball on pypi is called
1717+ # "meliae-0.4.0.tar.gz" while the version within that tarball is
1818+ # "0.4.0.final.0".
1919+ version = "0.4.0";
1620 sha256 = "976519ab02aaa6a8fb5f596dc4dd9f64fc9510b00e054979566e51c9be7cec99";
1721 };
1822
···7979Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install
8080this into your user profile.
81818282+Alternatively, you can create a self-contained `shell.nix` without the need to
8383+modify any configuration files:
8484+8585+```nix
8686+{ pkgs ? import <nixpkgs> {}
8787+}:
8888+8989+pkgs.rstudioWrapper.override {
9090+ packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ];
9191+}
9292+9393+```
9494+9595+Executing `nix-shell` will then drop you into an environment equivalent to the
9696+one above. If you need additional packages just add them to the list and
9797+re-enter the shell.
9898+8299## Updating the package set
8310084101```bash
···11+#!/bin/sh
22+33+###########################################################################
44+# /usr/bin/service
55+#
66+# A convenient wrapper for the /etc/init.d init scripts.
77+#
88+# This script is a modified version of the /sbin/service utility found on
99+# Red Hat/Fedora systems (licensed GPLv2+).
1010+#
1111+# Copyright (C) 2006 Red Hat, Inc. All rights reserved.
1212+# Copyright (C) 2008 Canonical Ltd.
1313+# * August 2008 - Dustin Kirkland <kirkland@canonical.com>
1414+# Copyright (C) 2013 Michael Stapelberg <stapelberg@debian.org>
1515+#
1616+# This program is free software; you can redistribute it and/or modify
1717+# it under the terms of the GNU General Public License as published by
1818+# the Free Software Foundation; either version 2 of the License, or
1919+# (at your option) any later version.
2020+#
2121+# This program is distributed in the hope that it will be useful,
2222+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2323+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2424+# GNU General Public License for more details.
2525+#
2626+# You should have received a copy of the GNU General Public License
2727+# along with this program; if not, write to the Free Software
2828+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2929+#
3030+# On Debian GNU/Linux systems, the complete text of the GNU General
3131+# Public License can be found in `/usr/share/common-licenses/GPL-2'.
3232+###########################################################################
3333+3434+3535+is_ignored_file() {
3636+ case "$1" in
3737+ skeleton | README | *.dpkg-dist | *.dpkg-old | rc | rcS | single | reboot | bootclean.sh)
3838+ return 0
3939+ ;;
4040+ esac
4141+ return 1
4242+}
4343+4444+VERSION=$(@coreutils@/bin/basename $0)" ver. 0.91-ubuntu1"
4545+USAGE="Usage: "$(@coreutils@/bin/basename $0)" < option > | --status-all | \
4646+[ service_name [ command | --full-restart ] ]"
4747+SERVICE=
4848+ACTION=
4949+SERVICEDIR="/etc/init.d"
5050+OPTIONS=
5151+is_systemd=
5252+5353+5454+if [ $# -eq 0 ]; then
5555+ echo "${USAGE}" >&2
5656+ exit 1
5757+fi
5858+5959+if [ -d /run/systemd/system ]; then
6060+ is_systemd=1
6161+fi
6262+6363+cd /
6464+while [ $# -gt 0 ]; do
6565+ case "${1}" in
6666+ --help | -h | --h* )
6767+ echo "${USAGE}" >&2
6868+ exit 0
6969+ ;;
7070+ --version | -V )
7171+ echo "${VERSION}" >&2
7272+ exit 0
7373+ ;;
7474+ *)
7575+ if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
7676+ if [ -d "${SERVICEDIR}" ]; then
7777+ cd ${SERVICEDIR}
7878+ for SERVICE in * ; do
7979+ case "${SERVICE}" in
8080+ functions | halt | killall | single| linuxconf| kudzu)
8181+ ;;
8282+ *)
8383+ if ! is_ignored_file "${SERVICE}" \
8484+ && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
8585+ 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)
8686+ retval=$?
8787+ if echo "$out" | egrep -iq "usage:"; then
8888+ #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
8989+ echo " [ ? ] $SERVICE" 1>&2
9090+ continue
9191+ else
9292+ if [ "$retval" = "0" -a -n "$out" ]; then
9393+ #printf " %s %-60s %s\n" "[+]" "$SERVICE:" "running"
9494+ echo " [ + ] $SERVICE"
9595+ continue
9696+ else
9797+ #printf " %s %-60s %s\n" "[-]" "$SERVICE:" "NOT running"
9898+ echo " [ - ] $SERVICE"
9999+ continue
100100+ fi
101101+ fi
102102+ #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
103103+ fi
104104+ ;;
105105+ esac
106106+ done
107107+ else
108108+ systemctl $sctl_args list-units
109109+ fi
110110+ exit 0
111111+ elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
112112+ SERVICE="${1}"
113113+ # On systems using systemd, we just perform a normal restart:
114114+ # A restart with systemd is already a full restart.
115115+ if [ -n "$is_systemd" ]; then
116116+ ACTION="restart"
117117+ else
118118+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
119119+ 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
120120+ 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
121121+ exit $?
122122+ fi
123123+ fi
124124+ elif [ -z "${SERVICE}" ]; then
125125+ SERVICE="${1}"
126126+ elif [ -z "${ACTION}" ]; then
127127+ ACTION="${1}"
128128+ else
129129+ OPTIONS="${OPTIONS} ${1}"
130130+ fi
131131+ shift
132132+ ;;
133133+ esac
134134+done
135135+136136+# Operate against system upstart, not session
137137+unset UPSTART_SESSION
138138+if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
139139+ && initctl version 2>/dev/null | grep -q upstart \
140140+ && initctl status ${SERVICE} 2>/dev/null 1>/dev/null
141141+then
142142+ # Upstart configuration exists for this job and we're running on upstart
143143+ case "${ACTION}" in
144144+ start|stop|status|reload)
145145+ # Action is a valid upstart action
146146+ exec ${ACTION} ${SERVICE} ${OPTIONS}
147147+ ;;
148148+ restart|force-reload)
149149+ # Map restart to the usual sysvinit behavior.
150150+ # Map force-reload to restart as per Debian policy 9.3.2,
151151+ # since there is no way to know if "reload" is supported
152152+ stop ${SERVICE} ${OPTIONS} || :
153153+ exec start ${SERVICE} ${OPTIONS}
154154+ ;;
155155+ esac
156156+fi
157157+158158+159159+run_via_sysvinit() {
160160+ # Otherwise, use the traditional sysvinit
161161+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
162162+ 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}
163163+ else
164164+ echo "${SERVICE}: unrecognized service" >&2
165165+ exit 1
166166+ fi
167167+}
168168+169169+update_openrc_started_symlinks() {
170170+ # maintain the symlinks of /run/openrc/started so that
171171+ # rc-status works with the service command as well
172172+ if [ -d /run/openrc/started ] ; then
173173+ case "${ACTION}" in
174174+ start)
175175+ if [ ! -h /run/openrc/started/$SERVICE ] ; then
176176+ ln -s $SERVICEDIR/$SERVICE /run/openrc/started/$SERVICE || true
177177+ fi
178178+ ;;
179179+ stop)
180180+ rm /run/openrc/started/$SERVICE || true
181181+ ;;
182182+ esac
183183+ fi
184184+}
185185+186186+# When this machine is running systemd, standard service calls are turned into
187187+# systemctl calls.
188188+if [ -n "$is_systemd" ]
189189+then
190190+ UNIT="${SERVICE%.sh}.service"
191191+ # avoid deadlocks during bootup and shutdown from units/hooks
192192+ # which call "invoke-rc.d service reload" and similar, since
193193+ # the synchronous wait plus systemd's normal behaviour of
194194+ # transactionally processing all dependencies first easily
195195+ # causes dependency loops
196196+ if ! systemctl --quiet is-active multi-user.target; then
197197+ sctl_args="--job-mode=ignore-dependencies"
198198+ fi
199199+200200+ case "${ACTION}" in
201201+ restart|status)
202202+ exec systemctl $sctl_args ${ACTION} ${UNIT}
203203+ ;;
204204+ start|stop)
205205+ # Follow the principle of least surprise for SysV people:
206206+ # When running "service foo stop" and foo happens to be a service that
207207+ # has one or more .socket files, we also stop the .socket units.
208208+ # Users who need more control will use systemctl directly.
209209+ for unit in $(systemctl list-unit-files --full --type=socket 2>/dev/null | sed -ne 's/\.socket\s*[a-z]*\s*$/.socket/p'); do
210210+ if [ "$(systemctl -p Triggers show $unit)" = "Triggers=${UNIT}" ]; then
211211+ systemctl $sctl_args ${ACTION} $unit
212212+ fi
213213+ done
214214+ exec systemctl $sctl_args ${ACTION} ${UNIT}
215215+ ;;
216216+ reload)
217217+ _canreload="$(SYSTEMCTL -p CanReload show ${UNIT} 2>/dev/null)"
218218+ if [ "$_canreload" = "CanReload=no" ]; then
219219+ # The reload action falls back to the sysv init script just in case
220220+ # the systemd service file does not (yet) support reload for a
221221+ # specific service.
222222+ run_via_sysvinit
223223+ else
224224+ exec systemctl $sctl_args reload "${UNIT}"
225225+ fi
226226+ ;;
227227+ force-stop)
228228+ exec systemctl --signal=KILL kill "${UNIT}"
229229+ ;;
230230+ force-reload)
231231+ _canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)"
232232+ if [ "$_canreload" = "CanReload=no" ]; then
233233+ exec systemctl $sctl_args restart "${UNIT}"
234234+ else
235235+ exec systemctl $sctl_args reload "${UNIT}"
236236+ fi
237237+ ;;
238238+ *)
239239+ # We try to run non-standard actions by running
240240+ # the init script directly.
241241+ run_via_sysvinit
242242+ ;;
243243+ esac
244244+fi
245245+246246+update_openrc_started_symlinks
247247+run_via_sysvinit
···11+{ stdenv, fetchurl, libX11 }:
22+33+stdenv.mkDerivation rec {
44+ name = "xosview2-${version}";
55+ version = "2.2.2";
66+77+ src = fetchurl {
88+ url = "mirror://sourceforge/xosview/${name}.tar.gz";
99+ sha256 = "3502e119a5305ff2396f559340132910807351c7d4e375f13b5c338404990406";
1010+ };
1111+1212+ # The software failed to buid with this enabled; it seemed tests were not implemented
1313+ doCheck = false;
1414+1515+ buildInputs = [ libX11 ];
1616+1717+ meta = with stdenv.lib; {
1818+ description = "Lightweight program that gathers information from your operating system and displays it in graphical form";
1919+ longDescription = ''
2020+ xosview is a lightweight program that gathers information from your
2121+ operating system and displays it in graphical form. It attempts to show
2222+ you in a quick glance an overview of how your system resources are being
2323+ utilized.
2424+2525+ It can be configured to be nothing more than a small strip showing a
2626+ couple of parameters on a desktop task bar. Or it can display dozens of
2727+ meters and rolling graphical charts over your entire screen.
2828+2929+ Since xosview renders all graphics with core X11 drawing methods, you can
3030+ run it on one machine and display it on another. This works even if your
3131+ other host is an operating system not running an X server inside a
3232+ virtual machine running on a physically different host. If you can
3333+ connect to it on a network, then you can popup an xosview instance and
3434+ monitor what is going on.
3535+ '';
3636+ homepage = "http://xosview.sourceforge.net/index.html";
3737+ license = licenses.gpl1;
3838+ maintainers = [ maintainers.SeanZicari ];
3939+ platforms = platforms.all;
4040+ };
4141+}
···11+{ stdenv, fetchurl, perl }:
22+33+stdenv.mkDerivation rec {
44+ name = "nat-traverse-${version}";
55+ version = "0.7";
66+77+ src = fetchurl {
88+ url = "https://www.speicherleck.de/iblech/nat-traverse/nat-traverse-${version}.tar.bz2";
99+ sha256 = "0knwnqsjwv7sa5wjb863ghabs7s269a73qwkmxpsbngjw9s0j2ih";
1010+ };
1111+1212+ nativeBuildInputs = [ perl ];
1313+1414+ installPhase = ''
1515+ mkdir -p $out/bin $out/share/man/man1
1616+ cp nat-traverse $out/bin
1717+ gzip -c nat-traverse.1 > $out/share/man/man1/nat-traverse.1.gz
1818+ '';
1919+2020+ meta = with stdenv.lib; {
2121+ description = "NAT gateway traversal utility";
2222+ longDescription = ''
2323+ nat-traverse establishes direct connections between nodes which are
2424+ behind NAT gateways, i.e. hosts which do not have public IP addresses.
2525+ This is done using an UDP NAT traversal technique. Additionally, it's
2626+ possible to setup a small VPN by using pppd on top of nat-traverse.
2727+2828+ nat-traverse does not need an external server on the Internet, and it
2929+ isn't necessary to reconfigure the involved NAT gateways, either.
3030+ nat-traverse works out-of-the-box.
3131+ '';
3232+ homepage = https://www.speicherleck.de/iblech/nat-traverse/;
3333+ license = licenses.gpl3Plus;
3434+ platforms = platforms.all;
3535+ maintainers = [ maintainers.iblech ];
3636+ };
3737+}