Merge branch 'master' into staging

The haskell split got reverted (again).
Hydra: ?compare=1416012
This commit is contained in:
Vladimír Čunát 2017-12-05 13:04:44 +01:00
commit 689d6303e8
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
39 changed files with 1133 additions and 999 deletions

View File

@ -290,8 +290,8 @@ in
ln -s /run/systemd/resolve/resolv.conf /run/resolvconf/interfaces/systemd ln -s /run/systemd/resolve/resolv.conf /run/resolvconf/interfaces/systemd
''} ''}
# Make sure resolv.conf is up to date if not managed by systemd # Make sure resolv.conf is up to date if not managed manually or by systemd
${optionalString (!config.services.resolved.enable) '' ${optionalString (!config.environment.etc?"resolv.conf") ''
${pkgs.openresolv}/bin/resolvconf -u ${pkgs.openresolv}/bin/resolvconf -u
''} ''}
''; '';

View File

@ -9,6 +9,12 @@ let
isBuiltinBackend = name: isBuiltinBackend = name:
builtins.elem name [ "graphite" "console" "repeater" ]; builtins.elem name [ "graphite" "console" "repeater" ];
backendsToPackages = let
mkMap = list: name:
if isBuiltinBackend name then list
else list ++ [ pkgs.nodePackages.${name} ];
in foldl mkMap [];
configFile = pkgs.writeText "statsd.conf" '' configFile = pkgs.writeText "statsd.conf" ''
{ {
address: "${cfg.listenAddress}", address: "${cfg.listenAddress}",
@ -27,13 +33,21 @@ let
prettyprint: false prettyprint: false
}, },
log: { log: {
backend: "syslog" backend: "stdout"
}, },
automaticConfigReload: false${optionalString (cfg.extraConfig != null) ","} automaticConfigReload: false${optionalString (cfg.extraConfig != null) ","}
${cfg.extraConfig} ${cfg.extraConfig}
} }
''; '';
deps = pkgs.buildEnv {
name = "statsd-runtime-deps";
pathsToLink = [ "/lib" ];
ignoreCollisions = true;
paths = backendsToPackages cfg.backends;
};
in in
{ {
@ -42,11 +56,7 @@ in
options.services.statsd = { options.services.statsd = {
enable = mkOption { enable = mkEnableOption "statsd";
description = "Whether to enable statsd stats aggregation service";
default = false;
type = types.bool;
};
listenAddress = mkOption { listenAddress = mkOption {
description = "Address that statsd listens on over UDP"; description = "Address that statsd listens on over UDP";
@ -110,6 +120,11 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = map (backend: {
assertion = !isBuiltinBackend backend -> hasAttrByPath [ backend ] pkgs.nodePackages;
message = "Only builtin backends (graphite, console, repeater) or backends enumerated in `pkgs.nodePackages` are allowed!";
}) cfg.backends;
users.extraUsers = singleton { users.extraUsers = singleton {
name = "statsd"; name = "statsd";
uid = config.ids.uids.statsd; uid = config.ids.uids.statsd;
@ -120,9 +135,7 @@ in
description = "Statsd Server"; description = "Statsd Server";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
environment = { environment = {
NODE_PATH=concatMapStringsSep ":" NODE_PATH = "${deps}/lib/node_modules";
(pkg: "${builtins.getAttr pkg pkgs.statsd.nodePackages}/lib/node_modules")
(filter (name: !isBuiltinBackend name) cfg.backends);
}; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.statsd}/bin/statsd ${configFile}"; ExecStart = "${pkgs.statsd}/bin/statsd ${configFile}";

View File

@ -332,6 +332,7 @@ in rec {
tests.slim = callTest tests/slim.nix {}; tests.slim = callTest tests/slim.nix {};
tests.smokeping = callTest tests/smokeping.nix {}; tests.smokeping = callTest tests/smokeping.nix {};
tests.snapper = callTest tests/snapper.nix {}; tests.snapper = callTest tests/snapper.nix {};
tests.statsd = callTest tests/statsd.nix {};
tests.switchTest = callTest tests/switch-test.nix {}; tests.switchTest = callTest tests/switch-test.nix {};
tests.taskserver = callTest tests/taskserver.nix {}; tests.taskserver = callTest tests/taskserver.nix {};
tests.tomcat = callTest tests/tomcat.nix {}; tests.tomcat = callTest tests/tomcat.nix {};

40
nixos/tests/statsd.nix Normal file
View File

@ -0,0 +1,40 @@
import ./make-test.nix ({ pkgs, lib }:
with lib;
{
name = "statsd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ma27 ];
};
nodes.statsd1 = {
services.statsd.enable = true;
services.statsd.backends = [ "statsd-influxdb-backend" "console" ];
services.statsd.extraConfig = ''
influxdb: {
username: "root",
password: "root",
database: "statsd"
}
'';
services.influxdb.enable = true;
systemd.services.influx-init = {
description = "Setup Influx Test Base";
after = [ "influxdb.service" ];
before = [ "statsd.service" ];
script = ''
echo "CREATE DATABASE statsd" | ${pkgs.influxdb}/bin/influx
'';
};
};
testScript = ''
$statsd1->start();
$statsd1->waitForUnit("statsd.service");
$statsd1->succeed("nc -z 127.0.0.1 8126");
'';
})

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper { stdenv, fetchurl, pkgconfig, intltool, file, wrapGAppsHook
, openssl, curl, libevent, inotify-tools, systemd, zlib , openssl, curl, libevent, inotify-tools, systemd, zlib
, enableGTK3 ? false, gtk3 , enableGTK3 ? false, gtk3
, enableSystemd ? stdenv.isLinux , enableSystemd ? stdenv.isLinux
@ -20,9 +20,10 @@ stdenv.mkDerivation rec {
sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s"; sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ]
++ optionals enableGTK3 [ wrapGAppsHook ];
buildInputs = [ intltool file openssl curl libevent zlib ] buildInputs = [ intltool file openssl curl libevent zlib ]
++ optionals enableGTK3 [ gtk3 makeWrapper ] ++ optionals enableGTK3 [ gtk3 ]
++ optionals enableSystemd [ systemd ] ++ optionals enableSystemd [ systemd ]
++ optionals stdenv.isLinux [ inotify-tools ]; ++ optionals stdenv.isLinux [ inotify-tools ];
@ -41,10 +42,8 @@ stdenv.mkDerivation rec {
++ optional enableSystemd "--with-systemd-daemon" ++ optional enableSystemd "--with-systemd-daemon"
++ optional enableGTK3 "--with-gtk"; ++ optional enableGTK3 "--with-gtk";
preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ '' preFixup = optionalString enableGTK3 ''
rm "$out/share/icons/hicolor/icon-theme.cache" rm "$out/share/icons/hicolor/icon-theme.cache"
wrapProgram "$out/bin/transmission-gtk" \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
''; '';
NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation"; NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation";

View File

@ -1322,6 +1322,19 @@ rec {
archs = ["noarch" "x86_64"]; archs = ["noarch" "x86_64"];
packages = commonCentOSPackages ++ [ "procps-ng" ]; packages = commonCentOSPackages ++ [ "procps-ng" ];
}; };
centos74x86_64 = rec {
name = "centos-7.4-x86_64";
fullName = "CentOS 7.4 (x86_64)";
# N.B. Switch to vault.centos.org when the next release comes out
urlPrefix = http://mirror.centos.org/centos-7/7.4.1708/os/x86_64;
packagesList = fetchurl {
url = "${urlPrefix}/repodata/b686d3a0f337323e656d9387b9a76ce6808b26255fc3a138b1a87d3b1cb95ed5-primary.xml.gz";
sha256 = "1mayp4f3nzd8n4wa3hsz4lk8p076djkvk1wkdmjkwcipyfhd71mn";
};
archs = ["noarch" "x86_64"];
packages = commonCentOSPackages ++ [ "procps-ng" ];
};
}; };

View File

@ -7,7 +7,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig wrapGAppsHook ]; nativeBuildInputs = [ pkgconfig wrapGAppsHook ];
buildInputs = [ vala libxslt glib dbus_glib gnome3.gtk libxml2 gnome3.defaultIconTheme buildInputs = [ vala libxslt glib dbus_glib gnome3.gtk libxml2 gnome3.defaultIconTheme
gnome3.gsettings_desktop_schemas
intltool docbook_xsl docbook_xsl_ns gnome3.dconf ]; intltool docbook_xsl docbook_xsl_ns gnome3.dconf ];
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -1,167 +0,0 @@
{ stdenv, fetchFromGitHub
, makeWrapper, unzip, which
, curl, tzdata
}:
stdenv.mkDerivation rec {
name = "dmd-${version}";
# This is the last version of dmd which is buildable without a D compiler.
# So we use this as a bootstrap version.
# The DMD frontend has been ported to D in 2.069.0 but idgen was already
# ported in 2.068.0.
version = "2.067.1";
srcs = [
(fetchFromGitHub {
owner = "dlang";
repo = "dmd";
rev = "v${version}";
sha256 = "0fm29lg8axfmzdaj0y6vg70lhwb5d9rv4aavnvdd15xjschinlcz";
name = "dmd-v${version}-src";
})
(fetchFromGitHub {
owner = "dlang";
repo = "druntime";
rev = "v${version}";
sha256 = "1n2qfw9kmnql0fk2nxikispqs7vh85nhvyyr00fk227n9lgnqf02";
name = "druntime-v${version}-src";
})
(fetchFromGitHub {
owner = "dlang";
repo = "phobos";
rev = "v${version}";
sha256 = "0fywgds9xvjcgnqxmpwr67p3wi2m535619pvj159cgwv5y0nr3p1";
name = "phobos-v${version}-src";
})
];
sourceRoot = ".";
postUnpack = ''
mv dmd-v${version}-src dmd
mv druntime-v${version}-src druntime
mv phobos-v${version}-src phobos
'';
# Compile with PIC to prevent colliding modules with binutils 2.28.
# https://issues.dlang.org/show_bug.cgi?id=17375
usePIC = "-fPIC";
ROOT_HOME_DIR = "$(echo ~root)";
postPatch = ''
# Ugly hack so the dlopen call has a chance to succeed.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace phobos/std/net/curl.d \
--replace libcurl.so ${curl.out}/lib/libcurl.so
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace phobos/std/datetime.d \
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
substituteInPlace druntime/test/shared/Makefile \
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
# phobos uses curl, so we need to patch the path to the lib.
substituteInPlace phobos/posix.mak \
--replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"
# Use proper C++ compiler
substituteInPlace dmd/src/posix.mak \
--replace g++ $CXX
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace dmd/src/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
# See https://github.com/NixOS/nixpkgs/issues/29443
substituteInPlace phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace dmd/src/posix.mak \
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
'';
nativeBuildInputs = [ makeWrapper unzip which ];
buildInputs = [ curl tzdata ];
# Buid and install are based on http://wiki.dlang.org/Building_DMD
buildPhase = ''
cd dmd
make -f posix.mak INSTALL_DIR=$out
export DMD=$PWD/src/dmd
cd ../druntime
make -f posix.mak PIC=${usePIC} INSTALL_DIR=$out DMD=$DMD
cd ../phobos
make -f posix.mak PIC=${usePIC} INSTALL_DIR=$out DMD=$DMD
cd ..
'';
# disable check phase because some tests are not working with sandboxing
doCheck = false;
checkPhase = ''
cd dmd
export DMD=$PWD/src/dmd
cd ../druntime
make -f posix.mak unittest PIC=${usePIC} DMD=$DMD BUILD=release
cd ../phobos
make -f posix.mak unittest PIC=${usePIC} DMD=$DMD BUILD=release
cd ..
'';
installPhase = ''
cd dmd
mkdir $out
mkdir $out/bin
cp $PWD/src/dmd $out/bin
mkdir -p $out/share/man/man1
mkdir -p $out/share/man/man5
cp -r docs/man/man1/* $out/share/man/man1/
cp -r docs/man/man5/* $out/share/man/man5/
cd ../druntime
mkdir $out/include
mkdir $out/include/d2
cp -r import/* $out/include/d2
cd ../phobos
mkdir $out/lib
${
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name;
extension = if stdenv.hostPlatform.isDarwin then "a" else "{a,so}"; in
"cp generated/${osname}/release/${bits}/libphobos2.${extension} $out/lib"
}
cp -r std $out/include/d2
cp -r etc $out/include/d2
wrapProgram $out/bin/dmd \
--prefix PATH ":" "${stdenv.cc}/bin" \
--set-default CC "$CC"
cd $out/bin
tee dmd.conf << EOF
[Environment]
DFLAGS=-I$out/include/d2 -L-L$out/lib ${stdenv.lib.optionalString (!stdenv.cc.isClang) "-L--export-dynamic"} -fPIC
EOF
'';
meta = with stdenv.lib; {
description = "Official reference compiler for the D language";
homepage = http://dlang.org/;
# Everything is now Boost licensed, even the backend.
# https://github.com/dlang/dmd/pull/6680
license = licenses.boost;
platforms = platforms.unix;
};
}

View File

@ -1,173 +1,287 @@
{ stdenv, fetchFromGitHub { stdenv, fetchFromGitHub, overrideCC, gcc5
, makeWrapper, unzip, which , makeWrapper, unzip, which
, curl, tzdata, gdb, darwin , curl, tzdata, gdb, darwin
# Versions 2.070.2 and up require a working dmd compiler to build: , callPackage
, bootstrapDmd }: , bootstrapVersion ? false
, version ? "2.075.1"
, dmdSha256 ? "0kq6r8rcghvzk5jcphg89l85rg734s29bssd2rcw3fygx0k9a9k5"
, druntimeSha256 ? "0idn2v1lmp7hl637g3i7pdfj9mjk4sclkz4cm77nl8873k2fhk8j"
, phobosSha256 ? "1a7q5fd15yspgs5plxgx54jyrcwgzlyw3rahmz04jd2s5h56dj04"
}:
stdenv.mkDerivation rec { let
name = "dmd-${version}";
version = "2.075.1";
srcs = [ bootstrapDmd = if !bootstrapVersion then
(fetchFromGitHub { # Versions 2.070.2 and up require a working dmd compiler to build so we just
owner = "dlang"; # use the last dmd without any D code to bootstrap the actual build.
repo = "dmd"; callPackage ./default.nix {
rev = "v${version}"; stdenv = if stdenv.hostPlatform.isDarwin then
sha256 = "0kq6r8rcghvzk5jcphg89l85rg734s29bssd2rcw3fygx0k9a9k5"; stdenv
name = "dmd-v${version}-src"; else
}) # Doesn't build with gcc6 on linux
(fetchFromGitHub { overrideCC stdenv gcc5;
owner = "dlang"; bootstrapVersion = true;
repo = "druntime"; version = "2.067.1";
rev = "v${version}"; dmdSha256 = "0fm29lg8axfmzdaj0y6vg70lhwb5d9rv4aavnvdd15xjschinlcz";
sha256 = "0idn2v1lmp7hl637g3i7pdfj9mjk4sclkz4cm77nl8873k2fhk8j"; druntimeSha256 = "1n2qfw9kmnql0fk2nxikispqs7vh85nhvyyr00fk227n9lgnqf02";
name = "druntime-v${version}-src"; phobosSha256 = "0fywgds9xvjcgnqxmpwr67p3wi2m535619pvj159cgwv5y0nr3p1";
}) }
(fetchFromGitHub { else
owner = "dlang"; "";
repo = "phobos";
rev = "v${version}";
sha256 = "1a7q5fd15yspgs5plxgx54jyrcwgzlyw3rahmz04jd2s5h56dj04";
name = "phobos-v${version}-src";
})
];
sourceRoot = "."; dmdBuild = stdenv.mkDerivation rec {
name = "dmdBuild-${version}";
inherit version;
postUnpack = '' enableParallelBuilding = true;
mv dmd-v${version}-src dmd
mv druntime-v${version}-src druntime
mv phobos-v${version}-src phobos
# Remove cppa test for now because it doesn't work. srcs = [
rm dmd/test/runnable/cppa.d (fetchFromGitHub {
rm dmd/test/runnable/extra-files/cppb.cpp owner = "dlang";
''; repo = "dmd";
rev = "v${version}";
sha256 = dmdSha256;
name = "dmd";
})
(fetchFromGitHub {
owner = "dlang";
repo = "druntime";
rev = "v${version}";
sha256 = druntimeSha256;
name = "druntime";
})
(fetchFromGitHub {
owner = "dlang";
repo = "phobos";
rev = "v${version}";
sha256 = phobosSha256;
name = "phobos";
})
];
# Compile with PIC to prevent colliding modules with binutils 2.28. sourceRoot = ".";
# https://issues.dlang.org/show_bug.cgi?id=17375
usePIC = "-fPIC";
postPatch = '' postUnpack = ''
# Ugly hack so the dlopen call has a chance to succeed. patchShebangs .
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace phobos/std/net/curl.d \
--replace libcurl.so ${curl.out}/lib/libcurl.so
# Ugly hack to fix the hardcoded path to zoneinfo in the source file. # Remove cppa test for now because it doesn't work.
# https://issues.dlang.org/show_bug.cgi?id=15391 rm dmd/test/runnable/cppa.d
substituteInPlace phobos/std/datetime/timezone.d \ rm dmd/test/runnable/extra-files/cppb.cpp
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
substituteInPlace druntime/test/common.mak \
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
# phobos uses curl, so we need to patch the path to the lib.
substituteInPlace phobos/posix.mak \
--replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"
# Use proper C++ compiler
substituteInPlace dmd/posix.mak \
--replace g++ $CXX
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace dmd/posix.mak \
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
''; '';
nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ] # Compile with PIC to prevent colliding modules with binutils 2.28.
# https://issues.dlang.org/show_bug.cgi?id=17375
usePIC = "-fPIC";
ROOT_HOME_DIR = "$(echo ~root)";
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ datetimePath = if bootstrapVersion then
Foundation "phobos/std/datetime.d"
]); else
"phobos/std/datetime/timezone.d";
buildInputs = [ curl tzdata ]; phobosPatches = ''
substituteInPlace ${datetimePath} \
--replace "import core.time;" "import core.time;import std.path;"
# Buid and install are based on http://wiki.dlang.org/Building_DMD substituteInPlace ${datetimePath} \
buildPhase = '' --replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
cd dmd
make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out
${
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
"export DMD=$PWD/generated/${osname}/release/${bits}/dmd"
}
cd ../druntime
make -j$NIX_BUILD_CORES -f posix.mak PIC=${usePIC} INSTALL_DIR=$out DMD=$DMD
cd ../phobos
make -j$NIX_BUILD_CORES -f posix.mak PIC=${usePIC} INSTALL_DIR=$out DMD=$DMD
cd ..
'';
# disable check phase because some tests are not working with sandboxing # Ugly hack to fix the hardcoded path to zoneinfo in the source file.
doCheck = false; # https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace ${datetimePath} \
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
checkPhase = '' # Ugly hack so the dlopen call has a chance to succeed.
cd dmd # https://issues.dlang.org/show_bug.cgi?id=15391
${ substituteInPlace phobos/std/net/curl.d \
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits; --replace libcurl.so ${curl.out}/lib/libcurl.so
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
"export DMD=$PWD/generated/${osname}/release/${bits}/dmd" # phobos uses curl, so we need to patch the path to the lib.
} substituteInPlace phobos/posix.mak \
make -j$NIX_BUILD_CORES -C test -f Makefile PIC=${usePIC} DMD=$DMD BUILD=release SHARED=0 --replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"
cd ../druntime
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=${usePIC} DMD=$DMD BUILD=release ''
cd ../phobos
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=${usePIC} DMD=$DMD BUILD=release + stdenv.lib.optionalString (bootstrapVersion) ''
cd .. substituteInPlace ${datetimePath} \
''; --replace "import std.traits;" "import std.traits;import std.path;"
substituteInPlace ${datetimePath} \
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
# See https://github.com/NixOS/nixpkgs/issues/29443
substituteInPlace phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}"
'';
dmdPath = if bootstrapVersion then
"dmd/src"
else
"dmd";
postPatch = ''
# Use proper C++ compiler
substituteInPlace ${dmdPath}/posix.mak \
--replace g++ $CXX
# TODO
substituteInPlace druntime/src/core/memory.d \
--replace "assert(z is null);" "//assert(z is null);"
''
+ stdenv.lib.optionalString (!bootstrapVersion) ''
substituteInPlace druntime/test/common.mak \
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
''
+ phobosPatches
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
substituteInPlace ${dmdPath}/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace ${dmdPath}/posix.mak \
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
''
+ stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin && bootstrapVersion) ''
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
'';
nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
Foundation
]);
buildInputs = [ curl tzdata ];
bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then
"osx"
else
stdenv.hostPlatform.parsed.kernel.name;
top = "$(echo $NIX_BUILD_TOP)";
pathToDmd = if bootstrapVersion then
"${top}/dmd/src/dmd"
else
"${top}/dmd/generated/${osname}/release/${bits}/dmd";
# Buid and install are based on http://wiki.dlang.org/Building_DMD
buildPhase = ''
cd dmd
make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out
cd ../druntime
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
cd ../phobos
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
cd ..
'';
doCheck = !bootstrapVersion;
checkPhase = ''
cd dmd
make -j$NIX_BUILD_CORES -C test -f Makefile PIC=1 DMD=${pathToDmd} BUILD=release SHARED=0 SHELL=$SHELL
cd ../druntime
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${pathToDmd} BUILD=release
cd ..
'';
extension = if stdenv.hostPlatform.isDarwin then "a" else "{a,so}";
installPhase = ''
cd dmd
mkdir $out
mkdir $out/bin
cp ${pathToDmd} $out/bin
mkdir -p $out/share/man/man1
mkdir -p $out/share/man/man5
cp -r docs/man/man1/* $out/share/man/man1/
cp -r docs/man/man5/* $out/share/man/man5/
cd ../druntime
mkdir $out/include
mkdir $out/include/d2
cp -r import/* $out/include/d2
cd ../phobos
mkdir $out/lib
cp generated/${osname}/release/${bits}/libphobos2.${extension} $out/lib
cp -r std $out/include/d2
cp -r etc $out/include/d2
wrapProgram $out/bin/dmd \
--prefix PATH ":" "${stdenv.cc}/bin" \
--set-default CC "$CC"
cd $out/bin
tee dmd.conf << EOF
[Environment]
DFLAGS=-I$out/include/d2 -L-L$out/lib ${stdenv.lib.optionalString (!stdenv.cc.isClang) "-L--export-dynamic"} -fPIC
EOF
'';
meta = with stdenv.lib; {
description = "Official reference compiler for the D language";
homepage = http://dlang.org/;
# Everything is now Boost licensed, even the backend.
# https://github.com/dlang/dmd/pull/6680
license = licenses.boost;
maintainers = with maintainers; [ ThomasMader ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
};
};
# Need to test Phobos in a fixed-output derivation, otherwise the
# network stuff in Phobos would fail if sandbox mode is enabled.
phobosUnittests = stdenv.mkDerivation rec {
name = "phobosUnittests-${version}";
version = dmdBuild.version;
enableParallelBuilding = dmdBuild.enableParallelBuilding;
preferLocalBuild = true;
inputString = dmdBuild.outPath;
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" inputString;
srcs = dmdBuild.srcs;
sourceRoot = ".";
postPatch = dmdBuild.phobosPatches;
nativeBuildInputs = dmdBuild.nativeBuildInputs;
buildInputs = dmdBuild.buildInputs;
buildPhase = ''
cd phobos
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release
'';
installPhase = ''
echo -n $inputString > $out
'';
};
in
stdenv.mkDerivation rec {
inherit phobosUnittests;
name = "dmd-${version}";
phases = "installPhase";
installPhase = '' installPhase = ''
cd dmd mkdir $out
mkdir $out cp -r --symbolic-link ${dmdBuild}/* $out/
mkdir $out/bin
${
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
"cp $PWD/generated/${osname}/release/${bits}/dmd $out/bin"
}
mkdir -p $out/share/man/man1
mkdir -p $out/share/man/man5
cp -r docs/man/man1/* $out/share/man/man1/
cp -r docs/man/man5/* $out/share/man/man5/
cd ../druntime
mkdir $out/include
mkdir $out/include/d2
cp -r import/* $out/include/d2
cd ../phobos
mkdir $out/lib
${
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name;
extension = if stdenv.hostPlatform.isDarwin then "a" else "{a,so}"; in
"cp generated/${osname}/release/${bits}/libphobos2.${extension} $out/lib"
}
cp -r std $out/include/d2
cp -r etc $out/include/d2
wrapProgram $out/bin/dmd \
--prefix PATH ":" "${stdenv.cc}/bin" \
--set-default CC "$CC"
cd $out/bin
tee dmd.conf << EOF
[Environment]
DFLAGS=-I$out/include/d2 -L-L$out/lib ${stdenv.lib.optionalString (!stdenv.cc.isClang) "-L--export-dynamic"} -fPIC
EOF
''; '';
meta = with stdenv.lib; {
description = "Official reference compiler for the D language";
homepage = http://dlang.org/;
# Everything is now Boost licensed, even the backend.
# https://github.com/dlang/dmd/pull/6680
license = licenses.boost;
maintainers = with maintainers; [ ThomasMader ];
platforms = platforms.unix;
};
} }

View File

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal"; sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal";
}; };
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ]; buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
patches = [ ./relocation.patch ]; patches = [ ./relocation.patch ];

View File

@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
./relocation.patch ./relocation.patch
]; ];
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ]; buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch; ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx ]; buildInputs = [ ghc perl hscolour sphinx ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -10,7 +10,7 @@
let let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
version = "8.2.1"; version = "8.2.1";
preReleaseName = "ghc-8.2.1";
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ]; commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
commonPreConfigure = '' commonPreConfigure = ''
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure

View File

@ -11,7 +11,7 @@
let let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
commonBuildInputs = [ ghc perl autoconf automake (stdenv.lib.getBin happy) (stdenv.lib.getBin alex) python3 ]; commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
rev = "14457cf6a50f708eecece8f286f08687791d51f7"; rev = "14457cf6a50f708eecece8f286f08687791d51f7";

View File

@ -113,7 +113,7 @@ in mkDerivation (rec {
lens optparse-applicative parallel safe shelly split lens optparse-applicative parallel safe shelly split
stringsearch syb system-fileio system-filepath tar terminfo text-binary stringsearch syb system-fileio system-filepath tar terminfo text-binary
unordered-containers vector wl-pprint-text yaml unordered-containers vector wl-pprint-text yaml
(stdenv.lib.getBin alex) (stdenv.lib.getBin happy) git gnumake autoconf automake libtool patch gmp alex happy git gnumake autoconf automake libtool patch gmp
base16-bytestring cryptohash executable-path haddock-api base16-bytestring cryptohash executable-path haddock-api
transformers-compat QuickCheck haddock hspec xhtml transformers-compat QuickCheck haddock hspec xhtml
regex-posix libiconv regex-posix libiconv

View File

@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
sed -ie 's|ld |${targetPackages.stdenv.cc.bintools}/bin/ld |g' src/scripts/ldkernel.in sed -ie 's|ld |${targetPackages.stdenv.cc.bintools}/bin/ld |g' src/scripts/ldkernel.in
''; '';
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ]; configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
propagatedNativeBuildInputs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) ]; propagatedNativeBuildInputs = [ alex happy ];
buildInputs = buildInputs =
let haskellPkgs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) (stdenv.lib.getBin bootPkgs.hscolour) bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
]; in [ bootPkgs.ghc ]; in [ bootPkgs.ghc
automake perl git targetPackages.stdenv.cc.bintools automake perl git targetPackages.stdenv.cc.bintools
autoconf xen zlib ncurses.dev autoconf xen zlib ncurses.dev

View File

@ -1,103 +1,258 @@
{ stdenv, fetchFromGitHub, cmake, llvm, dmd, curl, tzdata, python, { stdenv, fetchgit, fetchurl, cmake, llvm, curl, tzdata
lit, gdb, unzip, darwin }: , python, libconfig, lit, gdb, unzip, darwin, bash
, callPackage
, bootstrapVersion ? false
, version ? "1.5.0"
, ldcSha256 ? "1150sgns03vplni2wd4afk3rgw3rap8rsiipspw0rzxgki5rlr83"
}:
let
bootstrapLdc = if !bootstrapVersion then
# LDC 0.17.x is the last version which doesn't need a working D compiler to
# build so we use that version to bootstrap the actual build.
callPackage ./default.nix {
bootstrapVersion = true;
version = "0.17.5";
ldcSha256 = "0200r5y8hs5yv2cx24csgyh00dlg18877b9cfblixypr6nhl19bs";
}
else
"";
ldcBuild = stdenv.mkDerivation rec {
name = "ldcBuild-${version}";
enableParallelBuilding = true;
src = fetchurl {
url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz";
sha256 = ldcSha256;
};
sourceRoot = ".";
postUnpack = ''
cd ldc-${version}-src/
patchShebangs .
# Remove cppa test for now because it doesn't work.
rm tests/d2/dmd-testsuite/runnable/cppa.d
rm tests/d2/dmd-testsuite/runnable/extra-files/cppb.cpp
''
+ stdenv.lib.optionalString (bootstrapVersion) ''
# ... runnable/variadic.d ()
#Test failed. The logged output:
#/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/bin/ldmd2 -conf= -m64 -Irunnable -od/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/dmd-testsuite/runnable -of/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/dmd-testsuite/runnable/variadic_0 runnable/variadic.d
#Error: integer constant expression expected instead of <cant>
#Error: integer constant expression expected instead of <cant>
#Error: integer constant expression expected instead of <cant>
#Error: integer constant expression expected instead of <cant>
#Error: integer constant expression expected instead of <cant>
#runnable/variadic.d(84): Error: template instance variadic.Foo3!(int, int, int) error instantiating
#
#
#==============================
#Test failed: expected rc == 0, exited with rc == 1
rm tests/d2/dmd-testsuite/runnable/variadic.d
''
+ stdenv.lib.optionalString (!bootstrapVersion) ''
# https://github.com/NixOS/nixpkgs/issues/29611
rm tests/sanitizers/asan_*
'';
ROOT_HOME_DIR = "$(echo ~root)";
datetimePath = if bootstrapVersion then
"phobos/std/datetime.d"
else
"phobos/std/datetime/timezone.d";
postPatch = ''
substituteInPlace cmake/Modules/FindLLVM.cmake \
--replace "llvm_set(LIBRARY_DIRS" "#llvm_set(LIBRARY_DIRS"
substituteInPlace runtime/${datetimePath} \
--replace "import core.time;" "import core.time;import std.path;"
substituteInPlace runtime/${datetimePath} \
--replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
substituteInPlace runtime/phobos/std/net/curl.d \
--replace libcurl.so ${curl.out}/lib/libcurl.so
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace runtime/${datetimePath} \
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
substituteInPlace tests/d2/dmd-testsuite/Makefile \
--replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
# See https://github.com/NixOS/nixpkgs/issues/29443
substituteInPlace runtime/phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}"
# TODO
substituteInPlace runtime/druntime/src/core/memory.d \
--replace "assert(z is null);" "//assert(z is null);"
''
+ stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
# https://github.com/ldc-developers/ldc/pull/2306
# Can be removed on bootstrap version > 0.17.5
substituteInPlace gen/programs.cpp \
--replace "gcc" "clang"
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
''
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
substituteInPlace dmd2/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
''
+ stdenv.lib.optionalString (bootstrapVersion) ''
substituteInPlace runtime/${datetimePath} \
--replace "import std.traits;" "import std.traits;import std.path;"
substituteInPlace runtime/${datetimePath} \
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
'';
nativeBuildInputs = [ cmake llvm bootstrapLdc python lit gdb unzip ]
++ stdenv.lib.optional (bootstrapVersion) [
libconfig
]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
Foundation
]);
buildInputs = [ curl tzdata stdenv.cc ];
preConfigure = ''
cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_SKIP_RPATH=ON"
"-DBUILD_SHARED_LIBS=OFF"
"-DLDC_WITH_LLD=OFF"
# Xcode 9.0.1 fixes that bug according to ldc release notes
"-DRT_ARCHIVE_WITH_LDC=OFF"
"-DLLVM_LIBRARY_DIRS=${llvm}/lib"
)
'';
postConfigure = ''
export DMD=$PWD/bin/ldmd2
'';
makeFlags = [ "DMD=$DMD" ];
doCheck = true;
checkPhase = ''
# Build and run LDC D unittests.
ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite.
ctest -V -R "lit-tests"
# Run DMD testsuite.
DMD_TESTSUITE_MAKE_ARGS=-j$NIX_BUILD_CORES ctest -V -R "dmd-testsuite"
'';
meta = with stdenv.lib; {
description = "The LLVM-based D compiler";
homepage = https://github.com/ldc-developers/ldc;
# from https://github.com/ldc-developers/ldc/blob/master/LICENSE
license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ];
maintainers = with maintainers; [ ThomasMader ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
};
};
# Need to test Phobos in a fixed-output derivation, otherwise the
# network stuff in Phobos would fail if sandbox mode is enabled.
ldcUnittests = stdenv.mkDerivation rec {
name = "ldcUnittests-${version}";
enableParallelBuilding = ldcBuild.enableParallelBuilding;
preferLocalBuild = true;
inputString = ldcBuild.outPath;
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" inputString;
src = ldcBuild.src;
sourceRoot = ".";
postUnpack = ldcBuild.postUnpack;
postPatch = ldcBuild.postPatch;
nativeBuildInputs = ldcBuild.nativeBuildInputs
++ [
ldcBuild
];
buildInputs = ldcBuild.buildInputs;
preConfigure = ''
cmakeFlagsArray=( "-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_SKIP_RPATH=ON"
"-DBUILD_SHARED_LIBS=OFF"
"-DLDC_WITH_LLD=OFF"
# Xcode 9.0.1 fixes that bug according to ldc release notes
"-DRT_ARCHIVE_WITH_LDC=OFF"
"-DLLVM_LIBRARY_DIRS=${llvm}/lib"
"-DD_COMPILER=${ldcBuild}/bin/ldmd2"
)
'';
postConfigure = ldcBuild.postConfigure;
makeFlags = ldcBuild.makeFlags;
buildCmd = if bootstrapVersion then
"ctest -V -R \"build-druntime-ldc-unittest|build-phobos2-ldc-unittest\""
else
"make -j$NIX_BUILD_CORES DMD=${ldcBuild}/bin/ldc2 druntime-test-runner druntime-test-runner-debug phobos2-test-runner phobos2-test-runner-debug";
testCmd = if bootstrapVersion then
"ctest -j$NIX_BUILD_CORES --output-on-failure -E \"dmd-testsuite|lit-tests|ldc2-unittest|llvm-ir-testsuite\""
else
"ctest -j$NIX_BUILD_CORES --output-on-failure -E \"dmd-testsuite|lit-tests|ldc2-unittest\"";
buildPhase = ''
${buildCmd}
${testCmd}
'';
installPhase = ''
echo -n $inputString > $out
'';
};
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
inherit ldcUnittests;
name = "ldc-${version}"; name = "ldc-${version}";
version = "1.3.0"; phases = "installPhase";
srcs = [ installPhase = ''
(fetchFromGitHub { mkdir $out
owner = "ldc-developers"; cp -r --symbolic-link ${ldcBuild}/* $out/
repo = "ldc";
rev = "v${version}";
sha256 = "1ac3j4cwwgjpayhijxx4d6478bc3iqksjxkd7xp7byx7k8w1ppdl";
name = "ldc-v${version}-src";
})
(fetchFromGitHub {
owner = "ldc-developers";
repo = "druntime";
rev = "ldc-v${version}";
sha256 = "1m13370wnj3sizqk3sdpzi9am5d24srf27d613qblhqa9n8vwz30";
name = "druntime-ldc-v${version}-src";
})
(fetchFromGitHub {
owner = "ldc-developers";
repo = "phobos";
rev = "ldc-v${version}";
sha256 = "0fhcdfi7a00plwj27ysfyv783nhk0kspq7hawf6vbsl3s1nyvn8g";
name = "phobos-ldc-v${version}-src";
})
(fetchFromGitHub {
owner = "ldc-developers";
repo = "dmd-testsuite";
rev = "ldc-v${version}";
sha256 = "0dmdkp220gqhxjrmrjfkf0vsvylwfaj70hswavq4q3v4dg17pzmj";
name = "dmd-testsuite-ldc-v${version}-src";
})
];
sourceRoot = ".";
postUnpack = ''
mv ldc-v${version}-src/* .
mv druntime-ldc-v${version}-src/* runtime/druntime
mv phobos-ldc-v${version}-src/* runtime/phobos
mv dmd-testsuite-ldc-v${version}-src/* tests/d2/dmd-testsuite
# Remove cppa test for now because it doesn't work.
rm tests/d2/dmd-testsuite/runnable/cppa.d
rm tests/d2/dmd-testsuite/runnable/extra-files/cppb.cpp
''; '';
postPatch = ''
substituteInPlace runtime/phobos/std/net/curl.d \
--replace libcurl.so ${curl.out}/lib/libcurl.so
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace runtime/phobos/std/datetime.d \
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace driver/tool.cpp \
--replace "gcc" "clang"
'';
nativeBuildInputs = [ cmake llvm dmd python lit gdb unzip ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
Foundation
]);
buildInputs = [ curl tzdata stdenv.cc ];
preConfigure = ''
cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc")
'';
postConfigure = ''
export DMD=$PWD/bin/ldc2
'';
makeFlags = [ "DMD=$DMD" ];
# disable check phase because some tests are not working with sandboxing
doCheck = false;
checkPhase = ''
ctest -j $NIX_BUILD_CORES -V DMD=$DMD
'';
meta = with stdenv.lib; {
description = "The LLVM-based D compiler";
homepage = https://github.com/ldc-developers/ldc;
# from https://github.com/ldc-developers/ldc/blob/master/LICENSE
license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ];
maintainers = with maintainers; [ ThomasMader ];
platforms = platforms.unix;
};
} }

View File

@ -897,7 +897,6 @@ self: super: {
# Don't install internal mkReadme tool. # Don't install internal mkReadme tool.
hastache = overrideCabal super.hastache (drv: { hastache = overrideCabal super.hastache (drv: {
doCheck = false; doCheck = false;
enableSeparateBinOutput = false;
postInstall = "rm $out/bin/mkReadme && rmdir $out/bin"; postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
}); });

View File

@ -217,10 +217,7 @@ self: super: builtins.intersectAttrs super {
# wxc supports wxGTX >= 3.0, but our current default version points to 2.8. # wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
# http://hydra.cryp.to/build/1331287/log/raw # http://hydra.cryp.to/build/1331287/log/raw
wxc = (overrideCabal super.wxc (drv: { wxc = (addBuildDepend super.wxc self.split).override { wxGTK = pkgs.wxGTK30; };
buildDepends = (drv.buildDepends or []) ++ [self.split];
postInstall = "cp -v dist/build/libwxc.so.0.92.3.0 $lib/lib/libwxc.so";
})).override { wxGTK = pkgs.wxGTK30; };
wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; }; wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };
# Test suite wants to connect to $DISPLAY. # Test suite wants to connect to $DISPLAY.
@ -510,52 +507,4 @@ self: super: builtins.intersectAttrs super {
# Break cyclic reference that results in an infinite recursion. # Break cyclic reference that results in an infinite recursion.
partial-semigroup = dontCheck super.partial-semigroup; partial-semigroup = dontCheck super.partial-semigroup;
# Alex has some weird files in /usr/share that create a cyclic ref with
# its bin dir.
alex = hasNoBinOutput super.alex;
# Disable separate bin outputs for these specific packages that break with it.
H = hasNoBinOutput super.H;
cryptol = hasNoBinOutput super.cryptol;
hscolour = hasNoBinOutput super.hscolour;
sproxy = hasNoBinOutput super.sproxy;
sproxy2 = hasNoBinOutput super.sproxy2;
sproxy-web = hasNoBinOutput super.sproxy-web;
juandelacosa = hasNoBinOutput super.juandelacosa;
mywatch = hasNoBinOutput super.mywatch;
sugarhaskell = hasNoBinOutput super.sugarhaskell;
zerobin = hasNoBinOutput super.zerobin;
git-annex = overrideCabal super.git-annex (drv: {
enableSeparateBinOutput = false;
enableSeparateEtcOutput = false;
});
# Has extra data files which are referred to from the binary output,
# creating a store reference cycle. Putting data in separate output
# solves the problem.
happy = overrideCabal super.happy (drv: { enableSeparateDataOutput = true; });
# Override a number of packages with specific references to $out in their
# derivations
stack = overrideCabal super.stack (drv: {
postInstall = ''
exe=$bin/bin/stack
mkdir -p $bin/share/bash-completion/completions
$exe --bash-completion-script $exe >$bin/share/bash-completion/completions/stack
'';
});
Agda = overrideCabal super.Agda (drv: {
postInstall = ''
files=("$out/share/"*"-ghc-"*"/Agda-"*"/lib/prim/Agda/"{Primitive.agda,Builtin"/"*.agda})
for f in "''${files[@]}" ; do
$bin/bin/agda $f
done
for f in "''${files[@]}" ; do
$bin/bin/agda -c --no-main $f
done
$bin/bin/agda-mode compile
'';
});
} }

View File

@ -56,10 +56,6 @@ let isCross = (ghc.cross or null) != null; in
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all" , hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
, enableSeparateDataOutput ? false , enableSeparateDataOutput ? false
, enableSeparateDocOutput ? doHaddock , enableSeparateDocOutput ? doHaddock
, enableSeparateBinOutput ? isExecutable
, outputsToInstall ? []
, enableSeparateLibOutput ? true
, enableSeparateEtcOutput ? (stdenv.lib.versionOlder "7.7" ghc.version)
} @ args: } @ args:
assert editedCabalFile != null -> revision != null; assert editedCabalFile != null -> revision != null;
@ -83,6 +79,9 @@ let
then "package-db" then "package-db"
else "package-conf"; else "package-conf";
# the target dir for haddock documentation
docdir = docoutput: docoutput + "/share/doc";
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal"; newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
newCabalFile = fetchurl { newCabalFile = fetchurl {
url = newCabalFileUrl; url = newCabalFileUrl;
@ -96,13 +95,6 @@ let
''; '';
hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling); hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
hasLibOutput = enableSeparateLibOutput && hasActiveLibrary;
libDir = if hasLibOutput then "$lib/lib/${ghc.name}" else "$out/lib/${ghc.name}";
binDir = if enableSeparateBinOutput then "$bin/bin" else "$out/bin";
libexecDir = if enableSeparateBinOutput then "$libexec/bin" else "$out/libexec";
etcDir = if enableSeparateEtcOutput then "$etc/etc" else "$out/etc";
docDir = if enableSeparateDocOutput then "$doc/share/doc" else "$out/share/doc";
dataDir = if enableSeparateDataOutput then "$data/share/${ghc.name}" else "$out/share/${ghc.name}";
# We cannot enable -j<n> parallelism for libraries because GHC is far more # We cannot enable -j<n> parallelism for libraries because GHC is far more
# likely to generate a non-determistic library ID in that case. Further # likely to generate a non-determistic library ID in that case. Further
@ -121,20 +113,12 @@ let
stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags); stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
defaultConfigureFlags = [ defaultConfigureFlags = [
"--verbose" "--prefix=$out" "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
# Binary directory has to be $bin/bin instead of just $bin: this (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
# is so that the package is added to the PATH when it's used as a (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
# build input. Sadly mkDerivation won't add inputs that don't have
# bin subdirectory.
"--bindir=${binDir}"
"--libdir=${libDir}" "--libsubdir=\\$pkgid"
"--libexecdir=${libexecDir}"
(optionalString (enableSeparateEtcOutput) "--sysconfdir=${etcDir}") # Old versions of cabal don't support this flag.
"--datadir=${dataDir}"
"--docdir=${docDir}"
"--with-gcc=$CC" # Clang won't work without that extra information. "--with-gcc=$CC" # Clang won't work without that extra information.
"--package-db=$packageConfDir" "--package-db=$packageConfDir"
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=${libDir}/${pname}-${version}") (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES") (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
@ -168,11 +152,8 @@ let
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
nativeBuildInputs = map stdenv.lib.getBin nativeBuildInputs = optional (allPkgconfigDepends != []) pkgconfig ++
( optional (allPkgconfigDepends != []) pkgconfig buildTools ++ libraryToolDepends ++ executableToolDepends ++ [ removeReferencesTo ];
++ buildTools ++ libraryToolDepends ++ executableToolDepends
++ [ removeReferencesTo ]
);
propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends; propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
optionals (allPkgconfigDepends != []) allPkgconfigDepends ++ optionals (allPkgconfigDepends != []) allPkgconfigDepends ++
@ -201,15 +182,7 @@ assert allPkgconfigDepends != [] -> pkgconfig != null;
stdenv.mkDerivation ({ stdenv.mkDerivation ({
name = "${pname}-${version}"; name = "${pname}-${version}";
outputs = if (args ? outputs) then args.outputs else outputs = if (args ? outputs) then args.outputs else ([ "out" ] ++ (optional enableSeparateDataOutput "data") ++ (optional enableSeparateDocOutput "doc"));
( (optional enableSeparateBinOutput "bin")
++ (optional enableSeparateBinOutput "libexec")
++ [ "out" ]
++ (optional enableSeparateDataOutput "data")
++ (optional enableSeparateDocOutput "doc")
++ (optional enableSeparateEtcOutput "etc")
++ (optional hasLibOutput "lib")
);
setOutputFlags = false; setOutputFlags = false;
pos = builtins.unsafeGetAttrPos "pname" args; pos = builtins.unsafeGetAttrPos "pname" args;
@ -233,7 +206,7 @@ stdenv.mkDerivation ({
postPatch = optionalString jailbreak '' postPatch = optionalString jailbreak ''
echo "Run jailbreak-cabal to lift version restrictions on build inputs." echo "Run jailbreak-cabal to lift version restrictions on build inputs."
${stdenv.lib.getBin jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal ${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
'' + postPatch; '' + postPatch;
setupCompilerEnvironmentPhase = '' setupCompilerEnvironmentPhase = ''
@ -241,7 +214,7 @@ stdenv.mkDerivation ({
echo "Build with ${ghc}." echo "Build with ${ghc}."
export PATH="${ghc}/bin:$PATH" export PATH="${ghc}/bin:$PATH"
${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${stdenv.lib.getBin hscolour}/bin:$PATH"} ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
packageConfDir="$TMPDIR/package.conf.d" packageConfDir="$TMPDIR/package.conf.d"
mkdir -p $packageConfDir mkdir -p $packageConfDir
@ -268,7 +241,7 @@ stdenv.mkDerivation ({
# #
# Create a local directory with symlinks of the *.dylib (macOS shared # Create a local directory with symlinks of the *.dylib (macOS shared
# libraries) from all the dependencies. # libraries) from all the dependencies.
local dynamicLinksDir="${libDir}/links" local dynamicLinksDir="$out/lib/links"
mkdir -p $dynamicLinksDir mkdir -p $dynamicLinksDir
for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'); do for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'); do
ln -s "$d/"*.dylib $dynamicLinksDir ln -s "$d/"*.dylib $dynamicLinksDir
@ -340,7 +313,7 @@ stdenv.mkDerivation ({
${if !hasActiveLibrary then "${setupCommand} install" else '' ${if !hasActiveLibrary then "${setupCommand} install" else ''
${setupCommand} copy ${setupCommand} copy
local packageConfDir="${libDir}/package.conf.d" local packageConfDir="$out/lib/${ghc.name}/package.conf.d"
local packageConfFile="$packageConfDir/${pname}-${version}.conf" local packageConfFile="$packageConfDir/${pname}-${version}.conf"
mkdir -p "$packageConfDir" mkdir -p "$packageConfDir"
${setupCommand} register --gen-pkg-config=$packageConfFile ${setupCommand} register --gen-pkg-config=$packageConfFile
@ -348,7 +321,7 @@ stdenv.mkDerivation ({
mv $packageConfFile $packageConfDir/$pkgId.conf mv $packageConfFile $packageConfDir/$pkgId.conf
''} ''}
${optionalString isGhcjs '' ${optionalString isGhcjs ''
for exeDir in "${binDir}/"*.jsexe; do for exeDir in "$out/bin/"*.jsexe; do
exe="''${exeDir%.jsexe}" exe="''${exeDir%.jsexe}"
printWords '#!${nodejs}/bin/node' > "$exe" printWords '#!${nodejs}/bin/node' > "$exe"
cat "$exeDir/all.js" >> "$exe" cat "$exeDir/all.js" >> "$exe"
@ -357,68 +330,18 @@ stdenv.mkDerivation ({
''} ''}
${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"} ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") '' ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
for exe in "${binDir}/"* ; do for exe in "$out/bin/"* ; do
install_name_tool -add_rpath "${libDir}/${pname}-${version}" "$exe" install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe"
done done
''} ''}
${optionalString enableSeparateDocOutput '' ${optionalString enableSeparateDocOutput ''
# Remove references back to $out but also back to $lib if we have for x in ${docdir "$doc"}/html/src/*.html; do
# docs. $lib is needed as it stores path to haddock interfaces in the remove-references-to -t $out $x
# conf file which creates a cycle if docs refer back to library
# path.
mkdir -p ${docDir}
for x in ${docDir}/html/src/*.html; do
remove-references-to -t $out -t ${libDir} -t ${binDir} ${optionalString enableSeparateDataOutput "-t $data"} $x
done done
mkdir -p $doc
''} ''}
${optionalString enableSeparateDataOutput "mkdir -p $data"}
${optionalString hasLibOutput ''
# Even if we don't have binary output for the package, things like
# Paths files will embed paths to bin/libexec directories in themselves
# which results in .lib <-> $out cyclic store reference. We
# therefore patch out the paths from separate library if we don't have
# separate bin output too.
#
# If we _do_ have separate bin and lib outputs, we may still be in
# trouble in case of shared executables: executable contains path to
# .lib, .lib contains path (through Paths) to .bin and we have a
# cycle.
#
# Lastly we have to deal with references from .lib back into
# $out/share if we're not splitting out data directory.
#
# It may happen that we have hasLibOutput set but the library
# directory was not created: this happens in the case that library
# section is not exposing any modules. See "fail" package for an
# example where no modules are exposed for GHC >= 8.0.
if [ -d ${libDir} ]; then
find ${libDir} -type f -exec \
remove-references-to -t ${binDir} -t ${libexecDir} "{}" \;
fi
''}
${optionalString (hasLibOutput && ! enableSeparateDocOutput) ''
# If we don't have separate docs, we have to patch out the ref to
# docs in package conf. This will likely break Haddock
# cross-package links but is necessary to break store cycle…
find ${libDir}/ -type f -name '*.conf' -exec \
remove-references-to -t ${docDir} "{}" \;
''}
${optionalString (hasLibOutput && ! enableSeparateDataOutput) ''
# Just like for doc output path in $out potentially landing in
# *.conf, we have to also remove the data directory so that it
# doesn't appear under data-dir field creating a cycle.
find ${libDir}/ -type f -exec echo Removing ${dataDir} refs from "{}" \;
find ${libDir}/ -type f -exec \
remove-references-to -t ${dataDir} "{}" \;
''}
${optionalString enableSeparateDataOutput "mkdir -p ${dataDir}"}
${optionalString enableSeparateBinOutput "mkdir -p ${binDir} ${libexecDir}"}
${optionalString enableSeparateEtcOutput "mkdir -p ${etcDir}"}
runHook postInstall runHook postInstall
''; '';
@ -435,7 +358,7 @@ stdenv.mkDerivation ({
# the directory containing the haddock documentation. # the directory containing the haddock documentation.
# `null' if no haddock documentation was built. # `null' if no haddock documentation was built.
# TODO: fetch the self from the fixpoint instead # TODO: fetch the self from the fixpoint instead
haddockDir = self: if doHaddock then "${docDir}/html" else null; haddockDir = self: if doHaddock then "${docdir self.doc}/html" else null;
env = stdenv.mkDerivation { env = stdenv.mkDerivation {
name = "interactive-${pname}-${version}-environment"; name = "interactive-${pname}-${version}-environment";
@ -463,7 +386,6 @@ stdenv.mkDerivation ({
// optionalAttrs (description != "") { inherit description; } // optionalAttrs (description != "") { inherit description; }
// optionalAttrs (maintainers != []) { inherit maintainers; } // optionalAttrs (maintainers != []) { inherit maintainers; }
// optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; } // optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; }
// optionalAttrs (outputsToInstall != []) { inherit outputsToInstall; }
; ;
} }

View File

@ -147,8 +147,4 @@ rec {
overrideSrc = drv: { src, version ? drv.version }: overrideSrc = drv: { src, version ? drv.version }:
overrideCabal drv (_: { inherit src version; editedCabalFile = null; }); overrideCabal drv (_: { inherit src version; editedCabalFile = null; });
hasNoBinOutput = drv: overrideCabal drv (drv: { enableSeparateBinOutput = false; });
installOutputs = drv: outputs: overrideCabal drv
(drv: { outputsToInstall = outputs; });
} }

View File

@ -44,7 +44,6 @@ let
isLibrary = false; isLibrary = false;
doHaddock = false; doHaddock = false;
hyperlinkSource = false; # Avoid depending on hscolour for this build. hyperlinkSource = false; # Avoid depending on hscolour for this build.
enableSeparateEtcOutput = false; # The flag to support this is missing in old versions of cabal.
postFixup = "rm -rf $out/lib $out/share $out/nix-support"; postFixup = "rm -rf $out/lib $out/share $out/nix-support";
}); });
cpphs = overrideCabal (self.cpphs.overrideScope (self: super: { cpphs = overrideCabal (self.cpphs.overrideScope (self: super: {

View File

@ -43,7 +43,7 @@ let
libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}"; libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
docDir = "$out/share/doc/ghc/html"; docDir = "$out/share/doc/ghc/html";
packageCfgDir = "${libDir}/package.conf.d"; packageCfgDir = "${libDir}/package.conf.d";
paths = map lib.getLib (lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages)); paths = lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages);
hasLibraries = lib.any (x: x.isHaskellLibrary) paths; hasLibraries = lib.any (x: x.isHaskellLibrary) paths;
# CLang is needed on Darwin for -fllvm to work: # CLang is needed on Darwin for -fllvm to work:
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libp11-${version}"; name = "libp11-${version}";
version = "0.4.4"; version = "0.4.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "OpenSC"; owner = "OpenSC";
repo = "libp11"; repo = "libp11";
rev = name; rev = name;
sha256 = "1jnpnwipmw3skw112qff36w046nyz5amiil228rn5divpkvx4axa"; sha256 = "0n1i0pxj6l0vdq8gpdwfp5p9qd7wkymg0lpy6a17ix8hpqsljlhr";
}; };
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ]; makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];

View File

@ -7,13 +7,11 @@
assert readline != null; assert readline != null;
let let
arch = if stdenv.isArm arch = if stdenv.isx86_64 then "x64"
then if stdenv.is64bit else if stdenv.isi686 then "ia32"
then"arm64" else if stdenv.isAarch64 then "arm64"
else "arm" else if stdenv.isArm then "arm"
else if stdenv.is64bit else throw "Unknown architecture for v8";
then"x64"
else "ia32";
git_url = "https://chromium.googlesource.com"; git_url = "https://chromium.googlesource.com";
clangFlag = if stdenv.isDarwin then "1" else "0"; clangFlag = if stdenv.isDarwin then "1" else "0";
sharedFlag = if static then "static_library" else "shared_library"; sharedFlag = if static then "static_library" else "shared_library";
@ -172,6 +170,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
dontUpdateAutotoolsGnuConfigScripts = if stdenv.isAarch64 then true else null;
# the `libv8_libplatform` target is _only_ built as a static library, # the `libv8_libplatform` target is _only_ built as a static library,
# and is expected to be statically linked in when needed. # and is expected to be statically linked in when needed.
# see the following link for further commentary: # see the following link for further commentary:

View File

@ -175,13 +175,13 @@ let
sha1 = "0054e1e744502e27c04c187c3ecc505dd54bbb4f"; sha1 = "0054e1e744502e27c04c187c3ecc505dd54bbb4f";
}; };
}; };
"interpret-1.0.4" = { "interpret-1.1.0" = {
name = "interpret"; name = "interpret";
packageName = "interpret"; packageName = "interpret";
version = "1.0.4"; version = "1.1.0";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz"; url = "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz";
sha1 = "820cdd588b868ffb191a809506d6c9c8f212b1b0"; sha1 = "7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614";
}; };
}; };
"liftoff-2.3.0" = { "liftoff-2.3.0" = {
@ -1300,13 +1300,13 @@ let
sha1 = "a794af0c05ab1752846ee753a1f211a05ba0c44f"; sha1 = "a794af0c05ab1752846ee753a1f211a05ba0c44f";
}; };
}; };
"array-slice-1.0.0" = { "array-slice-1.1.0" = {
name = "array-slice"; name = "array-slice";
packageName = "array-slice"; packageName = "array-slice";
version = "1.0.0"; version = "1.1.0";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz"; url = "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz";
sha1 = "e73034f00dcc1f40876008fd20feae77bd4b7c2f"; sha512 = "3myjiz16qi117x0k52sisqyn0cqx6yxvpgr43bkil9shgs7yhs8wpdgd3wjwfzgwxsw330yqwhp880gsyx2kxj1lfyb6gs1fh7qqnh7";
}; };
}; };
"for-own-1.0.0" = { "for-own-1.0.0" = {
@ -2119,13 +2119,13 @@ let
sha1 = "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"; sha1 = "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79";
}; };
}; };
"ajv-5.5.0" = { "ajv-5.5.1" = {
name = "ajv"; name = "ajv";
packageName = "ajv"; packageName = "ajv";
version = "5.5.0"; version = "5.5.1";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/ajv/-/ajv-5.5.0.tgz"; url = "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz";
sha1 = "eb2840746e9dc48bd5e063a36e3fd400c5eab5a9"; sha1 = "b38bb8876d9e86bee994956a04e721e88b248eb2";
}; };
}; };
"har-schema-2.0.0" = { "har-schema-2.0.0" = {
@ -4045,13 +4045,13 @@ let
sha1 = "6373db76909fe570e08d73583365ed828a74eeeb"; sha1 = "6373db76909fe570e08d73583365ed828a74eeeb";
}; };
}; };
"commander-2.12.1" = { "commander-2.12.2" = {
name = "commander"; name = "commander";
packageName = "commander"; packageName = "commander";
version = "2.12.1"; version = "2.12.2";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/commander/-/commander-2.12.1.tgz"; url = "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz";
sha512 = "36cb2mrf9piidjbqiz8krwx7r9hikgirjxzfrbyk3hd39xpmg489lia9d3cmzci80sx99428hg960sz9j5b72fn7pi928z5289ln8rw"; sha512 = "007wb3baahjcrv17kgxryqjlsyr3c3kl2y07p85m4ia78pba9xyjr3cgi95jjrwq8qq550s78hj06f7z0ab8ssrxk6w06afjsmxln84";
}; };
}; };
"is-my-json-valid-2.16.1" = { "is-my-json-valid-2.16.1" = {
@ -4356,7 +4356,7 @@ in
}) })
]; ];
}) })
sources."interpret-1.0.4" sources."interpret-1.1.0"
(sources."liftoff-2.3.0" // { (sources."liftoff-2.3.0" // {
dependencies = [ dependencies = [
sources."extend-3.0.1" sources."extend-3.0.1"
@ -4518,7 +4518,7 @@ in
(sources."object.defaults-1.1.0" // { (sources."object.defaults-1.1.0" // {
dependencies = [ dependencies = [
sources."array-each-1.0.1" sources."array-each-1.0.1"
sources."array-slice-1.0.0" sources."array-slice-1.1.0"
(sources."for-own-1.0.0" // { (sources."for-own-1.0.0" // {
dependencies = [ dependencies = [
sources."for-in-1.0.2" sources."for-in-1.0.2"
@ -4835,7 +4835,7 @@ in
}) })
(sources."har-validator-5.0.3" // { (sources."har-validator-5.0.3" // {
dependencies = [ dependencies = [
(sources."ajv-5.5.0" // { (sources."ajv-5.5.1" // {
dependencies = [ dependencies = [
sources."co-4.6.0" sources."co-4.6.0"
sources."fast-deep-equal-1.0.0" sources."fast-deep-equal-1.0.0"
@ -6248,7 +6248,7 @@ in
sources."supports-color-2.0.0" sources."supports-color-2.0.0"
]; ];
}) })
sources."commander-2.12.1" sources."commander-2.12.2"
(sources."is-my-json-valid-2.16.1" // { (sources."is-my-json-valid-2.16.1" // {
dependencies = [ dependencies = [
sources."generate-function-2.0.0" sources."generate-function-2.0.0"

View File

@ -80,7 +80,10 @@
, "sloc" , "sloc"
, "smartdc" , "smartdc"
, "socket.io" , "socket.io"
, "stackdriver-statsd-backend"
, "statsd" , "statsd"
, "statsd-influxdb-backend"
, "statsd-librato-backend"
, "stylus" , "stylus"
, "svgo" , "svgo"
, "tern" , "tern"

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
{ stdenv, ocaml, findlib, fetchurl, curl, ncurses }: { stdenv, pkgconfig, ocaml, findlib, fetchurl, curl, ncurses }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "ocurl-0.7.8"; name = "ocurl-0.8.0";
src = fetchurl { src = fetchurl {
url = "https://forge.ocamlcore.org/frs/download.php/1463/${name}.tar.bz2"; url = "http://ygrek.org.ua/p/release/ocurl/${name}.tar.gz";
sha256 = "0yn7f3g5wva8nqxh76adpq9rihggc405jkqysfghzwnf3yymyqrr"; sha256 = "0292knvm9g038br0dc03lcsnbjqycyiqha256dp4bxkz3vmmz4wr";
}; };
buildInputs = [ ocaml findlib ncurses ]; buildInputs = [ pkgconfig ocaml findlib ncurses ];
propagatedBuildInputs = [ curl ]; propagatedBuildInputs = [ curl ];
createFindlibDestdir = true; createFindlibDestdir = true;
meta = { meta = {
description = "OCaml bindings to libcurl"; description = "OCaml bindings to libcurl";
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.mit;
homepage = http://ocurl.forge.ocamlcore.org/; homepage = "http://ygrek.org.ua/p/ocurl/";
maintainers = with stdenv.lib.maintainers; [ bennofs ]; maintainers = with stdenv.lib.maintainers; [ bennofs ];
platforms = ocaml.meta.platforms or []; platforms = ocaml.meta.platforms or [];
}; };

View File

@ -2,12 +2,12 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "zc.buildout"; pname = "zc.buildout";
version = "2.9.5"; version = "2.10.0";
name = "${pname}-nix-${version}"; name = "${pname}-nix-${version}";
src = fetchurl { src = fetchurl {
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz"; url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz";
sha256 = "dce840ea379e2ff10bae27465778708704e0a4287cde92eb6c7961f5b0277cfa"; sha256 = "00wi0f6wpfl2gywr02x2yqvx6i1k0ll5w4lhdl0khijk4g7mk8dq";
}; };
patches = [ ./nix.patch ]; patches = [ ./nix.patch ];

View File

@ -1,16 +1,16 @@
{ stdenv, fetchFromGitHub, lib, ocaml, libelf, cf-private, CoreServices, findlib, camlp4, sedlex, ocamlbuild }: { stdenv, fetchFromGitHub, lib, ocaml, libelf, cf-private, CoreServices, findlib, camlp4, sedlex, ocamlbuild, ocaml_lwt }:
with lib; with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.59.0"; version = "0.60.1";
name = "flow-${version}"; name = "flow-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "facebook"; owner = "facebook";
repo = "flow"; repo = "flow";
rev = "v${version}"; rev = "v${version}";
sha256 = "1i47k9dg3pawwkdccb57n6882q92jsmclk5ip2y6dv5hhv4s5z49"; sha256 = "1bi0m42qkdlljkk4lh85y8ncrn8im6mbn291b3305lf4pm0x59kd";
}; };
installPhase = '' installPhase = ''
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
cp bin/flow $out/bin/ cp bin/flow $out/bin/
''; '';
buildInputs = [ ocaml libelf findlib camlp4 sedlex ocamlbuild ] buildInputs = [ ocaml libelf findlib camlp4 sedlex ocamlbuild ocaml_lwt ]
++ optionals stdenv.isDarwin [ cf-private CoreServices ]; ++ optionals stdenv.isDarwin [ cf-private CoreServices ];
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -1,65 +1,96 @@
{ stdenv, fetchFromGitHub, curl, dmd, libevent, rsync }: { stdenv, fetchFromGitHub, curl, dmd, libevent, rsync }:
stdenv.mkDerivation rec { let
name = "dub-${version}";
version = "1.5.0";
src = fetchFromGitHub { dubBuild = stdenv.mkDerivation rec {
owner = "dlang"; name = "dubBuild-${version}";
repo = "dub"; version = "1.6.0";
rev = "v${version}";
sha256 = "0kmirx4ijhzirjwdqmnwqhngg38zdaydpvny2p0yj3afqgkj6vq5"; enableParallelBuilding = true;
src = fetchFromGitHub {
owner = "dlang";
repo = "dub";
rev = "v${version}";
sha256 = "1xjr5pp263lbcd4harxy1ybh7q0kzj9iyy63ji6pn66fizrgm7zk";
};
postPatch = ''
# Avoid that the version file is overwritten
substituteInPlace build.sh \
--replace source/dub/version_.d /dev/null
patchShebangs .
'';
nativeBuildInputs = [ dmd libevent rsync ];
buildInputs = [ curl ];
buildPhase = ''
export DMD=${dmd.out}/bin/dmd
./build.sh
'';
installPhase = ''
mkdir $out
mkdir $out/bin
cp bin/dub $out/bin
'';
meta = with stdenv.lib; {
description = "Package and build manager for D applications and libraries";
homepage = http://code.dlang.org/;
license = licenses.mit;
maintainers = with maintainers; [ ThomasMader ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
};
}; };
postPatch = '' # Need to test in a fixed-output derivation, otherwise the
# Avoid that the version file is overwritten # network tests would fail if sandbox mode is enabled.
substituteInPlace build.sh \ dubUnittests = stdenv.mkDerivation rec {
--replace source/dub/version_.d /dev/null name = "dubUnittests-${version}";
version = dubBuild.version;
substituteInPlace build.sh \ enableParallelBuilding = dubBuild.enableParallelBuilding;
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_ preferLocalBuild = true;
inputString = dubBuild.outPath;
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" inputString;
patchShebangs build.sh src = dubBuild.src;
patchShebangs test
# Remove unittest which is not working for now (upstream already fixed: https://github.com/dlang/dub/issues/1224) postPatch = dubBuild.postPatch;
rm test/interactive-remove.sh
# Fix test as long as there is no upstream solution. (see https://github.com/dlang/dub/pull/1227) nativeBuildInputs = dubBuild.nativeBuildInputs;
substituteInPlace test/issue884-init-defer-file-creation.sh \ buildInputs = dubBuild.buildInputs;
--replace "< /dev/stdin" "<(while :; do sleep 1; done)" \
--replace "sleep 1" ""
'';
nativeBuildInputs = [ dmd libevent rsync ]; buildPhase = ''
buildInputs = [ curl ]; # Can't use dub from dubBuild directly because one unittest
# (issue895-local-configuration) needs to generate a config
buildPhase = '' # file under ../etc relative to the dub location.
export DMD=${dmd.out}/bin/dmd cp ${dubBuild}/bin/dub bin/
./build.sh export DUB=$NIX_BUILD_TOP/source/bin/dub
'';
doCheck = false;
checkPhase = ''
export DUB=$PWD/bin/dub
export DC=${dmd.out}/bin/dmd export DC=${dmd.out}/bin/dmd
export HOME=$TMP export HOME=$TMP
./test/run-unittest.sh ./test/run-unittest.sh
''; '';
installPhase = ''
echo -n $inputString > $out
'';
};
in
stdenv.mkDerivation rec {
inherit dubUnittests;
name = "dub-${dubBuild.version}";
phases = "installPhase";
installPhase = '' installPhase = ''
mkdir $out mkdir $out
mkdir $out/bin cp -r --symbolic-link ${dubBuild}/* $out/
cp bin/dub $out/bin
''; '';
meta = with stdenv.lib; {
description = "Package and build manager for D applications and libraries";
homepage = http://code.dlang.org/;
license = licenses.mit;
maintainers = with maintainers; [ ThomasMader ];
platforms = platforms.unix;
};
} }

View File

@ -33,7 +33,10 @@ stdenv.mkDerivation rec {
--add-flags "--datadir $out/share/cataclysm-dda/" --add-flags "--datadir $out/share/cataclysm-dda/"
''; '';
enableParallelBuilding = true; # https://hydra.nixos.org/build/65193254
# src/weather_data.cpp:203:1: fatal error: opening dependency file obj/tiles/weather_data.d: No such file or directory
# make: *** [Makefile:687: obj/tiles/weather_data.o] Error 1
enableParallelBuilding = false;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A free, post apocalyptic, zombie infested rogue-like"; description = "A free, post apocalyptic, zombie infested rogue-like";

View File

@ -1,13 +0,0 @@
diff --git a/extractor/extractor_options.cpp b/extractor/extractor_options.cpp
index d14d8d9..c64d7fd 100644
--- a/extractor/extractor_options.cpp
+++ b/extractor/extractor_options.cpp
@@ -50,7 +50,7 @@ bool ExtractorOptions::ParseArguments(int argc, char *argv[], ExtractorConfig &e
boost::program_options::options_description config_options("Configuration");
config_options.add_options()("profile,p",
boost::program_options::value<boost::filesystem::path>(
- &extractor_config.profile_path)->default_value("profile.lua"),
+ &extractor_config.profile_path)->default_value("@out@/profiles/car.lua"),
"Path to LUA routing profile")(
"threads,t",
boost::program_options::value<unsigned int>(&extractor_config.requested_num_threads)

View File

@ -1,15 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,8 +127,9 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0" AND NOT MINGW)
message(STATUS "Using gcc specific binutils for LTO.")
- set(CMAKE_AR "/usr/bin/gcc-ar")
- set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
+ # Just let PATH do its job
+ set(CMAKE_AR "gcc-ar")
+ set(CMAKE_RANLIB "gcc-ranlib")
endif()
endif (HAS_LTO_FLAG)
endif()

View File

@ -1,24 +1,17 @@
{stdenv, fetchFromGitHub, cmake, luabind, libosmpbf, stxxl, tbb, boost, expat, protobuf, bzip2, zlib, substituteAll}: {stdenv, fetchFromGitHub, cmake, pkgconfig, bzip2, libxml2, libzip, boost, lua, luabind, tbb, expat}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "osrm-backend-${version}"; name = "osrm-backend-${version}";
version = "4.9.1"; version = "5.14.1";
src = fetchFromGitHub { src = fetchFromGitHub {
rev = "v${version}"; rev = "v${version}";
owner = "Project-OSRM"; owner = "Project-OSRM";
repo = "osrm-backend"; repo = "osrm-backend";
sha256 = "1r4dwniwxgfppnb9asdh98w5qxqwkjhp9gc5fabmck0gk73cwkcc"; sha256 = "0n7fpm8m5r93dxciagp2n8ij1wg483yb9srbzdzjqf1zzyh637sz";
}; };
patches = [ buildInputs = [ cmake pkgconfig bzip2 libxml2 libzip boost lua luabind tbb expat];
./4.5.0-gcc-binutils.patch
(substituteAll {
src = ./4.5.0-default-profile-path.template.patch;
})
];
buildInputs = [ cmake luabind libosmpbf stxxl tbb boost expat protobuf bzip2 zlib ];
postInstall = "mkdir -p $out/share/osrm-backend && cp -r ../profiles $out/share/osrm-backend/profiles"; postInstall = "mkdir -p $out/share/osrm-backend && cp -r ../profiles $out/share/osrm-backend/profiles";
@ -26,6 +19,7 @@ stdenv.mkDerivation rec {
homepage = https://github.com/Project-OSRM/osrm-backend/wiki; homepage = https://github.com/Project-OSRM/osrm-backend/wiki;
description = "Open Source Routing Machine computes shortest paths in a graph. It was designed to run well with map data from the Openstreetmap Project"; description = "Open Source Routing Machine computes shortest paths in a graph. It was designed to run well with map data from the Openstreetmap Project";
license = stdenv.lib.licenses.bsd2; license = stdenv.lib.licenses.bsd2;
maintainers = with stdenv.lib.maintainers;[ erictapen ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };
} }

View File

@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "194zzp1a989k2v8qzfr81gdknr8xiz16d6fdl63jx9r3mj5klmvb"; sha256 = "194zzp1a989k2v8qzfr81gdknr8xiz16d6fdl63jx9r3mj5klmvb";
}; };
sourceRoot = "${name}/X11"; # Note: don't change this to set sourceRoot, or updateAutotoolsGnuConfigScriptsHook
# on aarch64 doesn't find the files to patch and the aarch64 build fails!
preConfigure = "cd X11";
buildInputs = [ libX11 xproto libXt libICE libSM libXext ]; buildInputs = [ libX11 xproto libXt libICE libSM libXext ];

View File

@ -830,10 +830,10 @@ with pkgs;
enableSharedExecutables = false; enableSharedExecutables = false;
executableToolDepends = [ makeWrapper ]; executableToolDepends = [ makeWrapper ];
postInstall = '' postInstall = ''
exe=$libexec/bin/${drv.pname}-${drv.version}/${drv.pname} exe=$out/libexec/${drv.pname}-${drv.version}/${drv.pname}
install -D $bin/bin/${drv.pname} $exe install -D $out/bin/${drv.pname} $exe
rm -rf $bin/bin $out/lib $out/share rm -rf $out/{bin,lib,share}
makeWrapper $exe $bin/bin/${drv.pname} \ makeWrapper $exe $out/bin/${drv.pname} \
--prefix PATH ":" "${nix}/bin" \ --prefix PATH ":" "${nix}/bin" \
--prefix PATH ":" "${nix-prefetch-scripts}/bin" --prefix PATH ":" "${nix-prefetch-scripts}/bin"
mkdir -p $out/share/{bash-completion/completions,zsh/vendor-completions,fish/completions} mkdir -p $out/share/{bash-completion/completions,zsh/vendor-completions,fish/completions}
@ -847,7 +847,7 @@ with pkgs;
executableToolDepends = [ makeWrapper ]; executableToolDepends = [ makeWrapper ];
postInstall = '' postInstall = ''
wrapProgram $out/bin/stack2nix \ wrapProgram $out/bin/stack2nix \
${lib.makeBinPath [ git cabal2nix cabal-install stack ]} --prefix PATH ":" "${git}/bin:${cabal2nix}/bin:${cabal-install}/bin:${stack}/bin"
''; '';
}); });
@ -1777,17 +1777,7 @@ with pkgs;
dleyna-server = callPackage ../development/libraries/dleyna-server { }; dleyna-server = callPackage ../development/libraries/dleyna-server { };
dmd_2_067_1 = callPackage ../development/compilers/dmd/2.067.1.nix { dmd = callPackage ../development/compilers/dmd { };
stdenv = if stdenv.hostPlatform.isDarwin then
stdenv
else
# Doesn't build with gcc6 on linux
overrideCC stdenv gcc5;
};
dmd = callPackage ../development/compilers/dmd {
bootstrapDmd = dmd_2_067_1;
};
dmg2img = callPackage ../tools/misc/dmg2img { }; dmg2img = callPackage ../tools/misc/dmg2img { };
@ -7279,7 +7269,7 @@ with pkgs;
flow = callPackage ../development/tools/analysis/flow { flow = callPackage ../development/tools/analysis/flow {
inherit (darwin.apple_sdk.frameworks) CoreServices; inherit (darwin.apple_sdk.frameworks) CoreServices;
inherit (darwin) cf-private; inherit (darwin) cf-private;
inherit (ocamlPackages) ocaml findlib camlp4 sedlex ocamlbuild; inherit (ocamlPackages) ocaml findlib camlp4 sedlex ocamlbuild ocaml_lwt;
}; };
framac = callPackage ../development/tools/analysis/frama-c { }; framac = callPackage ../development/tools/analysis/frama-c { };

View File

@ -43,10 +43,10 @@ let
overrideWith = newArgs: origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs); overrideWith = newArgs: origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs);
in in
if builtins.isAttrs ff then (ff // { if builtins.isAttrs ff then (ff // {
overridePythonAttrs = newArgs: makeOverridable f (overrideWith newArgs); overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
}) })
else if builtins.isFunction ff then { else if builtins.isFunction ff then {
overridePythonAttrs = newArgs: makeOverridable f (overrideWith newArgs); overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
__functor = self: ff; __functor = self: ff;
} }
else ff; else ff;