From e3b02a49c9aaa3625b6e2e60522c28a98c65ca3b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 24 Nov 2018 17:46:44 -0600 Subject: [PATCH 1/8] i3-lock-color: broken on clang (cherry picked from commit ff12b98820bccc8f2ddb3f82ba7d12391375042e) --- pkgs/applications/window-managers/i3/lock-color.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/window-managers/i3/lock-color.nix b/pkgs/applications/window-managers/i3/lock-color.nix index 8c775833c28..45d142632d1 100644 --- a/pkgs/applications/window-managers/i3/lock-color.nix +++ b/pkgs/applications/window-managers/i3/lock-color.nix @@ -58,5 +58,7 @@ stdenv.mkDerivation rec { # Needs the SSE2 instruction set. See upstream issue # https://github.com/chrjguill/i3lock-color/issues/44 platforms = platforms.x86; + + broken = stdenv.hostPlatform.cc.isClang; }; } From e8a3c91b0e27da1edd3973b2207cd536602746aa Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 24 Nov 2018 17:48:22 -0600 Subject: [PATCH 2/8] hugs: broken on clang (cherry picked from commit 4861aecfae43f96589034567546ec200225c1d7e) --- pkgs/development/interpreters/hugs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/interpreters/hugs/default.nix b/pkgs/development/interpreters/hugs/default.nix index 2177ae22db5..aaa788cfb4b 100644 --- a/pkgs/development/interpreters/hugs/default.nix +++ b/pkgs/development/interpreters/hugs/default.nix @@ -45,5 +45,6 @@ stdenv.mkDerivation { maintainers = with maintainers; [ joachifm ]; license = licenses.bsd3; platforms = platforms.all; + broken = stdenv.hostPlatform.cc.isClang; }; } From b57f6b26a710fff5e9e50b10f89d6e38fa111ab9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 25 Nov 2018 14:51:51 -0600 Subject: [PATCH 3/8] tinyfugue: only works on linux (cherry picked from commit 420352fae8ddb11da757bd2f2f10c2dc6650bc58) --- pkgs/games/tinyfugue/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/tinyfugue/default.nix b/pkgs/games/tinyfugue/default.nix index dcae182ed17..f230a70c088 100644 --- a/pkgs/games/tinyfugue/default.nix +++ b/pkgs/games/tinyfugue/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { with any type of text MUD. ''; license = licenses.gpl2; - platforms = ncurses.meta.platforms; + platforms = platforms.linux; maintainers = [ maintainers.KibaFox ]; }; } From 5e2394ae3cdc142ad92209a9c81993a00d78c8c0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 25 Nov 2018 14:52:27 -0600 Subject: [PATCH 4/8] rofi: only works on linux (cherry picked from commit 568079277c5a8b6711db9ac0e3f4567bdffa8747) --- pkgs/applications/misc/rofi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/rofi/default.nix b/pkgs/applications/misc/rofi/default.nix index 2d22d87c49a..63b047976b3 100644 --- a/pkgs/applications/misc/rofi/default.nix +++ b/pkgs/applications/misc/rofi/default.nix @@ -37,6 +37,6 @@ stdenv.mkDerivation rec { homepage = https://davedavenport.github.io/rofi; license = licenses.mit; maintainers = with maintainers; [ mbakke garbas ma27 ]; - platforms = with platforms; unix; + platforms = with platforms; linux; }; } From b4087750c3912ad1ed8b8bfb2cb5d09517ff608d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 25 Nov 2018 14:52:43 -0600 Subject: [PATCH 5/8] flent/http-getter: broken on clang (cherry picked from commit a5dcde16bbe737914849536362d15eb5a9675297) --- pkgs/applications/networking/flent/http-getter.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/flent/http-getter.nix b/pkgs/applications/networking/flent/http-getter.nix index 63c18d6e092..3e63d19b855 100644 --- a/pkgs/applications/networking/flent/http-getter.nix +++ b/pkgs/applications/networking/flent/http-getter.nix @@ -19,5 +19,6 @@ stdenv.mkDerivation rec { description = "Simple getter for HTTP URLs using cURL"; platforms = platforms.unix; license = licenses.gpl3; + broken = stdenv.hostPlatform.cc.isClang; }; } From 9ddc2ec27db0453597532eee589bcf20a158a36f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 25 Nov 2018 14:53:31 -0600 Subject: [PATCH 6/8] tsocks: broken on darwin (cherry picked from commit 83982dc675ecf0fb6860d8077335c39e96d6c739) --- pkgs/development/libraries/tsocks/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/tsocks/default.nix b/pkgs/development/libraries/tsocks/default.nix index 149b2260792..bcc91d058f0 100644 --- a/pkgs/development/libraries/tsocks/default.nix +++ b/pkgs/development/libraries/tsocks/default.nix @@ -31,5 +31,6 @@ stdenv.mkDerivation rec { license = stdenv.lib.licenses.gpl2; maintainers = with maintainers; [ edwtjo phreedom ]; platforms = platforms.unix; + broken = stdenv.hostPlatform.isDarwin; }; } From 7a2c07d29bf9bb7582e5df2dfcb879278d65a8e8 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 26 Nov 2018 17:26:00 -0600 Subject: [PATCH 7/8] kmod: enable on darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed to build linux kernels on darwin. While we can’t actually use it to load kernel modules, we can use it to create indexes of modules on macOS. (cherry picked from commit ebb31480e8a45efbaff4c4a212bdfc0b053adde0) --- pkgs/os-specific/linux/kmod/darwin.patch | 123 +++++++++++++++++++++++ pkgs/os-specific/linux/kmod/default.nix | 10 +- 2 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 pkgs/os-specific/linux/kmod/darwin.patch diff --git a/pkgs/os-specific/linux/kmod/darwin.patch b/pkgs/os-specific/linux/kmod/darwin.patch new file mode 100644 index 00000000000..69dbf479f9f --- /dev/null +++ b/pkgs/os-specific/linux/kmod/darwin.patch @@ -0,0 +1,123 @@ +diff --git a/Makefile.am b/Makefile.am +index 194e111..0a095b5 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -80,8 +80,7 @@ EXTRA_DIST += libkmod/README \ + libkmod/COPYING testsuite/COPYING tools/COPYING COPYING + + libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \ +- -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \ +- -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym ++ -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) + libkmod_libkmod_la_DEPENDENCIES = \ + shared/libshared.la \ + ${top_srcdir}/libkmod/libkmod.sym +@@ -91,8 +90,7 @@ libkmod_libkmod_la_LIBADD = \ + + noinst_LTLIBRARIES += libkmod/libkmod-internal.la + libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) +-libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \ +- -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym ++libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) + libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) + libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) + +diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c +index 889f264..6f0a285 100644 +--- a/libkmod/libkmod-module.c ++++ b/libkmod/libkmod-module.c +@@ -787,7 +787,11 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod, + flags &= KMOD_REMOVE_FORCE; + flags |= KMOD_REMOVE_NOWAIT; + ++#if defined(__linux__) + err = delete_module(mod->name, flags); ++#else ++ err = -1; ++#endif + if (err != 0) { + err = -errno; + ERR(mod->ctx, "could not remove '%s': %m\n", mod->name); +@@ -879,7 +883,11 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, + } + size = kmod_file_get_size(mod->file); + ++#if defined(__linux__) + err = init_module(mem, size, args); ++#else ++ err = -1; ++#endif + init_finished: + if (err < 0) { + err = -errno; +diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c +index 429ffbd..17a3b9c 100644 +--- a/libkmod/libkmod-signature.c ++++ b/libkmod/libkmod-signature.c +@@ -17,7 +17,10 @@ + * License along with this library; if not, see . + */ + ++#if defined(__linux__) + #include ++#endif ++ + #include + #include + #include +diff --git a/shared/macro.h b/shared/macro.h +index 4fc5405..b5a2702 100644 +--- a/shared/macro.h ++++ b/shared/macro.h +@@ -71,3 +71,7 @@ + #endif + + #define UNIQ __COUNTER__ ++ ++ #if !defined(__linux__) ++#define program_invocation_short_name getprogname() ++#endif +diff --git a/shared/missing.h b/shared/missing.h +index 4c0d136..ad8ec0f 100644 +--- a/shared/missing.h ++++ b/shared/missing.h +@@ -45,6 +45,9 @@ static inline int finit_module(int fd, const char *uargs, int flags) + #endif + + #if !HAVE_DECL_BE32TOH ++ ++#if defined(__linux__) ++ + #include + #include + #if __BYTE_ORDER == __LITTLE_ENDIAN +@@ -52,4 +55,16 @@ static inline int finit_module(int fd, const char *uargs, int flags) + #else + #define be32toh(x) (x) + #endif ++ ++#elif defined(__APPLE__) ++ ++#include ++#define be32toh(x) OSSwapBigToHostInt32(x) ++ ++#else ++ ++#error No be32toh known for platform ++ ++#endif ++ + #endif +diff --git a/shared/util.c b/shared/util.c +index fd2028d..ecb0141 100644 +--- a/shared/util.c ++++ b/shared/util.c +@@ -367,7 +367,7 @@ char *path_make_absolute_cwd(const char *p) + if (path_is_absolute(p)) + return strdup(p); + +- cwd = get_current_dir_name(); ++ cwd = getcwd(NULL, 0); + if (!cwd) + return NULL; + diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index 43d69ac9574..cace828685a 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -1,4 +1,5 @@ -{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig, libxslt, xz }: +{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig +, libxslt, xz, elf-header }: let systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ]; @@ -14,7 +15,7 @@ in stdenv.mkDerivation rec { }; nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ]; - buildInputs = [ xz ]; + buildInputs = [ xz elf-header ]; configureFlags = [ "--sysconfdir=/etc" @@ -22,7 +23,8 @@ in stdenv.mkDerivation rec { "--with-modulesdirs=${modulesDirs}" ]; - patches = [ ./module-dir.patch ]; + patches = [ ./module-dir.patch ] + ++ lib.optional stdenv.isDarwin ./darwin.patch; postInstall = '' for prog in rmmod insmod lsmod modinfo modprobe depmod; do @@ -37,6 +39,6 @@ in stdenv.mkDerivation rec { homepage = https://www.kernel.org/pub/linux/utils/kernel/kmod/; description = "Tools for loading and managing Linux kernel modules"; license = licenses.lgpl21; - platforms = platforms.linux; + platforms = platforms.unix; }; } From 820927cb2c2ccb5bd9a938337228ea9c78400b49 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 26 Nov 2018 17:13:41 -0600 Subject: [PATCH 8/8] btrfs-progs: fix on cross compilation Fixes #50925 (cherry picked from commit 04978d152e8e8e0c2f82cbb8c2addc4ecc93c79c) --- pkgs/tools/filesystems/btrfs-progs/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index 252f25ad8fa..1d6285331c4 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, fetchpatch, pkgconfig, attr, acl, zlib, libuuid, e2fsprogs, lzo -, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3, python3Packages +, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python, pythonPackages }: stdenv.mkDerivation rec { @@ -12,10 +12,10 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt python3 python3Packages.setuptools + pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt python pythonPackages.setuptools ]; - buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd ]; + buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python ]; # gcc bug with -O1 on ARM with gcc 4.8 # This should be fine on all platforms so apply universally