Merge staging and PR #35021

It's the last staging commit (mostly) built on Hydra,
and a minimal fix for Darwin regression in pysqlite.

Changed files
+3122 -588
lib
nixos
doc
manual
release-notes
modules
services
networking
system
pkgs
applications
audio
editors
kakoune
misc
xterm
networking
browsers
sniffers
wireshark
science
version-management
git-and-tools
build-support
bintools-wrapper
development
compilers
haskell-modules
interpreters
lua-5
python
cpython
ruby
libraries
python-modules
aiohttp
async_timeout
cffi
chardet
multidict
pytest-xdist
testtools
tools
build-managers
misc
autoconf
autogen
lsof
patchelf
games
2048-in-terminal
armagetronad
os-specific
servers
monitoring
net-snmp
pulseaudio
sql
mariadb
postgresql
squid
x11
shells
bash
fish
stdenv
tools
compression
misc
findutils
man-db
screen
networking
package-management
security
system
smartmontools
text
top-level
+2 -1
lib/systems/default.nix
···
libc =
/**/ if final.isDarwin then "libSystem"
else if final.isMinGW then "msvcrt"
-
else if final.isLinux then "glibc"
+
else if final.isMusl then "musl"
+
else if final.isLinux /* default */ then "glibc"
# TODO(@Ericson2314) think more about other operating systems
else "native/impure";
extensions = {
+11 -6
lib/systems/examples.nix
···
config = "armv5tel-unknown-linux-gnueabi";
arch = "armv5tel";
float = "soft";
-
libc = "glibc";
platform = platforms.sheevaplug;
};
···
arch = "armv6l";
float = "hard";
fpu = "vfp";
-
libc = "glibc";
platform = platforms.raspberrypi;
};
···
arch = "armv7-a";
float = "hard";
fpu = "vfpv3-d16";
-
libc = "glibc";
platform = platforms.armv7l-hf-multiplatform;
};
aarch64-multiplatform = rec {
config = "aarch64-unknown-linux-gnu";
arch = "aarch64";
-
libc = "glibc";
platform = platforms.aarch64-multiplatform;
};
···
arch = "armv5tel";
config = "armv5tel-unknown-linux-gnueabi";
float = "soft";
-
libc = "glibc";
platform = platforms.pogoplug4;
};
···
config = "mips64el-unknown-linux-gnu";
arch = "mips";
float = "hard";
-
libc = "glibc";
platform = platforms.fuloong2f_n32;
};
+
+
muslpi = raspberryPi // {
+
config = "armv6l-unknown-linux-musleabihf";
+
};
+
+
aarch64-multiplatform-musl = aarch64-multiplatform // {
+
config = "aarch64-unknown-linux-musl";
+
};
+
+
musl64 = { config = "x86_64-unknown-linux-musl"; };
+
musl32 = { config = "i686-unknown-linux-musl"; };
#
# Darwin
+2
lib/systems/inspect.nix
···
Windows = { kernel = kernels.windows; };
Cygwin = { kernel = kernels.windows; abi = abis.cygnus; };
MinGW = { kernel = kernels.windows; abi = abis.gnu; };
+
+
Musl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
};
matchAnyAttrs = patterns:
+3
lib/systems/parse.nix
···
androideabi = {};
gnueabi = {};
gnueabihf = {};
+
musleabi = {};
+
musleabihf = {};
+
musl = {};
unknown = {};
};
-9
lib/systems/platforms.nix
···
rec {
pcBase = {
name = "pc";
-
kernelHeadersBaseConfig = "defconfig";
kernelBaseConfig = "defconfig";
# Build whatever possible as a module, if not stated in the extra config.
kernelAutoModules = true;
···
};
kernelMajor = "2.6";
-
kernelHeadersBaseConfig = "multi_v5_defconfig";
kernelBaseConfig = "multi_v5_defconfig";
kernelArch = "arm";
kernelAutoModules = false;
···
sheevaplug = {
name = "sheevaplug";
kernelMajor = "2.6";
-
kernelHeadersBaseConfig = "multi_v5_defconfig";
kernelBaseConfig = "multi_v5_defconfig";
kernelArch = "arm";
kernelAutoModules = false;
···
raspberrypi = {
name = "raspberrypi";
kernelMajor = "2.6";
-
kernelHeadersBaseConfig = "bcm2835_defconfig";
kernelBaseConfig = "bcmrpi_defconfig";
kernelDTB = true;
kernelArch = "arm";
···
utilite = {
name = "utilite";
kernelMajor = "2.6";
-
kernelHeadersBaseConfig = "multi_v7_defconfig";
kernelBaseConfig = "multi_v7_defconfig";
kernelArch = "arm";
kernelAutoModules = false;
···
# patch.
kernelBaseConfig = "guruplug_defconfig";
-
#kernelHeadersBaseConfig = "guruplug_defconfig";
};
fuloong2f_n32 = {
name = "fuloong2f_n32";
kernelMajor = "2.6";
-
kernelHeadersBaseConfig = "fuloong2e_defconfig";
kernelBaseConfig = "lemote2f_defconfig";
kernelArch = "mips";
kernelAutoModules = false;
···
armv7l-hf-multiplatform = {
name = "armv7l-hf-multiplatform";
kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
-
kernelHeadersBaseConfig = "multi_v7_defconfig";
kernelBaseConfig = "multi_v7_defconfig";
kernelArch = "arm";
kernelDTB = true;
···
aarch64-multiplatform = {
name = "aarch64-multiplatform";
kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
-
kernelHeadersBaseConfig = "defconfig";
kernelBaseConfig = "defconfig";
kernelArch = "arm64";
kernelDTB = true;
+11
nixos/doc/manual/release-notes/rl-1803.xml
···
</listitem>
<listitem>
<para>
+
The <literal>openssh</literal> package
+
now includes Kerberos support by default;
+
the <literal>openssh_with_kerberos</literal> package
+
is now a deprecated alias.
+
If you do not want Kerberos support,
+
you can do <literal>openssh.override { withKerboros = false; }</literal>.
+
Note, this also applies to the <literal>openssh_hpn</literal> package.
+
</para>
+
</listitem>
+
<listitem>
+
<para>
<literal>cc-wrapper</literal> has been split in two; there is now also a <literal>bintools-wrapper</literal>.
The most commonly used files in <filename>nix-support</filename> are now split between the two wrappers.
Some commonly used ones, like <filename>nix-support/dynamic-linker</filename>, are duplicated for backwards compatability, even though they rightly belong only in <literal>bintools-wrapper</literal>.
+1 -14
nixos/modules/services/networking/radvd.nix
···
systemd.services.radvd =
{ description = "IPv6 Router Advertisement Daemon";
-
wantedBy = [ "multi-user.target" ];
-
after = [ "network.target" ];
-
-
path = [ pkgs.radvd ];
-
-
preStart = ''
-
mkdir -m 755 -p /run/radvd
-
chown radvd /run/radvd
-
'';
-
serviceConfig =
-
{ ExecStart = "@${pkgs.radvd}/sbin/radvd radvd"
-
+ " -p /run/radvd/radvd.pid -m syslog -u radvd -C ${confFile}";
+
{ ExecStart = "@${pkgs.radvd}/bin/radvd radvd -n -u radvd -C ${confFile}";
Restart = "always";
-
Type = "forking";
-
PIDFile = "/run/radvd/radvd.pid";
};
};
-1
nixos/modules/system/boot/networkd.nix
···
systemd.additionalUpstreamSystemUnits = [
"systemd-networkd.service" "systemd-networkd-wait-online.service"
-
"org.freedesktop.network1.busname"
];
systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links
+1 -1
nixos/modules/system/boot/resolved.nix
···
config = mkIf cfg.enable {
systemd.additionalUpstreamSystemUnits = [
-
"systemd-resolved.service" "org.freedesktop.resolve1.busname"
+
"systemd-resolved.service"
];
systemd.services.systemd-resolved = {
+4 -13
nixos/modules/system/boot/systemd.nix
···
upstreamSystemUnits =
[ # Targets.
"basic.target"
-
"busnames.target"
"sysinit.target"
"sockets.target"
"exit.target"
···
# Consoles.
"getty.target"
+
"getty-pre.target"
"getty@.service"
"serial-getty@.service"
"console-getty.service"
···
"systemd-logind.service"
"autovt@.service"
"systemd-user-sessions.service"
-
"dbus-org.freedesktop.login1.service"
"dbus-org.freedesktop.machine1.service"
-
"org.freedesktop.login1.busname"
-
"org.freedesktop.machine1.busname"
"user@.service"
# Journal.
···
"swap.target"
"dev-hugepages.mount"
"dev-mqueue.mount"
-
"proc-sys-fs-binfmt_misc.mount"
"sys-fs-fuse-connections.mount"
"sys-kernel-config.mount"
"sys-kernel-debug.mount"
···
"systemd-tmpfiles-setup-dev.service"
# Misc.
-
"org.freedesktop.systemd1.busname"
"systemd-sysctl.service"
"dbus-org.freedesktop.timedate1.service"
"dbus-org.freedesktop.locale1.service"
"dbus-org.freedesktop.hostname1.service"
-
"org.freedesktop.timedate1.busname"
-
"org.freedesktop.locale1.busname"
-
"org.freedesktop.hostname1.busname"
"systemd-timedated.service"
"systemd-localed.service"
"systemd-hostnamed.service"
"systemd-binfmt.service"
"systemd-exit.service"
+
"systemd-update-done.service"
]
++ cfg.additionalUpstreamSystemUnits;
···
upstreamUserUnits =
[ "basic.target"
"bluetooth.target"
-
"busnames.target"
"default.target"
"exit.target"
"graphical-session-pre.target"
···
# Keep a persistent journal. Note that systemd-tmpfiles will
# set proper ownership/permissions.
-
# FIXME: revert to 0700 with systemd v233.
-
mkdir -m 0750 -p /var/log/journal
+
mkdir -m 0700 -p /var/log/journal
'';
users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;
···
systemd.targets.local-fs.unitConfig.X-StopOnReconfiguration = true;
systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true;
systemd.targets.network-online.wantedBy = [ "multi-user.target" ];
-
systemd.services.systemd-binfmt.wants = [ "proc-sys-fs-binfmt_misc.automount" ];
+
systemd.services.systemd-binfmt.wants = [ "proc-sys-fs-binfmt_misc.mount" ];
# Don't bother with certain units in containers.
systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container";
+1 -1
pkgs/applications/audio/cdparanoia/default.nix
···
url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/patch-paranoia_paranoia.c.10.4.diff";
sha256 = "17l2qhn8sh4jy6ryy5si6ll6dndcm0r537rlmk4a6a8vkn852vad";
})
-
];
+
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./utils.patch;
buildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook;
+68
pkgs/applications/audio/cdparanoia/utils.patch
···
+
diff --git cdparanoia-III-10.2/interface/utils.h cdparanoia-III-10.2/interface/utils.h
+
index c9647da..68c1a3a 100644
+
--- cdparanoia-III-10.2/interface/utils.h
+
+++ cdparanoia-III-10.2/interface/utils.h
+
@@ -1,4 +1,6 @@
+
-#include <endian.h>
+
+#include <unistd.h>
+
+#include <stdint.h>
+
+#include <stdlib.h>
+
#include <stdio.h>
+
#include <errno.h>
+
#include <string.h>
+
@@ -14,15 +16,15 @@ static inline int bigendianp(void){
+
}
+
+
static inline int32_t swap32(int32_t x){
+
- return((((u_int32_t)x & 0x000000ffU) << 24) |
+
- (((u_int32_t)x & 0x0000ff00U) << 8) |
+
- (((u_int32_t)x & 0x00ff0000U) >> 8) |
+
- (((u_int32_t)x & 0xff000000U) >> 24));
+
+ return((((uint32_t)x & 0x000000ffU) << 24) |
+
+ (((uint32_t)x & 0x0000ff00U) << 8) |
+
+ (((uint32_t)x & 0x00ff0000U) >> 8) |
+
+ (((uint32_t)x & 0xff000000U) >> 24));
+
}
+
+
static inline int16_t swap16(int16_t x){
+
- return((((u_int16_t)x & 0x00ffU) << 8) |
+
- (((u_int16_t)x & 0xff00U) >> 8));
+
+ return((((uint16_t)x & 0x00ffU) << 8) |
+
+ (((uint16_t)x & 0xff00U) >> 8));
+
}
+
+
#if BYTE_ORDER == LITTLE_ENDIAN
+
diff --git cdparanoia-III-10.2/utils.h cdparanoia-III-10.2/utils.h
+
index 10dce58..6211ce3 100644
+
--- cdparanoia-III-10.2/utils.h
+
+++ cdparanoia-III-10.2/utils.h
+
@@ -1,5 +1,6 @@
+
+#include <unistd.h>
+
+#include <stdint.h>
+
#include <stdlib.h>
+
-#include <endian.h>
+
#include <stdio.h>
+
#include <errno.h>
+
#include <string.h>
+
@@ -18,15 +19,15 @@ static inline int bigendianp(void){
+
}
+
+
static inline int32_t swap32(int32_t x){
+
- return((((u_int32_t)x & 0x000000ffU) << 24) |
+
- (((u_int32_t)x & 0x0000ff00U) << 8) |
+
- (((u_int32_t)x & 0x00ff0000U) >> 8) |
+
- (((u_int32_t)x & 0xff000000U) >> 24));
+
+ return((((uint32_t)x & 0x000000ffU) << 24) |
+
+ (((uint32_t)x & 0x0000ff00U) << 8) |
+
+ (((uint32_t)x & 0x00ff0000U) >> 8) |
+
+ (((uint32_t)x & 0xff000000U) >> 24));
+
}
+
+
static inline int16_t swap16(int16_t x){
+
- return((((u_int16_t)x & 0x00ffU) << 8) |
+
- (((u_int16_t)x & 0xff00U) >> 8));
+
+ return((((uint16_t)x & 0x00ffU) << 8) |
+
+ (((uint16_t)x & 0xff00U) >> 8));
+
}
+
+
#if BYTE_ORDER == LITTLE_ENDIAN
+2 -1
pkgs/applications/editors/kakoune/default.nix
···
-
{ stdenv, fetchFromGitHub, ncurses, boost, asciidoc, docbook_xsl, libxslt }:
+
{ stdenv, fetchFromGitHub, ncurses, boost, asciidoc, docbook_xsl, libxslt, pkgconfig }:
with stdenv.lib;
···
rev = "7482d117cc85523e840dff595134dcb9cdc62207";
sha256 = "08j611y192n9vln9i94ldlvz3k0sg79dkmfc0b1vczrmaxhpgpfh";
};
+
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ncurses boost asciidoc docbook_xsl libxslt ];
postPatch = ''
+7 -2
pkgs/applications/misc/xterm/default.nix
···
-
{ stdenv, fetchurl, xorg, ncurses, freetype, fontconfig, pkgconfig, makeWrapper
+
{ stdenv, fetchurl, fetchpatch, xorg, ncurses, freetype, fontconfig, pkgconfig, makeWrapper
, enableDecLocator ? true
}:
···
patches = [
./sixel-256.support.patch
-
];
+
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl
+
(fetchpatch {
+
name = "posix-ptys.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/community/xterm/posix-ptys.patch?id=3aa532e77875fa1db18c7fcb938b16647031bcc1";
+
sha256 = "0czgnsxkkmkrk1idw69qxbprh0jb4sw3c24zpnqq2v76jkl7zvlr";
+
});
configureFlags = [
"--enable-wide-chars"
+6 -2
pkgs/applications/networking/browsers/w3m/default.nix
···
hardeningDisable = [ "format" ];
-
configureFlags = "--with-ssl=${openssl.dev} --with-gc=${boehmgc.dev}"
-
+ optionalString graphicsSupport " --enable-image=${optionalString x11Support "x11,"}fb";
+
configureFlags =
+
[ "--with-ssl=${openssl.dev}" "--with-gc=${boehmgc.dev}" ]
+
++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+
"ac_cv_func_setpgrp_void=yes"
+
]
+
++ optional graphicsSupport "--enable-image=${optionalString x11Support "x11,"}fb";
preConfigure = ''
substituteInPlace ./configure --replace "/lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64" /no-such-path
+7 -1
pkgs/applications/networking/sniffers/wireshark/default.nix
···
++ optionals stdenv.isLinux [ libcap libnl ]
++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
-
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
+
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ]
+
# https://code.wireshark.org/review/#/c/23728/
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
name = "fix-timeout.patch";
+
url = "https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commitdiff_plain;h=8b5b843fcbc3e03e0fc45f3caf8cf5fc477e8613;hp=94af9724d140fd132896b650d10c4d060788e4f0";
+
sha256 = "1g2dm7lwsnanwp68b9xr9swspx7hfj4v3z44sz3yrfmynygk8zlv";
+
});
postInstall = optionalString (withQt || withGtk) ''
${optionalString withGtk ''
+19 -1
pkgs/applications/science/logic/avy/default.nix
···
};
buildInputs = [ cmake zlib boost.out boost.dev ];
-
NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ];
+
NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ]
+
# Squelch endless stream of warnings on same few things
+
++ stdenv.lib.optionals stdenv.cc.isClang [
+
"-Wno-empty-body"
+
"-Wno-tautological-compare"
+
"-Wc++11-compat-deprecated-writable-strings"
+
"-Wno-deprecated"
+
];
+
+
prePatch = ''
+
sed -i -e '1i#include <stdint.h>' abc/src/bdd/dsd/dsd.h
+
substituteInPlace abc/src/bdd/dsd/dsd.h --replace \
+
'((Child = Dsd_NodeReadDec(Node,Index))>=0);' \
+
'((intptr_t)(Child = Dsd_NodeReadDec(Node,Index))>=0);'
+
+
patch -p1 -d minisat -i ${./minisat-fenv.patch}
+
patch -p1 -d glucose -i ${./glucose-fenv.patch}
+
'';
+
patches =
[ ./0001-no-static-boost-libs.patch
];
+65
pkgs/applications/science/logic/avy/glucose-fenv.patch
···
+
From d6e0cb60270e8653bda3f339e3a07ce2cd2d6eb0 Mon Sep 17 00:00:00 2001
+
From: Will Dietz <w@wdtz.org>
+
Date: Tue, 17 Oct 2017 23:01:36 -0500
+
Subject: [PATCH] glucose: use fenv to set double precision
+
+
---
+
core/Main.cc | 8 ++++++--
+
simp/Main.cc | 8 ++++++--
+
utils/System.h | 2 +-
+
3 files changed, 13 insertions(+), 5 deletions(-)
+
+
diff --git a/core/Main.cc b/core/Main.cc
+
index c96aadd..994132b 100644
+
--- a/core/Main.cc
+
+++ b/core/Main.cc
+
@@ -96,8 +96,12 @@ int main(int argc, char** argv)
+
// printf("This is MiniSat 2.0 beta\n");
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("c WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/simp/Main.cc b/simp/Main.cc
+
index 4f4772d..70c2e4b 100644
+
--- a/simp/Main.cc
+
+++ b/simp/Main.cc
+
@@ -97,8 +97,12 @@ int main(int argc, char** argv)
+
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/utils/System.h b/utils/System.h
+
index 004d498..a768e99 100644
+
--- a/utils/System.h
+
+++ b/utils/System.h
+
@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+
#define Glucose_System_h
+
+
#if defined(__linux__)
+
-#include <fpu_control.h>
+
+#include <fenv.h>
+
#endif
+
+
#include "glucose/mtl/IntTypes.h"
+
--
+
2.14.2
+
+65
pkgs/applications/science/logic/avy/minisat-fenv.patch
···
+
From 7f1016ceab9b0f57a935bd51ca6df3d18439b472 Mon Sep 17 00:00:00 2001
+
From: Will Dietz <w@wdtz.org>
+
Date: Tue, 17 Oct 2017 22:57:02 -0500
+
Subject: [PATCH] use fenv instead of non-standard fpu_control
+
+
---
+
core/Main.cc | 8 ++++++--
+
simp/Main.cc | 8 ++++++--
+
utils/System.h | 2 +-
+
3 files changed, 13 insertions(+), 5 deletions(-)
+
+
diff --git a/core/Main.cc b/core/Main.cc
+
index 2b0d97b..8ad95fb 100644
+
--- a/core/Main.cc
+
+++ b/core/Main.cc
+
@@ -78,8 +78,12 @@ int main(int argc, char** argv)
+
// printf("This is MiniSat 2.0 beta\n");
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/simp/Main.cc b/simp/Main.cc
+
index 2804d7f..39bfb71 100644
+
--- a/simp/Main.cc
+
+++ b/simp/Main.cc
+
@@ -79,8 +79,12 @@ int main(int argc, char** argv)
+
// printf("This is MiniSat 2.0 beta\n");
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/utils/System.h b/utils/System.h
+
index 1758192..c0ad13a 100644
+
--- a/utils/System.h
+
+++ b/utils/System.h
+
@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+
#define Minisat_System_h
+
+
#if defined(__linux__)
+
-#include <fpu_control.h>
+
+#include <fenv.h>
+
#endif
+
+
#include "mtl/IntTypes.h"
+
--
+
2.14.2
+
+19 -1
pkgs/applications/science/logic/boolector/default.nix
···
-
{ stdenv, fetchurl }:
+
{ stdenv, fetchurl, writeShellScriptBin }:
stdenv.mkDerivation rec {
name = "boolector-${version}";
···
url = "http://fmv.jku.at/boolector/boolector-${version}-with-lingeling-bbc.tar.bz2";
sha256 = "0mdf7hwix237pvknvrpazcx6s3ininj5k7vhysqjqgxa7lxgq045";
};
+
+
prePatch =
+
let
+
lingelingPatch = writeShellScriptBin "lingeling-patch" ''
+
sed -i -e "1i#include <stdint.h>" lingeling/lglib.h
+
+
${crossFix}/bin/crossFix lingeling
+
'';
+
crossFix = writeShellScriptBin "crossFix" ''
+
# substituteInPlace not available here
+
sed -i $1/makefile.in \
+
-e 's@ar rc@$(AR) rc@' \
+
-e 's@ranlib@$(RANLIB)@'
+
'';
+
in ''
+
sed -i -e 's@mv lingeling\* lingeling@\0 \&\& ${lingelingPatch}/bin/lingeling-patch@' makefile
+
sed -i -e 's@mv boolector\* boolector@\0 \&\& ${crossFix}/bin/crossFix boolector@' makefile
+
'';
installPhase = ''
mkdir $out
+7
pkgs/applications/science/logic/cvc4/default.nix
···
"--with-boost=${boost.dev}"
];
+
prePatch = ''
+
patch -p1 -i ${./minisat-fenv.patch} -d src/prop/minisat
+
patch -p1 -i ${./minisat-fenv.patch} -d src/prop/bvminisat
+
'';
+
preConfigure = ''
patchShebangs ./src/
'';
+
+
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A high-performance theorem prover and SMT solver";
+65
pkgs/applications/science/logic/cvc4/minisat-fenv.patch
···
+
From 7f1016ceab9b0f57a935bd51ca6df3d18439b472 Mon Sep 17 00:00:00 2001
+
From: Will Dietz <w@wdtz.org>
+
Date: Tue, 17 Oct 2017 22:57:02 -0500
+
Subject: [PATCH] use fenv instead of non-standard fpu_control
+
+
---
+
core/Main.cc | 8 ++++++--
+
simp/Main.cc | 8 ++++++--
+
utils/System.h | 2 +-
+
3 files changed, 13 insertions(+), 5 deletions(-)
+
+
diff --git a/core/Main.cc b/core/Main.cc
+
index 2b0d97b..8ad95fb 100644
+
--- a/core/Main.cc
+
+++ b/core/Main.cc
+
@@ -78,8 +78,12 @@ int main(int argc, char** argv)
+
// printf("This is MiniSat 2.0 beta\n");
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/simp/Main.cc b/simp/Main.cc
+
index 2804d7f..39bfb71 100644
+
--- a/simp/Main.cc
+
+++ b/simp/Main.cc
+
@@ -79,8 +79,12 @@ int main(int argc, char** argv)
+
// printf("This is MiniSat 2.0 beta\n");
+
+
#if defined(__linux__)
+
- fpu_control_t oldcw, newcw;
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+
+ fenv_t fenv;
+
+
+
+ fegetenv(&fenv);
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+
+ fesetenv(&fenv);
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
+
#endif
+
// Extra options:
+
diff --git a/utils/System.h b/utils/System.h
+
index 1758192..c0ad13a 100644
+
--- a/utils/System.h
+
+++ b/utils/System.h
+
@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+
#define Minisat_System_h
+
+
#if defined(__linux__)
+
-#include <fpu_control.h>
+
+#include <fenv.h>
+
#endif
+
+
#include "mtl/IntTypes.h"
+
--
+
2.14.2
+
+8
pkgs/applications/science/logic/picosat/default.nix
···
sha256 = "0m578rpa5rdn08d10kr4lbsdwp4402hpavrz6n7n53xs517rn5hm";
};
+
prePatch = ''
+
substituteInPlace picosat.c --replace "sys/unistd.h" "unistd.h"
+
+
substituteInPlace makefile.in \
+
--replace 'ar rc' '$(AR) rc' \
+
--replace 'ranlib' '$(RANLIB)'
+
'';
+
configurePhase = "./configure.sh --shared --trace";
installPhase = ''
+4 -1
pkgs/applications/version-management/git-and-tools/git/default.nix
···
makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
+ (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1")
+ (if stdenv.isSunOS then " INSTALL=install NO_INET_NTOP= NO_INET_PTON=" else "")
-
+ (if stdenv.isDarwin then " NO_APPLE_COMMON_CRYPTO=1" else " sysconfdir=/etc/ ");
+
+ (if stdenv.isDarwin then " NO_APPLE_COMMON_CRYPTO=1" else " sysconfdir=/etc/ ")
+
# XXX: USE_PCRE2 might be useful in general, look into it
+
# XXX other alpine options?
+
+ (if stdenv.hostPlatform.isMusl then "NO_SYS_POLL_H=1 NO_GETTEXT=YesPlease" else "");
# build git-credential-osxkeychain if darwin
postBuild = stdenv.lib.optionalString stdenv.isDarwin ''
+1
pkgs/build-support/bintools-wrapper/default.nix
···
# shell glob that ought to match it.
dynamicLinker =
/**/ if libc == null then null
+
else if targetPlatform.libc == "musl" then "${libc_lib}/lib/ld-musl-*"
else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2"
else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2"
# ARM with a wildcard, which can be "" or "-armhf".
+1 -1
pkgs/development/compilers/gcc/4.8/default.nix
···
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
-
optionals (targetPlatform.libc == "uclibc") [
+
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
+1 -1
pkgs/development/compilers/gcc/4.9/default.nix
···
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
-
optionals (targetPlatform.libc == "uclibc") [
+
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
+18 -6
pkgs/development/compilers/gcc/5/default.nix
···
-
{ stdenv, targetPackages, fetchurl, noSysDirs
+
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
···
# This could be applied unconditionally but I don't want to cause a full
# Linux rebuild.
-
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch;
+
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch
+
++ optional stdenv.hostPlatform.isMusl (fetchpatch {
+
url = https://raw.githubusercontent.com/richfelker/musl-cross-make/e84b1bd1fc12a3def33111ca6df522cd6e5ec361/patches/gcc-5.3.0/0001-musl.diff;
+
sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
+
});
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
···
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
-
optionals (targetPlatform.libc == "uclibc") [
+
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
···
let
libc = if libcCross != null then libcCross else stdenv.cc.libc;
in
-
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
+
(
+
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
-
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
+
grep -q _DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..."
sed -i "$header" \
-
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
+
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
+
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done
''
+
+ stdenv.lib.optionalString (targetPlatform.libc == "musl")
+
''
+
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
+
''
+
)
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
···
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
+
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
+17 -4
pkgs/development/compilers/gcc/6/default.nix
···
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
+
# maybe only needed on musl, PATH_MAX
+
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
+
"--disable-libmpx"
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
···
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
-
optionals (targetPlatform.libc == "uclibc") [
+
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
+
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
+
"--disable-libmpx"
] ++ [
"--enable-threads=posix"
"--enable-nls"
···
let
libc = if libcCross != null then libcCross else stdenv.cc.libc;
in
-
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
+
(
+
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
-
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
+
grep -q _DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..."
sed -i "$header" \
-
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
+
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
+
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done
''
+
+ stdenv.lib.optionalString (targetPlatform.libc == "musl")
+
''
+
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
+
''
+
)
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
···
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
+
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
+43
pkgs/development/compilers/gcc/6/fix-objdump-check.patch
···
+
commit 4c38abe0967bad78dd6baa61c86923e4d4b346d3
+
Author: Ben Gamari <ben@smart-cactus.org>
+
Date: Sun Nov 5 13:14:19 2017 -0500
+
+
Fix it
+
+
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
+
index dd06a58..f4435b8 100644
+
--- a/config/gcc-plugin.m4
+
+++ b/config/gcc-plugin.m4
+
@@ -13,6 +13,32 @@ dnl the same distribution terms as the rest of that program.
+
# Sets the shell variables enable_plugin and pluginlibs.
+
AC_DEFUN([GCC_ENABLE_PLUGINS],
+
[# Check for plugin support
+
+
+
+ # Figure out what objdump we will be using.
+
+ AS_VAR_SET_IF(gcc_cv_objdump,, [
+
+ if test -f $gcc_cv_binutils_srcdir/configure.ac \
+
+ && test -f ../binutils/Makefile \
+
+ && test x$build = x$host; then
+
+ # Single tree build which includes binutils.
+
+ gcc_cv_objdump=../binutils/objdump$build_exeext
+
+ elif test -x objdump$build_exeext; then
+
+ gcc_cv_objdump=./objdump$build_exeext
+
+ elif ( set dummy $OBJDUMP_FOR_TARGET; test -x $[2] ); then
+
+ gcc_cv_objdump="$OBJDUMP_FOR_TARGET"
+
+ else
+
+ AC_PATH_PROG(gcc_cv_objdump, $OBJDUMP_FOR_TARGET)
+
+ fi])
+
+
+
+ AC_MSG_CHECKING(what objdump to use)
+
+ if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then
+
+ # Single tree build which includes binutils.
+
+ AC_MSG_RESULT(newly built objdump)
+
+ elif test x$gcc_cv_objdump = x; then
+
+ AC_MSG_RESULT(not found)
+
+ else
+
+ AC_MSG_RESULT($gcc_cv_objdump)
+
+ fi
+
+
+
AC_ARG_ENABLE(plugin,
+
[AS_HELP_STRING([--enable-plugin], [enable plugin support])],
+
enable_plugin=$enableval,
+17 -5
pkgs/development/compilers/gcc/7/default.nix
···
-
{ stdenv, targetPackages, fetchurl, noSysDirs
+
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
···
[ ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
+
++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied
+
url = "https://git.busybox.net/buildroot/plain/package/gcc/7.1.0/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
+
sha256 = "0mrvxsdwip2p3l17dscpc1x8vhdsciqw1z5q9i6p5g9yg1cqnmgs";
+
})
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
···
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
-
optionals (targetPlatform.libc == "uclibc") [
+
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
···
let
libc = if libcCross != null then libcCross else stdenv.cc.libc;
in
-
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
+
(
+
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
-
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
+
grep -q _DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..."
sed -i "$header" \
-
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
+
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
+
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done
''
+
+ stdenv.lib.optionalString (hostPlatform.libc == "musl")
+
''
+
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
+
''
+
)
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
···
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
+
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
+2 -1
pkgs/development/compilers/go/1.8.nix
···
nativeBuildInputs = [ perl which pkgconfig patch makeWrapper ]
++ optionals stdenv.isLinux [ procps ];
buildInputs = [ cacert pcre ]
-
++ optionals stdenv.isLinux [ stdenv.glibc.out stdenv.glibc.static ];
+
++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
+
++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
hardeningDisable = [ "all" ];
+2 -1
pkgs/development/compilers/go/1.9.nix
···
nativeBuildInputs = [ perl which pkgconfig patch makeWrapper ]
++ optionals stdenv.isLinux [ procps ];
buildInputs = [ cacert pcre ]
-
++ optionals stdenv.isLinux [ stdenv.glibc.out stdenv.glibc.static ];
+
++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
+
++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
hardeningDisable = [ "all" ];
+1 -1
pkgs/development/compilers/llvm/4/llvm.nix
···
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
patch -p1 < ./llvm-outputs.patch
''
-
+ stdenv.lib.optionalString (stdenv ? glibc) ''
+
+ ''
(
cd projects/compiler-rt
patch -p1 < ${
+2 -2
pkgs/development/compilers/zig/default.nix
···
-
{ stdenv, fetchFromGitHub, cmake, llvmPackages_5, llvm_5 }:
+
{ stdenv, fetchFromGitHub, cmake, llvmPackages }:
stdenv.mkDerivation rec {
version = "0.1.1";
···
sha256 = "01yqjyi25f99bfmxxwyh45k7j84z0zg7n9jl8gg0draf96mzdh06";
};
-
buildInputs = [ cmake llvmPackages_5.clang-unwrapped llvm_5 ];
+
buildInputs = [ cmake llvmPackages.clang-unwrapped llvmPackages.llvm ];
cmakeFlags = [
"-DZIG_LIBC_INCLUDE_DIR=${stdenv.cc.libc_dev}/include"
+1 -1
pkgs/development/haskell-modules/configuration-nix.nix
···
}
);
-
llvm-hs = super.llvm-hs.override { llvm-config = pkgs.llvm_5; };
+
llvm-hs = super.llvm-hs.override { llvm-config = pkgs.llvm; };
# Needs help finding LLVM.
spaceprobe = addBuildTool super.spaceprobe self.llvmPackages.llvm;
+1 -1
pkgs/development/interpreters/lua-5/5.1.nix
···
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC="$CC" )
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' )
'' else ''
-
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" )
+
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" CC="$CC" AR="$AR q" RANLIB="$RANLIB" )
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.5.1 liblua.so.5.1.5" INSTALL_DATA='cp -d' )
'';
+29 -4
pkgs/development/interpreters/python/cpython/2.7/default.nix
···
-
{ stdenv, hostPlatform, fetchurl
+
{ stdenv, hostPlatform, buildPlatform, buildPackages, fetchurl
, bzip2
, gdbm
, fetchpatch
···
# only works for GCC and Apple Clang. This makes distutils to call C++
# compiler when needed.
./python-2.7-distutils-C++.patch
-
];
preConfigure = ''
···
"ac_cv_func_bind_textdomain_codeset=yes"
] ++ optionals stdenv.isDarwin [
"--disable-toolbox-glue"
+
] ++ optionals (hostPlatform != buildPlatform) [
+
"PYTHON_FOR_BUILD=${getBin buildPackages.python}/bin/python"
+
"ac_cv_buggy_getaddrinfo=no"
+
# Assume little-endian IEEE 754 floating point when cross compiling
+
"ac_cv_little_endian_double=yes"
+
"ac_cv_big_endian_double=no"
+
"ac_cv_mixed_endian_double=no"
+
"ac_cv_x87_double_rounding=yes"
+
"ac_cv_tanh_preserves_zero_sign=yes"
+
# Generally assume that things are present and work
+
"ac_cv_posix_semaphores_enabled=yes"
+
"ac_cv_broken_sem_getvalue=no"
+
"ac_cv_wchar_t_signed=yes"
+
"ac_cv_rshift_extends_sign=yes"
+
"ac_cv_broken_nice=no"
+
"ac_cv_broken_poll=no"
+
"ac_cv_working_tzset=yes"
+
"ac_cv_have_long_long_format=yes"
+
"ac_cv_have_size_t_format=yes"
+
"ac_cv_computed_gotos=yes"
+
"ac_cv_file__dev_ptmx=yes"
+
"ac_cv_file__dev_ptc=yes"
];
postConfigure = if hostPlatform.isCygwin then ''
···
++ [ db gdbm ncurses sqlite readline ]
++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
++ optionals stdenv.isDarwin ([ CF ] ++ optional (configd != null) configd);
+
nativeBuildInputs =
+
optionals (hostPlatform != buildPlatform)
+
[ buildPackages.stdenv.cc buildPackages.python ];
mkPaths = paths: {
C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" paths;
···
name = "python-${version}";
pythonVersion = majorVersion;
-
inherit majorVersion version src patches buildInputs
+
inherit majorVersion version src patches buildInputs nativeBuildInputs
preConfigure configureFlags;
LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
···
# Determinism: Windows installers were not deterministic.
# We're also not interested in building Windows installers.
find "$out" -name 'wininst*.exe' | xargs -r rm -f
-
+
'' + optionalString (stdenv.hostPlatform == stdenv.buildPlatform)
+
''
# Determinism: rebuild all bytecode
# We exclude lib2to3 because that's Python 2 code which fails
# We rebuild three times, once for each optimization level
+27 -3
pkgs/development/interpreters/python/cpython/3.6/default.nix
···
-
{ stdenv, fetchurl, fetchpatch
+
{ stdenv, fetchurl, fetchpatch, buildPackages
, glibc
, bzip2
, expat
···
++ optionals x11Support [ tcl tk libX11 xproto ]
++ optionals stdenv.isDarwin [ CF configd ];
+
nativeBuildInputs =
+
optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.python3;
+
in stdenv.mkDerivation {
name = "python3-${version}";
pythonVersion = majorVersion;
inherit majorVersion version;
-
inherit buildInputs;
+
inherit buildInputs nativeBuildInputs;
src = fetchurl {
url = "https://www.python.org/ftp/python/${majorVersion}.${minorVersion}/Python-${version}.tar.xz";
···
"--without-ensurepip"
"--with-system-expat"
"--with-system-ffi"
+
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+
"ac_cv_buggy_getaddrinfo=no"
+
# Assume little-endian IEEE 754 floating point when cross compiling
+
"ac_cv_little_endian_double=yes"
+
"ac_cv_big_endian_double=no"
+
"ac_cv_mixed_endian_double=no"
+
"ac_cv_x87_double_rounding=yes"
+
"ac_cv_tanh_preserves_zero_sign=yes"
+
# Generally assume that things are present and work
+
"ac_cv_posix_semaphores_enabled=yes"
+
"ac_cv_broken_sem_getvalue=no"
+
"ac_cv_wchar_t_signed=yes"
+
"ac_cv_rshift_extends_sign=yes"
+
"ac_cv_broken_nice=no"
+
"ac_cv_broken_poll=no"
+
"ac_cv_working_tzset=yes"
+
"ac_cv_have_long_long_format=yes"
+
"ac_cv_have_size_t_format=yes"
+
"ac_cv_computed_gotos=yes"
+
"ac_cv_file__dev_ptmx=yes"
+
"ac_cv_file__dev_ptc=yes"
];
preConfigure = ''
···
for i in $out/lib/python${majorVersion}/_sysconfigdata*.py $out/lib/python${majorVersion}/config-${majorVersion}m*/Makefile; do
sed -i $i -e "s|-I/nix/store/[^ ']*||g" -e "s|-L/nix/store/[^ ']*||g" -e "s|$TMPDIR|/no-such-path|g"
done
-
+
'' + optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
# Determinism: rebuild all bytecode
# We exclude lib2to3 because that's Python 2 code which fails
# We rebuild three times, once for each optimization level
+20 -6
pkgs/development/interpreters/ruby/default.nix
···
-
{ stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
+
{ stdenv, buildPackages, lib
+
, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
, zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison
, autoconf, darwin ? null
, buildEnv, bundler, bundix, Foundation
···
# Contains the ruby version heuristics
rubyVersion = import ./ruby-version.nix { inherit lib; };
+
# Needed during postInstall
+
buildRuby =
+
if stdenv.hostPlatform == stdenv.buildPlatform
+
then "$out/bin/ruby"
+
else "${buildPackages.ruby}/bin/ruby";
+
generic = { version, sha256 }: let
ver = version;
tag = ver.gitTag;
···
isRuby25 = ver.majMin == "2.5";
baseruby = self.override { useRailsExpress = false; };
self = lib.makeOverridable (
-
{ stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
+
{ stdenv, buildPackages, lib
+
, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
, useRailsExpress ? true
, zlib, zlibSupport ? true
, openssl, opensslSupport ? true
···
unpackdir rubySrc;
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
-
NROFF = "${groff}/bin/nroff";
+
NROFF = if docSupport then "${groff}/bin/nroff" else null;
-
nativeBuildInputs = ops useRailsExpress [ autoreconfHook bison ];
+
nativeBuildInputs =
+
ops useRailsExpress [ autoreconfHook bison ]
+
++ ops (stdenv.buildPlatform != stdenv.hostPlatform) [
+
buildPackages.ruby
+
];
buildInputs =
(op fiddleSupport libffi)
++ (ops cursesSupport [ ncurses readline ])
···
"--with-out-ext=tk"
# on yosemite, "generating encdb.h" will hang for a very long time without this flag
"--with-setjmp-type=setjmp"
-
];
+
]
+
++ op (stdenv.hostPlatform != stdenv.buildPlatform)
+
"--with-baseruby=${buildRuby}";
installFlags = stdenv.lib.optionalString docSupport "install-doc";
# Bundler tries to create this directory
postInstall = ''
# Update rubygems
pushd rubygems
-
$out/bin/ruby setup.rb
+
${buildRuby} setup.rb
popd
# Remove unnecessary groff reference from runtime closure, since it's big
+3 -2
pkgs/development/libraries/SDL/default.nix
···
-
{ stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap
+
{ stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
, openglSupport ? false, mesa_noglu, mesa_glu
, alsaSupport ? true, alsaLib
, x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr
···
buildInputs = let
notMingw = !hostPlatform.isMinGW;
in optional notMingw audiofile
-
++ optionals stdenv.isDarwin [ OpenGL CoreAudio CoreServices AudioUnit Kernel ];
+
++ optionals stdenv.isDarwin [ OpenGL CoreAudio CoreServices AudioUnit Kernel ]
+
++ [ libiconv ];
# XXX: By default, SDL wants to dlopen() PulseAudio, in which case
# we must arrange to add it to its RPATH; however, `patchelf' seems
+3 -1
pkgs/development/libraries/SDL2/default.nix
···
, ibusSupport ? false, ibus
, pulseaudioSupport ? true, libpulseaudio
, AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
+
, libiconv
}:
# OSS is no longer supported, for it's much crappier than ALSA and
···
# Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
propagatedBuildInputs = lib.optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] ++
lib.optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] ++
-
lib.optional pulseaudioSupport libpulseaudio;
+
lib.optional pulseaudioSupport libpulseaudio
+
++ [ libiconv ];
buildInputs = [ audiofile ] ++
lib.optional openglSupport mesa_noglu ++
+3 -1
pkgs/development/libraries/attr/default.nix
···
-
{ stdenv, fetchurl, gettext }:
+
{ stdenv, fetchurl, gettext, hostPlatform }:
stdenv.mkDerivation rec {
name = "attr-2.4.47";
···
configureFlags = [ "MAKE=make" "MSGFMT=msgfmt" "MSGMERGE=msgmerge" "XGETTEXT=xgettext" "ECHO=echo" "SED=sed" "AWK=gawk" ];
installTargets = [ "install" "install-lib" "install-dev" ];
+
+
patches = if (hostPlatform.libc == "musl") then [ ./fix-headers-musl.patch ] else null;
meta = with stdenv.lib; {
homepage = "http://savannah.nongnu.org/projects/attr/";
+54
pkgs/development/libraries/attr/fix-headers-musl.patch
···
+
--- attr-2.4.47/include/xattr.h
+
+++ attr-2.4.47/include/xattr.h
+
@@ -31,33 +31,37 @@
+
#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+
+
-__BEGIN_DECLS
+
+#ifdef __cplusplus
+
+extern "C" {
+
+#endif
+
+
extern int setxattr (const char *__path, const char *__name,
+
- const void *__value, size_t __size, int __flags) __THROW;
+
+ const void *__value, size_t __size, int __flags);
+
extern int lsetxattr (const char *__path, const char *__name,
+
- const void *__value, size_t __size, int __flags) __THROW;
+
+ const void *__value, size_t __size, int __flags);
+
extern int fsetxattr (int __filedes, const char *__name,
+
- const void *__value, size_t __size, int __flags) __THROW;
+
+ const void *__value, size_t __size, int __flags);
+
+
extern ssize_t getxattr (const char *__path, const char *__name,
+
- void *__value, size_t __size) __THROW;
+
+ void *__value, size_t __size);
+
extern ssize_t lgetxattr (const char *__path, const char *__name,
+
- void *__value, size_t __size) __THROW;
+
+ void *__value, size_t __size);
+
extern ssize_t fgetxattr (int __filedes, const char *__name,
+
- void *__value, size_t __size) __THROW;
+
+ void *__value, size_t __size);
+
+
extern ssize_t listxattr (const char *__path, char *__list,
+
- size_t __size) __THROW;
+
+ size_t __size);
+
extern ssize_t llistxattr (const char *__path, char *__list,
+
- size_t __size) __THROW;
+
+ size_t __size);
+
extern ssize_t flistxattr (int __filedes, char *__list,
+
- size_t __size) __THROW;
+
+ size_t __size);
+
+
-extern int removexattr (const char *__path, const char *__name) __THROW;
+
-extern int lremovexattr (const char *__path, const char *__name) __THROW;
+
-extern int fremovexattr (int __filedes, const char *__name) __THROW;
+
+extern int removexattr (const char *__path, const char *__name);
+
+extern int lremovexattr (const char *__path, const char *__name);
+
+extern int fremovexattr (int __filedes, const char *__name);
+
+
-__END_DECLS
+
+#ifdef __cplusplus
+
+}
+
+#endif
+
+
#endif /* __XATTR_H__ */
+1
pkgs/development/libraries/aws-sdk-cpp/default.nix
···
cmakeFlags =
lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
+
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DENABLE_TESTING=OFF"
++ lib.optional (apis != ["*"])
"-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
+12 -2
pkgs/development/libraries/boehm-gc/default.nix
···
-
{ lib, stdenv, fetchurl, pkgconfig, libatomic_ops, enableLargeConfig ? false
+
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops, enableLargeConfig ? false
, buildPlatform, hostPlatform
}:
···
outputs = [ "out" "dev" "doc" ];
separateDebugInfo = stdenv.isLinux;
+
preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
+
export NIX_CFLAGS_COMPILE+="-D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
+
'';
+
+
patches = [ (fetchpatch {
+
url = "https://raw.githubusercontent.com/gentoo/musl/85b6a600996bdd71162b357e9ba93d8559342432/dev-libs/boehm-gc/files/boehm-gc-7.6.0-sys_select.patch";
+
sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3";
+
}) ];
+
configureFlags =
[ "--enable-cplusplus" ]
-
++ lib.optional enableLargeConfig "--enable-large-config";
+
++ lib.optional enableLargeConfig "--enable-large-config"
+
++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
doCheck = true; # not cross;
+1 -1
pkgs/development/libraries/fftw/default.nix
···
# all x86_64 have sse2
# however, not all float sizes fit
++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2"
-
++ optional stdenv.cc.isGNU "--enable-openmp"
+
++ optional (stdenv.cc.isGNU && !stdenv.hostPlatform.isMusl) "--enable-openmp"
# doc generation causes Fortran wrapper generation which hard-codes gcc
++ optional (!withDoc) "--disable-doc";
+7 -2
pkgs/development/libraries/gamin/default.nix
···
-
{ stdenv, fetchurl, python, pkgconfig, glib }:
+
{ stdenv, fetchurl, fetchpatch, python, pkgconfig, glib }:
stdenv.mkDerivation (rec {
name = "gamin-0.1.10";
···
patches = [ ./deadlock.patch ]
++ map fetchurl (import ./debian-patches.nix)
-
++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch;
+
++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
name = "fix-pthread-mutex.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/gamin/fix-pthread-mutex.patch?h=3.4-stable&id=a1a836b089573752c1b0da7d144c0948b04e8ea8";
+
sha256 = "13igdbqsxb3sz0h417k6ifmq2n4siwqspj6slhc7fdl5wd1fxmdz";
+
});
meta = with stdenv.lib; {
+1 -1
pkgs/development/libraries/glibc/common.nix
···
# To avoid a dependency on the build system 'bash'.
preFixup = ''
-
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
+
rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace}
'';
})
+2 -2
pkgs/development/libraries/glibc/locales.nix
···
https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
*/
-
{ stdenv, callPackage, writeText
+
{ stdenv, buildPackages, callPackage, writeText
, allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
}:
···
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
-
mkdir -p $TMPDIR/"${stdenv.cc.libc.out}/lib/locale"
+
mkdir -p $TMPDIR/"${buildPackages.stdenv.cc.libc.out}/lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile
+1 -1
pkgs/development/libraries/icu/base.nix
···
'';
# https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
-
postPatch = if stdenv ? glibc
+
postPatch = if (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl")
then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'"
else null; # won't find locale_t on darwin
+13 -1
pkgs/development/libraries/libbfd/default.nix
···
{ stdenv
-
, fetchurl, autoreconfHook264, bison, binutils-raw
+
, fetchurl, fetchpatch, gnu-config, autoreconfHook264, bison, binutils-raw
, libiberty, zlib
}:
···
patches = binutils-raw.bintools.patches ++ [
../../tools/misc/binutils/build-components-separately.patch
+
(fetchpatch {
+
url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
+
sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
+
})
];
# We just want to build libbfd
postPatch = ''
cd bfd
'';
+
+
postAutoreconf = ''
+
echo "Updating config.guess and config.sub from ${gnu-config}"
+
cp -f ${gnu-config}/config.{guess,sub} ../
+
'';
+
+
# We update these ourselves
+
dontUpdateAutotoolsGnuConfigScripts = true;
nativeBuildInputs = [ autoreconfHook264 bison ];
buildInputs = [ libiberty zlib ];
+4 -3
pkgs/development/libraries/libclc/default.nix
···
-
{ stdenv, fetchFromGitHub, python2, llvmPackages }:
+
{ stdenv, fetchFromGitHub, python, llvmPackages }:
let
llvm = llvmPackages.llvm;
···
sha256 = "10fqrlnqlknh58x7pfsbg9r07fblfg2mgq2m4fr1jbb836ncn3wh";
};
-
buildInputs = [ python2 llvm clang ];
+
nativeBuildInputs = [ python ];
+
buildInputs = [ llvm clang ];
postPatch = ''
sed -i 's,llvm_clang =.*,llvm_clang = "${clang}/bin/clang",' configure.py
···
'';
configurePhase = ''
-
${python2.interpreter} ./configure.py --prefix=$out
+
${python.interpreter} ./configure.py --prefix=$out
'';
meta = with stdenv.lib; {
+6 -2
pkgs/development/libraries/libdaemon/default.nix
···
{stdenv, fetchurl}:
-
stdenv.mkDerivation rec {
+
stdenv.mkDerivation (rec {
name = "libdaemon-0.14";
src = fetchurl {
···
platforms = stdenv.lib.platforms.unix;
maintainers = [ ];
};
-
}
+
} // stdenv.lib.optionalAttrs stdenv.hostPlatform.isMusl {
+
# This patch should be applied unconditionally, but doing so will cause mass rebuild.
+
patches = ./fix-includes.patch;
+
})
+
+13
pkgs/development/libraries/libdaemon/fix-includes.patch
···
+
--- libdaemon-0.14.orig/examples/testd.c
+
+++ libdaemon-0.14/examples/testd.c
+
@@ -21,9 +21,9 @@
+
#include <signal.h>
+
#include <errno.h>
+
#include <string.h>
+
+#include <unistd.h>
+
#include <sys/types.h>
+
#include <sys/time.h>
+
-#include <sys/unistd.h>
+
#include <sys/select.h>
+
+
#include <libdaemon/dfork.h>
+46
pkgs/development/libraries/libexecinfo/default.nix
···
+
{ stdenv, fetchurl, fetchpatch }:
+
+
stdenv.mkDerivation rec {
+
name = "libexecinfo-${version}";
+
version = "1.1";
+
+
src = fetchurl {
+
url = "http://distcache.freebsd.org/local-distfiles/itetcu/${name}.tar.bz2";
+
sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
+
};
+
+
patches = [
+
(fetchpatch {
+
name = "10-execinfo.patch";
+
url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+
sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
+
})
+
(fetchpatch {
+
name = "20-define-gnu-source.patch";
+
url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+
sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
+
})
+
(fetchpatch {
+
name = "30-linux-makefile.patch";
+
url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+
sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf";
+
})
+
];
+
+
makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
+
+
patchFlags = "-p0";
+
+
installPhase = ''
+
install -Dm644 execinfo.h stacktraverse.h -t $out/include
+
install -Dm755 libexecinfo.{a,so.1} -t $out/lib
+
ln -s $out/lib/libexecinfo.so{.1,}
+
'';
+
+
meta = with stdenv.lib; {
+
description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
+
license = licenses.bsd2;
+
homepage = https://www.freshports.org/devel/libexecinfo;
+
maintainers = with maintainers; [ dtzWill ];
+
};
+
}
+21 -4
pkgs/development/libraries/libffi/default.nix
···
-
{ fetchurl, stdenv, dejagnu, doCheck ? false
+
{ stdenv, fetchurl, fetchpatch, dejagnu, doCheck ? false
, buildPlatform, hostPlatform
}:
···
sha256 = "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh";
};
-
patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch ++
-
stdenv.lib.optional stdenv.isAarch64 (fetchurl {
+
patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch
+
++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch;
sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc";
-
});
+
})
+
++ stdenv.lib.optional hostPlatform.isMusl (fetchpatch {
+
name = "gnu-linux-define.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580";
+
sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2";
+
})
+
++ stdenv.lib.optionals stdenv.isMips [
+
(fetchpatch {
+
name = "0001-mips-Use-compiler-internal-define-for-linux.patch";
+
url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
+
sha256 = "1gc53lw90p6hc0cmhj3csrwincfz7va5ss995ksw5gm0yrr9mrvb";
+
})
+
(fetchpatch {
+
name = "0001-mips-fix-MIPS-softfloat-build-issue.patch";
+
url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
+
sha256 = "0l8xgdciqalg4z9rcwyk87h8fdxpfv4hfqxwsy2agpnpszl5jjdq";
+
})
+
];
outputs = [ "out" "dev" "man" "info" ];
+5 -1
pkgs/development/libraries/libgpg-error/default.nix
···
sha256 = "1li95ni122fzinzlmxbln63nmgij63irxfvi52ws4zfbzv3am4sg";
};
-
postPatch = "sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure";
+
postPatch = ''
+
sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
+
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
ln -s lock-obj-pub.x86_64-pc-linux-musl.h src/syscfg/lock-obj-pub.linux-musl.h
+
'';
outputs = [ "out" "dev" "info" ];
outputBin = "dev"; # deps want just the lib, most likely
+1 -1
pkgs/development/libraries/libiconv/default.nix
···
, buildPlatform, hostPlatform
}:
-
assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
+
# assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
stdenv.mkDerivation rec {
name = "libiconv-${version}";
+1 -1
pkgs/development/libraries/libidn/default.nix
···
outputs = [ "bin" "dev" "out" "info" "devdoc" ];
-
doCheck = (stdenv.buildPlatform == stdenv.hostPlatform) && !stdenv.isDarwin;
+
doCheck = !stdenv.isDarwin && !stdenv.hostPlatform.isMusl;
hardeningDisable = [ "format" ];
+2 -1
pkgs/development/libraries/libmemcached/default.nix
···
++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb";
sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8";
-
});
+
})
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
buildInputs = [ libevent ];
propagatedBuildInputs = [ cyrus_sasl ];
+58
pkgs/development/libraries/libmemcached/musl-fixes.patch
···
+
diff --git a/libhashkit/fnv_64.cc b/libhashkit/fnv_64.cc
+
index 68e4dd0..64656b7 100644
+
--- a/libhashkit/fnv_64.cc
+
+++ b/libhashkit/fnv_64.cc
+
@@ -37,8 +37,9 @@
+
+
+
#include <libhashkit/common.h>
+
+#include <limits.h>
+
+
-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
+
+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+
+
/* FNV hash'es lifted from Dustin Sallings work */
+
static uint64_t FNV_64_INIT= 0xcbf29ce484222325;
+
diff --git a/libhashkit/has.cc b/libhashkit/has.cc
+
index 843e32e..4153e5e 100644
+
--- a/libhashkit/has.cc
+
+++ b/libhashkit/has.cc
+
@@ -37,6 +37,7 @@
+
+
+
#include <libhashkit/common.h>
+
+#include <limits.h>
+
+
bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+
{
+
@@ -44,7 +45,7 @@ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+
{
+
case HASHKIT_HASH_FNV1_64:
+
case HASHKIT_HASH_FNV1A_64:
+
-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
+
+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+
return true;
+
#else
+
return false;
+
diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
+
index 29a22de..161c646 100644
+
--- a/libtest/cmdline.cc
+
+++ b/libtest/cmdline.cc
+
@@ -61,7 +61,7 @@ using namespace libtest;
+
#include <algorithm>
+
#include <stdexcept>
+
+
-#ifndef __USE_GNU
+
+#ifndef _GNU_SOURCE
+
static char **environ= NULL;
+
#endif
+
+
@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
+
+
fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+
+
-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
+
+#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
+
// Use USEVFORK on linux
+
flags |= POSIX_SPAWN_USEVFORK;
+
#endif
+3 -6
pkgs/development/libraries/libmpc/default.nix
···
{ stdenv, fetchurl
, gmp, mpfr
-
, buildPlatform, hostPlatform
}:
let
-
version = "1.0.3";
+
version = "1.1.0";
in
stdenv.mkDerivation rec {
name = "libmpc-${version}"; # to avoid clash with the MPD client
src = fetchurl {
-
url = "https://ftp.gnu.org/gnu/mpc/mpc-${version}.tar.gz";
-
sha256 = "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1";
+
url = "mirror://gnu/mpc/mpc-${version}.tar.gz";
+
sha256 = "0biwnhjm3rx3hc0rfpvyniky4lpzsvdcwhmcn7f0h4iw2hwcb1b9";
};
buildInputs = [ gmp mpfr ];
-
-
CFLAGS = "-I${gmp.dev}/include";
doCheck = true; # not cross;
+2
pkgs/development/libraries/libnet/default.nix
···
sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj";
};
+
patches = [ ./fix-includes.patch ];
+
meta = with stdenv.lib; {
homepage = https://github.com/sam-github/libnet;
description = "Portable framework for low-level network packet construction";
+29
pkgs/development/libraries/libnet/fix-includes.patch
···
+
--- libnet-1.1.6.orig/src/libnet_link_linux.c
+
+++ libnet-1.1.6/src/libnet_link_linux.c
+
@@ -30,26 +30,15 @@
+
#include <sys/time.h>
+
+
#include <net/if.h>
+
-#if (__GLIBC__)
+
#include <netinet/if_ether.h>
+
#include <net/if_arp.h>
+
-#else
+
-#include <linux/if_arp.h>
+
-#include <linux/if_ether.h>
+
-#endif
+
+
#if (HAVE_PACKET_SOCKET)
+
#ifndef SOL_PACKET
+
#define SOL_PACKET 263
+
#endif /* SOL_PACKET */
+
-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+
#include <netpacket/packet.h>
+
#include <net/ethernet.h> /* the L2 protocols */
+
-#else
+
-#include <asm/types.h>
+
-#include <linux/if_packet.h>
+
-#include <linux/if_ether.h> /* The L2 protocols */
+
-#endif
+
#endif /* HAVE_PACKET_SOCKET */
+
+
#include "../include/libnet.h"
+499
pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch
···
+
From patchwork Fri Apr 3 22:04:46 2015
+
Content-Type: text/plain; charset="utf-8"
+
MIME-Version: 1.0
+
Content-Transfer-Encoding: 7bit
+
Subject: Use stdlib uint* instead of u_int*
+
From: Nathan McSween <nwmcsween@gmail.com>
+
X-Patchwork-Id: 458131
+
X-Patchwork-Delegate: pablo@netfilter.org
+
Message-Id: <1428098686-17843-1-git-send-email-nwmcsween@gmail.com>
+
To: netfilter-devel@vger.kernel.org
+
Cc: Nathan McSween <nwmcsween@gmail.com>
+
Date: Fri, 3 Apr 2015 22:04:46 +0000
+
+
Signed-off-by: Nathan McSween <nwmcsween@gmail.com>
+
---
+
include/libnfnetlink/libnfnetlink.h | 25 +++++-----
+
include/libnfnetlink/linux_nfnetlink.h | 11 +++--
+
include/libnfnetlink/linux_nfnetlink_compat.h | 6 ++-
+
src/iftable.c | 9 ++--
+
src/iftable.h | 6 ++-
+
src/libnfnetlink.c | 71 ++++++++++++++-------------
+
src/rtnl.c | 5 +-
+
src/rtnl.h | 3 +-
+
8 files changed, 73 insertions(+), 63 deletions(-)
+
+
diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
+
index 1d8c49d..cd0be3d 100644
+
--- a/include/libnfnetlink/libnfnetlink.h
+
+++ b/include/libnfnetlink/libnfnetlink.h
+
@@ -15,6 +15,7 @@
+
#define aligned_u64 unsigned long long __attribute__((aligned(8)))
+
#endif
+
+
+#include <stdint.h>
+
#include <sys/socket.h> /* for sa_family_t */
+
#include <linux/netlink.h>
+
#include <libnfnetlink/linux_nfnetlink.h>
+
@@ -55,7 +56,7 @@ struct nfnlhdr {
+
struct nfnl_callback {
+
int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
+
void *data;
+
- u_int16_t attr_count;
+
+ uint16_t attr_count;
+
};
+
+
struct nfnl_handle;
+
@@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void);
+
extern int nfnl_close(struct nfnl_handle *);
+
+
extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *,
+
- u_int8_t, u_int8_t,
+
+ uint8_t, uint8_t,
+
unsigned int);
+
extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+
+
@@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
+
const struct iovec *iov, unsigned int num,
+
unsigned int flags);
+
extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
+
- unsigned int, u_int8_t, u_int16_t, u_int16_t,
+
- u_int16_t);
+
+ unsigned int, uint8_t, uint16_t, uint16_t,
+
+ uint16_t);
+
extern __attribute__((deprecated)) int
+
nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
+
unsigned, struct nlmsghdr *,
+
@@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *,
+
/* receiving */
+
extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
+
extern int nfnl_callback_register(struct nfnl_subsys_handle *,
+
- u_int8_t type, struct nfnl_callback *cb);
+
-extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
+
+ uint8_t type, struct nfnl_callback *cb);
+
+extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type);
+
extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
+
+
/* parsing */
+
@@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh);
+
+
/* nfnl attribute handling functions */
+
extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int);
+
-extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t);
+
-extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t);
+
-extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t);
+
+extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t);
+
+extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t);
+
+extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t);
+
extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int);
+
-extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t);
+
-extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t);
+
+extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t);
+
+extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t);
+
extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+
#define nfnl_parse_nested(tb, max, nfa) \
+
nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
+
@@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+
({ (tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })
+
+
extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa,
+
- u_int16_t type, u_int32_t len,
+
+ uint16_t type, uint32_t len,
+
unsigned char *val);
+
extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h,
+
unsigned int size);
+
diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
+
index 76a8550..7b843c6 100644
+
--- a/include/libnfnetlink/linux_nfnetlink.h
+
+++ b/include/libnfnetlink/linux_nfnetlink.h
+
@@ -1,5 +1,6 @@
+
#ifndef _NFNETLINK_H
+
#define _NFNETLINK_H
+
+#include <stdint.h>
+
#include <linux/types.h>
+
#include <libnfnetlink/linux_nfnetlink_compat.h>
+
+
@@ -25,9 +26,9 @@ enum nfnetlink_groups {
+
/* General form of address family dependent message.
+
*/
+
struct nfgenmsg {
+
- u_int8_t nfgen_family; /* AF_xxx */
+
- u_int8_t version; /* nfnetlink version */
+
- u_int16_t res_id; /* resource id */
+
+ uint8_t nfgen_family; /* AF_xxx */
+
+ uint8_t version; /* nfnetlink version */
+
+ uint16_t res_id; /* resource id */
+
};
+
+
#define NFNETLINK_V0 0
+
@@ -59,7 +60,7 @@ struct nfnl_callback
+
int (*call)(struct sock *nl, struct sk_buff *skb,
+
struct nlmsghdr *nlh, struct nlattr *cda[]);
+
const struct nla_policy *policy; /* netlink attribute policy */
+
- const u_int16_t attr_count; /* number of nlattr's */
+
+ const uint16_t attr_count; /* number of nlattr's */
+
};
+
+
struct nfnetlink_subsystem
+
@@ -76,7 +77,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
+
extern int nfnetlink_has_listeners(unsigned int group);
+
extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
+
int echo);
+
-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
+
+extern int nfnetlink_unicast(struct sk_buff *skb, uint32_t pid, int flags);
+
+
#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
+
MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
+
diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
+
index e145176..cd094fc 100644
+
--- a/include/libnfnetlink/linux_nfnetlink_compat.h
+
+++ b/include/libnfnetlink/linux_nfnetlink_compat.h
+
@@ -3,6 +3,8 @@
+
#ifndef __KERNEL__
+
/* Old nfnetlink macros for userspace */
+
+
+#include <stdint.h>
+
+
+
/* nfnetlink groups: Up to 32 maximum */
+
#define NF_NETLINK_CONNTRACK_NEW 0x00000001
+
#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
+
@@ -20,8 +22,8 @@
+
+
struct nfattr
+
{
+
- u_int16_t nfa_len;
+
- u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
+
+ uint16_t nfa_len;
+
+ uint16_t nfa_type; /* we use 15 bits for the type, and the highest
+
* bit to indicate whether the payload is nested */
+
};
+
+
diff --git a/src/iftable.c b/src/iftable.c
+
index 5976ed8..3411c4c 100644
+
--- a/src/iftable.c
+
+++ b/src/iftable.c
+
@@ -9,6 +9,7 @@
+
/* IFINDEX handling */
+
+
#include <unistd.h>
+
+#include <stdint.h>
+
#include <stdlib.h>
+
#include <stdio.h>
+
#include <string.h>
+
@@ -27,10 +28,10 @@
+
struct ifindex_node {
+
struct list_head head;
+
+
- u_int32_t index;
+
- u_int32_t type;
+
- u_int32_t alen;
+
- u_int32_t flags;
+
+ uint32_t index;
+
+ uint32_t type;
+
+ uint32_t alen;
+
+ uint32_t flags;
+
char addr[8];
+
char name[16];
+
};
+
diff --git a/src/iftable.h b/src/iftable.h
+
index 8df7f24..0cc5335 100644
+
--- a/src/iftable.h
+
+++ b/src/iftable.h
+
@@ -1,8 +1,10 @@
+
#ifndef _IFTABLE_H
+
#define _IFTABLE_H
+
+
-int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+
-int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+
+#include <stdint.h>
+
+
+
+int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+
+int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+
+
int iftable_init(void);
+
void iftable_fini(void);
+
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+
index 398b7d7..b8958dc 100644
+
--- a/src/libnfnetlink.c
+
+++ b/src/libnfnetlink.c
+
@@ -36,6 +36,7 @@
+
* minor cleanups
+
*/
+
+
+#include <stdint.h>
+
#include <stdlib.h>
+
#include <stdio.h>
+
#include <unistd.h>
+
@@ -72,9 +73,9 @@
+
+
struct nfnl_subsys_handle {
+
struct nfnl_handle *nfnlh;
+
- u_int32_t subscriptions;
+
- u_int8_t subsys_id;
+
- u_int8_t cb_count;
+
+ uint32_t subscriptions;
+
+ uint8_t subsys_id;
+
+ uint8_t cb_count;
+
struct nfnl_callback *cb; /* array of callbacks */
+
};
+
+
@@ -86,11 +87,11 @@ struct nfnl_handle {
+
int fd;
+
struct sockaddr_nl local;
+
struct sockaddr_nl peer;
+
- u_int32_t subscriptions;
+
- u_int32_t seq;
+
- u_int32_t dump;
+
- u_int32_t rcv_buffer_size; /* for nfnl_catch */
+
- u_int32_t flags;
+
+ uint32_t subscriptions;
+
+ uint32_t seq;
+
+ uint32_t dump;
+
+ uint32_t rcv_buffer_size; /* for nfnl_catch */
+
+ uint32_t flags;
+
struct nlmsghdr *last_nlhdr;
+
struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1];
+
};
+
@@ -145,7 +146,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h)
+
static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
+
{
+
int i, err;
+
- u_int32_t new_subscriptions = nfnlh->subscriptions;
+
+ uint32_t new_subscriptions = nfnlh->subscriptions;
+
+
for (i = 0; i < NFNL_MAX_SUBSYS; i++)
+
new_subscriptions |= nfnlh->subsys[i].subscriptions;
+
@@ -273,8 +274,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size)
+
* a valid address that points to a nfnl_subsys_handle structure is returned.
+
*/
+
struct nfnl_subsys_handle *
+
-nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id,
+
- u_int8_t cb_count, u_int32_t subscriptions)
+
+nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id,
+
+ uint8_t cb_count, uint32_t subscriptions)
+
{
+
struct nfnl_subsys_handle *ssh;
+
+
@@ -435,10 +436,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov,
+
*/
+
void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh,
+
struct nlmsghdr *nlh, unsigned int len,
+
- u_int8_t family,
+
- u_int16_t res_id,
+
- u_int16_t msg_type,
+
- u_int16_t msg_flags)
+
+ uint8_t family,
+
+ uint16_t res_id,
+
+ uint16_t msg_type,
+
+ uint16_t msg_flags)
+
{
+
assert(ssh);
+
assert(nlh);
+
@@ -849,14 +850,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
+
}
+
+
/**
+
- * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
+
+ * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr
+
*
+
* @n: netlink message header to which attribute is to be added
+
* @maxlen: maximum length of netlink message header
+
* @type: type of new attribute
+
* @data: content of new attribute
+
*/
+
-int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+
+int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data)
+
{
+
assert(n);
+
assert(maxlen > 0);
+
@@ -866,7 +867,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+
}
+
+
/**
+
- * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr
+
+ * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr
+
*
+
* @nfa: struct nfattr
+
* @maxlen: maximal length of nfattr buffer
+
@@ -875,7 +876,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+
*
+
*/
+
int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+
- u_int16_t data)
+
+ uint16_t data)
+
{
+
assert(nfa);
+
assert(maxlen > 0);
+
@@ -885,7 +886,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+
}
+
+
/**
+
- * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr
+
+ * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr
+
*
+
* @n: netlink message header to which attribute is to be added
+
* @maxlen: maximum length of netlink message header
+
@@ -894,7 +895,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+
*
+
*/
+
int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+
- u_int16_t data)
+
+ uint16_t data)
+
{
+
assert(n);
+
assert(maxlen > 0);
+
@@ -904,7 +905,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+
}
+
+
/**
+
- * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr
+
+ * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr
+
*
+
* @nfa: struct nfattr
+
* @maxlen: maximal length of nfattr buffer
+
@@ -913,7 +914,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+
*
+
*/
+
int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+
- u_int32_t data)
+
+ uint32_t data)
+
{
+
assert(nfa);
+
assert(maxlen > 0);
+
@@ -923,7 +924,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+
}
+
+
/**
+
- * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr
+
+ * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr
+
*
+
* @n: netlink message header to which attribute is to be added
+
* @maxlen: maximum length of netlink message header
+
@@ -932,7 +933,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+
*
+
*/
+
int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type,
+
- u_int32_t data)
+
+ uint32_t data)
+
{
+
assert(n);
+
assert(maxlen > 0);
+
@@ -980,7 +981,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len)
+
*
+
*/
+
void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa,
+
- u_int16_t type, u_int32_t len, unsigned char *val)
+
+ uint16_t type, uint32_t len, unsigned char *val)
+
{
+
assert(iov);
+
assert(nfa);
+
@@ -1115,7 +1116,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h,
+
* appropiately.
+
*/
+
int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+
- u_int8_t type, struct nfnl_callback *cb)
+
+ uint8_t type, struct nfnl_callback *cb)
+
{
+
assert(ssh);
+
assert(cb);
+
@@ -1138,7 +1139,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+
* On sucess, 0 is returned. On error, -1 is returned and errno is
+
* set appropiately.
+
*/
+
-int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type)
+
+int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type)
+
{
+
assert(ssh);
+
+
@@ -1161,8 +1162,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h,
+
assert(nfa);
+
+
int min_len;
+
- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
+ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
+ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
const struct nfnl_subsys_handle *ssh;
+
struct nfnl_callback *cb;
+
+
@@ -1212,8 +1213,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh,
+
int len)
+
{
+
struct nfnl_subsys_handle *ssh;
+
- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
+ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
+ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
int err = 0;
+
+
if (subsys_id > NFNL_MAX_SUBSYS)
+
@@ -1243,7 +1244,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len)
+
{
+
+
while (len >= NLMSG_SPACE(0)) {
+
- u_int32_t rlen;
+
+ uint32_t rlen;
+
struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+
+
if (nlh->nlmsg_len < sizeof(struct nlmsghdr)
+
@@ -1285,8 +1286,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh)
+
static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh)
+
{
+
struct nfnl_subsys_handle *ssh;
+
- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
+ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+
+ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
+
/* Is this an error message? */
+
if (nfnl_is_error(h, nlh)) {
+
diff --git a/src/rtnl.c b/src/rtnl.c
+
index 7b4ac7d..34802fe 100644
+
--- a/src/rtnl.c
+
+++ b/src/rtnl.c
+
@@ -11,6 +11,7 @@
+
/* rtnetlink - routing table netlink interface */
+
+
#include <unistd.h>
+
+#include <stdint.h>
+
#include <stdlib.h>
+
#include <string.h>
+
#include <errno.h>
+
@@ -30,7 +31,7 @@
+
#define rtnl_log(x, ...)
+
+
static inline struct rtnl_handler *
+
-find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+
+find_handler(struct rtnl_handle *rtnl_handle, uint16_t type)
+
{
+
struct rtnl_handler *h;
+
for (h = rtnl_handle->handlers; h; h = h->next) {
+
@@ -41,7 +42,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+
}
+
+
static int call_handler(struct rtnl_handle *rtnl_handle,
+
- u_int16_t type,
+
+ uint16_t type,
+
struct nlmsghdr *hdr)
+
{
+
struct rtnl_handler *h = find_handler(rtnl_handle, type);
+
diff --git a/src/rtnl.h b/src/rtnl.h
+
index 0c403dc..9858ae5 100644
+
--- a/src/rtnl.h
+
+++ b/src/rtnl.h
+
@@ -1,13 +1,14 @@
+
#ifndef _RTNL_H
+
#define _RTNL_H
+
+
+#include <stdint.h>
+
#include <linux/types.h>
+
#include <linux/rtnetlink.h>
+
+
struct rtnl_handler {
+
struct rtnl_handler *next;
+
+
- u_int16_t nlmsg_type;
+
+ uint16_t nlmsg_type;
+
int (*handlefn)(struct nlmsghdr *h, void *arg);
+
void *arg;
+
};
+4
pkgs/development/libraries/libnfnetlink/default.nix
···
sha256 = "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j";
};
+
patches = [
+
./Use-stdlib-uint-instead-of-u_int.patch
+
];
+
meta = {
description = "Low-level library for netfilter related kernel/userspace communication";
longDescription = ''
+30
pkgs/development/libraries/libnsl/cdefs.patch
···
+
--- a/src/rpcsvc/nislib.h
+
+++ b/src/rpcsvc/nislib.h
+
@@ -19,6 +19,7 @@
+
#ifndef __RPCSVC_NISLIB_H__
+
#define __RPCSVC_NISLIB_H__
+
+
+#include <sys/cdefs.h>
+
#include <features.h>
+
+
__BEGIN_DECLS
+
--- a/src/rpcsvc/ypclnt.h
+
+++ b/src/rpcsvc/ypclnt.h
+
@@ -20,6 +20,7 @@
+
#ifndef __RPCSVC_YPCLNT_H__
+
#define __RPCSVC_YPCLNT_H__
+
+
+#include <sys/cdefs.h>
+
#include <features.h>
+
+
/* Some defines */
+
--- a/src/rpcsvc/ypupd.h
+
+++ b/src/rpcsvc/ypupd.h
+
@@ -33,6 +33,7 @@
+
#ifndef __RPCSVC_YPUPD_H__
+
#define __RPCSVC_YPUPD_H__
+
+
+#include <sys/cdefs.h>
+
#include <features.h>
+
+
#include <rpc/rpc.h>
+2
pkgs/development/libraries/libnsl/default.nix
···
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ libtirpc ];
+
patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ ./cdefs.patch ./nis_h.patch ];
+
meta = with stdenv.lib; {
description = "Client interface library for NIS(YP) and NIS+";
homepage = https://github.com/thkukuk/libnsl;
+45
pkgs/development/libraries/libnsl/nis_h.patch
···
+
--- a/src/rpcsvc/nis.h
+
+++ b/src/rpcsvc/nis.h
+
@@ -32,6 +32,7 @@
+
#ifndef _RPCSVC_NIS_H
+
#define _RPCSVC_NIS_H 1
+
+
+#include <sys/cdefs.h>
+
#include <features.h>
+
#include <rpc/rpc.h>
+
#include <rpcsvc/nis_tags.h>
+
@@ -56,6 +57,34 @@
+
* <kukuk@suse.de>
+
*/
+
+
+#ifndef rawmemchr
+
+#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
+
+#endif
+
+
+
+#ifndef __asprintf
+
+#define __asprintf asprintf
+
+#endif
+
+
+
+#ifndef __mempcpy
+
+#define __mempcpy mempcpy
+
+#endif
+
+
+
+#ifndef __strtok_r
+
+#define __strtok_r strtok_r
+
+#endif
+
+
+
+#ifndef __always_inline
+
+#define __always_inline __attribute__((__always_inline__))
+
+#endif
+
+
+
+#ifndef TEMP_FAILURE_RETRY
+
+#define TEMP_FAILURE_RETRY(exp) ({ \
+
+typeof (exp) _rc; \
+
+ do { \
+
+ _rc = (exp); \
+
+ } while (_rc == -1 && errno == EINTR); \
+
+ _rc; })
+
+#endif
+
+
#ifndef __nis_object_h
+
#define __nis_object_h
+1 -1
pkgs/development/libraries/libunistring/default.nix
···
"--with-libiconv-prefix=${libiconv}"
];
-
doCheck = true;
+
doCheck = !stdenv.hostPlatform.isMusl;
enableParallelBuilding = true;
+45
pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
···
+
From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
+
From: Khem Raj <raj.khem at gmail.com>
+
Date: Thu, 31 Dec 2015 06:44:07 +0000
+
Subject: [PATCH] backtrace: Use only with glibc and uclibc
+
+
backtrace API is glibc specific not linux specific
+
so make it behave so.
+
+
Signed-off-by: Khem Raj <raj.khem at gmail.com>
+
---
+
Upstream-Status: Pending
+
+
tests/test-coredump-unwind.c | 4 +++-
+
1 file changed, 3 insertions(+), 1 deletion(-)
+
+
diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+
index 5254708..8767b42 100644
+
--- a/tests/test-coredump-unwind.c
+
+++ b/tests/test-coredump-unwind.c
+
@@ -57,7 +57,9 @@
+
#include <grp.h>
+
+
/* For SIGSEGV handler code */
+
+#ifdef __GLIBC__
+
#include <execinfo.h>
+
+#endif
+
#include <sys/ucontext.h>
+
+
#include <libunwind-coredump.h>
+
@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+
ip);
+
+
{
+
+#ifdef __GLIBC__
+
/* glibc extension */
+
void *array[50];
+
int size;
+
size = backtrace(array, 50);
+
-#ifdef __linux__
+
backtrace_symbols_fd(array, size, 2);
+
#endif
+
}
+
--
+
2.6.4
+
+1
pkgs/development/libraries/libunwind/default.nix
···
patches = [
./version-1.2.1.patch
+
./backtrace-only-with-glibc.patch
];
nativeBuildInputs = [ autoreconfHook ];
+2
pkgs/development/libraries/libusb/default.nix
···
sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0";
};
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
+
meta = {
platforms = stdenv.lib.platforms.unix;
};
+10
pkgs/development/libraries/libusb/fix-headers.patch
···
+
--- libusb-compat-0.1.5.orig/libusb/usb.h
+
+++ libusb-compat-0.1.5/libusb/usb.h
+
@@ -25,6 +25,7 @@
+
#ifndef __USB_H__
+
#define __USB_H__
+
+
+#include <sys/types.h>
+
#include <unistd.h>
+
#include <stdlib.h>
+
#include <limits.h>
+2 -1
pkgs/development/libraries/libxml2/default.nix
···
enableParallelBuilding = true;
-
doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin;
+
doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin &&
+
hostPlatform.libc != "musl";
crossAttrs = lib.optionalAttrs (hostPlatform.libc == "msvcrt") {
# creating the DLL is broken ATM
+1 -1
pkgs/development/libraries/mesa/default.nix
···
patches = [
./glx_ro_text_segm.patch # fix for grsecurity/PaX
./symlink-drivers.patch
-
];
+
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
outputs = [ "out" "dev" "drivers" "osmesa" ];
+22
pkgs/development/libraries/mesa/musl-fixes.patch
···
+
--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig
+
+++ ./src/gallium/winsys/svga/drm/vmw_screen.h
+
@@ -34,7 +34,7 @@
+
#ifndef VMW_SCREEN_H_
+
#define VMW_SCREEN_H_
+
+
-
+
+#include <sys/stat.h>
+
#include "pipe/p_compiler.h"
+
#include "pipe/p_state.h"
+
+
--- a/src/util/u_endian.h.orig 2016-11-04 12:16:00.480356454 +0100
+
+++ b/src/util/u_endian.h 2016-11-04 12:16:11.984347944 +0100
+
@@ -27,7 +27,7 @@
+
#ifndef U_ENDIAN_H
+
#define U_ENDIAN_H
+
+
-#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
+
+#if defined(__linux__) || defined(ANDROID) || defined(__CYGWIN__)
+
#include <endian.h>
+
+
#if __BYTE_ORDER == __LITTLE_ENDIAN
+4 -6
pkgs/development/libraries/mpfr/default.nix
···
{ stdenv, fetchurl, gmp
-
, buildPlatform, hostPlatform
+
, hostPlatform
}:
stdenv.mkDerivation rec {
-
name = "mpfr-3.1.3";
+
name = "mpfr-3.1.6";
src = fetchurl {
-
url = "mirror://gnu/mpfr/${name}.tar.bz2";
-
sha256 = "1z8akfw9wbmq91vrx04bw86mmnxw2sw5qm5cr8ix5b3w2mcv8fzn";
+
url = "mirror://gnu/mpfr/${name}.tar.xz";
+
sha256 = "0l598h9klpgkz2bp0rxiqb90mkqh9f2f81n5rpy191j00hdaqqks";
};
-
-
patches = [ ./upstream.patch ];
outputs = [ "out" "dev" "doc" "info" ];
+3 -2
pkgs/development/libraries/nettle/generic.nix
···
-
{ stdenv, gmp, gnum4
+
{ stdenv, buildPackages, gmp, gnum4
# Version specific args
, version, src
···
outputs = [ "out" "dev" ];
outputBin = "dev";
-
buildInputs = [ gnum4 ];
+
depsBuildBuild = [ buildPackages.stdenv.cc ];
+
nativeBuildInputs = [ gnum4 ];
propagatedBuildInputs = [ gmp ];
doCheck = (stdenv.system != "i686-cygwin" && !stdenv.isDarwin);
+2
pkgs/development/libraries/npth/default.nix
···
sha256 = "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9";
};
+
doCheck = true;
+
meta = with stdenv.lib; {
description = "The New GNU Portable Threads Library";
longDescription = ''
+10
pkgs/development/libraries/openssl/default.nix
···
++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin)
./darwin-arch.patch;
+
postPatch = if (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) then ''
+
substituteInPlace crypto/async/arch/async_posix.h \
+
--replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
+
'!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
+
'' else null;
+
outputs = [ "bin" "dev" "out" "man" ];
setOutputFlags = false;
separateDebugInfo = hostPlatform.isLinux;
···
# TODO(@Ericson2314): Make unconditional on mass rebuild
${if buildPlatform != hostPlatform then "configurePlatforms" else null} = [];
+
+
preConfigure = ''
+
patchShebangs Configure
+
'';
configureFlags = [
"shared"
+13 -4
pkgs/development/libraries/pixman/default.nix
···
-
{ fetchurl, stdenv, pkgconfig, libpng, glib /*just passthru*/ }:
+
{ stdenv, fetchurl, fetchpatch, autoconf, automake, libtool, pkgconfig, libpng, glib /*just passthru*/ }:
stdenv.mkDerivation rec {
-
name = "pixman-0.34.0";
+
name = "pixman-${version}";
+
version = "0.34.0";
src = fetchurl {
url = "mirror://xorg/individual/lib/${name}.tar.bz2";
sha256 = "184lazwdpv67zrlxxswpxrdap85wminh1gmq1i5lcz6iycw39fir";
};
-
patches = [];
+
patches = stdenv.lib.optionals stdenv.cc.isClang [
+
(fetchpatch {
+
name = "builtin-shuffle.patch";
+
url = https://patchwork.freedesktop.org/patch/177506/raw;
+
sha256 = "0rvraq93769dy2im2m022rz99fcdxprgc2fbmasnddcwrqy1x3xr";
+
})
+
];
-
nativeBuildInputs = [ pkgconfig ];
+
nativeBuildInputs = [ pkgconfig ]
+
++ stdenv.lib.optionals stdenv.cc.isClang [ autoconf automake libtool ];
+
buildInputs = stdenv.lib.optional doCheck libpng;
configureFlags = stdenv.lib.optional stdenv.isArm "--disable-arm-iwmmxt";
+9 -1
pkgs/development/libraries/polkit/default.nix
···
url = "http://src.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-itstool.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
sha256 = "0bxmjwp8ahy1y5g1l0kxmld0l3mlvb2l0i5n1qabia3d5iyjkyfh";
})
-
];
+
]
+
# Could be applied uncondtionally but don't want to trigger rebuild
+
# https://bugs.freedesktop.org/show_bug.cgi?id=50145
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
name = "netgroup-optional.patch";
+
url = "https://bugs.freedesktop.org/attachment.cgi?id=118753";
+
sha256 = "1zq51dhmqi9zi86bj9dq4i4pxlxm41k3k4a091j07bd78cjba038";
+
});
+
outputs = [ "bin" "dev" "out" ]; # small man pages in $bin
+13
pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch
···
+
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
+
index 204d685..e05179e 100644
+
--- a/src/gui/text/qfontengine_coretext.mm
+
+++ b/src/gui/text/qfontengine_coretext.mm
+
@@ -886,7 +886,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+
+
QFixed QCoreTextFontEngine::emSquareSize() const
+
{
+
- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
+ return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
}
+
+
QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
+8 -1
pkgs/development/libraries/qt-4.x/4.8/default.nix
···
[ ./glib-2.32.patch
./libressl.patch
./parallel-configure.patch
+
./clang-5-darwin.patch
./qt-4.8.7-unixmake-darwin.patch
(substituteAll {
src = ./dlopen-absolute-paths.diff;
···
++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt/raw/ecf530486e0fb7fe31bad26805cde61115562b2b/f/qt-aarch64.patch";
sha256 = "1fbjh78nmafqmj7yk67qwjbhl3f6ylkp6x33b1dqxfw9gld8b3gl";
-
});
+
})
+
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+
./qt-musl.patch
+
./qt-musl-iconv-no-bom.patch
+
./patch-qthread-stacksize.diff
+
./qsettings-recursive-global-mutex.patch
+
];
preConfigure = ''
export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
+54
pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff
···
+
--- a/src/corelib/thread/qthread_unix.cpp.orig 2015-11-23 19:05:40.000000000 +0100
+
+++ b/src/corelib/thread/qthread_unix.cpp 2015-11-24 11:22:31.000000000 +0100
+
@@ -79,6 +79,7 @@
+
#endif
+
+
+#include <sys/resource.h> // getrlimit/setrlimit
+
#if defined(Q_OS_MAC)
+
# ifdef qDebug
+
# define old_qDebug qDebug
+
# undef qDebug
+
@@ -649,6 +650,43 @@
+
#endif // QT_HAS_THREAD_PRIORITY_SCHEDULING
+
+
+
+ if (d->stackSize == 0) {
+
+ // Fix the default (too small) stack size for threads on OS X,
+
+ // which also affects the thread pool.
+
+ // See also:
+
+ // https://bugreports.qt.io/browse/QTBUG-2568
+
+ // This fix can also be found in Chromium:
+
+ // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186
+
+
+
+ // The Mac OS X default for a pthread stack size is 512kB.
+
+ // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses
+
+ // DEFAULT_STACK_SIZE for this purpose.
+
+ //
+
+ // 512kB isn't quite generous enough for some deeply recursive threads that
+
+ // otherwise request the default stack size by specifying 0. Here, adopt
+
+ // glibc's behavior as on Linux, which is to use the current stack size
+
+ // limit (ulimit -s) as the default stack size. See
+
+ // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To
+
+ // avoid setting the limit below the Mac OS X default or the minimum usable
+
+ // stack size, these values are also considered. If any of these values
+
+ // can't be determined, or if stack size is unlimited (ulimit -s unlimited),
+
+ // stack_size is left at 0 to get the system default.
+
+ //
+
+ // Mac OS X normally only applies ulimit -s to the main thread stack. On
+
+ // contemporary OS X and Linux systems alike, this value is generally 8MB
+
+ // or in that neighborhood.
+
+ size_t default_stack_size = 0;
+
+ struct rlimit stack_rlimit;
+
+ if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 &&
+
+ getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 &&
+
+ stack_rlimit.rlim_cur != RLIM_INFINITY) {
+
+ default_stack_size =
+
+ std::max(std::max(default_stack_size,
+
+ static_cast<size_t>(PTHREAD_STACK_MIN)),
+
+ static_cast<size_t>(stack_rlimit.rlim_cur));
+
+ }
+
+ d->stackSize = default_stack_size;
+
+ }
+
if (d->stackSize > 0) {
+
#if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0)
+
int code = pthread_attr_setstacksize(&attr, d->stackSize);
+17
pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch
···
+
Calling qsettings before constructing qapplications causes a dead-lock.
+
+
http://sourceforge.net/tracker/?func=detail&aid=3168620&group_id=4932&atid=104932
+
http://developer.qt.nokia.com/forums/viewthread/10365
+
+
+
--- ./src/corelib/io/qsettings.cpp.orig
+
+++ ./src/corelib/io/qsettings.cpp
+
@@ -122,7 +122,7 @@
+
Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc)
+
Q_GLOBAL_STATIC(PathHash, pathHashFunc)
+
Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc)
+
-Q_GLOBAL_STATIC(QMutex, globalMutex)
+
+Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive))
+
static QSettings::Format globalDefaultFormat = QSettings::NativeFormat;
+
+
#ifndef Q_OS_WIN
+11
pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch
···
+
--- qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp.orig
+
+++ qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp
+
@@ -62,7 +62,7 @@
+
#elif defined(Q_OS_AIX)
+
# define NO_BOM
+
# define UTF16 "UCS-2"
+
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
+
# define NO_BOM
+
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
+
# define UTF16 "UTF-16BE"
+14
pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch
···
+
--- qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h.orig
+
+++ qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h
+
@@ -86,11 +86,7 @@
+
+
#undef QT_SOCKLEN_T
+
+
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+
#define QT_SOCKLEN_T socklen_t
+
-#else
+
-#define QT_SOCKLEN_T int
+
-#endif
+
+
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+
#define QT_SNPRINTF ::snprintf
+13
pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
···
+
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
index 66baf16..89794ef 100644
+
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
@@ -830,7 +830,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+
+
QFixed QCoreTextFontEngine::emSquareSize() const
+
{
+
- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
+ return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
}
+
+
QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 341d3bccf2..3368234c26 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+13
pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
···
+
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
index 66baf16..89794ef 100644
+
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+
@@ -830,7 +830,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+
+
QFixed QCoreTextFontEngine::emSquareSize() const
+
{
+
- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
+ return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+
}
+
+
QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 341d3bc..3368234 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+9 -2
pkgs/development/libraries/science/math/openblas/default.nix
···
-
{ stdenv, fetchurl, gfortran, perl, which, config, coreutils
+
{ stdenv, fetchurl, fetchpatch, gfortran, perl, which, config, coreutils
# Most packages depending on openblas expect integer width to match
# pointer width, but some expect to use 32-bit integers always
# (for compatibility with reference BLAS).
···
"NUM_THREADS=64"
"INTERFACE64=${if blas64 then "1" else "0"}"
"NO_STATIC=1"
-
]
+
] ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "musl") "NO_AFFINITY=1"
++ mapAttrsToList (var: val: var + "=" + val) config;
+
+
patches = stdenv.lib.optional (stdenv.hostPlatform.libc != "glibc")
+
# https://github.com/xianyi/OpenBLAS/pull/1247
+
(fetchpatch {
+
url = "https://github.com/xianyi/OpenBLAS/commit/88a35ff457f55e527e0e8a503a0dc61976c1846d.patch";
+
sha256 = "1a3qrhvl5hp06c53fjqghq4zgf6ls7narm06l0shcvs57hznh09n";
+
});
doCheck = true;
checkTarget = "tests";
+2 -1
pkgs/development/libraries/stfl/default.nix
···
buildPhase = ''
sed -i s/gcc/cc/g Makefile
sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
+
'' + stdenv.lib.optionalString (stdenv.hostPlatform.libc != "glibc") ''
+
sed -i 's/LDLIBS += -lncursesw/LDLIBS += -lncursesw -liconv/' Makefile
'' + ( stdenv.lib.optionalString stdenv.isDarwin ''
-
sed -i 's/LDLIBS += -lncursesw/LDLIBS += -lncursesw -liconv/' Makefile
sed -i s/-soname/-install_name/ Makefile
'' ) + ''
make
+2
pkgs/development/libraries/tbb/default.nix
···
optional (stdver != null) "stdver=${stdver}"
);
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
+
installPhase = ''
mkdir -p $out/{lib,share/doc}
cp "build/"*release*"/"*${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib/
+43
pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch
···
+
From b577153a10c98f4e13405dc93ea2ab1a7b990e07 Mon Sep 17 00:00:00 2001
+
From: David Huffman <storedbox+alpine@outlook.com>
+
Date: Wed, 6 Jan 2016 07:09:30 -0500
+
Subject: [PATCH] hard-code glibc's definition of struct mallinfo
+
+
---
+
src/tbbmalloc/proxy.h | 20 ++++++++++++++++++++
+
1 file changed, 20 insertions(+)
+
+
diff --git a/src/tbbmalloc/proxy.h b/src/tbbmalloc/proxy.h
+
index 781cadc..e1ea1ae 100644
+
--- a/src/tbbmalloc/proxy.h
+
+++ b/src/tbbmalloc/proxy.h
+
@@ -32,6 +32,26 @@
+
+
#include <stddef.h>
+
+
+// The following definition was taken from /usr/include/malloc.h as provided by
+
+// the glibc-devel-2.19-17.4.x86_64 package on openSUSE Leap 42.1; it is
+
+// made available under the GNU Lesser General Public License v2.1 or later.
+
+// See <https://www.gnu.org/licenses>.
+
+//
+
+// Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+struct mallinfo
+
+{
+
+ int arena; /* non-mmapped space allocated from system */
+
+ int ordblks; /* number of free chunks */
+
+ int smblks; /* number of fastbin blocks */
+
+ int hblks; /* number of mmapped regions */
+
+ int hblkhd; /* space in mmapped regions */
+
+ int usmblks; /* maximum total allocated space */
+
+ int fsmblks; /* space available in freed fastbin blocks */
+
+ int uordblks; /* total allocated space */
+
+ int fordblks; /* total free space */
+
+ int keepcost; /* top-most, releasable (via malloc_trim) space */
+
+};
+
+
+
extern "C" {
+
void * scalable_malloc(size_t size);
+
void * scalable_calloc(size_t nobj, size_t size);
+
--
+
2.6.2
+
+7 -1
pkgs/development/libraries/ti-rpc/default.nix
···
-
{ fetchurl, stdenv, autoreconfHook, libkrb5 }:
+
{ fetchurl, fetchpatch, stdenv, autoreconfHook, libkrb5 }:
stdenv.mkDerivation rec {
name = "libtirpc-1.0.2";
···
url = "mirror://sourceforge/libtirpc/${name}.tar.bz2";
sha256 = "1xchbxy0xql7yl7z4n1icj8r7dmly46i22fvm00vdjq64zlmqg3j";
};
+
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl
+
(fetchpatch {
+
url = "https://raw.githubusercontent.com/openembedded/openembedded-core/2be873301420ec6ca2c70d899b7c49a7e2b0954d/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch";
+
sha256 = "1jmbn0j2bnjp0j9z5vzz5xiwyv3kd28w5pixbqsy2lz6q8nii7cf";
+
});
postPatch = ''
sed '1i#include <stdint.h>' -i src/xdr_sizeof.c
+2
pkgs/development/libraries/webkitgtk/2.4.nix
···
./quartz-webcore.patch
./libc++.patch
./plugin-none.patch
+
] ++ optionals stdenv.hostPlatform.isMusl [
+
./fix-execinfo.patch
];
configureFlags = with stdenv.lib; [
+20
pkgs/development/libraries/webkitgtk/fix-execinfo.patch
···
+
--- webkitgtk-2.2.0.orig/Source/WTF/wtf/Assertions.cpp
+
+++ webkitgtk-2.2.0/Source/WTF/wtf/Assertions.cpp
+
@@ -64,7 +64,7 @@
+
#include <windows.h>
+
#endif
+
+
-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+
+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+
#include <cxxabi.h>
+
#include <dlfcn.h>
+
#include <execinfo.h>
+
@@ -242,7 +242,7 @@
+
+
void WTFGetBacktrace(void** stack, int* size)
+
{
+
-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+
+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+
*size = backtrace(stack, *size);
+
#elif OS(WINDOWS) && !OS(WINCE)
+
// The CaptureStackBackTrace function is available in XP, but it is not defined
+2
pkgs/development/libraries/webrtc-audio-processing/default.nix
···
# signal_processing/filter_ar_fast_q12_armv7.S:88: Error: selected processor does not support `sbfx r11,r6,#12,#16' in ARM mode
patchPhase = stdenv.lib.optionalString stdenv.isArm ''
substituteInPlace configure --replace 'armv7*|armv8*' 'disabled'
+
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
substituteInPlace webrtc/base/checks.cc --replace 'defined(__UCLIBC__)' 1
'';
meta = with stdenv.lib; {
+1 -2
pkgs/development/python-modules/aiohttp/default.nix
···
, idna-ssl
, pytest
, gunicorn
-
, pytest-raisesregexp
, pytest-mock
}:
···
disabled = pythonOlder "3.4";
-
checkInputs = [ pytest gunicorn pytest-raisesregexp pytest-mock ];
+
checkInputs = [ pytest gunicorn pytest-mock ];
propagatedBuildInputs = [ async-timeout chardet multidict yarl ]
++ lib.optional (pythonOlder "3.7") idna-ssl;
+5 -8
pkgs/development/python-modules/async_timeout/default.nix
···
{ lib
-
, fetchurl
+
, fetchPypi
, buildPythonPackage
, pytestrunner
, pythonOlder
}:
-
let
+
buildPythonPackage rec {
pname = "async-timeout";
version = "2.0.0";
-
in buildPythonPackage rec {
-
name = "${pname}-${version}";
-
src = fetchurl {
-
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
+
src = fetchPypi {
+
inherit pname version;
sha256 = "c17d8ac2d735d59aa62737d76f2787a6c938f5a944ecf768a8c0ab70b0dea566";
};
-
buildInputs = [ pytestrunner ];
# Circular dependency on aiohttp
doCheck = false;
···
homepage = https://github.com/aio-libs/async_timeout/;
license = lib.licenses.asl20;
};
-
}
+
}
+1
pkgs/development/python-modules/cffi/default.nix
···
# The tests use -Werror but with python3.6 clang detects some unreachable code.
NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ];
+
doCheck = !stdenv.hostPlatform.isMusl; # TODO: Investigate
checkPhase = ''
py.test
'';
+1 -2
pkgs/development/python-modules/chardet/default.nix
···
, pytest, pytestrunner, hypothesis }:
buildPythonPackage rec {
-
name = "${pname}-${version}";
pname = "chardet";
version = "3.0.4";
···
sha256 = "1bpalpia6r5x1kknbk11p1fzph56fmmnp405ds8icksd3knr5aw4";
};
-
buildInputs = [ pytest pytestrunner hypothesis ];
+
checkInputs = [ pytest pytestrunner hypothesis ];
meta = with stdenv.lib; {
homepage = https://github.com/chardet/chardet;
+2 -4
pkgs/development/python-modules/multidict/default.nix
···
{ lib
, fetchPypi
, buildPythonPackage
-
, cython
-
, pytest, psutil, pytestrunner
+
, pytest, pytestrunner
, isPy3k
}:
···
sha256 = "0liazqlyk2nmr82nhiw2z72j7bjqxaisifkj476msw140d4i4i7v";
};
-
buildInputs = [ cython ];
-
checkInputs = [ pytest psutil pytestrunner ];
+
checkInputs = [ pytest pytestrunner ];
disabled = !isPy3k;
+8 -11
pkgs/development/python-modules/pytest-xdist/default.nix
···
{ stdenv, fetchPypi, buildPythonPackage, isPy3k, execnet, pytest, setuptools_scm, pytest-forked }:
buildPythonPackage rec {
-
name = "${pname}-${version}";
pname = "pytest-xdist";
version = "1.22.0";
···
sha256 = "65228a859191f2c74ee68c127317eefe35eedd3d43fc1431f19240663b0cafcd";
};
-
buildInputs = [ pytest setuptools_scm pytest-forked];
+
nativeBuildInputs = [ setuptools_scm ];
+
buildInputs = [ pytest pytest-forked ];
propagatedBuildInputs = [ execnet ];
-
postPatch = ''
-
rm testing/acceptance_test.py testing/test_remote.py testing/test_slavemanage.py
-
'';
-
checkPhase = ''
-
py.test testing
+
# Excluded tests access file system
+
py.test testing -k "not test_distribution_rsyncdirs_example \
+
and not test_rsync_popen_with_path \
+
and not test_popen_rsync_subdir \
+
and not test_init_rsync_roots \
+
and not test_rsyncignore"
'';
-
-
# Only test on 3.x
-
# INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'getconsumer'
-
doCheck = isPy3k;
meta = with stdenv.lib; {
description = "py.test xdist plugin for distributed testing and loop-on-failing modes";
+5 -12
pkgs/development/python-modules/testtools/default.nix
···
, pbr
, python_mimeparse
, extras
-
, lxml
, unittest2
, traceback2
-
, isPy3k
-
, fixtures
-
, pyrsistent
+
, testscenarios
}:
-
-
buildPythonPackage rec {
pname = "testtools";
version = "2.3.0";
-
# Python 2 only judging from SyntaxError
-
# disabled = isPy3k;
-
src = fetchPypi {
inherit pname version;
sha256 = "5827ec6cf8233e0f29f51025addd713ca010061204fdea77484a2934690a0559";
};
-
propagatedBuildInputs = [ pbr python_mimeparse extras lxml unittest2 pyrsistent ];
+
propagatedBuildInputs = [ pbr python_mimeparse extras unittest2 ];
buildInputs = [ traceback2 ];
-
# No tests in archive
+
# testscenarios has a circular dependency on testtools
doCheck = false;
+
checkInputs = [ testscenarios ];
# testtools 2.0.0 and up has a circular run-time dependency on futures
postPatch = ''
···
homepage = https://pypi.python.org/pypi/testtools;
license = lib.licenses.mit;
};
-
}
+
}
+15 -1
pkgs/development/tools/build-managers/cmake/default.nix
···
configureFlags = [ "--docdir=share/doc/${name}" ]
++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
++ optional (useQt4 || withQt5) "--qt-gui"
-
++ optionals (!useNcurses) [ "--" "-DBUILD_CursesDialog=OFF" ];
+
++ ["--"]
+
++ optionals (!useNcurses) [ "-DBUILD_CursesDialog=OFF" ]
+
++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+
"-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++"
+
"-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc"
+
"-DCMAKE_AR=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
+
"-DCMAKE_RANLIB=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
+
"-DCMAKE_STRIP=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
+
# TODO: Why are ar and friends not provided by the bintools wrapper?
+
];
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
+
+
# This isn't an autoconf configure script; triples are passed via
+
# CMAKE_SYSTEM_NAME, etc.
+
configurePlatforms = [ ];
+
meta = with stdenv.lib; {
homepage = http://www.cmake.org/;
+9 -1
pkgs/development/tools/build-managers/cmake/setup-hook.sh
···
# By now it supports linux builds only. We should set the proper
# CMAKE_SYSTEM_NAME otherwise.
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
-
cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-g++ -DCMAKE_C_COMPILER=$crossConfig-gcc $cmakeFlags"
+
#
+
# Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
+
# strip. Otherwise they are taken to be relative to the source root of
+
# the package being built.
+
cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-c++ $cmakeFlags"
+
cmakeFlags="-DCMAKE_C_COMPILER=$crossConfig-cc $cmakeFlags"
+
cmakeFlags="-DCMAKE_AR=$(command -v $crossConfig-ar) $cmakeFlags"
+
cmakeFlags="-DCMAKE_RANLIB=$(command -v $crossConfig-ranlib) $cmakeFlags"
+
cmakeFlags="-DCMAKE_STRIP=$(command -v $crossConfig-strip) $cmakeFlags"
fi
# This installs shared libraries with a fully-specified install
+1 -1
pkgs/development/tools/build-managers/gnumake/4.2/default.nix
···
./pselect.patch
];
-
nativeBuildInputs = [ pkgconfig ];
+
nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkgconfig ];
buildInputs = stdenv.lib.optionals guileSupport [ guile ];
configureFlags = stdenv.lib.optional guileSupport "--with-guile";
+2 -1
pkgs/development/tools/misc/autoconf/default.nix
···
sha256 = "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4";
};
-
buildInputs = [ m4 perl ];
+
nativeBuildInputs = [ m4 perl ];
+
buildInputs = [ m4 ];
# Work around a known issue in Cygwin. See
# http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
+16 -3
pkgs/development/tools/misc/autogen/default.nix
···
-
{ stdenv, fetchurl, which, pkgconfig, perl, guile, libxml2 }:
+
{ stdenv, buildPackages, fetchurl, which, pkgconfig, texinfo, perl, guile, libxml2 }:
stdenv.mkDerivation rec {
name = "autogen-${version}";
···
outputs = [ "bin" "dev" "lib" "out" "man" "info" ];
-
nativeBuildInputs = [ which pkgconfig perl ];
-
buildInputs = [ guile libxml2 ];
+
nativeBuildInputs = [ which pkgconfig perl ]
+
# autogen needs a build autogen when cross-compiling
+
++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+
buildPackages.autogen buildPackages.texinfo ];
+
buildInputs = [
+
guile libxml2
+
];
+
+
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+
"--with-libxml2=${libxml2.dev}"
+
"--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2"
+
# the configure check for regcomp wants to run a host program
+
"libopts_cv_with_libregex=yes"
+
#"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo"
+
];
postPatch = ''
# Fix a broken sed expression used for detecting the minor
+4
pkgs/development/tools/misc/lsof/default.nix
···
patches = [ ./dfile.patch ];
+
postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
+
'';
+
# Stop build scripts from searching global include paths
LSOF_INCLUDE = "${stdenv.cc.libc}/include";
configurePhase = "LINUX_CONF_CC=$CC_FOR_BUILD LSOF_CC=$CC LSOF_AR=\"$AR cr\" LSOF_RANLIB=$RANLIB ./Configure -n ${dialect}";
+6
pkgs/development/tools/misc/patchelf/unstable.nix
···
sha256 = "1f1s8q3as3nrhcc1a8qc2z7imm644jfz44msn9sfv4mdynp2m2yb";
};
+
# Drop test that fails on musl (?)
+
postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
substituteInPlace tests/Makefile.am \
+
--replace "set-rpath-library.sh" ""
+
'';
+
setupHook = [ ./setup-hook.sh ];
nativeBuildInputs = [ autoreconfHook ];
+4
pkgs/games/2048-in-terminal/default.nix
···
buildInputs = [ ncurses ];
+
prePatch = ''
+
sed -i '1i#include <fcntl.h>\n' save.c
+
'';
+
enableParallelBuilding = true;
preInstall = ''
+2
pkgs/games/armagetronad/default.nix
···
NIX_LDFLAGS = [ "-lSDL_image" ];
+
enableParallelBuilding = true;
+
configureFlags = [ "--disable-etc" ];
buildInputs = [ SDL SDL_image libxml2 libjpeg libpng mesa zlib ];
+22
pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch
···
+
diff --git a/icuSources/i18n/ucoleitr.cpp b/icuSources/i18n/ucoleitr.cpp
+
index ecc94c9..936452f 100644
+
--- a/icuSources/i18n/ucoleitr.cpp
+
+++ b/icuSources/i18n/ucoleitr.cpp
+
@@ -320,7 +320,7 @@ ucol_nextProcessed(UCollationElements *elems,
+
int32_t *ixHigh,
+
UErrorCode *status)
+
{
+
- return (UCollationPCE::UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
+
+ return (UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
+
}
+
+
+
@@ -384,7 +384,7 @@ ucol_previousProcessed(UCollationElements *elems,
+
int32_t *ixHigh,
+
UErrorCode *status)
+
{
+
- return (UCollationPCE::UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
+
+ return (UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
+
}
+
+
U_NAMESPACE_BEGIN
+2
pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
···
appleDerivation {
nativeBuildInputs = [ cctools ];
+
patches = [ ./clang-5.patch ];
+
postPatch = ''
substituteInPlace makefile \
--replace /usr/bin/ "" \
+26 -1
pkgs/os-specific/linux/apparmor/default.nix
···
-
{ stdenv, fetchurl, makeWrapper, autoreconfHook
+
{ stdenv, fetchurl, fetchpatch, makeWrapper, autoreconfHook
, pkgconfig, which
, flex, bison
, linuxHeaders ? stdenv.cc.libc.linuxHeaders
···
substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man"
'';
+
# use 'if c then x else null' to avoid rebuilding
+
# patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+
patches = if stdenv.hostPlatform.isMusl then [
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/testing/apparmor/0002-Provide-missing-secure_getenv-and-scandirat-function.patch?id=74b8427cc21f04e32030d047ae92caa618105b53";
+
name = "0002-Provide-missing-secure_getenv-and-scandirat-function.patch";
+
sha256 = "0pj1bzifghxwxlc39j8hyy17dkjr9fk64kkj94ayymyprz4i4nac";
+
})
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/testing/apparmor/0003-Added-missing-typedef-definitions-on-parser.patch?id=74b8427cc21f04e32030d047ae92caa618105b53";
+
name = "0003-Added-missing-typedef-definitions-on-parser.patch";
+
sha256 = "0yyaqz8jlmn1bm37arggprqz0njb4lhjni2d9c8qfqj0kll0bam0";
+
})
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/testing/apparmor/0007-Do-not-build-install-vim-file-with-utils-package.patch?id=74b8427cc21f04e32030d047ae92caa618105b53";
+
name = "0007-Do-not-build-install-vim-file-with-utils-package.patch";
+
sha256 = "1m4dx901biqgnr4w4wz8a2z9r9dxyw7wv6m6mqglqwf2lxinqmp4";
+
})
+
# (alpine patches {1,4,5,6,8} are needed for apparmor 2.11, but not 2.12)
+
] else null;
+
# FIXME: convert these to a single multiple-outputs package?
libapparmor = stdenv.mkDerivation {
···
substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h"
substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h"
'';
+
inherit patches;
+
postPatch = "cd ./libraries/libapparmor";
configureFlags = "--with-python --with-perl";
···
];
prePatch = prePatchCommon;
+
inherit patches;
postPatch = "cd ./utils";
makeFlags = ''LANGS='';
installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin VIM_INSTALL_PATH=$(out)/share PYPREFIX='';
···
## techdoc.pdf still doesn't build ...
substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages"
'';
+
inherit patches;
postPatch = "cd ./parser";
makeFlags = ''LANGS= USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include'';
installFlags = ''DESTDIR=$(out) DISTRO=unknown'';
+17 -1
pkgs/os-specific/linux/audit/default.nix
···
{
-
stdenv, buildPackages, fetchurl,
+
stdenv, buildPackages, fetchurl, fetchpatch,
enablePython ? false, python ? null,
}:
···
enableParallelBuilding = true;
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/audit/0002-auparse-remove-use-of-rawmemchr.patch?id=3e57180fdf3f90c30a25aea44f57846efc93a696";
+
name = "0002-auparse-remove-use-of-rawmemchr.patch";
+
sha256 = "1caaqbfgb2rq3ria5bz4n8x30ihgihln6w9w9a46k62ba0wh9rkz";
+
})
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/audit/0003-all-get-rid-of-strndupa.patch?id=3e57180fdf3f90c30a25aea44f57846efc93a696";
+
name = "0003-all-get-rid-of-strndupa.patch";
+
sha256 = "1ddrm6a0ijrf7caw1wpw2kkbjp2lkxkmc16v51j5j7dvdalc6591";
+
})
+
];
+
+
prePatch = ''
+
sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
+
'';
meta = {
description = "Audit Library";
homepage = http://people.redhat.com/sgrubb/audit/;
+2 -2
pkgs/os-specific/linux/bcc/default.nix
···
-
{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, cmake, llvmPackages_5, kernel
+
{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, cmake, llvmPackages, kernel
, flex, bison, elfutils, python, pythonPackages, luajit, netperf, iperf, libelf }:
stdenv.mkDerivation rec {
···
};
buildInputs = [
-
llvmPackages_5.llvm llvmPackages_5.clang-unwrapped kernel
+
llvmPackages.llvm llvmPackages.clang-unwrapped kernel
elfutils python pythonPackages.netaddr luajit netperf iperf
];
+12 -2
pkgs/os-specific/linux/busybox/default.nix
···
{ stdenv, lib, buildPackages, fetchurl, fetchpatch
, enableStatic ? false
, enableMinimal ? false
-
, useMusl ? false, musl
+
, useMusl ? stdenv.hostPlatform.libc == "musl", musl
, extraConfig ? ""
, buildPlatform, hostPlatform
}:
+
+
assert stdenv.hostPlatform.libc == "musl" -> useMusl;
let
configParser = ''
···
}
'';
+
libcConfig = lib.optionalString useMusl ''
+
CONFIG_FEATURE_UTMP n
+
CONFIG_FEATURE_WTMP n
+
'';
in
stdenv.mkDerivation rec {
···
# Set paths for console fonts.
CONFIG_DEFAULT_SETFONT_DIR "/etc/kbd"
+
# Bump from 4KB, much faster I/O
+
CONFIG_FEATURE_COPYBUF_KB 64
+
${extraConfig}
CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.targetPrefix}"
+
${libcConfig}
EOF
make oldconfig
···
'';
postConfigure = lib.optionalString useMusl ''
-
makeFlagsArray+=("CC=${stdenv.cc.targetPrefix}gcc -isystem ${musl}/include -B${musl}/lib -L${musl}/lib")
+
makeFlagsArray+=("CC=${stdenv.cc.targetPrefix}cc -isystem ${musl.dev}/include -B${musl}/lib -L${musl}/lib")
'';
depsBuildBuild = [ buildPackages.stdenv.cc ];
+7 -1
pkgs/os-specific/linux/iproute/default.nix
···
-
{ fetchurl, stdenv, lib, flex, bison, db, iptables, pkgconfig }:
+
{ fetchurl, stdenv, lib, flex, bash, bison, db, iptables, pkgconfig }:
stdenv.mkDerivation rec {
name = "iproute2-${version}";
···
preConfigure = ''
patchShebangs ./configure
sed -e '/ARPDDIR/d' -i Makefile
+
# Don't build netem tools--they're not installed and require HOSTCC
+
substituteInPlace Makefile --replace " netem " " "
'';
makeFlags = [
···
nativeBuildInputs = [ bison flex pkgconfig ];
enableParallelBuilding = true;
+
+
postInstall = ''
+
PATH=${bash}/bin:$PATH patchShebangs $out/sbin
+
'';
meta = with stdenv.lib; {
homepage = https://wiki.linuxfoundation.org/networking/iproute2;
+4 -5
pkgs/os-specific/linux/iputils/default.nix
···
, libidn, nettle
, SGMLSpm, libgcrypt }:
-
assert stdenv ? glibc;
-
let
time = "20161105";
in
···
-i doc/Makefile
'';
-
makeFlags = "USE_GNUTLS=no";
+
# Disable idn usage w/musl: https://github.com/iputils/iputils/pull/111
+
makeFlags = [ "USE_GNUTLS=no" ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "USE_IDN=no";
buildInputs = [
-
libsysfs opensp openssl libcap docbook_sgml_dtd_31 SGMLSpm libgcrypt libidn nettle
-
];
+
libsysfs opensp openssl libcap docbook_sgml_dtd_31 SGMLSpm libgcrypt nettle
+
] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn;
buildFlags = "man all ninfod";
-61
pkgs/os-specific/linux/kernel-headers/4.4.nix
···
-
{ stdenvNoCC, lib, buildPackages
-
, buildPlatform, hostPlatform
-
, fetchurl, perl
-
}:
-
-
assert hostPlatform.isLinux;
-
-
let
-
version = "4.4.10";
-
inherit (hostPlatform.platform) kernelHeadersBaseConfig;
-
in
-
-
stdenvNoCC.mkDerivation {
-
name = "linux-headers-${version}";
-
-
src = fetchurl {
-
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-
sha256 = "1kpjvvd9q9wwr3314q5ymvxii4dv2d27295bzly225wlc552xhja";
-
};
-
-
targetConfig = if hostPlatform != buildPlatform then hostPlatform.config else null;
-
-
platform = hostPlatform.platform.kernelArch;
-
-
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
-
# We do this so we have a build->build, not build->host, C compiler.
-
depsBuildBuild = [ buildPackages.stdenv.cc ];
-
nativeBuildInputs = [ perl ];
-
-
extraIncludeDirs = lib.optional hostPlatform.isPowerPC ["ppc"];
-
-
buildPhase = ''
-
if test -n "$targetConfig"; then
-
export ARCH=$platform
-
fi
-
make ${kernelHeadersBaseConfig} SHELL=bash
-
make mrproper headers_check SHELL=bash
-
'';
-
-
installPhase = ''
-
make INSTALL_HDR_PATH=$out headers_install
-
-
# Some builds (e.g. KVM) want a kernel.release.
-
mkdir -p $out/include/config
-
echo "${version}-default" > $out/include/config/kernel.release
-
'';
-
-
# !!! hacky
-
fixupPhase = ''
-
ln -s asm $out/include/asm-$platform
-
if test "$platform" = "i386" -o "$platform" = "x86_64"; then
-
ln -s asm $out/include/asm-x86
-
fi
-
'';
-
-
meta = with lib; {
-
description = "Header files and scripts for Linux kernel";
-
license = licenses.gpl2;
-
platforms = platforms.linux;
-
};
-
}
+67
pkgs/os-specific/linux/kernel-headers/default.nix
···
+
{ stdenvNoCC, lib, buildPackages
+
, buildPlatform, hostPlatform
+
, fetchurl, perl
+
}:
+
+
assert hostPlatform.isLinux;
+
+
let
+
common = { version, sha256, patches ? null }: stdenvNoCC.mkDerivation {
+
name = "linux-headers-${version}";
+
+
src = fetchurl {
+
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
+
inherit sha256;
+
};
+
+
ARCH = hostPlatform.platform.kernelArch;
+
+
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
+
# We do this so we have a build->build, not build->host, C compiler.
+
depsBuildBuild = [ buildPackages.stdenv.cc ];
+
nativeBuildInputs = [ perl ];
+
+
extraIncludeDirs = lib.optional hostPlatform.isPowerPC ["ppc"];
+
+
# "patches" array defaults to 'null' to avoid changing hash
+
# and causing mass rebuild
+
inherit patches;
+
+
buildPhase = ''
+
make mrproper headers_check SHELL=bash
+
'';
+
+
installPhase = ''
+
make INSTALL_HDR_PATH=$out headers_install
+
+
# Some builds (e.g. KVM) want a kernel.release.
+
mkdir -p $out/include/config
+
echo "${version}-default" > $out/include/config/kernel.release
+
'';
+
+
# !!! hacky
+
fixupPhase = ''
+
ln -s asm $out/include/asm-$platform
+
if test "$platform" = "i386" -o "$platform" = "x86_64"; then
+
ln -s asm $out/include/asm-x86
+
fi
+
'';
+
+
meta = with lib; {
+
description = "Header files and scripts for Linux kernel";
+
license = licenses.gpl2;
+
platforms = platforms.linux;
+
};
+
};
+
in {
+
+
linuxHeaders_4_4 = common {
+
version = "4.4.10";
+
sha256 = "1kpjvvd9q9wwr3314q5ymvxii4dv2d27295bzly225wlc552xhja";
+
};
+
+
linuxHeaders_4_15 = common {
+
version = "4.15";
+
sha256 = "0sd7l9n9h7vf9c6gd6ciji28hawda60yj0llh17my06m0s4lf9js";
+
};
+
}
+3 -1
pkgs/os-specific/linux/kexectools/default.nix
···
-
{ stdenv, fetchurl, zlib }:
+
{ stdenv, buildPackages, fetchurl, zlib }:
stdenv.mkDerivation rec {
name = "kexec-tools-${version}";
···
hardeningDisable = [ "format" "pic" "relro" ];
+
configureFlags = [ "BUILD_CC=${buildPackages.stdenv.cc.targetPrefix}cc" ];
+
nativeBuildInputs = [ buildPackages.stdenv.cc ];
buildInputs = [ zlib ];
meta = with stdenv.lib; {
+4 -1
pkgs/os-specific/linux/libcap/default.nix
···
-
{ stdenv, fetchurl, attr, perl, pam ? null }:
+
{ stdenv, buildPackages, fetchurl, attr, perl, pam ? null }:
assert pam != null -> stdenv.isLinux;
stdenv.mkDerivation rec {
···
outputs = [ "out" "dev" "lib" "man" "doc" ]
++ stdenv.lib.optional (pam != null) "pam";
+
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl ];
buildInputs = [ pam ];
···
makeFlags = [
"lib=lib"
(stdenv.lib.optional (pam != null) "PAM_CAP=yes")
+
"BUILD_CC=$(CC_FOR_BUILD)"
+
"CC:=$(CC)"
];
prePatch = ''
+7 -1
pkgs/os-specific/linux/libnl/default.nix
···
-
{ stdenv, lib, fetchFromGitHub, autoreconfHook, bison, flex, pkgconfig }:
+
{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, bison, flex, pkgconfig }:
let version = "3.3.0"; in
stdenv.mkDerivation {
···
};
outputs = [ "bin" "dev" "out" "man" ];
+
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl
+
(fetchpatch {
+
url = "https://raw.githubusercontent.com/gentoo/musl/48d2a28710ae40877fd3e178ead1fb1bb0baa62c/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch";
+
sha256 = "0dd7xxikib201i99k2if066hh7gwf2i4ffckrjplq6lr206jn00r";
+
});
nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
+2
pkgs/os-specific/linux/lm-sensors/default.nix
···
buildInputs = [ bison flex which perl ]
++ stdenv.lib.optional sensord rrdtool;
+
patches = [ ./musl-fix-includes.patch ];
+
preBuild = ''
makeFlagsArray=(PREFIX=$out ETCDIR=$out/etc
${stdenv.lib.optionalString sensord "PROG_EXTRA=sensord"})
+62
pkgs/os-specific/linux/lm-sensors/musl-fix-includes.patch
···
+
--- lm_sensors-3.3.4.orig/prog/dump/isadump.c
+
+++ lm_sensors-3.3.4/prog/dump/isadump.c
+
@@ -36,13 +36,7 @@
+
#include "util.h"
+
#include "superio.h"
+
+
-
+
-/* To keep glibc2 happy */
+
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+
#include <sys/io.h>
+
-#else
+
-#include <asm/io.h>
+
-#endif
+
+
#ifdef __powerpc__
+
unsigned long isa_io_base = 0; /* XXX for now */
+
--- lm_sensors-3.3.4.orig/prog/dump/isaset.c
+
+++ lm_sensors-3.3.4/prog/dump/isaset.c
+
@@ -32,13 +32,7 @@
+
#include <string.h>
+
#include "util.h"
+
+
-
+
-/* To keep glibc2 happy */
+
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+
#include <sys/io.h>
+
-#else
+
-#include <asm/io.h>
+
-#endif
+
+
#ifdef __powerpc__
+
unsigned long isa_io_base = 0; /* XXX for now */
+
--- lm_sensors-3.3.4.orig/prog/dump/superio.c
+
+++ lm_sensors-3.3.4/prog/dump/superio.c
+
@@ -20,12 +20,7 @@
+
*/
+
+
#include <stdlib.h>
+
-
+
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+
#include <sys/io.h>
+
-#else
+
-#include <asm/io.h>
+
-#endif
+
+
#include "superio.h"
+
+
--- lm_sensors-3.3.4.orig/prog/dump/util.c
+
+++ lm_sensors-3.3.4/prog/dump/util.c
+
@@ -11,12 +11,7 @@
+
#include <stdio.h>
+
#include "util.h"
+
+
-/* To keep glibc2 happy */
+
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
+
#include <sys/io.h>
+
-#else
+
-#include <asm/io.h>
+
-#endif
+
+
/* Return 1 if we should continue, 0 if we should abort */
+
int user_ack(int def)
+18 -1
pkgs/os-specific/linux/lvm2/default.nix
···
-
{ stdenv, fetchurl, pkgconfig, systemd, libudev, utillinux, coreutils, libuuid
+
{ stdenv, fetchurl, fetchpatch, pkgconfig, systemd, libudev, utillinux, coreutils, libuuid
, thin-provisioning-tools, enable_dmeventd ? false }:
let
···
enableParallelBuilding = true;
#patches = [ ./purity.patch ];
+
patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+
(fetchpatch {
+
name = "fix-stdio-usage.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/lvm2/fix-stdio-usage.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50";
+
sha256 = "0m6wr6qrvxqi2d2h054cnv974jq1v65lqxy05g1znz946ga73k3p";
+
})
+
(fetchpatch {
+
name = "mallinfo.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50";
+
sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0";
+
})
+
(fetchpatch {
+
name = "mlockall-default-config.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/lvm2/mlockall-default-config.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50";
+
sha256 = "1ivbj3sphgf8n1ykfiv5rbw7s8dgnj5jcr9jl2v8cwf28lkacw5l";
+
})
+
];
# To prevent make install from failing.
preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\"";
+48 -5
pkgs/os-specific/linux/musl/default.nix
···
-
{ stdenv, fetchurl, fetchpatch }:
+
{ stdenv, lib, fetchurl
+
, buildPackages
+
, linuxHeaders ? null
+
, useBSDCompatHeaders ? true
+
}:
+
let
+
cdefs_h = fetchurl {
+
url = "http://git.alpinelinux.org/cgit/aports/plain/main/libc-dev/sys-cdefs.h";
+
sha256 = "16l3dqnfq0f20rzbkhc38v74nqcsh9n3f343bpczqq8b1rz6vfrh";
+
};
+
queue_h = fetchurl {
+
url = "http://git.alpinelinux.org/cgit/aports/plain/main/libc-dev/sys-queue.h";
+
sha256 = "12qm82id7zys92a1qh2l1qf2wqgq6jr4qlbjmqyfffz3s3nhfd61";
+
};
+
tree_h = fetchurl {
+
url = "http://git.alpinelinux.org/cgit/aports/plain/main/libc-dev/sys-tree.h";
+
sha256 = "14igk6k00bnpfw660qhswagyhvr0gfqg4q55dxvaaq7ikfkrir71";
+
};
+
in
stdenv.mkDerivation rec {
name = "musl-${version}";
version = "1.1.18";
src = fetchurl {
-
url = "http://www.musl-libc.org/releases/${name}.tar.gz";
+
url = "http://www.musl-libc.org/releases/musl-${version}.tar.gz";
sha256 = "0651lnj5spckqjf83nz116s8qhhydgqdy3rkl4icbh5f05fyw5yh";
};
···
"--enable-shared"
"--enable-static"
"CFLAGS=-fstack-protector-strong"
+
# Fix cycle between outputs
+
"--disable-wrapper"
];
+
outputs = [ "out" "dev" ];
+
+
patches = [ ./few-more-uapi-fixes.patch ];
+
dontDisableStatic = true;
+
dontStrip = true;
+
+
postInstall =
+
''
+
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
+
# Apparently glibc provides scsi itself?
+
(cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
+
'' +
+
''
+
mkdir -p $out/bin
+
# Create 'ldd' symlink, builtin
+
ln -s $out/lib/libc.so $out/bin/ldd
+
'' + lib.optionalString useBSDCompatHeaders ''
+
install -D ${queue_h} $dev/include/sys/queue.h
+
install -D ${cdefs_h} $dev/include/sys/cdefs.h
+
install -D ${tree_h} $dev/include/sys/tree.h
+
'';
+
+
passthru.linuxHeaders = linuxHeaders;
meta = {
description = "An efficient, small, quality libc implementation";
homepage = "http://www.musl-libc.org";
-
license = stdenv.lib.licenses.mit;
-
platforms = stdenv.lib.platforms.linux;
-
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+
license = lib.licenses.mit;
+
platforms = lib.platforms.linux;
+
maintainers = [ lib.maintainers.thoughtpolice ];
};
}
+71
pkgs/os-specific/linux/musl/few-more-uapi-fixes.patch
···
+
http://www.openwall.com/lists/musl/2018/01/06/3
+
+
Date: Sat, 6 Jan 2018 23:32:52 +0100
+
From: Hauke Mehrtens <hauke@...ke-m.de>
+
To: musl@...ts.openwall.com
+
Cc: felix.janda@...teo.de,
+
Hauke Mehrtens <hauke@...ke-m.de>
+
Subject: [PATCH v2] Add additional uapi guards for Linux kernel header files
+
+
With Linux kernel 4.16 it will be possible to guard more parts of the
+
Linux header files from a libc. Make use of this in musl to guard all
+
the structures and other definitions from the Linux header files which
+
are also defined by the header files provided by musl. This will make
+
musl compile with the unmodified Linux kernel user space headers.
+
+
This extends the definitions done in commit 04983f227238 ("make
+
netinet/in.h suppress clashing definitions from kernel headers")
+
+
The needed patches were recently accepted into the netdev tree and will be integrated in Linux 4.16:
+
https://patchwork.ozlabs.org/patch/854342/
+
https://patchwork.ozlabs.org/patch/855293/
+
---
+
include/net/if.h | 7 +++++++
+
include/netinet/if_ether.h | 1 +
+
include/sys/xattr.h | 2 ++
+
3 files changed, 10 insertions(+)
+
+
diff --git a/include/net/if.h b/include/net/if.h
+
index 2f2fcc10..0ee48cd7 100644
+
--- a/include/net/if.h
+
+++ b/include/net/if.h
+
@@ -125,6 +125,13 @@ struct ifconf {
+
#define ifc_req ifc_ifcu.ifcu_req
+
#define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
+
+
+#define __UAPI_DEF_IF_IFCONF 0
+
+#define __UAPI_DEF_IF_IFMAP 0
+
+#define __UAPI_DEF_IF_IFNAMSIZ 0
+
+#define __UAPI_DEF_IF_IFREQ 0
+
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
+
+
#endif
+
+
#ifdef __cplusplus
+
diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
+
index d9a131aa..c2c6e944 100644
+
--- a/include/netinet/if_ether.h
+
+++ b/include/netinet/if_ether.h
+
@@ -133,5 +133,6 @@ do { \
+
(enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
+
} while(0)
+
+
+#define __UAPI_DEF_ETHHDR 0
+
+
#endif
+
diff --git a/include/sys/xattr.h b/include/sys/xattr.h
+
index 6479fcc6..52e3dd89 100644
+
--- a/include/sys/xattr.h
+
+++ b/include/sys/xattr.h
+
@@ -24,6 +24,8 @@ int removexattr(const char *, const char *);
+
int lremovexattr(const char *, const char *);
+
int fremovexattr(int, const char *);
+
+
+#define __UAPI_DEF_XATTR 0
+
+
+
#ifdef __cplusplus
+
}
+
#endif
+
--
+
2.11.0
+14
pkgs/os-specific/linux/musl/fts.nix
···
+
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
+
+
stdenv.mkDerivation rec {
+
name = "musl-fts-${version}";
+
version = "2017-01-13";
+
src = fetchFromGitHub {
+
owner = "pullmoll";
+
repo = "musl-fts";
+
rev = "0bde52df588e8969879a2cae51c3a4774ec62472";
+
sha256 = "1q8cpzisziysrs08b89wj0rm4p6dsyl177cclpfa0f7spjm3jg03";
+
};
+
+
nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
}
+19
pkgs/os-specific/linux/musl/getconf.nix
···
+
{ stdenv, fetchurl }:
+
+
stdenv.mkDerivation {
+
name = "musl-getconf";
+
src = fetchurl {
+
url = "https://raw.githubusercontent.com/alpinelinux/aports/48b16204aeeda5bc1f87e49c6b8e23d9abb07c73/main/musl/getconf.c";
+
sha256 = "0z14ml5343p5gapxw9fnbn2r72r7v2gk8662iifjrblh6sxhqzfq";
+
};
+
+
unpackPhase = ":";
+
+
buildPhase = ''$CC $src -o getconf'';
+
installPhase = ''
+
mkdir -p $out/bin
+
cp getconf $out/bin/
+
'';
+
}
+
+
+18
pkgs/os-specific/linux/musl/getent.nix
···
+
{ stdenv, fetchurl }:
+
+
stdenv.mkDerivation {
+
name = "musl-getent";
+
src = fetchurl {
+
url = "https://raw.githubusercontent.com/alpinelinux/aports/89a718d88ec7466e721f3bbe9ede5ffe58061d78/main/musl/getent.c";
+
sha256 = "0b4jqnsmv1hjgcz7db3vd61k682aphl59c3yhwya2q7mkc6g48xk";
+
};
+
+
unpackPhase = ":";
+
+
buildPhase = ''$CC $src -o getent'';
+
installPhase = ''
+
mkdir -p $out/bin
+
cp getent $out/bin/
+
'';
+
}
+
+18 -5
pkgs/os-specific/linux/numactl/default.nix
···
-
{ stdenv, fetchurl, autoreconfHook }:
+
{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
stdenv.mkDerivation rec {
-
name = "numactl-2.0.10";
+
name = "numactl-${version}";
+
version = "2.0.11";
-
src = fetchurl {
-
url = "ftp://oss.sgi.com/www/projects/libnuma/download/${name}.tar.gz";
-
sha256 = "0qfv2ks6d3gm0mw5sj4cbhsd7cbsb7qm58xvchl2wfzifkzcinnv";
+
src = fetchFromGitHub {
+
owner = "numactl";
+
repo = "numactl";
+
rev = "v${version}";
+
sha256 = "0bcffqawwbyrnza8np0whii25mfd0dria35zal9v3l55xcrya3j9";
};
nativeBuildInputs = [ autoreconfHook ];
+
+
patches = [
+
(fetchpatch {
+
url = https://raw.githubusercontent.com/gentoo/gentoo/b64d15e731e3d6a7671f0ec6c34a20203cf2609d/sys-process/numactl/files/numactl-2.0.11-sysmacros.patch;
+
sha256 = "05277kv3x12n2xlh3fgnmxclxfc384mkwb0v9pd91046khj6h843";
+
})
+
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
url = https://git.alpinelinux.org/cgit/aports/plain/testing/numactl/musl.patch?id=0592b128c71c3e70d493bc7a13caed0d7fae91dd;
+
sha256 = "080b0sygmg7104qbbh1amh3b322yyiajwi2d3d0vayffgva0720v";
+
});
meta = with stdenv.lib; {
description = "Library and tools for non-uniform memory access (NUMA) machines";
+24 -2
pkgs/os-specific/linux/pam/default.nix
···
-
{ stdenv, fetchurl, flex, cracklib }:
+
{ stdenv, buildPackages, hostPlatform, fetchurl, fetchpatch, flex, cracklib }:
stdenv.mkDerivation rec {
name = "linux-pam-${version}";
···
sha256 = "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4";
};
+
patches = stdenv.lib.optionals (hostPlatform.libc == "musl") [
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/linux-pam/fix-compat.patch?id=05a62bda8ec255d7049a2bd4cf0fdc4b32bdb2cc";
+
sha256 = "1h5yp5h2mqp1fcwiwwklyfpa69a3i03ya32pivs60fd7g5bqa7sf";
+
})
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch?id=05a62bda8ec255d7049a2bd4cf0fdc4b32bdb2cc";
+
sha256 = "1ib6shhvgzinjsc603k2x1lxh9dic6qq449fnk110gc359m23j81";
+
})
+
(fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/linux-pam/musl-fix-pam_exec.patch?id=05a62bda8ec255d7049a2bd4cf0fdc4b32bdb2cc";
+
sha256 = "04dx6s9d8cxl40r7m7dc4si47ds4niaqm7902y1d6wcjvs11vrf0";
+
})
+
];
+
outputs = [ "out" "doc" "man" /* "modules" */ ];
+
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ flex ];
buildInputs = [ cracklib ];
···
crossAttrs = {
propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
preConfigure = preConfigure + ''
-
ar x ${flex.crossDrv}/lib/libfl.a
+
$crossConfig-ar x ${flex.crossDrv}/lib/libfl.a
mv libyywrap.o libyywrap-target.o
ar x ${flex}/lib/libfl.a
mv libyywrap.o libyywrap-host.o
···
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
+
'' + stdenv.lib.optionalString (hostPlatform.libc == "musl") ''
+
# export ac_cv_search_crypt=no
+
# (taken from Alpine linux, apparently insecure but also doesn't build O:))
+
# disable insecure modules
+
# sed -e 's/pam_rhosts//g' -i modules/Makefile.am
+
sed -e 's/pam_rhosts//g' -i modules/Makefile.in
'';
meta = {
+4 -3
pkgs/os-specific/linux/shadow/default.nix
···
glibc =
if hostPlatform != buildPlatform
then glibcCross
-
else assert stdenv ? glibc; stdenv.glibc;
+
else assert hostPlatform.libc == "glibc"; stdenv.cc.libc;
dots_in_usernames = fetchpatch {
url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch;
···
configureFlags="$configureFlags --with-xml-catalog=$PWD/xmlcatalog ";
'';
-
configureFlags = " --enable-man ";
+
configureFlags = " --enable-man "
+
+ stdenv.lib.optionalString (hostPlatform.libc != "glibc") " --disable-nscd ";
-
preBuild = assert glibc != null;
+
preBuild = stdenv.lib.optionalString (hostPlatform.libc == "glibc")
''
substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd
'';
+186 -155
pkgs/os-specific/linux/systemd/default.nix
···
{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap, kmod
, zlib, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, libffi
-
, glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libapparmor, audit, lz4
-
, kexectools, libmicrohttpd, linuxHeaders ? stdenv.cc.libc.linuxHeaders, libseccomp
-
, iptables, gnu-efi
+
, glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libidn2, libapparmor
+
, audit, lz4, bzip2, kexectools, libmicrohttpd
+
, linuxHeaders ? stdenv.cc.libc.linuxHeaders
+
, libseccomp, iptables, gnu-efi
, autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
+
, ninja, meson, python3Packages, glibcLocales
+
, patchelf
+
, getent
}:
assert stdenv.isLinux;
-
stdenv.mkDerivation rec {
-
version = "234";
-
name = "systemd-${version}";
+
let
+
pythonLxmlEnv = python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
-
src = fetchFromGitHub {
-
owner = "nixos";
-
repo = "systemd";
-
rev = "eef5613fda5";
-
sha256 = "0wgh5y319v56hcs82mhs58ipb100cz4x41vz3kh4bq1n7sx88cdz";
-
};
+
in
-
outputs = [ "out" "lib" "man" "dev" ];
+
stdenv.mkDerivation rec {
+
version = "237";
+
name = "systemd-${version}";
-
nativeBuildInputs =
-
[ pkgconfig intltool gperf libxslt
-
/* FIXME: we may be able to prevent the following dependencies
-
by generating an autoconf'd tarball, but that's probably not
-
worth it. */
-
autoreconfHook gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45
-
];
-
buildInputs =
-
[ linuxHeaders libcap kmod xz pam acl
-
/* cryptsetup */ libuuid m4 glib libgcrypt libgpgerror
-
libmicrohttpd kexectools libseccomp libffi audit lz4 libapparmor
-
iptables gnu-efi
-
];
+
src = fetchFromGitHub {
+
owner = "NixOS";
+
repo = "systemd";
+
rev = "1e8830dfa77a7dc6976509f4a6edb7e012c50792";
+
sha256 = "1cw1k0i68azmzpqzi3r8jm6mbi2wqlql78fhcg0vvnv1ly8bf7vq";
+
};
-
configureFlags =
-
[ "--localstatedir=/var"
-
"--sysconfdir=/etc"
-
"--with-rootprefix=$(out)"
-
"--with-kbd-loadkeys=${kbd}/bin/loadkeys"
-
"--with-kbd-setfont=${kbd}/bin/setfont"
-
"--with-rootprefix=$(out)"
-
"--with-dbuspolicydir=$(out)/etc/dbus-1/system.d"
-
"--with-dbussystemservicedir=$(out)/share/dbus-1/system-services"
-
"--with-dbussessionservicedir=$(out)/share/dbus-1/services"
-
"--with-tty-gid=3" # tty in NixOS has gid 3
-
"--disable-tests"
+
outputs = [ "out" "lib" "man" "dev" ];
+
+
nativeBuildInputs =
+
[ pkgconfig intltool gperf libxslt gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45
+
ninja meson
+
coreutils # meson calls date, stat etc.
+
pythonLxmlEnv glibcLocales
+
patchelf getent
+
];
+
buildInputs =
+
[ linuxHeaders libcap kmod xz pam acl
+
/* cryptsetup */ libuuid m4 glib libgcrypt libgpgerror libidn2
+
libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor
+
iptables gnu-efi
+
];
+
+
#dontAddPrefix = true;
-
"--enable-lz4"
-
"--enable-hostnamed"
-
"--enable-networkd"
-
"--disable-sysusers"
-
"--enable-timedated"
-
"--enable-timesyncd"
-
"--disable-firstboot"
-
"--enable-localed"
-
"--enable-resolved"
-
"--disable-split-usr"
-
"--disable-libcurl"
-
"--disable-libidn"
-
"--disable-quotacheck"
-
"--disable-ldconfig"
-
"--disable-smack"
+
mesonFlags = [
+
"-Dloadkeys-path=${kbd}/bin/loadkeys"
+
"-Dsetfont-path=${kbd}/bin/setfont"
+
"-Dtty-gid=3" # tty in NixOS has gid 3
+
# "-Dtests=" # TODO
+
"-Dlz4=true"
+
"-Dhostnamed=true"
+
"-Dnetworkd=true"
+
"-Dsysusers=false"
+
"-Dtimedated=true"
+
"-Dtimesyncd=true"
+
"-Dfirstboot=false"
+
"-Dlocaled=true"
+
"-Dresolve=true"
+
"-Dsplit-usr=false"
+
"-Dlibcurl=false"
+
"-Dlibidn=false"
+
"-Dlibidn2=true"
+
"-Dquotacheck=false"
+
"-Dldconfig=false"
+
"-Dsmack=true"
+
"-Dsystem-uid-max=499" #TODO: debug why awking around in /etc/login.defs doesn't work
+
"-Dsystem-gid-max=499"
+
# "-Dtime-epoch=1"
-
(if stdenv.isArm then "--disable-gnuefi" else "--enable-gnuefi")
-
"--with-efi-libdir=${gnu-efi}/lib"
-
"--with-efi-includedir=${gnu-efi}/include"
-
"--with-efi-ldsdir=${gnu-efi}/lib"
+
(if stdenv.isArm then "-Dgnu-efi=false" else "-Dgnu-efi=true")
+
"-Defi-libdir=${gnu-efi}/lib"
+
"-Defi-includedir=${gnu-efi}/include/efi"
+
"-Defi-ldsdir=${gnu-efi}/lib"
-
"--with-sysvinit-path="
-
"--with-sysvrcnd-path="
-
"--with-rc-local-script-path-stop=/etc/halt.local"
-
];
+
"-Dsysvinit-path="
+
"-Dsysvrcnd-path="
+
];
-
hardeningDisable = [ "stackprotector" ];
+
preConfigure =
+
''
+
mesonFlagsArray+=(-Dntp-servers="0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
+
mesonFlagsArray+=(-Ddbuspolicydir=$out/etc/dbus-1/system.d)
+
mesonFlagsArray+=(-Ddbussessionservicedir=$out/share/dbus-1/services)
+
mesonFlagsArray+=(-Ddbussystemservicedir=$out/share/dbus-1/system-services)
+
mesonFlagsArray+=(-Dpamconfdir=$out/etc/pam.d)
+
mesonFlagsArray+=(-Dsysconfdir=$out/etc)
+
mesonFlagsArray+=(-Drootprefix=$out)
+
mesonFlagsArray+=(-Dlibdir=$lib/lib)
+
mesonFlagsArray+=(-Drootlibdir=$lib/lib)
+
mesonFlagsArray+=(-Dmandir=$man/lib)
+
mesonFlagsArray+=(-Dincludedir=$dev/include)
+
mesonFlagsArray+=(-Dpkgconfiglibdir=$dev/lib/pkgconfig)
+
mesonFlagsArray+=(-Dpkgconfigdatadir=$dev/share/pkgconfig)
-
patches = [
-
# TODO: Remove this patch when we have a systemd version
-
# with https://github.com/systemd/systemd/pull/6678
-
(fetchpatch {
-
url = "https://github.com/systemd/systemd/commit/58a78ae77063eddfcd23ea272bd2e0ddc9ea3ff7.patch";
-
sha256 = "0g3pvqigs69mciw6lj3zg12dmxnhwxndwxdjg78af52xrp0djfg8";
-
})
-
];
+
# FIXME: Why aren't includedir and libdir picked up from mesonFlags while other options are?
+
substituteInPlace meson.build \
+
--replace "includedir = join_paths(prefixdir, get_option('includedir'))" \
+
"includedir = '$dev/include'" \
+
--replace "libdir = join_paths(prefixdir, get_option('libdir'))" \
+
"libdir = '$lib/lib'"
-
preConfigure =
-
''
-
unset RANLIB
+
export LC_ALL="en_US.UTF-8";
+
# FIXME: patch this in systemd properly (and send upstream).
+
# already fixed in f00929ad622c978f8ad83590a15a765b4beecac9: (u)mount
+
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c src/shared/generator.c; do
+
test -e $i
+
substituteInPlace $i \
+
--replace /usr/bin/getent ${getent}/bin/getent \
+
--replace /sbin/swapon ${utillinux.bin}/sbin/swapon \
+
--replace /sbin/swapoff ${utillinux.bin}/sbin/swapoff \
+
--replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
+
--replace /bin/echo ${coreutils}/bin/echo \
+
--replace /bin/cat ${coreutils}/bin/cat \
+
--replace /sbin/sulogin ${utillinux.bin}/sbin/sulogin \
+
--replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck \
+
--replace /bin/plymouth /run/current-system/sw/bin/plymouth # To avoid dependency
+
done
-
./autogen.sh
+
for i in tools/xml_helper.py tools/make-directive-index.py tools/make-man-index.py test/sys-script.py; do
+
substituteInPlace $i \
+
--replace "#!/usr/bin/env python" "#!${pythonLxmlEnv}/bin/python"
+
done
-
# FIXME: patch this in systemd properly (and send upstream).
-
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c src/shared/generator.c; do
-
test -e $i
-
substituteInPlace $i \
-
--replace /usr/bin/getent ${stdenv.glibc.bin}/bin/getent \
-
--replace /bin/mount ${utillinux.bin}/bin/mount \
-
--replace /bin/umount ${utillinux.bin}/bin/umount \
-
--replace /sbin/swapon ${utillinux.bin}/sbin/swapon \
-
--replace /sbin/swapoff ${utillinux.bin}/sbin/swapoff \
-
--replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
-
--replace /bin/echo ${coreutils}/bin/echo \
-
--replace /bin/cat ${coreutils}/bin/cat \
-
--replace /sbin/sulogin ${utillinux.bin}/sbin/sulogin \
-
--replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck \
-
--replace /bin/plymouth /run/current-system/sw/bin/plymouth # To avoid dependency
-
done
+
for i in src/basic/generate-gperfs.py src/resolve/generate-dns_type-gperf.py src/test/generate-sym-test.py ; do
+
substituteInPlace $i \
+
--replace "#!/usr/bin/env python" "#!${python3Packages.python}/bin/python"
+
done
-
substituteInPlace src/journal/catalog.c \
-
--replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
+
substituteInPlace src/journal/catalog.c \
+
--replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
+
'';
-
configureFlagsArray+=("--with-ntp-servers=0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
+
# These defines are overridden by CFLAGS and would trigger annoying
+
# warning messages
+
postConfigure = ''
+
substituteInPlace config.h \
+
--replace "POLKIT_AGENT_BINARY_PATH" "_POLKIT_AGENT_BINARY_PATH" \
+
--replace "SYSTEMD_BINARY_PATH" "_SYSTEMD_BINARY_PATH" \
+
--replace "SYSTEMD_CGROUP_AGENT_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
'';
-
PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
+
hardeningDisable = [ "stackprotector" ];
-
NIX_CFLAGS_COMPILE =
-
[ # Can't say ${polkit.bin}/bin/pkttyagent here because that would
-
# lead to a cyclic dependency.
-
"-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
-
"-fno-stack-protector"
+
NIX_CFLAGS_COMPILE =
+
[ # Can't say ${polkit.bin}/bin/pkttyagent here because that would
+
# lead to a cyclic dependency.
+
"-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
-
# Set the release_agent on /sys/fs/cgroup/systemd to the
-
# currently running systemd (/run/current-system/systemd) so
-
# that we don't use an obsolete/garbage-collected release agent.
-
"-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
-
-
"-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
-
];
+
# Set the release_agent on /sys/fs/cgroup/systemd to the
+
# currently running systemd (/run/current-system/systemd) so
+
# that we don't use an obsolete/garbage-collected release agent.
+
"-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
-
installFlags =
-
[ "localstatedir=$(TMPDIR)/var"
-
"sysconfdir=$(out)/etc"
-
"sysvinitdir=$(TMPDIR)/etc/init.d"
-
"pamconfdir=$(out)/etc/pam.d"
-
];
+
"-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
+
];
-
postInstall =
-
''
-
# sysinit.target: Don't depend on
-
# systemd-tmpfiles-setup.service. This interferes with NixOps's
-
# send-keys feature (since sshd.service depends indirectly on
-
# sysinit.target).
-
mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/
+
postInstall =
+
''
+
# sysinit.target: Don't depend on
+
# systemd-tmpfiles-setup.service. This interferes with NixOps's
+
# send-keys feature (since sshd.service depends indirectly on
+
# sysinit.target).
+
mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/
-
mkdir -p $out/example/systemd
-
mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example
-
mv $out/lib/systemd/{system,user} $out/example/systemd
+
mkdir -p $out/example/systemd
+
mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example
+
mv $out/lib/systemd/{system,user} $out/example/systemd
-
rm -rf $out/etc/systemd/system
+
rm -rf $out/etc/systemd/system
-
# Install SysV compatibility commands.
-
mkdir -p $out/sbin
-
ln -s $out/lib/systemd/systemd $out/sbin/telinit
-
for i in init halt poweroff runlevel reboot shutdown; do
-
ln -s $out/bin/systemctl $out/sbin/$i
-
done
+
# Install SysV compatibility commands.
+
mkdir -p $out/sbin
+
ln -s $out/lib/systemd/systemd $out/sbin/telinit
+
for i in init halt poweroff runlevel reboot shutdown; do
+
ln -s $out/bin/systemctl $out/sbin/$i
+
done
-
# Fix reference to /bin/false in the D-Bus services.
-
for i in $out/share/dbus-1/system-services/*.service; do
-
substituteInPlace $i --replace /bin/false ${coreutils}/bin/false
-
done
+
# Fix reference to /bin/false in the D-Bus services.
+
for i in $out/share/dbus-1/system-services/*.service; do
+
substituteInPlace $i --replace /bin/false ${coreutils}/bin/false
+
done
-
rm -rf $out/etc/rpm
+
rm -rf $out/etc/rpm
-
rm $lib/lib/*.la
+
# "kernel-install" shouldn't be used on NixOS.
+
find $out -name "*kernel-install*" -exec rm {} \;
-
# "kernel-install" shouldn't be used on NixOS.
-
find $out -name "*kernel-install*" -exec rm {} \;
+
# Keep only libudev and libsystemd in the lib output.
+
mkdir -p $out/lib
+
mv $lib/lib/security $lib/lib/libnss* $out/lib/
+
''; # */
-
# Keep only libudev and libsystemd in the lib output.
-
mkdir -p $out/lib
-
mv $lib/lib/security $lib/lib/libnss* $out/lib/
-
''; # */
+
enableParallelBuilding = true;
-
enableParallelBuilding = true;
+
# The rpath to the shared systemd library is not added by meson. The
+
# functionality was removed by a nixpkgs patch because it would overwrite
+
# the existing rpath.
+
postFixup = ''
+
sharedLib=libsystemd-shared-${version}.so
+
for prog in `find $out -type f -executable`; do
+
(patchelf --print-needed $prog | grep $sharedLib > /dev/null) && (
+
patchelf --set-rpath `patchelf --print-rpath $prog`:"$out/lib/systemd" $prog
+
) || true
+
done
+
'';
-
# The interface version prevents NixOS from switching to an
-
# incompatible systemd at runtime. (Switching across reboots is
-
# fine, of course.) It should be increased whenever systemd changes
-
# in a backwards-incompatible way. If the interface version of two
-
# systemd builds is the same, then we can switch between them at
-
# runtime; otherwise we can't and we need to reboot.
-
passthru.interfaceVersion = 2;
+
# The interface version prevents NixOS from switching to an
+
# incompatible systemd at runtime. (Switching across reboots is
+
# fine, of course.) It should be increased whenever systemd changes
+
# in a backwards-incompatible way. If the interface version of two
+
# systemd builds is the same, then we can switch between them at
+
# runtime; otherwise we can't and we need to reboot.
+
passthru.interfaceVersion = 2;
-
meta = {
-
homepage = http://www.freedesktop.org/wiki/Software/systemd;
-
description = "A system and service manager for Linux";
-
platforms = stdenv.lib.platforms.linux;
-
maintainers = [ stdenv.lib.maintainers.eelco ];
-
};
+
meta = {
+
homepage = http://www.freedesktop.org/wiki/Software/systemd;
+
description = "A system and service manager for Linux";
+
platforms = stdenv.lib.platforms.linux;
+
maintainers = [ stdenv.lib.maintainers.eelco ];
+
};
}
+14 -1
pkgs/servers/monitoring/net-snmp/default.nix
···
-
{ stdenv, fetchurl, autoreconfHook, file, openssl, perl, unzip }:
+
{ stdenv, fetchurl, fetchpatch, autoreconfHook, file, openssl, perl, unzip }:
stdenv.mkDerivation rec {
name = "net-snmp-5.7.3";
···
url = "mirror://sourceforge/net-snmp/${name}.zip";
sha256 = "0gkss3zclm23zwpqfhddca8278id7pk6qx1mydpimdrrcndwgpz8";
};
+
+
patches =
+
let fetchAlpinePatch = name: sha256: fetchpatch {
+
url = "https://git.alpinelinux.org/cgit/aports/plain/main/net-snmp/${name}?id=f25d3fb08341b60b6ccef424399f060dfcf3f1a5";
+
inherit name sha256;
+
};
+
in [
+
(fetchAlpinePatch "CVE-2015-5621.patch" "05098jyvd9ddr5q26z7scbbvk1bk6x4agpjm6pyprvpc1zpi0y09")
+
(fetchAlpinePatch "fix-Makefile-PL.patch" "14ilnkj3cr6mpi242hrmmmv8nv4dj0fdgn42qfk9aa7scwsc0lc7")
+
(fetchAlpinePatch "fix-includes.patch" "0zpkbb6k366qpq4dax5wknwprhwnhighcp402mlm7950d39zfa3m")
+
(fetchAlpinePatch "netsnmp-swinst-crash.patch" "0gh164wy6zfiwiszh58fsvr25k0ns14r3099664qykgpmickkqid")
+
(fetchAlpinePatch "remove-U64-typedef.patch" "1msxyhcqkvhqa03dwb50288g7f6nbrcd9cs036m9xc8jdgjb8k8j")
+
];
preConfigure =
''
+6 -1
pkgs/servers/pulseaudio/default.nix
···
sha256 = "0sf92knqkvqmfhrbz4vlsagzqlps72wycpmln5dygicg07a0a8q7";
};
-
patches = [ ./caps-fix.patch ];
+
patches = [ ./caps-fix.patch ]
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
name = "padsp-fix.patch";
+
url = "https://git.alpinelinux.org/cgit/aports/plain/testing/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch?id=167be02bf4618a90328e2b234f6a63a5dc05f244";
+
sha256 = "0gf4w25zi123ghk0njapysvrlljkc3hyanacgiswfnnm1i8sab1q";
+
});
outputs = [ "out" "dev" ];
+1
pkgs/servers/sql/mariadb/default.nix
···
"-DPLUGIN_AUTH_GSSAPI_CLIENT=NO"
]
++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
+
++ optional stdenv.hostPlatform.isMusl "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
;
preConfigure = ''
+1 -1
pkgs/servers/sql/postgresql/default.nix
···
fi
'';
-
postFixup = lib.optionalString (!stdenv.isDarwin)
+
postFixup = lib.optionalString (!stdenv.isDarwin && stdenv.hostPlatform.libc == "glibc")
''
# initdb needs access to "locale" command from glibc.
wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin
+1 -3
pkgs/servers/squid/4.nix
···
"--enable-removal-policies=lru,heap"
"--enable-delay-pools"
"--enable-x-accelerator-vary"
-
] ++ stdenv.lib.optionals stdenv.isLinux [
-
"--enable-linux-netfilter"
-
];
+
] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isMusl) "--enable-linux-netfilter";
meta = with stdenv.lib; {
description = "A caching proxy for the Web supporting HTTP, HTTPS, FTP, and more";
+1 -3
pkgs/servers/squid/default.nix
···
"--enable-removal-policies=lru,heap"
"--enable-delay-pools"
"--enable-x-accelerator-vary"
-
] ++ stdenv.lib.optionals stdenv.isLinux [
-
"--enable-linux-netfilter"
-
];
+
] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isMusl) "--enable-linux-netfilter";
meta = with stdenv.lib; {
description = "A caching proxy for the Web supporting HTTP, HTTPS, FTP, and more";
+3
pkgs/servers/x11/xorg/overrides.nix
···
args.udev
];
patches = commonPatches;
+
prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t"
+
'';
configureFlags = [
"--enable-kdrive" # not built by default
"--enable-xephyr"
+14 -5
pkgs/shells/bash/4.4.nix
···
{ stdenv, buildPackages
-
, fetchurl, readline70 ? null, texinfo ? null, binutils ? null, bison
+
, fetchurl, readline70 ? null, texinfo ? null, binutils ? null, bison, autoconf
, buildPlatform, hostPlatform
, interactive ? false
}:
···
patchFlags = "-p0";
-
patches = upstreamPatches;
+
patches = upstreamPatches
+
# https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00006.html
+
++ optional (hostPlatform.libc == "musl") (fetchurl {
+
url = "https://lists.gnu.org/archive/html/bug-bash/2016-10/patchJxugOXrY2y.patch";
+
sha256 = "1m4v9imidb1cc1h91f2na0b8y9kc5c5fgmpvy9apcyv2kbdcghg1";
+
});
postPatch = optionalString hostPlatform.isCygwin "patch -p2 < ${./cygwin-bash-4.4.11-2.src.patch}";
···
"bash_cv_dev_stdin=present"
"bash_cv_dev_fd=standard"
"bash_cv_termcap_lib=libncurses"
+
] ++ optionals (hostPlatform.libc == "musl") [
+
"--without-bash-malloc"
+
"--disable-nls"
];
# Note: Bison is needed because the patches above modify parse.y.
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [bison]
++ optional (texinfo != null) texinfo
-
++ optional hostPlatform.isDarwin binutils;
+
++ optional hostPlatform.isDarwin binutils
+
++ optional (hostPlatform.libc == "musl") autoconf;
buildInputs = optional interactive readline70;
···
postInstall = ''
ln -s bash "$out/bin/sh"
-
rm $out/lib/bash/Makefile.inc
+
rm -f $out/lib/bash/Makefile.inc
'';
postFixup = if interactive
···
''
# most space is taken by locale data
else ''
-
rm -r "$out/share" "$out/bin/bashbug"
+
rm -rf "$out/share" "$out/bin/bashbug"
'';
meta = with stdenv.lib; {
+2 -2
pkgs/shells/fish/default.nix
···
{ stdenv, fetchurl, coreutils, utillinux,
nettools, kbd, bc, which, gnused, gnugrep,
-
groff, man-db, glibc, libiconv, pcre2,
+
groff, man-db, getent, libiconv, pcre2,
gettext, ncurses, python3
, writeText
···
sed -e "s| ul| ${utillinux}/bin/ul|" \
-i "$out/share/fish/functions/__fish_print_help.fish"
for cur in $out/share/fish/functions/*.fish; do
-
sed -e "s|/usr/bin/getent|${glibc.bin}/bin/getent|" \
+
sed -e "s|/usr/bin/getent|${getent}/bin/getent|" \
-i "$cur"
done
+1 -1
pkgs/stdenv/adapters.nix
···
# without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
-
++ stdenv.lib.optional hostPlatform.isAarch64 pkgs.updateAutotoolsGnuConfigScriptsHook
+
++ stdenv.lib.optional (hostPlatform.isAarch64 || hostPlatform.libc == "musl") pkgs.updateAutotoolsGnuConfigScriptsHook
;
crossConfig = hostPlatform.config;
+11
pkgs/stdenv/linux/bootstrap-files/aarch64-musl.nix
···
+
{
+
busybox = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/wjzsj9cmdkc70f78yh072483x8656nci-stdenv-bootstrap-tools-aarch64-unknown-linux-musl/on-server/busybox;
+
sha256 = "01s6bwq84wyrjh3rdsgxni9gkzp7ss8rghg0cmp8zd87l79y8y4g";
+
executable = true;
+
};
+
bootstrapTools = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/wjzsj9cmdkc70f78yh072483x8656nci-stdenv-bootstrap-tools-aarch64-unknown-linux-musl/on-server/bootstrap-tools.tar.xz;
+
sha256 = "0pbqrw9z4ifkijpfpx15l2dzi00rq8c5zg9ghimz5qgr5dx7f7cl";
+
};
+
}
+11
pkgs/stdenv/linux/bootstrap-files/armv6l-musl.nix
···
+
{
+
busybox = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/xmz441m69qrlfdw47l2k10zf87fsya6r-stdenv-bootstrap-tools-armv6l-unknown-linux-musleabihf/on-server/busybox;
+
sha256 = "01d0hp1xgrriiy9w0sd9vbqzwxnpwiyah80pi4vrpcmbwji36j1i";
+
executable = true;
+
};
+
bootstrapTools = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/xmz441m69qrlfdw47l2k10zf87fsya6r-stdenv-bootstrap-tools-armv6l-unknown-linux-musleabihf/on-server/bootstrap-tools.tar.xz;
+
sha256 = "1r9mz9w8y5jd7gfwfsrvs20qarzxy7bvrp5dlm41hnx6z617if1h";
+
};
+
}
+11
pkgs/stdenv/linux/bootstrap-files/x86_64-musl.nix
···
+
{
+
busybox = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/030q34q7fk6jdfxkgcqp5rzr4yhw3pgx-stdenv-bootstrap-tools-x86_64-unknown-linux-musl/on-server/busybox;
+
sha256 = "16lzrwwvdk6q3g08gs45pldz0rh6xpln2343xr444960h6wqxl5v";
+
executable = true;
+
};
+
bootstrapTools = import <nix/fetchurl.nix> {
+
url = https://wdtz.org/files/030q34q7fk6jdfxkgcqp5rzr4yhw3pgx-stdenv-bootstrap-tools-x86_64-unknown-linux-musl/on-server/bootstrap-tools.tar.xz;
+
sha256 = "0ly0wj8wzbikn2j8sn727vikk90bq36drh98qvfx1kkh5k5azm2j";
+
};
+
}
+18
pkgs/stdenv/linux/bootstrap-tools-musl/default.nix
···
+
{ system, bootstrapFiles }:
+
+
derivation {
+
name = "bootstrap-tools";
+
+
builder = bootstrapFiles.busybox;
+
+
args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
+
+
tarball = bootstrapFiles.bootstrapTools;
+
+
inherit system;
+
+
# Needed by the GCC wrapper.
+
langC = true;
+
langCC = true;
+
isGNU = true;
+
}
+64
pkgs/stdenv/linux/bootstrap-tools-musl/scripts/unpack-bootstrap-tools.sh
···
+
# Unpack the bootstrap tools tarball.
+
echo Unpacking the bootstrap tools...
+
$builder mkdir $out
+
< $tarball $builder unxz | $builder tar x -C $out
+
+
# Set the ELF interpreter / RPATH in the bootstrap binaries.
+
echo Patching the bootstrap tools...
+
+
if test -f $out/lib/ld.so.?; then
+
# MIPS case
+
LD_BINARY=$out/lib/ld.so.?
+
else
+
# i686, x86_64 and armv5tel
+
LD_BINARY=$out/lib/ld-*so.?
+
fi
+
+
# On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So
+
# use a copy of patchelf.
+
LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf .
+
+
for i in $out/bin/* $out/libexec/gcc/*/*/*; do
+
if [ -L "$i" ]; then continue; fi
+
if [ -z "${i##*/liblto*}" ]; then continue; fi
+
echo patching "$i"
+
LD_LIBRARY_PATH=$out/lib $LD_BINARY \
+
./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
+
done
+
+
for i in $out/lib/libiconv*.so $out/lib/libpcre* $out/lib/libc.so; do
+
if [ -L "$i" ]; then continue; fi
+
echo patching "$i"
+
$out/bin/patchelf --set-rpath $out/lib --force-rpath "$i"
+
done
+
+
export PATH=$out/bin
+
+
# Fix the libc linker script.
+
#cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp
+
#mv $out/lib/libc.so.tmp $out/lib/libc.so
+
#cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp
+
#mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
+
+
# Provide some additional symlinks.
+
ln -s bash $out/bin/sh
+
ln -s bzip2 $out/bin/bunzip2
+
+
# Provide a gunzip script.
+
cat > $out/bin/gunzip <<EOF
+
#!$out/bin/sh
+
exec $out/bin/gzip -d "\$@"
+
EOF
+
chmod +x $out/bin/gunzip
+
+
# Provide fgrep/egrep.
+
echo "#! $out/bin/sh" > $out/bin/egrep
+
echo "exec $out/bin/grep -E \"\$@\"" >> $out/bin/egrep
+
echo "#! $out/bin/sh" > $out/bin/fgrep
+
echo "exec $out/bin/grep -F \"\$@\"" >> $out/bin/fgrep
+
+
# Provide xz (actually only xz -d will work).
+
echo "#! $out/bin/sh" > $out/bin/xz
+
echo "exec $builder unxz \"\$@\"" >> $out/bin/xz
+
+
chmod +x $out/bin/egrep $out/bin/fgrep $out/bin/xz
+51 -25
pkgs/stdenv/linux/default.nix
···
{ lib
, localSystem, crossSystem, config, overlays
-
, bootstrapFiles ? { # switch
-
"i686-linux" = import ./bootstrap-files/i686.nix;
-
"x86_64-linux" = import ./bootstrap-files/x86_64.nix;
-
"armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
-
"armv6l-linux" = import ./bootstrap-files/armv6l.nix;
-
"armv7l-linux" = import ./bootstrap-files/armv7l.nix;
-
"aarch64-linux" = import ./bootstrap-files/aarch64.nix;
-
"mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
-
}.${localSystem.system}
-
or (abort "unsupported platform for the pure Linux stdenv")
+
, bootstrapFiles ?
+
let table = {
+
"glibc" = {
+
"i686-linux" = import ./bootstrap-files/i686.nix;
+
"x86_64-linux" = import ./bootstrap-files/x86_64.nix;
+
"armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
+
"armv6l-linux" = import ./bootstrap-files/armv6l.nix;
+
"armv7l-linux" = import ./bootstrap-files/armv7l.nix;
+
"aarch64-linux" = import ./bootstrap-files/aarch64.nix;
+
"mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
+
};
+
"musl" = {
+
"aarch64-linux" = import ./bootstrap-files/aarch64-musl.nix;
+
"armv6l-linux" = import ./bootstrap-files/armv6l-musl.nix;
+
"x86_64-linux" = import ./bootstrap-files/x86_64-musl.nix;
+
};
+
};
+
archLookupTable = table.${localSystem.libc}
+
or (abort "unsupported libc for the pure Linux stdenv");
+
files = archLookupTable.${localSystem.system}
+
or (abort "unsupported platform for the pure Linux stdenv");
+
in files
}:
assert crossSystem == null;
···
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
-
bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
+
bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; };
+
+
getLibc = stage: stage.${localSystem.libc};
# This function builds the various standard environments used during
···
cc = prevStage.gcc-unwrapped;
bintools = prevStage.binutils;
isGNU = true;
-
libc = prevStage.glibc;
+
libc = getLibc prevStage;
inherit (prevStage) coreutils gnugrep;
name = name;
stdenvNoCC = prevStage.ccWrapperStdenv;
···
# stdenv.glibc is used by GCC build to figure out the system-level
# /usr/include directory.
+
# TODO: Remove this!
inherit (prevStage) glibc;
};
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
···
__raw = true;
gcc-unwrapped = null;
-
glibc = null;
+
glibc = assert false; null;
+
musl = assert false; null;
binutils = null;
coreutils = null;
gnugrep = null;
···
# will search the Glibc headers before the GCC headers). So
# create a dummy Glibc here, which will be used in the stdenv of
# stage1.
-
glibc = self.stdenv.mkDerivation {
-
name = "bootstrap-glibc";
+
${localSystem.libc} = self.stdenv.mkDerivation {
+
name = "bootstrap-${localSystem.libc}";
buildCommand = ''
mkdir -p $out
ln -s ${bootstrapTools}/lib $out/lib
+
'' + lib.optionalString (localSystem.libc == "glibc") ''
ln -s ${bootstrapTools}/include-glibc $out/include
+
'' + lib.optionalString (localSystem.libc == "musl") ''
+
ln -s ${bootstrapTools}/include-libc $out/include
'';
};
gcc-unwrapped = bootstrapTools;
···
nativeTools = false;
nativeLibc = false;
buildPackages = { };
-
libc = self.glibc;
+
libc = getLibc self;
inherit (self) stdenvNoCC coreutils gnugrep;
bintools = bootstrapTools;
name = "bootstrap-binutils-wrapper";
···
binutils = super.binutils_nogold;
inherit (prevStage)
ccWrapperStdenv
-
glibc gcc-unwrapped coreutils gnugrep;
+
gcc-unwrapped coreutils gnugrep;
+
+
${localSystem.libc} = getLibc prevStage;
# A threaded perl build needs glibc/libpthread_nonshared.a,
# which is not included in bootstrapTools, so disable threading.
···
binutils = prevStage.binutils.override {
# Rewrap the binutils with the new glibc, so both the next
# stage's wrappers use it.
-
libc = self.glibc;
+
libc = getLibc self;
};
};
})
···
overrides = self: super: rec {
inherit (prevStage)
ccWrapperStdenv
-
binutils glibc coreutils gnugrep
+
binutils coreutils gnugrep
perl patchelf linuxHeaders gnum4 bison;
+
${localSystem.libc} = getLibc prevStage;
# Link GCC statically against GMP etc. This makes sense because
# these builds of the libraries are only used by GCC, so it
# reduces the size of the stdenv closure.
···
# because gcc (since JAR support) already depends on zlib, and
# then if we already have a zlib we want to use that for the
# other purposes (binutils and top-level pkgs) too.
-
inherit (prevStage) gettext gnum4 bison gmp perl glibc zlib linuxHeaders;
-
+
inherit (prevStage) gettext gnum4 bison gmp perl zlib linuxHeaders;
+
${localSystem.libc} = getLibc prevStage;
binutils = super.binutils.override {
# Don't use stdenv's shell but our own
shell = self.bash + "/bin/bash";
···
};
cc = prevStage.gcc-unwrapped;
bintools = self.binutils;
-
libc = self.glibc;
+
libc = getLibc self;
inherit (self) stdenvNoCC coreutils gnugrep;
name = "";
shell = self.bash + "/bin/bash";
···
inherit (prevStage.stdenv) fetchurlBoot;
extraAttrs = {
+
# TODO: remove this!
inherit (prevStage) glibc;
+
inherit platform bootstrapTools;
shellPackage = prevStage.bash;
};
···
++ lib.optional (gawk.libsigsegv != null) gawk.libsigsegv
)
# More complicated cases
-
++ [
-
glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
+
++ (map (x: getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] )
+
++ [ /*propagated from .dev*/ linuxHeaders
binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params
]
+
++ lib.optional (localSystem.libc == "musl") libiconv
++ lib.optionals localSystem.isAarch64
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
overrides = self: super: {
inherit (prevStage)
gzip bzip2 xz bash coreutils diffutils findutils gawk
-
glibc gnumake gnused gnutar gnugrep gnupatch patchelf
+
gnumake gnused gnutar gnugrep gnupatch patchelf
attr acl paxctl zlib pcre;
+
${localSystem.libc} = getLibc prevStage;
} // lib.optionalAttrs (super.targetPlatform == localSystem) {
# Need to get rid of these when cross-compiling.
inherit (prevStage) binutils binutils-raw;
+10 -6
pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
···
};
in with (import ../../../lib).systems.examples; {
-
armv5tel = make sheevaplug;
-
scaleway = make scaleway-c1;
-
pogoplug4 = make pogoplug4;
-
armv6l = make raspberryPi;
-
armv7l = make armv7l-hf-multiplatform;
-
aarch64 = make aarch64-multiplatform;
+
armv5tel = make sheevaplug;
+
scaleway = make scaleway-c1;
+
pogoplug4 = make pogoplug4;
+
armv6l = make raspberryPi;
+
armv7l = make armv7l-hf-multiplatform;
+
aarch64 = make aarch64-multiplatform;
+
x86_64-musl = make musl64;
+
i686-musl = make musl32;
+
armv6l-musl = make muslpi;
+
aarch64-musl = make aarch64-multiplatform-musl;
}
+51 -25
pkgs/stdenv/linux/make-bootstrap-tools.nix
···
let
pkgs = import ../../.. { inherit localSystem crossSystem; };
-
glibc = if pkgs.hostPlatform != pkgs.buildPlatform
-
then pkgs.glibcCross
-
else pkgs.glibc;
+
libc = pkgs.stdenv.cc.libc;
in with pkgs; rec {
···
set -x
mkdir -p $out/bin $out/lib $out/libexec
+
'' + (if (hostPlatform.libc == "glibc") then ''
# Copy what we need of Glibc.
-
cp -d ${glibc.out}/lib/ld*.so* $out/lib
-
cp -d ${glibc.out}/lib/libc*.so* $out/lib
-
cp -d ${glibc.out}/lib/libc_nonshared.a $out/lib
-
cp -d ${glibc.out}/lib/libm*.so* $out/lib
-
cp -d ${glibc.out}/lib/libdl*.so* $out/lib
-
cp -d ${glibc.out}/lib/librt*.so* $out/lib
-
cp -d ${glibc.out}/lib/libpthread*.so* $out/lib
-
cp -d ${glibc.out}/lib/libnsl*.so* $out/lib
-
cp -d ${glibc.out}/lib/libutil*.so* $out/lib
-
cp -d ${glibc.out}/lib/libnss*.so* $out/lib
-
cp -d ${glibc.out}/lib/libresolv*.so* $out/lib
-
cp -d ${glibc.out}/lib/crt?.o $out/lib
+
cp -d ${libc.out}/lib/ld*.so* $out/lib
+
cp -d ${libc.out}/lib/libc*.so* $out/lib
+
cp -d ${libc.out}/lib/libc_nonshared.a $out/lib
+
cp -d ${libc.out}/lib/libm*.so* $out/lib
+
cp -d ${libc.out}/lib/libdl*.so* $out/lib
+
cp -d ${libc.out}/lib/librt*.so* $out/lib
+
cp -d ${libc.out}/lib/libpthread*.so* $out/lib
+
cp -d ${libc.out}/lib/libnsl*.so* $out/lib
+
cp -d ${libc.out}/lib/libutil*.so* $out/lib
+
cp -d ${libc.out}/lib/libnss*.so* $out/lib
+
cp -d ${libc.out}/lib/libresolv*.so* $out/lib
+
cp -d ${libc.out}/lib/crt?.o $out/lib
-
cp -rL ${glibc.dev}/include $out
+
cp -rL ${libc.dev}/include $out
chmod -R u+w "$out"
-
# glibc can contain linker scripts: find them, copy their deps,
+
# libc can contain linker scripts: find them, copy their deps,
# and get rid of absolute paths (nuke-refs would make them useless)
local lScripts=$(grep --files-with-matches --max-count=1 'GNU ld script' -R "$out/lib")
-
cp -d -t "$out/lib/" $(cat $lScripts | tr " " "\n" | grep -F '${glibc.out}' | sort -u)
+
cp -d -t "$out/lib/" $(cat $lScripts | tr " " "\n" | grep -F '${libc.out}' | sort -u)
for f in $lScripts; do
-
substituteInPlace "$f" --replace '${glibc.out}/lib/' ""
+
substituteInPlace "$f" --replace '${libc.out}/lib/' ""
done
# Hopefully we won't need these.
···
find $out/include -name .install -exec rm {} \;
find $out/include -name ..install.cmd -exec rm {} \;
mv $out/include $out/include-glibc
+
'' else if (hostPlatform.libc == "musl") then ''
+
# Copy what we need from musl
+
cp ${libc.out}/lib/* $out/lib
+
cp -rL ${libc.dev}/include $out
+
chmod -R u+w "$out"
+
rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
+
find $out/include -name .install -exec rm {} \;
+
find $out/include -name ..install.cmd -exec rm {} \;
+
mv $out/include $out/include-libc
+
'' else throw "unsupported libc for bootstrap tools")
+
+ ''
# Copy coreutils, bash, etc.
cp ${coreutilsMinimal.out}/bin/* $out/bin
(cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
···
cp -rd ${gcc.cc.out}/libexec/* $out/libexec
chmod -R u+w $out/libexec
rm -rf $out/libexec/gcc/*/*/plugin
-
mkdir $out/include
+
mkdir -p $out/include
cp -rd ${gcc.cc.out}/include/c++ $out/include
chmod -R u+w $out/include
rm -rf $out/include/c++/*/ext/pb_ds
···
cp -d ${libmpc.out}/lib/libmpc*.so* $out/lib
cp -d ${zlib.out}/lib/libz.so* $out/lib
cp -d ${libelf}/lib/libelf.so* $out/lib
+
'' + lib.optionalString (hostPlatform.libc == "musl") ''
+
cp -d ${libiconv.out}/lib/libiconv*.so* $out/lib
'' + lib.optionalString (hostPlatform != buildPlatform) ''
# These needed for cross but not native tools because the stdenv
···
mv $out/.pack $out/pack
mkdir $out/on-server
-
tar cvfJ $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack .
+
XZ_OPT=-9 tar cvJf $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack .
cp ${busyboxMinimal}/bin/busybox $out/on-server
chmod u+w $out/on-server/busybox
nuke-refs $out/on-server/busybox
···
bootstrapTools = runCommand "bootstrap-tools.tar.xz" {} "cp ${build}/on-server/bootstrap-tools.tar.xz $out";
};
-
bootstrapTools = import ./bootstrap-tools {
-
inherit (hostPlatform) system;
-
inherit bootstrapFiles;
-
};
+
bootstrapTools = if (hostPlatform.libc == "glibc") then
+
import ./bootstrap-tools {
+
inherit (hostPlatform) system;
+
inherit bootstrapFiles;
+
}
+
else if (hostPlatform.libc == "musl") then
+
import ./bootstrap-tools-musl {
+
inherit (hostPlatform) system;
+
inherit bootstrapFiles;
+
}
+
else throw "unsupported libc";
test = derivation {
name = "test-bootstrap-tools";
···
grep --version
gcc --version
+
'' + lib.optionalString (hostPlatform.libc == "glibc") ''
ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
+
'' + lib.optionalString (hostPlatform.libc == "musl") ''
+
ldmusl=$(echo ${bootstrapTools}/lib/ld-musl*.so.?)
+
export CPP="cpp -idirafter ${bootstrapTools}/include-libc -B${bootstrapTools}"
+
export CC="gcc -idirafter ${bootstrapTools}/include-libc -B${bootstrapTools} -Wl,-dynamic-linker,$ldmusl -Wl,-rpath,${bootstrapTools}/lib"
+
export CXX="g++ -idirafter ${bootstrapTools}/include-libc -B${bootstrapTools} -Wl,-dynamic-linker,$ldmusl -Wl,-rpath,${bootstrapTools}/lib"
+
'' + ''
echo '#include <stdio.h>' >> foo.c
echo '#include <limits.h>' >> foo.c
+1 -1
pkgs/tools/compression/xz/default.nix
···
doCheck = true;
# In stdenv-linux, prevent a dependency on bootstrap-tools.
-
preConfigure = "unset CONFIG_SHELL";
+
preConfigure = "CONFIG_SHELL=/bin/sh";
postInstall = "rm -rf $out/share/doc";
+1
pkgs/tools/misc/findutils/default.nix
···
doCheck
= !hostPlatform.isDarwin
&& !(hostPlatform.libc == "glibc" && hostPlatform.isi686)
+
&& (hostPlatform.libc != "musl")
&& hostPlatform == buildPlatform;
outputs = [ "out" "info" ];
+17 -3
pkgs/tools/misc/man-db/default.nix
···
-
{ stdenv, fetchurl, pkgconfig, libpipeline, db, groff, makeWrapper }:
+
{ stdenv, fetchurl, pkgconfig, libpipeline, db, groff, libiconv, makeWrapper, buildPackages }:
stdenv.mkDerivation rec {
name = "man-db-2.7.5";
···
outputs = [ "out" "doc" ];
outputMan = "out"; # users will want `man man` to work
-
nativeBuildInputs = [ pkgconfig makeWrapper ];
-
buildInputs = [ libpipeline db groff ];
+
nativeBuildInputs = [ pkgconfig makeWrapper groff ]
+
++ stdenv.lib.optionals doCheck checkInputs;
+
buildInputs = [ libpipeline db groff ]; # (Yes, 'groff' is both native and build input)
+
checkInputs = [ libiconv /* for 'iconv' binary */ ];
postPatch = ''
substituteInPlace src/man_db.conf.in \
···
# make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name)
find "$out/bin" -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${groff}/bin"
+
done
+
'';
+
+
postFixup = stdenv.lib.optionalString (buildPackages.groff != groff) ''
+
# Check to make sure none of the outputs depend on build-time-only groff:
+
for outName in $outputs; do
+
out=''${!outName}
+
echo "Checking $outName(=$out) for references to build-time groff..."
+
if grep -r '${buildPackages.groff}' $out; then
+
echo "Found an erroneous dependency on groff ^^^" >&2
+
exit 1
+
fi
done
'';
+7
pkgs/tools/misc/screen/default.nix
···
"--enable-colors256"
];
+
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl
+
(fetchpatch {
+
url = https://gist.githubusercontent.com/yujinakayama/4608863/raw/76b9f89af5e5a2e97d9a0f36aac989fb56cf1447/gistfile1.diff;
+
sha256 = "0f9bf83p8zdxaa1pr75jyf5g8xr3r8kv7cyzzbpraa1q4j15ss1p";
+
stripLen = 1;
+
});
+
buildInputs = [ ncurses ] ++ stdenv.lib.optional stdenv.isLinux pam
++ stdenv.lib.optional stdenv.isDarwin utmp;
+8 -2
pkgs/tools/networking/inetutils/default.nix
···
buildInputs = [ ncurses /* for `talk' */ perl /* for `whois' */ help2man ];
-
configureFlags = "--with-ncurses-include-dir=${ncurses.dev}/include";
+
configureFlags = [ "--with-ncurses-include-dir=${ncurses.dev}/include" ]
+
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ # Musl doesn't define rcmd
+
"--disable-rcp"
+
"--disable-rsh"
+
"--disable-rlogin"
+
"--disable-rexec"
+
];
# Test fails with "UNIX socket name too long", probably because our
# $TMPDIR is too long.
···
postInstall = ''
# XXX: These programs are normally installed setuid but since it
# fails, they end up being non-executable, hence this hack.
-
chmod +x $out/bin/{ping,ping6,rcp,rlogin,rsh,traceroute}
+
chmod +x $out/bin/{ping,ping6,${stdenv.lib.optionalString (!stdenv.hostPlatform.isMusl) ''rcp,rlogin,rsh,''}traceroute}
'';
meta = {
+18 -1
pkgs/tools/networking/iperf/3.nix
···
-
{ stdenv, fetchurl, openssl }:
+
{ stdenv, fetchurl, openssl, fetchpatch }:
stdenv.mkDerivation rec {
name = "iperf-3.3";
···
};
buildInputs = [ openssl ];
+
+
preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+
NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE"
+
'';
+
+
patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+
(fetchpatch {
+
url = "http://git.alpinelinux.org/cgit/aports/plain/main/iperf3/build-fixes.patch";
+
name = "fix-musl-build.patch";
+
sha256 = "0zvfjnqdldh6rc6qggyb310swdnl9qk0m3z1kklnqzgjsh8dskvl";
+
})
+
(fetchpatch {
+
url = "http://git.alpinelinux.org/cgit/aports/plain/main/iperf3/remove-pg-flags.patch";
+
name = "remove-pg-flags.patch";
+
sha256 = "0lnczhass24kgq59drgdipnhjnw4l1cy6gqza7f2ah1qr4q104rm";
+
})
+
];
postInstall = ''
ln -s iperf3 $out/bin/iperf
+5
pkgs/tools/networking/openntpd/default.nix
···
sha256 = "1g6hi03ylhv47sbar3xxgsrar8schqfwn4glckh6m6lni67ndq85";
};
+
prePatch = ''
+
sed -i '20i#include <sys/cdefs.h>' src/ntpd.h
+
sed -i '19i#include <sys/cdefs.h>' src/log.c
+
'';
+
configureFlags = [
"--with-privsep-path=${privsepPath}"
"--with-privsep-user=${privsepUser}"
+1
pkgs/tools/networking/ppp/default.nix
···
url = "https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/plain/debian/patches/rc_mksid-no-buffer-overflow?h=debian/2.4.7-1%2b4";
sha256 = "1dk00j7bg9nfgskw39fagnwv1xgsmyv0xnkd6n1v5gy0psw0lvqh";
})
+
./musl-fix-headers.patch
];
buildInputs = [ libpcap ];
+137
pkgs/tools/networking/ppp/musl-fix-headers.patch
···
+
diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
+
index b06eda5..dafa36c 100644
+
--- a/include/net/ppp_defs.h
+
+++ b/include/net/ppp_defs.h
+
@@ -38,6 +38,8 @@
+
#ifndef _PPP_DEFS_H_
+
#define _PPP_DEFS_H_
+
+
+#include <sys/time.h>
+
+
+
/*
+
* The basic PPP frame.
+
*/
+
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+
index a74c914..7acd2cf 100644
+
--- a/pppd/Makefile.linux
+
+++ b/pppd/Makefile.linux
+
@@ -126,7 +126,7 @@ LIBS += -lcrypt
+
endif
+
+
ifdef USE_LIBUTIL
+
-CFLAGS += -DHAVE_LOGWTMP=1
+
+#CFLAGS += -DHAVE_LOGWTMP=1
+
LIBS += -lutil
+
endif
+
+
diff --git a/pppd/magic.h b/pppd/magic.h
+
index c81213b..305aece 100644
+
--- a/pppd/magic.h
+
+++ b/pppd/magic.h
+
@@ -42,6 +42,8 @@
+
* $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
+
*/
+
+
+#include <sys/cdefs.h>
+
+
+
void magic_init __P((void)); /* Initialize the magic number generator */
+
u_int32_t magic __P((void)); /* Returns the next magic number */
+
+
diff --git a/pppd/plugins/rp-pppoe/if.c b/pppd/plugins/rp-pppoe/if.c
+
index 91e9a57..9c0fac3 100644
+
--- a/pppd/plugins/rp-pppoe/if.c
+
+++ b/pppd/plugins/rp-pppoe/if.c
+
@@ -30,10 +30,6 @@ static char const RCSID[] =
+
#include <linux/if_packet.h>
+
#endif
+
+
-#ifdef HAVE_NET_ETHERNET_H
+
-#include <net/ethernet.h>
+
-#endif
+
-
+
#ifdef HAVE_ASM_TYPES_H
+
#include <asm/types.h>
+
#endif
+
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
+
index a8c2bb4..ca34d79 100644
+
--- a/pppd/plugins/rp-pppoe/plugin.c
+
+++ b/pppd/plugins/rp-pppoe/plugin.c
+
@@ -46,7 +46,6 @@ static char const RCSID[] =
+
#include <unistd.h>
+
#include <fcntl.h>
+
#include <signal.h>
+
-#include <net/ethernet.h>
+
#include <net/if_arp.h>
+
#include <linux/ppp_defs.h>
+
#include <linux/if_pppox.h>
+
diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+
index 3d3bf4e..b5f82d3 100644
+
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+
@@ -27,10 +27,6 @@
+
#include <linux/if_packet.h>
+
#endif
+
+
-#ifdef HAVE_NET_ETHERNET_H
+
-#include <net/ethernet.h>
+
-#endif
+
-
+
#ifdef HAVE_ASM_TYPES_H
+
#include <asm/types.h>
+
#endif
+
@@ -55,6 +51,8 @@ void die(int status)
+
exit(status);
+
}
+
+
+#define error(x...) fprintf(stderr, x)
+
+
+
/* Initialize frame types to RFC 2516 values. Some broken peers apparently
+
use different frame types... sigh... */
+
+
diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+
index 9ab2eee..4d68147 100644
+
--- a/pppd/plugins/rp-pppoe/pppoe.h
+
+++ b/pppd/plugins/rp-pppoe/pppoe.h
+
@@ -86,18 +86,6 @@ typedef unsigned long UINT32_t;
+
+
#include <netinet/in.h>
+
+
-#ifdef HAVE_NETINET_IF_ETHER_H
+
-#include <sys/types.h>
+
-
+
-#ifdef HAVE_SYS_SOCKET_H
+
-#include <sys/socket.h>
+
-#endif
+
-#ifndef HAVE_SYS_DLPI_H
+
-#include <netinet/if_ether.h>
+
-#endif
+
-#endif
+
-
+
-
+
+
/* Ethernet frame types according to RFC 2516 */
+
#define ETH_PPPOE_DISCOVERY 0x8863
+
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+
index 6d71530..86d224e 100644
+
--- a/pppd/sys-linux.c
+
+++ b/pppd/sys-linux.c
+
@@ -102,19 +102,11 @@
+
#define MAX_ADDR_LEN 7
+
#endif
+
+
-#if __GLIBC__ >= 2
+
#include <asm/types.h> /* glibc 2 conflicts with linux/types.h */
+
#include <net/if.h>
+
#include <net/if_arp.h>
+
#include <net/route.h>
+
#include <netinet/if_ether.h>
+
-#else
+
-#include <linux/types.h>
+
-#include <linux/if.h>
+
-#include <linux/if_arp.h>
+
-#include <linux/route.h>
+
-#include <linux/if_ether.h>
+
-#endif
+
#include <netinet/in.h>
+
#include <arpa/inet.h>
+
+4
pkgs/tools/networking/siege/default.nix
···
buildInputs = [ openssl zlib ];
+
prePatch = ''
+
sed -i -e 's/u_int32_t/uint32_t/g' -e '1i#include <stdint.h>' src/hash.c
+
'';
+
configureFlags = [
"--with-ssl=${openssl.dev}"
"--with-zlib=${zlib.dev}"
+1 -1
pkgs/tools/networking/unbound/default.nix
···
installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ];
-
preFixup = stdenv.lib.optionalString stdenv.isLinux
+
preFixup = stdenv.lib.optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) # XXX: revisit
# Build libunbound again, but only against nettle instead of openssl.
# This avoids gnutls.out -> unbound.lib -> openssl.out.
# There was some problem with this on Darwin; let's not complicate non-Linux.
+8 -35
pkgs/tools/package-management/nix/default.nix
···
, pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli
, autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook5_xsl
, libseccomp, busybox-sandbox-shell
-
, hostPlatform
+
, hostPlatform, buildPlatform
, storeDir ? "/nix/store"
, stateDir ? "/nix/var"
, confDir ? "/etc"
···
nativeBuildInputs =
[ pkgconfig ]
-
++ lib.optionals (!is20) [ perl ]
+
++ lib.optionals (!is20) [ curl perl ]
++ lib.optionals fromGit [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook5_xsl ];
-
buildInputs = [ curl openssl sqlite xz ]
+
buildInputs = [ curl openssl sqlite xz bzip2 ]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optionals fromGit [ brotli ] # Since 1.12
++ lib.optional stdenv.isLinux libseccomp
···
propagatedBuildInputs = [ boehmgc ];
-
# Note: bzip2 is not passed as a build input, because the unpack phase
-
# would end up using the wrong bzip2 when cross-compiling.
-
# XXX: The right thing would be to reinstate `--with-bzip2' in Nix.
-
postUnpack =
-
'' export CPATH="${bzip2.dev}/include"
-
export LIBRARY_PATH="${bzip2.out}/lib"
-
export CXXFLAGS="-Wno-error=reserved-user-defined-literal"
-
'';
-
configureFlags =
[ "--with-store-dir=${storeDir}"
"--localstatedir=${stateDir}"
···
"--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}"
] ++ lib.optionals (is20 && stdenv.isLinux) [
"--with-sandbox-shell=${sh}/bin/busybox"
-
];
+
]
+
++ lib.optional (
+
hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system
+
) ''--with-system=${hostPlatform.nix.system}'';
makeFlags = "profiledir=$(out)/etc/profile.d";
installFlags = "sysconfdir=$(out)/etc";
-
doInstallCheck = true;
+
doInstallCheck = true; # not cross
# socket path becomes too long otherwise
preInstallCheck = lib.optional stdenv.isDarwin "export TMPDIR=/tmp";
separateDebugInfo = stdenv.isLinux;
-
-
crossAttrs = {
-
postUnpack =
-
'' export CPATH="${bzip2.crossDrv}/include"
-
export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
-
'';
-
-
configureFlags =
-
''
-
--with-store-dir=${storeDir} --localstatedir=${stateDir}
-
--with-dbi=${perlPackages.DBI}/${perl.libPrefix}
-
--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
-
--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
-
--disable-init-state
-
--enable-gc
-
'' + stdenv.lib.optionalString (
-
hostPlatform ? nix && hostPlatform.nix ? system
-
) ''--with-system=${hostPlatform.nix.system}'';
-
-
doInstallCheck = false;
-
};
enableParallelBuilding = true;
+1
pkgs/tools/security/sudo/default.nix
···
"--with-logpath=/var/log/sudo.log"
"--with-iologdir=/var/log/sudo-io"
"--with-sendmail=${sendmailPath}"
+
"--enable-tmpfiles.d=no"
] ++ stdenv.lib.optional withInsults [
"--with-insults"
"--with-all-insults"
+9 -2
pkgs/tools/system/smartmontools/default.nix
···
-
{ stdenv, fetchurl, autoreconfHook
+
{ stdenv, fetchurl, fetchpatch, autoreconfHook
, IOKit ? null , ApplicationServices ? null }:
let
···
sha256 = "0m1hllbb78rr6cxkbalmz1gqkl0psgq8rrmv4gwcmz34n07kvx2i";
};
-
patches = [ ./smartmontools.patch ];
+
patches = [ ./smartmontools.patch ]
+
# https://www.smartmontools.org/changeset/4603
+
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+
name = "musl-canonicalize_file_name.patch";
+
url = "https://www.smartmontools.org/changeset/4603?format=diff&new=4603";
+
sha256 = "06s9pcd95snjkrbfrsjby2lln3lnwjd21bgabmvr4p7fx19b75zp";
+
stripLen = 2;
+
});
postPatch = "cp -v ${driverdb} drivedb.h";
nativeBuildInputs = [ autoreconfHook ];
+4
pkgs/tools/text/agrep/default.nix
···
sha256 = "14addnwspdf2mxpqyrw8b84bb2257y43g5ccy4ipgrr91fmxq2sk";
};
+
# Related: https://github.com/Wikinaut/agrep/pull/11
+
prePatch = stdenv.lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) ''
+
sed -i '1i#include <sys/stat.h>' checkfil.c newmgrep.c recursiv.c
+
'';
installPhase = ''
install -Dm 555 agrep -t "$out/bin"
install -Dm 444 docs/* -t "$out/doc"
+3 -3
pkgs/tools/text/gnupatch/default.nix
···
}:
stdenv.mkDerivation rec {
-
name = "patch-2.7.5";
+
name = "patch-2.7.6";
src = fetchurl {
url = "mirror://gnu/patch/${name}.tar.xz";
-
sha256 = "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx";
+
sha256 = "1zfqy4rdcy279vwn2z1kbv19dcfw25d2aqy9nzvdkq5bjzd0nqdc";
};
buildInputs = stdenv.lib.optional doCheck ed;
···
"ac_cv_func_strnlen_working=yes"
];
-
doCheck = true; # not cross;
+
doCheck = hostPlatform.libc != "musl"; # not cross;
meta = {
description = "GNU Patch, a program to apply differences to files";
+6
pkgs/tools/text/groff/default.nix
···
, ghostscript #for postscript and html output
, psutils, netpbm #for html output
, buildPackages
+
, autoreconfHook
}:
stdenv.mkDerivation rec {
···
outputs = [ "out" "man" "doc" "info" "perl" ];
enableParallelBuilding = false;
+
+
patches = [ ./look-for-ar.patch ];
postPatch = stdenv.lib.optionalString (psutils != null) ''
substituteInPlace src/preproc/html/pre-html.cpp \
···
'';
buildInputs = [ ghostscript psutils netpbm perl ];
+
nativeBuildInputs = [ autoreconfHook ];
# Builds running without a chroot environment may detect the presence
# of /usr/X11 in the host system, leading to an impure build of the
···
"--without-x"
] ++ stdenv.lib.optionals (ghostscript != null) [
"--with-gs=${ghostscript}/bin/gs"
+
] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+
"ac_cv_path_PERL=${perl}/bin/perl"
];
doCheck = true;
+39
pkgs/tools/text/groff/look-for-ar.patch
···
+
commit 988a001f969262089579958827652da00fda096f
+
Author: Ben Gamari <ben@smart-cactus.org>
+
Date: Tue Oct 17 16:15:20 2017 -0400
+
+
Look for AR
+
+
diff --git a/Makefile.in b/Makefile.in
+
index bc156ce..cc02126 100644
+
--- a/Makefile.in
+
+++ b/Makefile.in
+
@@ -464,7 +464,7 @@ INSTALL_SCRIPT=@INSTALL_SCRIPT@
+
INSTALL_DATA=@INSTALL_DATA@
+
INSTALL_INFO=@INSTALL_INFO@
+
LN_S=@LN_S@
+
-AR=ar
+
+AR=@AR@
+
ETAGS=etags
+
ETAGSFLAGS=
+
# Flag that tells etags to assume C++.
+
diff --git a/configure.ac b/configure.ac
+
index c779165..6d53f5e 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -45,6 +45,7 @@ AC_PREREQ([2.62])
+
+
AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
+
AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+
AC_USE_SYSTEM_EXTENSIONS
+
+
@@ -73,6 +74,7 @@ GROFF_PROG_YACC
+
GROFF_DOC_CHECK
+
GROFF_MAKEINFO
+
AC_PROG_RANLIB
+
+AC_CHECK_TOOL([AR], [ar], [ar])
+
GROFF_INSTALL_SH
+
GROFF_INSTALL_INFO
+
AC_PROG_INSTALL
+36 -24
pkgs/top-level/all-packages.nix
···
platform = {
name = "ben_nanonote";
kernelMajor = "2.6";
-
# It's not a bcm47xx processor, but for the headers this should work
-
kernelHeadersBaseConfig = "bcm47xx_defconfig";
kernelArch = "mips";
};
gcc = {
···
'';
});
-
crystal = callPackage ../development/compilers/crystal {
-
llvm = llvm_5;
-
};
+
crystal = callPackage ../development/compilers/crystal { };
devpi-client = callPackage ../development/tools/devpi-client {};
···
libcCross1 =
if targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers
else if targetPlatform.libc == "libSystem" then darwin.xcode
+
else if targetPlatform.libc == "musl" then musl
else null;
binutils1 = wrapBintoolsWith {
bintools = binutils-unwrapped;
···
llvm_35 = llvmPackages_35.llvm;
llvm_34 = llvmPackages_34.llvm;
-
llvmPackages = recurseIntoAttrs llvmPackages_4;
+
llvmPackages = recurseIntoAttrs llvmPackages_5;
llvmPackagesSelf = llvmPackages_34.override {
stdenv = libcxxStdenv;
···
inherit (stdenvAdapters) overrideCC;
};
-
llvmPackages_4 = callPackage ../development/compilers/llvm/4 ({
+
llvmPackages_4 = callPackage ../development/compilers/llvm/4 {
+
inherit (stdenvAdapters) overrideCC;
+
};
+
+
llvmPackages_5 = callPackage ../development/compilers/llvm/5 ({
inherit (stdenvAdapters) overrideCC;
} // stdenv.lib.optionalAttrs stdenv.isDarwin {
cmake = cmake.override {
···
python2 = callPackage ../development/interpreters/python/cpython/2.7/boot.nix { inherit (darwin) CF configd; };
});
-
llvmPackages_5 = callPackage ../development/compilers/llvm/5 {
-
inherit (stdenvAdapters) overrideCC;
-
};
-
manticore = callPackage ../development/compilers/manticore { };
mentorToolchains = recurseIntoAttrs (
···
ycmd = callPackage ../development/tools/misc/ycmd {
inherit (darwin.apple_sdk.frameworks) Cocoa;
-
llvmPackages = llvmPackages_5;
python = python2;
};
···
stdenv = crossLibcStdenv;
};
+
muslCross = callPackage ../os-specific/linux/musl {
+
stdenv = crossLibcStdenv;
+
};
+
# We can choose:
libcCrossChooser = name:
# libc is hackily often used from the previous stage. This `or`
# hack fixes the hack, *sigh*.
/**/ if name == "glibc" then targetPackages.glibcCross or glibcCross
else if name == "uclibc" then uclibcCross
+
else if name == "musl" then targetPackages.muslCross or muslCross
else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
else if name == "libSystem" then darwin.xcode
else throw "Unknown libc";
libcCross = assert targetPlatform != buildPlatform; libcCrossChooser targetPlatform.libc;
-
# Only supported on Linux
-
glibcLocales = if stdenv.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null;
+
# Only supported on Linux, using glibc
+
glibcLocales = if hostPlatform.libc == "glibc" then callPackage ../development/libraries/glibc/locales.nix { } else null;
glibcInfo = callPackage ../development/libraries/glibc/info.nix { };
···
libchop = callPackage ../development/libraries/libchop { };
-
libclc = callPackage ../development/libraries/libclc {
-
llvmPackages = llvmPackages_5;
-
};
+
libclc = callPackage ../development/libraries/libclc { };
libcli = callPackage ../development/libraries/libcli { };
···
else callPackage ../development/libraries/libelf { };
libetpan = callPackage ../development/libraries/libetpan { };
+
+
libexecinfo = callPackage ../development/libraries/libexecinfo { };
libfaketime = callPackage ../development/libraries/libfaketime { };
···
};
# On non-GNU systems we need GNU Gettext for libintl.
-
libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux) gettext;
+
libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux || hostPlatform.libc != "glibc") gettext;
libid3tag = callPackage ../development/libraries/libid3tag {
gperf = gperf_3_0;
···
# makes it slower, but during runtime we link against just mesa_drivers
# through /run/opengl-driver*, which is overriden according to config.grsecurity
# grsecEnabled = true; # no more support in nixpkgs ATM
-
-
llvmPackages = llvmPackages_5;
});
mesa_glu = mesaDarwinOr (callPackage ../development/libraries/mesa-glu { });
···
xorg = recurseIntoAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg/default.nix {
-
inherit clangStdenv fetchurl fetchgit fetchpatch stdenv pkgconfig intltool freetype fontconfig
+
inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig
libxslt expat libpng zlib perl mesa_drivers spice_protocol libunwind
dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook
-
autoconf automake libtool xmlto asciidoc flex bison mtdev pixman
+
autoconf automake libtool mtdev pixman
cairo epoxy;
+
inherit (buildPackages) pkgconfig xmlto asciidoc flex bison;
inherit (darwin) apple_sdk cf-private libobjc;
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
mesa = mesa_noglu;
···
lkl = callPackage ../applications/virtualization/lkl { };
-
linuxHeaders_4_4 = callPackage ../os-specific/linux/kernel-headers/4.4.nix { };
-
linuxHeaders = linuxHeaders_4_4;
+
inherit (callPackages ../os-specific/linux/kernel-headers { })
+
linuxHeaders_4_4 linuxHeaders_4_15;
+
linuxHeaders = if hostPlatform.isMusl then linuxHeaders_4_15 else linuxHeaders_4_4;
kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
···
multipath-tools = callPackage ../os-specific/linux/multipath-tools { };
musl = callPackage ../os-specific/linux/musl { };
+
musl-fts = callPackage ../os-specific/linux/musl/fts.nix { };
+
musl-getconf = callPackage ../os-specific/linux/musl/getconf.nix { };
+
musl-getent = callPackage ../os-specific/linux/musl/getent.nix { };
+
getent =
+
if hostPlatform.isMusl then musl-getent
+
# This may not be right on other platforms, but preserves existing behavior
+
else /* if hostPlatform.libc == "glibc" then */ glibc.bin;
+
+
getconf =
+
if hostPlatform.isMusl then musl-getconf
+
else lib.getBin stdenv.cc.libc;
nettools = callPackage ../os-specific/linux/net-tools { };
+2
pkgs/top-level/perl-packages.nix
···
meta = {
description = "Line wrapping module with support for multibyte, fullwidth, and combining characters and languages without whitespaces between words";
license = with stdenv.lib.licenses; [ artistic1 gpl2 ];
+
# bogus use of glibc, pretty sure, think this is what we have glibcLocales for?
+
broken = stdenv.hostPlatform.libc != "glibc";
+5 -4
pkgs/top-level/python-packages.nix
···
diff-match-patch = callPackage ../development/python-modules/diff-match-patch { };
globus-sdk = callPackage ../development/python-modules/globus-sdk { };
-
+
gssapi = callPackage ../development/python-modules/gssapi { };
h5py = callPackage ../development/python-modules/h5py {
···
};
mwoauth = callPackage ../development/python-modules/mwoauth { };
-
+
neuron = pkgs.neuron.override {
inherit python;
};
···
};
pytest-tornado = callPackage ../development/python-modules/pytest-tornado { };
-
+
python-sql = callPackage ../development/python-modules/python-sql { };
python-stdnum = callPackage ../development/python-modules/python-stdnum { };
···
locustio = callPackage ../development/python-modules/locustio { };
-
llvmlite = callPackage ../development/python-modules/llvmlite {llvm=pkgs.llvm_5;};
+
llvmlite = callPackage ../development/python-modules/llvmlite { llvm = pkgs.llvm; };
lockfile = buildPythonPackage rec {
pname = "lockfile";
···
substituteInPlace "setup.cfg" \
--replace "/usr/local/include" "${pkgs.sqlite.dev}/include" \
--replace "/usr/local/lib" "${pkgs.sqlite.out}/lib"
+
${stdenv.lib.optionalString (!stdenv.isDarwin) ''export LDSHARED="$CC -pthread -shared"''}
'';
meta = {
+11
pkgs/top-level/release-cross.nix
···
android = mapTestOnCross lib.systems.examples.aarch64-multiplatform (linuxCommon // {
});
+
x86_64-musl = mapTestOnCross lib.systems.examples.musl64 linuxCommon;
+
rpi-musl = mapTestOnCross lib.systems.examples.muslpi (linuxCommon // {
+
vim = nativePlatforms;
+
unzip = nativePlatforms;
+
ddrescue = nativePlatforms;
+
lynx = nativePlatforms;
+
patchelf = nativePlatforms;
+
buildPackages.binutils = nativePlatforms;
+
mpg123 = nativePlatforms;
+
});
+
/* Cross-built bootstrap tools for every supported platform */
bootstrapTools = let
tools = import ../stdenv/linux/make-bootstrap-tools-cross.nix { system = "x86_64-linux"; };