diff options
91 files changed, 1332 insertions, 142 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 8fcc1f029723..317583669809 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -232,7 +232,8 @@ done mkdir -p /lib ln -s @modulesClosure@/lib/modules /lib/modules ln -s @modulesClosure@/lib/firmware /lib/firmware -echo @extraUtils@/bin/modprobe > /proc/sys/kernel/modprobe +# see comment in stage-1.nix for explanation +echo @extraUtils@/bin/modprobe-kernel > /proc/sys/kernel/modprobe for i in @kernelModules@; do info "loading module $(basename $i)..." modprobe $i diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 1575c0257d1c..c45857441c6c 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -131,6 +131,26 @@ let copy_bin_and_libs ${pkgs.kmod}/bin/kmod ln -sf kmod $out/bin/modprobe + # Dirty hack to make sure the kernel properly loads modules + # such as ext4 on demand (e.g. on a `mount(2)` syscall). This is necessary + # because `kmod` isn't linked against `libpthread.so.0` anymore (since + # it was merged into `libc.so.6` since version `2.34`), but still needs + # to access it for some reason. This is not an issue in stage-1 itself + # because of the `LD_LIBRARY_PATH`-variable and anytime later because the rpath of + # kmod/modprobe points to glibc's `$out/lib` where `libpthread.so.6` exists. + # However, this is a problem when the kernel calls `modprobe` inside + # the initial ramdisk because it doesn't know about the + # `LD_LIBRARY_PATH` and the rpath was nuked. + # + # Also, we can't use `makeWrapper` here because `kmod` only does + # `modprobe` functionality if `argv[0] == "modprobe"`. + cat >$out/bin/modprobe-kernel <<EOF + #!$out/bin/ash + export LD_LIBRARY_PATH=$out/lib + exec $out/bin/modprobe "\$@" + EOF + chmod +x $out/bin/modprobe-kernel + # Copy resize2fs if any ext* filesystems are to be resized ${optionalString (any (fs: fs.autoResize && (lib.hasPrefix "ext" fs.fsType)) fileSystems) '' # We need mke2fs in the initrd. diff --git a/pkgs/applications/audio/sfizz/default.nix b/pkgs/applications/audio/sfizz/default.nix index 54acc782c603..aaa79bd3e392 100644 --- a/pkgs/applications/audio/sfizz/default.nix +++ b/pkgs/applications/audio/sfizz/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub, libjack2, libsndfile, xorg, freetype , libxkbcommon, cairo, glib, gnome, flac, libogg, libvorbis, libopus, cmake -, pango, pkg-config }: +, pango, pkg-config, catch2 +}: stdenv.mkDerivation rec { pname = "sfizz"; @@ -40,6 +41,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; postPatch = '' + cp ${catch2}/include/catch2/catch.hpp tests/catch2/catch.hpp + substituteInPlace plugins/editor/external/vstgui4/vstgui/lib/platform/linux/x11fileselector.cpp \ --replace 'zenitypath = "zenity"' 'zenitypath = "${gnome.zenity}/bin/zenity"' substituteInPlace plugins/editor/src/editor/NativeHelpers.cpp \ @@ -48,6 +51,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DSFIZZ_TESTS=ON" ]; + doCheck = true; + meta = with lib; { homepage = "https://github.com/sfztools/sfizz"; description = "SFZ jack client and LV2 plugin"; diff --git a/pkgs/applications/audio/sfxr-qt/default.nix b/pkgs/applications/audio/sfxr-qt/default.nix index bf8b826f544f..ef83531e4365 100644 --- a/pkgs/applications/audio/sfxr-qt/default.nix +++ b/pkgs/applications/audio/sfxr-qt/default.nix @@ -7,6 +7,7 @@ , qtquickcontrols2 , SDL , python3 +, catch2 }: mkDerivation rec { @@ -21,6 +22,10 @@ mkDerivation rec { fetchSubmodules = true; }; + postPatch = '' + cp ${catch2}/include/catch2/catch.hpp 3rdparty/catch2/single_include/catch2/catch.hpp + ''; + nativeBuildInputs = [ cmake extra-cmake-modules @@ -33,6 +38,8 @@ mkDerivation rec { SDL ]; + doCheck = true; + meta = with lib; { homepage = "https://github.com/agateau/sfxr-qt"; description = "A sound effect generator, QtQuick port of sfxr"; diff --git a/pkgs/applications/editors/emacs/27.nix b/pkgs/applications/editors/emacs/27.nix index 436785c34f68..064231b24565 100644 --- a/pkgs/applications/editors/emacs/27.nix +++ b/pkgs/applications/editors/emacs/27.nix @@ -7,5 +7,10 @@ import ./generic.nix (rec { url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=a88f63500e475f842e5fbdd9abba4ce122cdb082"; sha256 = "sha256-RF9b5PojFUAjh2TDUW4+HaWveV30Spy1iAXhaWf1ZVg="; }) + # glibc 2.34 compat + (fetchpatch { + url = "https://src.fedoraproject.org/rpms/emacs/raw/181aafcdb7ee2fded9fce4cfc448f27edccc927f/f/emacs-glibc-2.34.patch"; + sha256 = "sha256-2o3C/jhZPl2OW/LmVPt/fhdwbS9NOdF9lVEF1Kn9aEk="; + }) ]; }) diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix index f842cf6f5c4b..756f0da9f348 100644 --- a/pkgs/applications/graphics/apitrace/default.nix +++ b/pkgs/applications/graphics/apitrace/default.nix @@ -11,6 +11,12 @@ stdenv.mkDerivation rec { owner = "apitrace"; }; + patches = [ + # glibc 2.34 compat + # derived from https://github.com/apitrace/apitrace/commit/d28a980802ad48568c87da02d630c8babfe163bb + ./glibc-2.34-compat.patch + ]; + # LD_PRELOAD wrappers need to be statically linked to work against all kinds # of games -- so it's fine to use e.g. bundled snappy. buildInputs = [ libX11 procps python2 libdwarf qtbase qtwebkit ]; diff --git a/pkgs/applications/graphics/apitrace/glibc-2.34-compat.patch b/pkgs/applications/graphics/apitrace/glibc-2.34-compat.patch new file mode 100644 index 000000000000..3f8cebe030c0 --- /dev/null +++ b/pkgs/applications/graphics/apitrace/glibc-2.34-compat.patch @@ -0,0 +1,13 @@ +diff --git a/wrappers/dlsym.cpp b/wrappers/dlsym.cpp +index 2eda082..0c0c8ee 100644 +--- a/wrappers/dlsym.cpp ++++ b/wrappers/dlsym.cpp +@@ -34,7 +34,7 @@ + #include "os.hpp" + + +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 34 + + + #include <dlfcn.h> diff --git a/pkgs/applications/misc/pdfslicer/default.nix b/pkgs/applications/misc/pdfslicer/default.nix index 31bc47140159..ed20f460a167 100644 --- a/pkgs/applications/misc/pdfslicer/default.nix +++ b/pkgs/applications/misc/pdfslicer/default.nix @@ -24,6 +24,12 @@ stdenv.mkDerivation rec { sha256 = "0sja0ddd9c8wjjpzk2ag8q1lxpj09adgmhd7wnsylincqnj2jyls"; }; + postPatch = '' + # Don't build tests, vendored catch doesn't build with latest glibc. + substituteInPlace CMakeLists.txt \ + --replace "add_subdirectory (tests)" "" + ''; + nativeBuildInputs = [ cmake gettext diff --git a/pkgs/applications/misc/trenchbroom/default.nix b/pkgs/applications/misc/trenchbroom/default.nix index 8a7025060607..a49fbf71191e 100644 --- a/pkgs/applications/misc/trenchbroom/default.nix +++ b/pkgs/applications/misc/trenchbroom/default.nix @@ -21,6 +21,19 @@ stdenv.mkDerivation rec { --subst-var-by APP_VERSION_YEAR ${lib.versions.major version} \ --subst-var-by APP_VERSION_NUMBER ${lib.versions.minor version} \ --subst-var-by GIT_DESCRIBE v${version} + + # Tests don't compile because of vendored `catch2` being incompatible with glibc-2.34. + # Also, no need to since we don't even run them. + substituteInPlace lib/CMakeLists.txt \ + --replace "add_subdirectory(Catch2)" "" + substituteInPlace lib/vecmath/CMakeLists.txt \ + --replace "add_subdirectory(test)" "" \ + --replace "add_subdirectory(lib)" "" + substituteInPlace lib/kdl/CMakeLists.txt \ + --replace "add_subdirectory(test)" "" + substituteInPlace common/CMakeLists.txt \ + --replace "add_subdirectory(test)" "" \ + --replace "add_subdirectory(benchmark)" "" ''; nativeBuildInputs = [ cmake git pandoc wrapQtAppsHook copyDesktopItems ]; diff --git a/pkgs/applications/science/logic/potassco/clingcon.nix b/pkgs/applications/science/logic/potassco/clingcon.nix index 1614adf45537..d7ec2e72433e 100644 --- a/pkgs/applications/science/logic/potassco/clingcon.nix +++ b/pkgs/applications/science/logic/potassco/clingcon.nix @@ -2,6 +2,7 @@ , fetchFromGitHub , cmake , clingo +, catch2 }: stdenv.mkDerivation rec { @@ -15,6 +16,10 @@ stdenv.mkDerivation rec { sha256 = "1g2xkz9nsgqnrw3fdf5jchl16f0skj5mm32va61scc2yrchll166"; }; + postPatch = '' + cp ${catch2}/include/catch2/catch.hpp libclingcon/tests/catch.hpp + ''; + nativeBuildInputs = [ cmake clingo ]; cmakeFlags = [ diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix index d46a67a8601e..6982bd43b263 100644 --- a/pkgs/applications/version-management/rcs/default.nix +++ b/ |