Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

musl-cross, native-musl, cross fixes, oh my! #34645

Merged
merged 173 commits into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
f5e96d3
xz: set CONFIG_SHELL to /bin/sh, fix retained reference to bootstrap
dtzWill Feb 13, 2018
2870c99
autogen: Enable cross-compilation
bgamari Oct 25, 2017
df5b0ce
xorg: Use build dependencies where appropriate
bgamari Oct 27, 2017
d72c4c6
w3m: Enable cross-compilation
bgamari Dec 10, 2017
a868bf3
glibc: Fix cross-compilation of locales
bgamari Dec 16, 2017
da310bd
sudo: Enable tmpfiles.d is disabled
bgamari Dec 16, 2017
e120c42
iproute: don't use host BASH for scripts, fix for cross
dtzWill Jan 15, 2018
47540da
lua: Fix cross-compilation
bgamari Dec 25, 2017
46c2e61
linux-pam: Add necessary build dependencies for cross-compilation
bgamari Oct 15, 2017
4f3c817
groff: Enable cross-compilation
bgamari Dec 10, 2017
d625f18
autoconf: Enable cross-compilation
bgamari Nov 5, 2017
cb5453e
cpython: Enable cross-compilation
bgamari Oct 18, 2017
b9b57da
shadow: disable nscd on non-glibc (musl)
dtzWill Jan 9, 2018
37c2ac9
cmake: fix cross
dtzWill Jan 9, 2018
e6da426
man-db: fix cross
dtzWill Jan 10, 2018
2d772d5
libbfd: fix for cross (based on same from @bgamari)
dtzWill Jan 11, 2018
4102655
ruby: Enable cross-compilation
bgamari Oct 29, 2017
bc2ad5a
libunwind: patch to fix build on non-glibc
dtzWill Jan 11, 2018
9ba32c7
libnfnetlink: patch to fix build w/non-glibc (namely, musl)
dtzWill Jan 11, 2018
afe517a
nix: 1.11 needs 'curl' on PATH so provide as nativeBuildInput.
dtzWill Jan 13, 2018
3aa61e3
nix: simplify bzip2 dependency, this is handled properly now
dtzWill Jan 13, 2018
cec99d2
npth: run tests, even if brief
dtzWill Nov 8, 2017
0a70dc6
kakuone: add pkgconfig to appease warning
dtzWill Nov 8, 2017
d6b5ee8
pysqlite: quickfix for cross
dtzWill Jan 11, 2018
81eef05
postgresql: don't try to use 'locale' if not building to run on glibc
dtzWill Jan 12, 2018
9138d05
boolector: fix missing stdint.h include
dtzWill Oct 18, 2017
46cbded
boolector: patch usage of ar and ranlib for cross
dtzWill Feb 5, 2018
36b2706
picosat: fixup include for unistd.h
dtzWill Oct 18, 2017
4c76741
picosat: fix ar and ranlib usage for cross
dtzWill Feb 5, 2018
b4fa6da
siege: fixup u_int32_t here as well
dtzWill Sep 22, 2017
a2eb1f4
openntpd: patch missing includes to cdefs, fix build on musl
dtzWill Sep 22, 2017
290c62e
musl: multiple outputs
dtzWill Jan 4, 2018
d5916a8
bintools-wrapper: teach about musl dynamic linkers
dtzWill Jan 5, 2018
1d538d5
musl: linux headers, bsd compat headers, and ldd
dtzWill Jan 4, 2018
af6b756
muslCross: init
dtzWill Jan 3, 2018
9df72c0
Add musl-fts for bits that need it.
dtzWill Aug 13, 2017
b12a7c9
add getconf, getent from Alpine for use w/musl
dtzWill Nov 11, 2017
d4a2e33
busybox: fixup after musl multiple outputs
dtzWill Jan 23, 2018
172af30
fish: on musl use musl-getent
dtzWill Jan 12, 2018
7debd78
release-cross.nix: add entry for testing musl
dtzWill Jan 4, 2018
5ac5a3e
make-bootstrap-tools-cross.nix: add musl -> musl64
dtzWill Jan 4, 2018
41435ee
libiconv: disable overly strict asssertion in libiconv
dtzWill Jan 3, 2018
5dcf3cd
stdenv: automatically update config.sub for musl
dtzWill Jan 3, 2018
b42c8af
bash: fix on musl
dtzWill Jan 3, 2018
65c9c38
attr: patch to fix headers w/musl
dtzWill Jan 3, 2018
cb521f7
linux-pam: fix build w/musl
dtzWill Jan 3, 2018
4831495
make-bootstrap-tools: glibc -> libcCross
dtzWill Jan 4, 2018
0ac5042
make-bootstrap-tools: initial musl support, less glibc-specific
dtzWill Jan 5, 2018
a0af2aa
for now, copy bootstrap-tools instead of modify in-place
dtzWill Jan 5, 2018
0e16989
bootstrap-tools-musl: WIP
dtzWill Jan 5, 2018
15d401d
gcc: disable libsanitizer, libgomp on musl
dtzWill Jan 3, 2018
ece06de
gcc6: try to fix gccCrossStageStati
dtzWill Jan 15, 2018
5eea9e8
gcc6: try patching MUSL_DYNAMIC_LINKER as well
dtzWill Jan 4, 2018
fbf41b9
gcc6: try to fix LOCAL_INCLUDE_DIR problem w/musl
dtzWill Jan 4, 2018
f146a3c
gcc5, 7: same fixes as gcc6
dtzWill Jan 8, 2018
ff9b494
gcc7: Apply patch to fix selftest w/musl?
dtzWill Jan 8, 2018
e4d5928
boehm-gc: fix missing include, fix build w/musl
dtzWill Jan 11, 2018
3ee5094
linux bootstrap for musl: kludgery
dtzWill Jan 11, 2018
fd00d37
musl64 bootstrap: grab from gravity, requires netrc magic
dtzWill Jan 11, 2018
9dbbd75
musl bootstrap: allow libiconv
dtzWill Jan 12, 2018
5a80028
fixup linux stdenv bootstrap
dtzWill Jan 12, 2018
e390b45
gccCrossStageStatic: use musl to ensure dynamic linker is right
dtzWill Jan 15, 2018
2020320
perl.TextWrapI18N: mark broken on musl
dtzWill Jan 12, 2018
8ad9400
findutils: disable tests w/musl
dtzWill Jan 12, 2018
f969923
gnupatch: disable tests on musl :(
dtzWill Jan 12, 2018
158c3c4
libxml2: disable tests also
dtzWill Jan 12, 2018
4aca016
changes some targetPlatform to hostPlatform checks
dtzWill Jan 12, 2018
4b6b83f
linux stdenv: find bootstrap files by libc, then arch
dtzWill Jan 12, 2018
f566e3f
gcc7: more selftest disabling, whenever building cross
dtzWill Jan 13, 2018
3b9e99d
libffi: add patch to fix w/musl
dtzWill Jan 13, 2018
3b0d324
gcc7: tweak check, target -> host
dtzWill Jan 13, 2018
3f2619a
glibcLocales: not supported on non-glibc
dtzWill Jan 13, 2018
38d17e3
libidn: don't run tests on musl
dtzWill Jan 13, 2018
b47f502
inetutils: fix build w/musl
dtzWill Jan 13, 2018
bc999dc
libunistring: no tests on musl
dtzWill Jan 13, 2018
b905c0c
stfl: use libiconv fix on all non-glibc not just darwin
dtzWill Jan 5, 2018
8fa7634
xterm: patch from alpine to fix pty on musl
dtzWill Jan 13, 2018
6c2e8b3
libnsl: Add alpine patches to fix w/musl
dtzWill Dec 7, 2017
4a5aa55
ti-rpc: patch to fix w/musl
dtzWill Jan 13, 2018
317ac44
net-snmp: alpine patches
dtzWill Nov 9, 2017
12e60c2
cvc4: patch up fpu_control usage
dtzWill Nov 8, 2017
cbdd208
cvc4: build in parallel
dtzWill Nov 8, 2017
32b472d
audit: tweaks to make musl compat
dtzWill Apr 17, 2017
f96d0d1
libnet: Add patch from alpine to fix build on musl
dtzWill Oct 30, 2017
29b012e
tbb: mallinfo patch to fix build w/musl, fix w/clang
dtzWill Oct 23, 2017
77c58c9
libusb: fix header usage on musl, patch from Alpine
dtzWill Oct 3, 2017
08e70f7
ppp: grab alpine patch, fix build on musl
dtzWill Sep 22, 2017
54b3967
libnl: use patch from gentoo-musl, fixes! \o/
dtzWill Sep 22, 2017
1ac2b79
squid{,4}: only enable netfilter bits on non-musl
dtzWill Jan 17, 2018
f2aae45
git: Disable use of <sys/poll.h> on musl, disable gettext
dtzWill Sep 8, 2017
49b7e43
libexecinfo: init at 1.1, patches from Alpine
dtzWill Sep 8, 2017
c808197
openblas: NO_AFFINITY=1 fix for musl
dtzWill Jan 13, 2018
8dfe068
openblas: patch to fix on non-glibc
dtzWill Jan 13, 2018
e1e6e94
webkitgtk: Add musl patch from Alpine re:execinfo, use libc++ on ALLVM
dtzWill Sep 4, 2017
c739942
armagetronad: enable parallel building
dtzWill May 31, 2017
3b5e113
libapparmor: Add musl patches from Alpine
dtzWill Aug 25, 2017
aa00d53
openssl 1.1.0: disable 'async' bits relating to setcontext/etc on musl
dtzWill Aug 13, 2017
6593d88
openssl: fix cross, ensure 'Configure' has shebang patched
dtzWill Jan 13, 2018
cccf48c
openssl: isMusl
dtzWill Feb 11, 2018
5d3af42
unbound: don't build twice w/musl, second time fails :(
dtzWill Jan 13, 2018
e2ef21d
lm_sensors: add musl patch from alpine.
dtzWill May 28, 2017
0153599
libdaemon: Add patch to fix musl build
dtzWill May 27, 2017
3564ae1
libmemcached: add musl patch from alpine
dtzWill May 28, 2017
cd50057
webrtc-audio-processing: don't use execinfo w/musl
dtzWill Jan 13, 2018
be29973
agrep: patch to fix on musl, darwin
dtzWill Jan 13, 2018
6ae1bd4
go: don't require glibc (.static), dunno if go works w/musl
dtzWill Jan 13, 2018
ab92d02
python-cffi: disable tests on musl :3
dtzWill Jan 13, 2018
4a60516
iperf: Fix build with musl.
dtzWill Sep 6, 2016
7eba45d
gcc5: patch for musl compat/support
dtzWill Jan 13, 2018
2974ed9
avy: fixes to work with clang and musl
dtzWill Oct 18, 2017
1289cda
mesa: patch to fix w/musl
dtzWill Jan 13, 2018
bc76f76
linuxHeaders: allow multiple versions, use newest + patches w/musl
dtzWill Jan 13, 2018
f29bbd7
musl: add patch to make full use of new guards in kernel headers
dtzWill Jan 14, 2018
bd23fc7
2048-in-terminal: fix on musl
dtzWill Aug 14, 2017
a0ee888
pulseaudio: patch for musl
dtzWill Jan 14, 2018
0e15473
cdparanoia: use part of darwin patch to fix utils.h on musl
dtzWill Jun 1, 2017
2e2517c
SDL: add libiconv to fix build
dtzWill May 28, 2017
c48974c
qt4: Add patch for socklen_t on musl, from alpine
dtzWill Jun 1, 2017
e7580d0
xorgserver: Builds! small workaround re:bad types
dtzWill Apr 20, 2017
e25153a
gamin: patch from alpine to fix non-portable pthread mutex init
dtzWill Jan 14, 2018
e606e4d
lvm2: musl patches from alpine
dtzWill Jan 14, 2018
5aed799
iputils: only use libidn on non-musl
dtzWill Jan 14, 2018
551f070
polkit: patch to fix w/musl, POSIX
dtzWill Jan 14, 2018
f48258f
smartmontools: patch from upstream project
dtzWill Jan 14, 2018
3c75091
wireshark: fix build w/musl using upstream commit
dtzWill Jan 14, 2018
9bc8127
bootstrap-tools-cross, release-cross: add various musl entries
dtzWill Jan 15, 2018
c8d03e6
make-bootstrap-tools: grab libc from stdenv.cc.libc
dtzWill Feb 6, 2018
db9f302
libcap: Fix cross-compilation
bgamari Oct 17, 2017
cea0765
libcap: depsBuildBuild, don't set CC/BUILD_CC
dtzWill Feb 6, 2018
5b761a8
nettle: Enable cross-compilation
bgamari Oct 18, 2017
c0d343b
patchelfUnstable: fix build on musl, disable failing test
dtzWill Jan 22, 2018
d67638c
screen: fix utmp messages w/musl
dtzWill Jan 23, 2018
94ab0da
lsof: fix build w/musl
dtzWill Jan 14, 2018
5d6e229
nixUnstable: Enable cross-compilation
bgamari Dec 10, 2017
5a802af
nix: doInstallCheck is disabled on cross already.
dtzWill Jan 28, 2018
ee4f04d
aws-sdk-cpp: disable tests on cross
dtzWill Jan 28, 2018
7fbb42e
Similarly, use 4.15 kernel headers instead of patching 4.14 w/uapi fixes
dtzWill Jan 30, 2018
d8b15f8
numactl: 2.0.10 -> 2.0.11
dtzWill Jan 30, 2018
ad09de4
numactl: fix use of deprecated macros, patch to fix w/musl
dtzWill Jan 31, 2018
3413562
fftw: disable using openmp w/musl
dtzWill Jan 31, 2018
f33a75a
kexectools: Add dependency on build CC
bgamari Oct 17, 2017
ef5d3d1
kexectools: Fix cross compilation
bgamari Dec 10, 2017
6923737
libgpg-error: hack-fix missing header?
dtzWill Jan 31, 2018
e93dc20
icu: xlocale.h fixup needed w/musl as well
dtzWill Feb 2, 2018
d9b8f17
shadow: fix attempt to access 'stdenv.glibc'
dtzWill Feb 4, 2018
b281cb2
iputils: drop glibc assert
dtzWill Feb 4, 2018
5bf5e6e
llvm4: always apply fix, improve compat, fix w/musl
dtzWill Feb 5, 2018
24721aa
mariadb: disable tokudb on musl, per docs (and fix build)
dtzWill Feb 5, 2018
7522d6b
busybox: don't force gcc
dtzWill Feb 6, 2018
22a5393
pam: depsBuildBuild for buildPackages.stdenv.cc
dtzWill Feb 6, 2018
119920f
restore stdenv.glibc, will remove separately.
dtzWill Feb 9, 2018
9bd4e00
gcc6: cross-musl disable libmpx
dtzWill Feb 9, 2018
4f8292f
python2.7: drop unused cross-compile patch
dtzWill Feb 12, 2018
d00f200
bootstrap-files: nicer naming
dtzWill Feb 12, 2018
8bedb69
add musl bootstrap paths for aarch64, armv6l
dtzWill Feb 12, 2018
a4c6974
aarch64-musl, armv6l-musl: fetch from wdtz.org instead of storePath
dtzWill Feb 12, 2018
268bff6
make-bootstrap-tools: set XZ to maximum level, big wins
dtzWill Feb 12, 2018
4619f8e
new musl bootstrap URL's, much smaller. rebuild all the things.
dtzWill Feb 12, 2018
84a527e
x86_64-musl bootstrap: use separate 64bit busybox
dtzWill Feb 13, 2018
8323123
systemd: use musl-getent on musl instead of glibc.bin's getent
dtzWill Feb 13, 2018
82dfab8
systemd: add getent-bin to nativeBuildInputs, meson searches for getent
dtzWill Feb 13, 2018
7f3527d
libexecinfo: fetch patches, add meta, maintain
dtzWill Feb 13, 2018
2bfe036
libexecinfo: fix CC/AR
dtzWill Feb 13, 2018
a65aa78
libbfd: simplify per reviewer feedback
dtzWill Feb 13, 2018
6c3df22
libintlOrEmpty: use actual gettext on non-glibc too (musl)
dtzWill Feb 13, 2018
d3b59f8
define top-level attrs for getent, getconf
dtzWill Feb 13, 2018
804ae99
getconf: nothing uses glibc.bin for getconf, generalize to cc.libc
dtzWill Feb 13, 2018
6825c0c
nettle: cleanup cross changes
dtzWill Feb 13, 2018
e25a343
cmake: don't force gcc, use more general cc/c++
dtzWill Feb 13, 2018
42a17d6
libbfd: back to postPatch, restore configurePlatforms
dtzWill Feb 13, 2018
767bddb
libbfd: manually update config.guess/config.sub
dtzWill Feb 13, 2018
b0c4138
iproute: patchshebangs to work on 'hostPlatform' (not build)
dtzWill Feb 13, 2018
bd11ffd
ruby: don't reference groff if not being used (not used by default)
dtzWill Feb 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/applications/audio/cdparanoia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
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;

Expand Down
68 changes: 68 additions & 0 deletions pkgs/applications/audio/cdparanoia/utils.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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
3 changes: 2 additions & 1 deletion pkgs/applications/editors/kakoune/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, ncurses, boost, asciidoc, docbook_xsl, libxslt }:
{ stdenv, fetchFromGitHub, ncurses, boost, asciidoc, docbook_xsl, libxslt, pkgconfig }:

