···2323 config = parse.tripleFromSystem final.parsed;
2424 # Just a guess, based on `system`
2525 platform = platforms.selectBySystem final.system;
2626+ # Derived meta-data
2627 libc =
2727- /**/ if final.isDarwin then "libSystem"
2828- else if final.isMinGW then "msvcrt"
2929- else if final.isMusl then "musl"
3030- else if final.isLinux /* default */ then "glibc"
2828+ /**/ if final.isDarwin then "libSystem"
2929+ else if final.isMinGW then "msvcrt"
3030+ else if final.isMusl then "musl"
3131+ else if final.isAndroid then "bionic"
3232+ else if final.isLinux /* default */ then "glibc"
3133 # TODO(@Ericson2314) think more about other operating systems
3232- else "native/impure";
3434+ else "native/impure";
3335 extensions = {
3436 sharedLibrary =
3537 /**/ if final.isDarwin then ".dylib"
···3941 /**/ if final.isWindows then ".exe"
4042 else "";
4143 };
4444+ # Misc boolean options
4545+ useAndroidPrebuilt = false;
4246 } // mapAttrs (n: v: v final.parsed) inspect.predicates
4347 // args;
4444- in final;
4848+ in assert final.useAndroidPrebuilt -> final.isAndroid;
4949+ final;
4550}
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+ cfg = config.programs.digitalbitbox;
77+in
88+99+{
1010+ options.programs.digitalbitbox = {
1111+ enable = mkOption {
1212+ type = types.bool;
1313+ default = false;
1414+ description = ''
1515+ Installs the Digital Bitbox application and enables the complementary hardware module.
1616+ '';
1717+ };
1818+1919+ package = mkOption {
2020+ type = types.package;
2121+ default = pkgs.digitalbitbox;
2222+ defaultText = "pkgs.digitalbitbox";
2323+ description = "The Digital Bitbox package to use. This can be used to install a package with udev rules that differ from the defaults.";
2424+ };
2525+ };
2626+2727+ config = mkIf cfg.enable {
2828+ environment.systemPackages = [ cfg.package ];
2929+ hardware.digitalbitbox = {
3030+ enable = true;
3131+ package = cfg.package;
3232+ };
3333+ };
3434+3535+ meta = {
3636+ doc = ./doc.xml;
3737+ maintainers = with stdenv.lib.maintainers; [ vidbina ];
3838+ };
3939+}
+85
nixos/modules/programs/digitalbitbox/doc.xml
···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="module-programs-digitalbitbox">
66+77+ <title>Digital Bitbox</title>
88+99+ <para>
1010+ Digital Bitbox is a hardware wallet and second-factor authenticator.
1111+ </para>
1212+1313+ <para>
1414+ The <literal>digitalbitbox</literal> programs module may be
1515+ installed by setting <literal>programs.digitalbitbox</literal>
1616+ to <literal>true</literal> in a manner similar to
1717+1818+ <programlisting>
1919+ programs.digitalbitbox.enable = true;
2020+ </programlisting>
2121+2222+ and bundles the <literal>digitalbitbox</literal> package (see <xref
2323+ linkend="sec-digitalbitbox-package" />), which contains the
2424+ <literal>dbb-app</literal> and <literal>dbb-cli</literal> binaries,
2525+ along with the hardware module (see <xref
2626+ linkend="sec-digitalbitbox-hardware-module" />) which sets up the
2727+ necessary udev rules to access the device.
2828+ </para>
2929+3030+ <para>
3131+ Enabling the digitalbitbox module is pretty much the easiest way to
3232+ get a Digital Bitbox device working on your system.
3333+ </para>
3434+3535+ <para>
3636+ For more information, see
3737+ <link xlink:href="https://digitalbitbox.com/start_linux" />.
3838+ </para>
3939+4040+ <section xml:id="sec-digitalbitbox-package">
4141+ <title>Package</title>
4242+4343+ <para>
4444+ The binaries, <literal>dbb-app</literal> (a GUI tool) and
4545+ <literal>dbb-cli</literal> (a CLI tool), are available through the
4646+ <literal>digitalbitbox</literal> package which could be installed
4747+ as follows:
4848+4949+ <programlisting>
5050+ environment.systemPackages = [
5151+ pkgs.digitalbitbox
5252+ ];
5353+ </programlisting>
5454+ </para>
5555+ </section>
5656+5757+5858+ <section xml:id="sec-digitalbitbox-hardware-module">
5959+ <title>Hardware</title>
6060+6161+ <para>
6262+ The digitalbitbox hardware package enables the udev rules for
6363+ Digital Bitbox devices and may be installed as follows:
6464+6565+ <programlisting>
6666+ hardware.digitalbitbox.enable = true;
6767+ </programlisting>
6868+ </para>
6969+7070+ <para>
7171+ In order to alter the udev rules, one may provide different values for
7272+ the <literal>udevRule51</literal> and <literal>udevRule52</literal>
7373+ attributes by means of overriding as follows:
7474+7575+ <programlisting>
7676+ programs.digitalbitbox = {
7777+ enable = true;
7878+ package = pkgs.digitalbitbox.override {
7979+ udevRule51 = "something else";
8080+ };
8181+ };
8282+ </programlisting>
8383+ </para>
8484+ </section>
8585+</chapter>
···11+{ stdenv
22+, autoreconfHook
33+, curl
44+, fetchFromGitHub
55+, git
66+, libevent
77+, libtool
88+, libqrencode
99+, libudev
1010+, libusb
1111+, makeWrapper
1212+, pkgconfig
1313+, qtbase
1414+, qttools
1515+, qtwebsockets
1616+, qtmultimedia
1717+, udevRule51 ? ''
1818+, SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbb%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402"
1919+, ''
2020+, udevRule52 ? ''
2121+, KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbbf%n"
2222+, ''
2323+, writeText
2424+}:
2525+2626+# Enabling the digitalbitbox program
2727+#
2828+# programs.digitalbitbox.enable = true;
2929+#
3030+# will install the digitalbitbox package and enable the corresponding hardware
3131+# module and is by far the easiest way to get started with the Digital Bitbox on
3232+# NixOS.
3333+3434+# In case you install the package only, please be aware that you may need to
3535+# apply some udev rules to allow the application to identify and access your
3636+# wallet. In a nixos-configuration, one may accomplish this by enabling the
3737+# digitalbitbox hardware module
3838+#
3939+# hardware.digitalbitbox.enable = true;
4040+#
4141+# or by adding the digitalbitbox package to system.udev.packages
4242+#
4343+# system.udev.packages = [ pkgs.digitalbitbox ];
4444+4545+# See https://digitalbitbox.com/start_linux for more information.
4646+let
4747+ copyUdevRuleToOutput = name: rule:
4848+ "cp ${writeText name rule} $out/etc/udev/rules.d/${name}";
4949+in stdenv.mkDerivation rec {
5050+ name = "digitalbitbox-${version}";
5151+ version = "2.2.2";
5252+5353+ src = fetchFromGitHub {
5454+ owner = "digitalbitbox";
5555+ repo = "dbb-app";
5656+ rev = "v${version}";
5757+ sha256 = "1r77fvqrlaryzij5dfbnigzhvg1d12g96qb2gp8dy3xph1j0k3s1";
5858+ };
5959+6060+ nativeBuildInputs = with stdenv.lib; [
6161+ autoreconfHook
6262+ curl
6363+ git
6464+ makeWrapper
6565+ pkgconfig
6666+ qttools
6767+ ];
6868+6969+ buildInputs = with stdenv.lib; [
7070+ libevent
7171+ libtool
7272+ libudev
7373+ libusb
7474+ libqrencode
7575+7676+ qtbase
7777+ qtwebsockets
7878+ qtmultimedia
7979+ ];
8080+8181+ LUPDATE="${qttools.dev}/bin/lupdate";
8282+ LRELEASE="${qttools.dev}/bin/lrelease";
8383+ MOC="${qtbase.dev}/bin/moc";
8484+ QTDIR="${qtbase.dev}";
8585+ RCC="${qtbase.dev}/bin/rcc";
8686+ UIC="${qtbase.dev}/bin/uic";
8787+8888+ configureFlags = [
8989+ "--enable-libusb"
9090+ ];
9191+9292+ hardeningDisable = [
9393+ "format"
9494+ ];
9595+9696+ postInstall = ''
9797+ mkdir -p "$out/lib"
9898+ cp src/libbtc/.libs/*.so* $out/lib
9999+ cp src/libbtc/src/secp256k1/.libs/*.so* $out/lib
100100+ cp src/hidapi/libusb/.libs/*.so* $out/lib
101101+ cp src/univalue/.libs/*.so* $out/lib
102102+103103+ # [RPATH][patchelf] Avoid forbidden reference error
104104+ rm -rf $PWD
105105+106106+ wrapProgram "$out/bin/dbb-cli" --prefix LD_LIBRARY_PATH : "$out/lib"
107107+ wrapProgram "$out/bin/dbb-app" --prefix LD_LIBRARY_PATH : "$out/lib"
108108+109109+ # Provide udev rules as documented in https://digitalbitbox.com/start_linux
110110+ mkdir -p "$out/etc/udev/rules.d"
111111+ ${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51}
112112+ ${copyUdevRuleToOutput "52-hid-digitalbox.rules" udevRule52}
113113+ '';
114114+115115+ meta = with stdenv.lib; {
116116+ description = "A QT based application for the Digital Bitbox hardware wallet";
117117+ longDescription = ''
118118+ Digital Bitbox provides dbb-app, a GUI tool, and dbb-cli, a CLI tool, to manage Digital Bitbox devices.
119119+120120+ This package will only install the dbb-app and dbb-cli, however; in order for these applications to identify and access Digital Bitbox devices, one may want to enable the digitalbitbox hardware module by adding
121121+122122+ hardware.digitalbitbox.enable = true;
123123+124124+ to the configuration which is equivalent to adding this package to the udev.packages list.
125125+126126+127127+ The easiest way to use the digitalbitbox package in NixOS is by adding
128128+129129+ programs.digitalbitbox.enable = true;
130130+131131+ to the configuration which installs the package and enables the hardware module.
132132+ '';
133133+ homepage = "https://digitalbitbox.com/";
134134+ license = licenses.mit;
135135+ maintainers = with maintainers; [
136136+ vidbina
137137+ ];
138138+ platforms = platforms.linux;
139139+ };
140140+}
···6464 # but they are linked against GPL'd softwares
6565 # - so the resulting program will be GPL
6666 maintainers = [ maintainers.AndersonTorres ];
6767- platforms = platforms.linux;
6767+ platforms = [ "i686-linux" "x86_64-linux" ];
6868 };
6969}
···317317318318 # Platform-specific flags
319319 optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
320320- # Trick that should be taken out once we have a mips64el-linux not loongson2f
321321- optional (targetPlatform == hostPlatform && stdenv.system == "mips64el-linux") "--with-arch=loongson2f"
320320+ # Trick that should be taken out once we have a mipsel-linux not loongson2f
321321+ optional (targetPlatform == hostPlatform && stdenv.system == "mipsel-linux") "--with-arch=loongson2f"
322322 ;
323323324324 targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
+3-3
pkgs/development/compilers/gerbil/default.nix
···88stdenv.mkDerivation rec {
99 name = "gerbil-${version}";
10101111- version = "0.12-DEV-1404-g0a266db";
1111+ version = "0.12-RELEASE";
1212 src = fetchgit {
1313 url = "https://github.com/vyzo/gerbil.git";
1414- rev = "0a266db5e2e241272711bc150cc2607204bf2b78";
1515- sha256 = "1lvawqn8havfyxkkgfqffc213zq2pgm179l42yj49fy3fhpzia4m";
1414+ rev = "5618892d7939e1cb4ef5247912e0bc1ec99f6b52";
1515+ sha256 = "0b2valahf5k81r4sp6y12d44fb286p92s7k6dphij0kmvg0dp818";
1616 };
17171818 # Use makeStaticLibraries to enable creation of statically linked binaries
+206
pkgs/development/compilers/graalvm/default.nix
···11+{ stdenv, lib, fetchFromGitHub, fetchhg, fetchurl, mercurial, python27, zlib, makeWrapper, oraclejdk8 }:
22+33+let
44+ # pre-download some cache entries ('mx' will not be able to download under nixbld1)
55+ makeMxCache = list:
66+ stdenv.mkDerivation {
77+ name = "mx-cache";
88+ buildCommand = ''
99+ mkdir $out
1010+ ${lib.concatMapStrings ({url, name, sha1}: ''
1111+ ln -s ${fetchurl { inherit url sha1; }} $out/${name}
1212+ echo -n ${sha1} > $out/${name}.sha1
1313+ '') list}
1414+ '';
1515+ };
1616+1717+ jvmci8-mxcache = [
1818+ rec { sha1 = "66215826a684eb6866d4c14a5a4f9c344f1d1eef"; name = "JACOCOCORE_${sha1}.jar"; url = mirror://maven/org/jacoco/org.jacoco.core/0.7.9/org.jacoco.core-0.7.9.jar; }
1919+ rec { sha1 = "a365ee459836b2aa18028929923923d15f0c3af9"; name = "JACOCOCORE.sources_${sha1}.jar"; url = mirror://maven/org/jacoco/org.jacoco.core/0.7.9/org.jacoco.core-0.7.9-sources.jar; }
2020+ rec { sha1 = "8a7f78fdf2a4e58762890d8e896a9298c2980c10"; name = "JACOCOREPORT_${sha1}.jar"; url = mirror://maven/org/jacoco/org.jacoco.report/0.7.9/org.jacoco.report-0.7.9.jar; }
2121+ rec { sha1 = "e6703ef288523a8e63fa756d8adeaa70858d41b0"; name = "JACOCOREPORT.sources_${sha1}.jar"; url = mirror://maven/org/jacoco/org.jacoco.report/0.7.9/org.jacoco.report-0.7.9-sources.jar; }
2222+ rec { sha1 = "306816fb57cf94f108a43c95731b08934dcae15c"; name = "JOPTSIMPLE_4_6_${sha1}.jar"; url = mirror://maven/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.jar; }
2323+ rec { sha1 = "9cd14a61d7aa7d554f251ef285a6f2c65caf7b65"; name = "JOPTSIMPLE_4_6.sources_${sha1}.jar"; url = mirror://maven/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6-sources.jar; }
2424+ rec { sha1 = "b852fb028de645ad2852bbe998e084d253f450a5"; name = "JMH_GENERATOR_ANNPROCESS_1_18_${sha1}.jar"; url = mirror://maven/org/openjdk/jmh/jmh-generator-annprocess/1.18/jmh-generator-annprocess-1.18.jar; }
2525+ rec { sha1 = "d455b0dc6108b5e6f1fb4f6cf1c7b4cbedbecc97"; name = "JMH_GENERATOR_ANNPROCESS_1_18.sources_${sha1}.jar"; url = mirror://maven/org/openjdk/jmh/jmh-generator-annprocess/1.18/jmh-generator-annprocess-1.18-sources.jar; }
2626+ rec { sha1 = "702b8525fcf81454235e5e2fa2a35f15ffc0ec7e"; name = "ASM_DEBUG_ALL_${sha1}.jar"; url = mirror://maven/org/ow2/asm/asm-debug-all/5.0.4/asm-debug-all-5.0.4.jar; }
2727+ rec { sha1 = "ec2544ab27e110d2d431bdad7d538ed509b21e62"; name = "COMMONS_MATH3_3_2_${sha1}.jar"; url = mirror://maven/org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar; }
2828+ rec { sha1 = "cd098e055bf192a60c81d81893893e6e31a6482f"; name = "COMMONS_MATH3_3_2.sources_${sha1}.jar"; url = mirror://maven/org/apache/commons/commons-math3/3.2/commons-math3-3.2-sources.jar; }
2929+ rec { sha1 = "0174aa0077e9db596e53d7f9ec37556d9392d5a6"; name = "JMH_1_18_${sha1}.jar"; url = mirror://maven/org/openjdk/jmh/jmh-core/1.18/jmh-core-1.18.jar; }
3030+ rec { sha1 = "7ff1e1aafea436b6aa8b29a8b8f1c2d66be26f5b"; name = "JMH_1_18.sources_${sha1}.jar"; url = mirror://maven/org/openjdk/jmh/jmh-core/1.18/jmh-core-1.18-sources.jar; }
3131+ rec { sha1 = "2973d150c0dc1fefe998f834810d68f278ea58ec"; name = "JUNIT_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/junit-4.12.jar; }
3232+ rec { sha1 = "a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa"; name = "JUNIT.sources_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/junit-4.12-sources.jar; }
3333+ rec { sha1 = "42a25dc3219429f0e5d060061f71acb49bf010a0"; name = "HAMCREST_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3.jar; }
3434+ rec { sha1 = "1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b"; name = "HAMCREST.sources_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3-sources.jar; }
3535+ rec { sha1 = "0d031013db9a80d6c88330c42c983fbfa7053193"; name = "hsdis_${sha1}.so"; url = https://lafo.ssw.uni-linz.ac.at/pub/hsdis/intel/hsdis-amd64-linux-0d031013db9a80d6c88330c42c983fbfa7053193.so; }
3636+ ];
3737+3838+ graal-mxcache = jvmci8-mxcache ++ [
3939+ rec { sha1 = "f2cfb09cee12469ff64f0d698b13de19903bb4f7"; name = "NanoHTTPD-WebSocket_${sha1}.jar"; url = mirror://maven/org/nanohttpd/nanohttpd-websocket/2.3.1/nanohttpd-websocket-2.3.1.jar; }
4040+ rec { sha1 = "a8d54d1ca554a77f377eff6bf9e16ca8383c8f6c"; name = "NanoHTTPD_${sha1}.jar"; url = mirror://maven/org/nanohttpd/nanohttpd/2.3.1/nanohttpd-2.3.1.jar; }
4141+ rec { sha1 = "aca5eb39e2a12fddd6c472b240afe9ebea3a6733"; name = "org.json_${sha1}.jar"; url = mirror://maven/org/json/json/20160810/json-20160810.jar; }
4242+ rec { sha1 = "fdedd5f2522122102f0b3db85fe7aa563a009926"; name = "JLINE_${sha1}.jar"; url = mirror://maven/jline/jline/2.14.5/jline-2.14.5.jar; }
4343+ rec { sha1 = "476d9a44cd19d6b55f81571077dfa972a4f8a083"; name = "JAVA_ALLOCATION_INSTRUMENTER_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/java-allocation-instrumenter/java-allocation-instrumenter-8f0db117e64e.jar; }
4444+ rec { sha1 = "0da08b8cce7bbf903602a25a3a163ae252435795"; name = "ASM5_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar; }
4545+ rec { sha1 = "396ce0c07ba2b481f25a70195c7c94922f0d1b0b"; name = "ASM_TREE5_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar; }
4646+ rec { sha1 = "280c265b789e041c02e5c97815793dfc283fb1e6"; name = "LIBFFI_${sha1}.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/libffi-3.2.1.tar.gz; }
4747+ rec { sha1 = "616a4fca49c5d610a3354e78cd97e7627024bb66"; name = "GSON_SHADOWED_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/gson-shadowed-2.2.4.jar; }
4848+ rec { sha1 = "b13337a4ffd095c2e27ea401dc6edfca0d23a6e4"; name = "GSON_SHADOWED.sources_${sha1}.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/gson-shadowed-2.2.4-sources.jar; }
4949+ ];
5050+5151+in rec {
5252+5353+ mx = stdenv.mkDerivation {
5454+ name = "mx";
5555+ src = fetchFromGitHub {
5656+ owner = "graalvm";
5757+ repo = "mx";
5858+ rev = "22557cf7ec417c49aca20c13a9123045005d72d0"; # HEAD at 2018-02-16
5959+ sha256 = "070647ih2qzcssj7yripbg1w9bjwi1rcp1blx5z3jbp1shrr6563";
6060+ };
6161+ nativeBuildInputs = [ makeWrapper ];
6262+ buildPhase = ''
6363+ substituteInPlace mx --replace /bin/pwd pwd
6464+ '';
6565+ installPhase = ''
6666+ mkdir -p $out/bin
6767+ cp -dpR * $out/bin
6868+ wrapProgram $out/bin/mx --prefix PATH : ${lib.makeBinPath [ python27 mercurial ]}
6969+ '';
7070+ meta = with stdenv.lib; {
7171+ homepage = https://github.com/graalvm/mx;
7272+ description = "Command-line tool used for the development of Graal projects";
7373+ license = licenses.unfree;
7474+ platforms = python27.meta.platforms;
7575+ };
7676+ };
7777+7878+ # copy of pkgs.oraclejvm8 with JVMCI interface (TODO: it should work with pkgs.openjdk8 too)
7979+ jvmci8 = stdenv.mkDerivation rec {
8080+ version = "0.41";
8181+ name = let
8282+ n = "jvmci8u161-${version}";
8383+ in if (lib.stringLength n) == (lib.stringLength oraclejdk8.name) then
8484+ n
8585+ else
8686+ throw "length of string `${n}' must be equal to the length of `${oraclejdk8.name}'";
8787+ src = fetchFromGitHub {
8888+ owner = "graalvm";
8989+ repo = "graal-jvmci-8";
9090+ rev = "jvmci-${version}";
9191+ sha256 = "0pajf114l8lzczfdzz968c3s1ardiy4q5ya8p2kmwxl06giy95qr";
9292+ };
9393+ buildInputs = [ mx mercurial ];
9494+ postUnpack = ''
9595+ # a fake mercurial dir to prevent mx crash and supply the version to mx
9696+ ( cd $sourceRoot
9797+ hg init
9898+ hg add
9999+ hg commit -m 'dummy commit'
100100+ hg tag ${lib.escapeShellArg src.rev}
101101+ hg checkout ${lib.escapeShellArg src.rev}
102102+ )
103103+ '';
104104+ NIX_CFLAGS_COMPILE = [
105105+ "-Wno-error=format-overflow" # newly detected by gcc7
106106+ ];
107107+ buildPhase = ''
108108+ cp -dpR ${oraclejdk8} writable-copy-of-jdk
109109+ chmod +w -R writable-copy-of-jdk
110110+111111+ export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild
112112+ export MX_CACHE_DIR=${makeMxCache jvmci8-mxcache}
113113+ mx --java-home $(pwd)/writable-copy-of-jdk build
114114+ '';
115115+ installPhase = ''
116116+ mv jdk1.8.0_*/linux-amd64/product $out
117117+ find $out -type f -exec sed -i "s#${oraclejdk8}#$out#g" {} \;
118118+ '';
119119+ dontStrip = true; # why? see in oraclejdk derivation
120120+ inherit (oraclejdk8) meta;
121121+ };
122122+123123+ graalvm8 = stdenv.mkDerivation rec {
124124+ version = "0.31";
125125+ name = let
126126+ n = "graal-vm-8-${version}";
127127+ in if (lib.stringLength n) == (lib.stringLength jvmci8.name) then
128128+ n
129129+ else
130130+ throw "length of string `${n}' must be equal to the length of `${jvmci8.name}'";
131131+ src = fetchFromGitHub {
132132+ owner = "oracle";
133133+ repo = "graal";
134134+ rev = "vm-enterprise-${version}";
135135+ sha256 = "0rhd6dk2jpbxgdprqvdk991b2k177jrjgyjabdnmv5lzlhczy676";
136136+ };
137137+ buildInputs = [ mx zlib mercurial jvmci8 ];
138138+ postUnpack = ''
139139+ # a fake mercurial dir to prevent mx crash and supply the version to mx
140140+ ( cd $sourceRoot
141141+ hg init
142142+ hg add
143143+ hg commit -m 'dummy commit'
144144+ hg tag ${lib.escapeShellArg src.rev}
145145+ hg checkout ${lib.escapeShellArg src.rev}
146146+ )
147147+ '';
148148+ buildPhase = ''
149149+ # make a copy of jvmci8
150150+ cp -dpR ${jvmci8} $out
151151+ chmod +w -R $out
152152+ find $out -type f -exec sed -i "s#${jvmci8}#$out#g" {} \;
153153+154154+ export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild
155155+ export MX_CACHE_DIR=${makeMxCache graal-mxcache}
156156+ ( cd substratevm; mx --java-home $out build --no-daemon )
157157+ '';
158158+ installPhase = ''
159159+ # add graal files
160160+ mkdir -p $out/jre/tools/{profiler,chromeinspector}
161161+ cp -pR substratevm/svmbuild/native-image-root/linux-amd64/bin/* $out/jre/bin/
162162+ cp -pLR substratevm/svmbuild/native-image-root/lib/* $out/jre/lib/ || true # ignore "same file" error when dereferencing symlinks
163163+ cp -pLR substratevm/svmbuild/native-image-root/tools/* $out/jre/tools/
164164+ cp -pR $MX_ALT_OUTPUT_ROOT/truffle/dists/* $out/jre/lib/truffle/
165165+ cp -pR $MX_ALT_OUTPUT_ROOT/tools/dists/truffle-profiler* $out/jre/tools/profiler/
166166+ cp -pR $MX_ALT_OUTPUT_ROOT/tools/dists/chromeinspector* $out/jre/tools/chromeinspector/
167167+ echo "name=GraalVM ${version}" > $out/jre/lib/amd64/server/vm.properties
168168+ ln -s --relative $out/jre/bin/native-image $out/bin/native-image
169169+ cp $out/jre/tools/nfi/bin/libtrufflenfi.so $out/jre/lib/amd64/
170170+ cp -dpR $out/jre/lib/svm/clibraries $out/jre/lib/svm/builder/
171171+172172+ # BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html
173173+ substituteInPlace $out/jre/lib/security/java.security \
174174+ --replace file:/dev/random file:/dev/./urandom \
175175+ --replace NativePRNGBlocking SHA1PRNG
176176+ '';
177177+ dontStrip = true; # why? see in oraclejdk derivation
178178+ doInstallCheck = true;
179179+ installCheckPhase = ''
180180+ echo ${lib.escapeShellArg ''
181181+ public class HelloWorld {
182182+ public static void main(String[] args) {
183183+ System.out.println("Hello World");
184184+ }
185185+ }
186186+ ''} > HelloWorld.java
187187+ $out/bin/javac HelloWorld.java
188188+189189+ # run on JVM with Graal Compiler
190190+ $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld
191191+ $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World'
192192+193193+ # Ahead-Of-Time compilation
194194+ $out/bin/native-image -no-server HelloWorld
195195+ ./helloworld
196196+ ./helloworld | fgrep 'Hello World'
197197+ '';
198198+ meta = with stdenv.lib; {
199199+ homepage = https://github.com/oracle/graal;
200200+ description = "High-Performance Polyglot VM";
201201+ license = licenses.unfree;
202202+ maintainers = with maintainers; [ volth ];
203203+ platforms = [ "x86_64-linux" ];
204204+ };
205205+ };
206206+}
···11+{ lib, hostPlatform, targetPlatform
22+, makeWrapper
33+, runCommand, wrapBintoolsWith, wrapCCWith
44+, buildAndroidndk, androidndk, targetAndroidndkPkgs
55+}:
66+77+let
88+ # Mapping from a platform to information needed to unpack NDK stuff for that
99+ # platform.
1010+ #
1111+ # N.B. The Android NDK uses slightly different LLVM-style platform triples
1212+ # than we do. We don't just use theirs because ours are less ambiguous and
1313+ # some builds need that clarity.
1414+ ndkInfoFun = { config, ... }: {
1515+ "x86_64-unknown-linux-gnu" = {
1616+ double = "linux-x86_64";
1717+ };
1818+ "arm-unknown-linux-androideabi" = {
1919+ arch = "arm";
2020+ triple = "arm-linux-androideabi";
2121+ gccVer = "4.8";
2222+ };
2323+ "aarch64-unknown-linux-android" = {
2424+ arch = "arm64";
2525+ triple = "aarch64-linux-android";
2626+ gccVer = "4.9";
2727+ };
2828+ }.${config} or
2929+ (throw "Android NDK doesn't support ${config}, as far as we know");
3030+3131+ hostInfo = ndkInfoFun hostPlatform;
3232+ targetInfo = ndkInfoFun targetPlatform;
3333+3434+in
3535+3636+rec {
3737+ # Misc tools
3838+ binaries = let
3939+ ndkBinDir =
4040+ "${androidndk}/libexec/${androidndk.name}/toolchains/${targetInfo.triple}-${targetInfo.gccVer}/prebuilt/${hostInfo.double}/bin";
4141+ in runCommand "ndk-gcc-binutils" {
4242+ isGNU = true; # for cc-wrapper
4343+ nativeBuildInputs = [ makeWrapper ];
4444+ propgatedBuildInputs = [ androidndk ];
4545+ } ''
4646+ mkdir -p $out/bin
4747+ for prog in ${ndkBinDir}/${targetInfo.triple}-*; do
4848+ prog_suffix=$(basename $prog | sed 's/${targetInfo.triple}-//')
4949+ ln -s $prog $out/bin/${targetPlatform.config}-$prog_suffix
5050+ done
5151+ '';
5252+5353+ binutils = wrapBintoolsWith {
5454+ bintools = binaries;
5555+ libc = targetAndroidndkPkgs.libraries;
5656+ };
5757+5858+ gcc = wrapCCWith {
5959+ cc = binaries;
6060+ bintools = binutils;
6161+ libc = targetAndroidndkPkgs.libraries;
6262+ extraBuildCommands =
6363+ # GCC 4.9 is the first relase with "-fstack-protector"
6464+ lib.optionalString (lib.versionOlder targetInfo.gccVer "4.9") ''
6565+ sed -E \
6666+ -i $out/nix-support/add-hardening.sh \
6767+ -e 's|(-fstack-protector)-strong|\1|g'
6868+ '';
6969+ };
7070+7171+ # Bionic lib C and other libraries.
7272+ #
7373+ # We use androidndk from the previous stage, else we waste time or get cycles
7474+ # cross-compiling packages to wrap incorrectly wrap binaries we don't include
7575+ # anyways.
7676+ libraries = {
7777+ name = "bionic-prebuilt";
7878+ type = "derivation";
7979+ outPath = "${buildAndroidndk}/libexec/${buildAndroidndk.name}/platforms/android-21/arch-${hostInfo.arch}/usr/";
8080+ drvPath = throw "fake derivation, build ${buildAndroidndk} to use";
8181+ };
8282+}
+15
pkgs/development/mobile/androidenv/default.nix
···242242 inherit (pkgs) stdenv;
243243 inherit androidsdk;
244244 };
245245+246246+ androidndkPkgs = import ./androidndk-pkgs.nix {
247247+ inherit (buildPackages)
248248+ makeWrapper;
249249+ inherit (pkgs)
250250+ lib hostPlatform targetPlatform
251251+ runCommand wrapBintoolsWith wrapCCWith;
252252+ # buildPackages.foo rather than buildPackages.buildPackages.foo would work,
253253+ # but for splicing messing up on infinite recursion for the variants we
254254+ # *dont't* use. Using this workaround, but also making a test to ensure
255255+ # these two really are the same.
256256+ buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk;
257257+ inherit androidndk;
258258+ targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs;
259259+ };
245260}
+1-1
pkgs/development/node-packages/composition-v6.nix
···11-# This file has been generated by node2nix 1.5.1. Do not edit!
11+# This file has been generated by node2nix 1.5.2. Do not edit!
2233{pkgs ? import <nixpkgs> {
44 inherit system;
+1-1
pkgs/development/node-packages/composition-v8.nix
···11-# This file has been generated by node2nix 1.5.1. Do not edit!
11+# This file has been generated by node2nix 1.5.2. Do not edit!
2233{pkgs ? import <nixpkgs> {
44 inherit system;
···11-# This file has been generated by node2nix 1.5.1. Do not edit!
11+# This file has been generated by node2nix 1.5.2. Do not edit!
2233{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
44
···4455buildPythonApplication rec {
66 name = "vim-vint-${version}";
77- version = "0.3.11";
77+ version = "0.3.18";
8899 src = fetchFromGitHub {
1010 owner = "kuniwak";
1111 repo = "vint";
1212 rev = "v${version}";
1313- sha256 = "0xl166xs7sm404f1qz2s0xcry7fr1hgyvhqhyj1qj0dql9i3xx8v";
1313+ sha256 = "0qrlimg385sxq4y6vqbanby31inaa1q47w9qcw5knwffbz96whrs";
1414 };
15151616 # For python 3.5 > version > 2.7 , a nested dependency (pythonPackages.hypothesis) fails.
+63
pkgs/games/sil/default.nix
···11+{ stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu, makeWrapper, writeScript, ... }:
22+let
33+ setup = writeScript "setup" ''
44+ mkdir -p "$ANGBAND_PATH"
55+ # Copy all the data files into place
66+ cp -ar $1/* "$ANGBAND_PATH"
77+ # The copied files are not writable, make them so
88+ chmod +w -R "$ANGBAND_PATH"
99+ '';
1010+in
1111+stdenv.mkDerivation rec {
1212+ name = "Sil-${version}";
1313+ version = "1.3.0";
1414+1515+ src = fetchzip {
1616+ url = "http://www.amirrorclear.net/flowers/game/sil/Sil-130-src.zip";
1717+ sha256 = "1amp2mr3fxascra0k76sdsvikjh8g76nqh46kka9379zd35lfq8w";
1818+ stripRoot=false;
1919+ };
2020+2121+ buildInputs = [ makeWrapper ncurses libX11 libXaw libXt libXext libXmu ];
2222+2323+ sourceRoot = "source/Sil/src";
2424+2525+ makefile = "Makefile.std";
2626+2727+ prePatch = ''
2828+ # Allow usage of ANGBAND_PATH
2929+ substituteInPlace config.h --replace "#define FIXED_PATHS" ""
3030+ '';
3131+3232+ preConfigure = ''
3333+ buildFlagsArray+=("LIBS=-lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lncurses")
3434+ '';
3535+3636+ installPhase = ''
3737+ # the makefile doesn't have a sensible install target, so we hav to do it ourselves
3838+ mkdir -p $out/bin
3939+ cp sil $out/bin/sil
4040+ # Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place
4141+ # We could just use the options for a user-local save and scores dir, but it tried to write to the
4242+ # lib directory anyway, so we might as well give everyone a copy
4343+ wrapProgram $out/bin/sil \
4444+ --run "set -u" \
4545+ --run "export ANGBAND_PATH=\$HOME/.sil" \
4646+ --run "${setup} ${src}/Sil/lib"
4747+ '';
4848+4949+ meta = {
5050+ description = "A rouge-like game set in the first age of Middle-earth";
5151+ longDescription = ''
5252+ A game of adventure set in the first age of Middle-earth, when the world still
5353+ rang with elven song and gleamed with dwarven mail.
5454+5555+ Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining
5656+ Silmaril from Morgoth’s iron crown.
5757+ '';
5858+ homepage = http://www.amirrorclear.net/flowers/game/sil/index.html;
5959+ license = stdenv.lib.licenses.gpl2;
6060+ maintainers = [ stdenv.lib.maintainers.michaelpj ];
6161+ platforms = stdenv.lib.platforms.linux;
6262+ };
6363+}
···32323333 # We get a warning in armv5tel-linux and the fuloong2f, so we
3434 # disable -Werror in it.
3535- ${stdenv.lib.optionalString (stdenv.isArm || stdenv.system == "mips64el-linux") ''
3535+ ${stdenv.lib.optionalString (stdenv.isArm || stdenv.hostPlatform.isMips) ''
3636 sed -i s/-Werror// src/Makefile.am
3737 ''}
3838 '';
+1
pkgs/os-specific/linux/kernel/common-config.nix
···134134 ''}
135135 NETFILTER y
136136 NETFILTER_ADVANCED y
137137+ CGROUP_BPF? y # Required by systemd per-cgroup firewalling
137138 IP_ROUTE_VERBOSE y
138139 IP_MROUTE_MULTIPLE_TABLES y
139140 IP_VS_PROTO_TCP y
-17
pkgs/os-specific/linux/kernel/linux-4.13.nix
···11-{ stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
22-33-buildLinux (args // rec {
44- version = "4.13.16";
55- extraMeta.branch = "4.13";
66-77- # TODO: perhaps try being more concrete (ideally CVE numbers).
88- extraMeta.knownVulnerabilities = [
99- "ALSA: usb-audio: Fix potential out-of-bound access at parsing SU"
1010- "eCryptfs: use after free in ecryptfs_release_messaging()"
1111- ];
1212-1313- src = fetchurl {
1414- url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
1515- sha256 = "0cf7prqzl1ajbgl98w0symdyn0k5wl5xaf1l5ldgy6l083yg69dh";
1616- };
1717-} // (args.argsOverride or {}))
···3434 hostPlatform = crossSystem;
3535 targetPlatform = crossSystem;
3636 cc = if crossSystem.useiOSCross or false
3737- then buildPackages.darwin.ios-cross
3737+ then buildPackages.darwin.ios-cross
3838+ else if crossSystem.useAndroidPrebuilt
3939+ then buildPackages.androidenv.androidndkPkgs.gcc
3840 else buildPackages.gcc;
3941 };
4042 })
···2233stdenv.mkDerivation rec {
44 name = "xidel-${version}";
55- version = "0.8.4";
55+ version = "0.9.6";
6677 ## Source archive lacks file (manageUtils.sh), using pre-built package for now.
88 #src = fetchurl {
···1414 if stdenv.system == "x86_64-linux" then
1515 fetchurl {
1616 url = "mirror://sourceforge/videlibri/Xidel/Xidel%20${version}/xidel_${version}-1_amd64.deb";
1717- sha256 = "0gq95ag2661hsw8b7ii6z07ian832cz8g21lvq2cvps4a80ql1gi";
1717+ sha256 = "0hskc74y7p4j1x33yx0w4fvr610p2yimas8pxhr6bs7mb9b300h7";
1818 }
1919 else if stdenv.system == "i686-linux" then
2020 fetchurl {
+2
pkgs/tools/typesetting/tex/texlive/bin.nix
···176176 # http://tex.stackexchange.com/questions/97999/when-to-use-luajittex-in-favour-of-luatex
177177 ];
178178179179+ patches = [ ./luatex-gcc7.patch ];
180180+179181 configureScript = ":";
180182181183 # we use static libtexlua, because it's only used by a single binary