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

Update libjxl dependencies, fix static compilation #179102

Merged
merged 9 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/giflib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/libraries/gperftools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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
Expand Down
13 changes: 9 additions & 4 deletions pkgs/development/libraries/libhwy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion pkgs/development/libraries/libjxl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/libwebp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ stdenv.mkDerivation rec {
hash = "sha256-XX6qOWlIl8TqOQMiGpmmDVKwQnM1taG6lrqq1ZFVk5s=";
};

prePatch = "patchShebangs .";

configureFlags = [
(lib.enableFeature threadingSupport "threading")
(lib.enableFeature openglSupport "gl")
Expand Down
12 changes: 4 additions & 8 deletions pkgs/development/libraries/openexr/3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
11 changes: 4 additions & 7 deletions pkgs/development/libraries/openexr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@

stdenv.mkDerivation rec {
pname = "openexr";
version = "2.5.7";
version = "2.5.8";

outputs = [ "bin" "dev" "out" "doc" ];

src = fetchFromGitHub {
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";
Expand All @@ -35,6 +30,8 @@ stdenv.mkDerivation rec {
})
];

cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";

nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ ilmbase zlib ];

Expand Down