with stdenv.lib;

Expand All @@ -11,6 +11,7 @@ stdenv.mkDerivation rec {
rev = "7482d117cc85523e840dff595134dcb9cdc62207";
sha256 = "08j611y192n9vln9i94ldlvz3k0sg79dkmfc0b1vczrmaxhpgpfh";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ncurses boost asciidoc docbook_xsl libxslt ];

postPatch = ''
Expand Down
9 changes: 7 additions & 2 deletions pkgs/applications/misc/xterm/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, xorg, ncurses, freetype, fontconfig, pkgconfig, makeWrapper
{ stdenv, fetchurl, fetchpatch, xorg, ncurses, freetype, fontconfig, pkgconfig, makeWrapper
, enableDecLocator ? true
}:

Expand All @@ -20,7 +20,12 @@ stdenv.mkDerivation rec {

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"
Expand Down
8 changes: 6 additions & 2 deletions pkgs/applications/networking/browsers/w3m/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ stdenv.mkDerivation rec {

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
Expand Down
8 changes: 7 additions & 1 deletion pkgs/applications/networking/sniffers/wireshark/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ in stdenv.mkDerivation {
++ 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 ''
Expand Down
20 changes: 19 additions & 1 deletion pkgs/applications/science/logic/avy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,25 @@ stdenv.mkDerivation rec {
};

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
];
Expand Down
65 changes: 65 additions & 0 deletions pkgs/applications/science/logic/avy/glucose-fenv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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 changes: 65 additions & 0 deletions pkgs/applications/science/logic/avy/minisat-fenv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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

20 changes: 19 additions & 1 deletion pkgs/applications/science/logic/boolector/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, writeShellScriptBin }:

stdenv.mkDerivation rec {
name = "boolector-${version}";
Expand All @@ -8,6 +8,24 @@ stdenv.mkDerivation rec {
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
mv boolector/bin $out
Expand Down
7 changes: 7 additions & 0 deletions pkgs/applications/science/logic/cvc4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ stdenv.mkDerivation rec {
"--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";
homepage = http://cvc4.cs.nyu.edu/web/;
Expand Down
Loading