Skip to content
Open
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
90 changes: 90 additions & 0 deletions pkgs/by-name/jp/jpegli/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
stdenv,
lib,
asciidoc,
brotli,
cmake,
fetchFromGitHub,
giflib,
gtest,
lcms2,
libjpeg,
libhwy,
libpng,
ninja,
openexr,
pkg-config,
python3Minimal,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "jpegli";
version = "0-unstable-2025-02-11";

src = fetchFromGitHub {
owner = "google";
repo = "jpegli";
rev = "bc19ca2393f79bfe0a4a9518f77e4ad33ce1ab7a";
hash = "sha256-8th+QHLOoAIbSJwFyaBxUXoCXwj7K7rgg/cCK7LgOb0=";
fetchSubmodules = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to unvendor everything in the third_party directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was checking in the OG package (libjxl) and there it's the same way, there are too many vendored sub-modules that making it work will need a bunch of changes in their cmake.

};

outputs = [
"out"
"man"
];

strictDeps = true;

nativeBuildInputs = [
asciidoc
cmake
ninja
pkg-config
python3Minimal
];

buildInputs = [
brotli
giflib
gtest
lcms2
libhwy
libjpeg
libpng
openexr
];

cmakeFlags = [
(lib.cmakeBool "JPEGXL_ENABLE_JPEGLI_LIBJPEG" false)
(lib.cmakeBool "JPEGXL_BUNDLE_LIBPNG" false)
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_BROTLI" true)
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_GTEST" true)
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_LCMS2" true)
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_HWY" true)
# Enable hardware-dependent optimizations
(lib.cmakeBool "JPEGXL_ENABLE_SIZELESS_VECTORS" true)
(lib.cmakeBool "JPEGXL_ENABLE_AVX512" true)
(lib.cmakeBool "JPEGXL_ENABLE_AVX512_SPR" true)
(lib.cmakeBool "JPEGXL_ENABLE_AVX512_ZEN4" true)
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
];

doCheck = true;

passthru = {
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
};

meta = {
description = "Improved JPEG encoder and decoder implementation";
homepage = "https://github.com/google/jpegli";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
jwillikers
leiserfg
];
mainProgram = "cjpegli";
};
}
Loading