From a1442518972ab81db4a34e1e42d917c500afe9ab Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 25 Jun 2022 08:31:17 +0200 Subject: [PATCH 1/9] openexr: 2.5.7 -> 2.5.8 --- pkgs/development/libraries/openexr/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix index 31ca485527553..a08c446821c24 100644 --- a/pkgs/development/libraries/openexr/default.nix +++ b/pkgs/development/libraries/openexr/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { pname = "openexr"; - version = "2.5.7"; + version = "2.5.8"; outputs = [ "bin" "dev" "out" "doc" ]; @@ -17,15 +17,10 @@ stdenv.mkDerivation rec { owner = "AcademySoftwareFoundation"; repo = "openexr"; rev = "v${version}"; - sha256 = "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468"; + sha256 = "sha256-N7XdDaDsYdx4TXvHplQDTvhHNUmW5rntdaTKua4C0es="; }; patches = [ - # Fix pkg-config paths - (fetchpatch { - url = "https://github.com/AcademySoftwareFoundation/openexr/commit/2f19a01923885fda75ec9d19332de080ec7102bd.patch"; - sha256 = "1yxmrdzq1x1911wdzwnzr29jmg2r4wd4yx3vhjn0y5dpny0ri5y5"; - }) (fetchpatch { name = "CVE-2021-45942.patch"; url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch"; From 28ced3657ee4b0f6d54d78a7dec807e0f0ada44e Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 25 Jun 2022 10:02:06 +0200 Subject: [PATCH 2/9] openexr*: Fix statically building --- pkgs/development/libraries/openexr/3.nix | 12 ++++-------- pkgs/development/libraries/openexr/default.nix | 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/openexr/3.nix b/pkgs/development/libraries/openexr/3.nix index 17d4382d0b937..586bdb3af600e 100644 --- a/pkgs/development/libraries/openexr/3.nix +++ b/pkgs/development/libraries/openexr/3.nix @@ -27,14 +27,10 @@ stdenv.mkDerivation rec { done ''; - nativeBuildInputs = [ - cmake - ]; - - propagatedBuildInputs = [ - imath - zlib - ]; + cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON"; + + nativeBuildInputs = [ cmake ]; + propagatedBuildInputs = [ imath zlib ]; doCheck = true; diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix index a08c446821c24..ba0263bcad13b 100644 --- a/pkgs/development/libraries/openexr/default.nix +++ b/pkgs/development/libraries/openexr/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { }) ]; + cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON"; + nativeBuildInputs = [ cmake ]; propagatedBuildInputs = [ ilmbase zlib ]; From ac6e79e44e7760196611829013c97399d80fe821 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 25 Jun 2022 20:35:02 +0200 Subject: [PATCH 3/9] gperftools: 2.9.1 -> 2.10 --- pkgs/development/libraries/gperftools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix index c1dd608f80529..30af1d06fbbc3 100644 --- a/pkgs/development/libraries/gperftools/default.nix +++ b/pkgs/development/libraries/gperftools/default.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "gperftools"; - version = "2.9.1"; + version = "2.10"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "${pname}-${version}"; - sha256 = "sha256-loUlC6mtR3oyS5opSmicCnfUqcefSk8+kKDcHNmC/oo="; + sha256 = "sha256-lUX9T31cYZEi+0DgF52EDSL9yiSHa8ToMxhpQFKHOGk="; }; patches = [ From a2a8cf5a7e75b38aacbe85ec1f2e891b4e35da99 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 2 Jul 2022 15:31:28 +0200 Subject: [PATCH 4/9] gperftools: remove libunwind when building statically Co-authored-by: Alyssa Ross --- pkgs/development/libraries/gperftools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix index 30af1d06fbbc3..c4f7770ae8c37 100644 --- a/pkgs/development/libraries/gperftools/default.nix +++ b/pkgs/development/libraries/gperftools/default.nix @@ -28,8 +28,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - # tcmalloc uses libunwind in a way that works correctly only on non-ARM linux - buildInputs = lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isAarch) libunwind; + # tcmalloc uses libunwind in a way that works correctly only on non-ARM dynamically linked linux + buildInputs = lib.optional (stdenv.isLinux && !(stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isStatic )) libunwind; # Disable general dynamic TLS on AArch to support dlopen()'ing the library: # https://bugzilla.redhat.com/show_bug.cgi?id=1483558 From f2afc6c9dae86c0be6829a46d36aa7c188ab195c Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 8 Jul 2022 22:38:30 +0200 Subject: [PATCH 5/9] libwebp: don't patch shebangs It isn't needed as none of the scripts are being ran during build. See https://github.com/NixOS/nixpkgs/commit/2c7119de924feff4edd46da9b417fbf9ec0a97a2 for discussion --- pkgs/development/libraries/libwebp/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/libraries/libwebp/default.nix b/pkgs/development/libraries/libwebp/default.nix index ed4ccacb9ed54..13ad9eb29c2ea 100644 --- a/pkgs/development/libraries/libwebp/default.nix +++ b/pkgs/development/libraries/libwebp/default.nix @@ -36,8 +36,6 @@ stdenv.mkDerivation rec { hash = "sha256-XX6qOWlIl8TqOQMiGpmmDVKwQnM1taG6lrqq1ZFVk5s="; }; - prePatch = "patchShebangs ."; - configureFlags = [ (lib.enableFeature threadingSupport "threading") (lib.enableFeature openglSupport "gl") From e468b319b73db7bafc1022429f4a646da8979f23 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 8 Jul 2022 22:38:44 +0200 Subject: [PATCH 6/9] giflib: Remove xml dependencies These should have been in nativeBuildInputs anyways. But it seems the docbook generation isn't needed when downloading the tarball It didn't change the output anyways. So if there are any docs that were supposed to be built that needs to be fixed somehow. --- pkgs/development/libraries/giflib/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/libraries/giflib/default.nix b/pkgs/development/libraries/giflib/default.nix index 2016742351cd1..795aeb88440e4 100644 --- a/pkgs/development/libraries/giflib/default.nix +++ b/pkgs/development/libraries/giflib/default.nix @@ -31,8 +31,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; - buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ]; - passthru.tests.static = pkgsStatic.giflib; meta = { From de70971c90f3e3161e94ace851b30474228a0861 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 15 Aug 2022 02:10:01 +0200 Subject: [PATCH 7/9] lib/systems: Add staticLibrary and library staticLibrary includes common extensions for static libraries library is a new common attribute that includes both shared and static extensions --- lib/systems/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 2990afde3e9a6..8f579368d6d34 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -65,11 +65,17 @@ rec { # is why we use the more obscure "bfd" and not "binutils" for this # choice. else "bfd"; - extensions = { + extensions = rec { sharedLibrary = /**/ if final.isDarwin then ".dylib" else if final.isWindows then ".dll" else ".so"; + staticLibrary = + /**/ if final.isWindows then ".lib" + else ".a"; + library = + /**/ if final.isStatic then staticLibrary + else sharedLibrary; executable = /**/ if final.isWindows then ".exe" else ""; From 7c86ef16ed7687f8f573d245f9d8aa3c83cd2c85 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 9 Jul 2022 23:01:55 +0200 Subject: [PATCH 8/9] libhwy: fix tests when cross-compiling It seems to need some help to find gtest when cross compiling. (Only applies when cross-compiling to compatible architectures where the tests are enabled, like pkgsStatic.) Co-authored-by: Daniel Olsen --- pkgs/development/libraries/libhwy/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libhwy/default.nix b/pkgs/development/libraries/libhwy/default.nix index 7656e063822da..43b2e93d8270a 100644 --- a/pkgs/development/libraries/libhwy/default.nix +++ b/pkgs/development/libraries/libhwy/default.nix @@ -23,16 +23,21 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ]; - checkInputs = [ gtest ]; - # Required for case-insensitive filesystems ("BUILD" exists) dontUseCmakeBuildDir = true; - cmakeFlags = [ + cmakeFlags = let + libExt = stdenv.hostPlatform.extensions.library; + in [ "-GNinja" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_INCLUDEDIR=include" - ] ++ lib.optional doCheck "-DHWY_SYSTEM_GTEST:BOOL=ON"; + ] ++ lib.optionals doCheck [ + "-DHWY_SYSTEM_GTEST:BOOL=ON" + "-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include" + "-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}" + "-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}" + ]; # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408 doCheck = !stdenv.hostPlatform.isDarwin; From 49cc0e1d03e631c7072008f8988a8ceb3902b435 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 25 Jun 2022 21:00:39 +0200 Subject: [PATCH 9/9] libjxl: Fix static compilation Co-authored-by: Alyssa Ross --- pkgs/development/libraries/libjxl/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libjxl/default.nix b/pkgs/development/libraries/libjxl/default.nix index 6eba2d0112ef0..461a3579ddef8 100644 --- a/pkgs/development/libraries/libjxl/default.nix +++ b/pkgs/development/libraries/libjxl/default.nix @@ -69,11 +69,14 @@ stdenv.mkDerivation rec { pkg-config ] ++ lib.optionals buildDocs [ asciidoc - graphviz doxygen python3 ]; + depsBuildBuild = lib.optionals buildDocs [ + graphviz + ]; + # Functionality not currently provided by this package # that the cmake build can apparently use: # OpenGL/GLUT (for Examples -> comparison with sjpeg) @@ -125,6 +128,8 @@ stdenv.mkDerivation rec { # * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files # * the `gimp` one, which allows GIMP to load jpeg-xl files # "-DJPEGXL_ENABLE_PLUGINS=ON" + ] ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-DJPEGXL_STATIC=ON" ]; LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic";