Skip to content

Commit bd03a82

Browse files
jwillikersleiserfg
authored andcommitted
jpegli: init at 0-unstable-2025-02-11
1 parent 8861294 commit bd03a82

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

pkgs/by-name/jp/jpegli/package.nix

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
stdenv,
3+
lib,
4+
asciidoc,
5+
brotli,
6+
cmake,
7+
fetchFromGitHub,
8+
giflib,
9+
gtest,
10+
lcms2,
11+
libjpeg,
12+
libhwy,
13+
libpng,
14+
ninja,
15+
openexr,
16+
pkg-config,
17+
python3Minimal,
18+
unstableGitUpdater,
19+
}:
20+
stdenv.mkDerivation {
21+
pname = "jpegli";
22+
version = "0-unstable-2025-02-11";
23+
24+
src = fetchFromGitHub {
25+
owner = "google";
26+
repo = "jpegli";
27+
rev = "bc19ca2393f79bfe0a4a9518f77e4ad33ce1ab7a";
28+
hash = "sha256-8th+QHLOoAIbSJwFyaBxUXoCXwj7K7rgg/cCK7LgOb0=";
29+
fetchSubmodules = true;
30+
};
31+
32+
outputs = [
33+
"out"
34+
"man"
35+
];
36+
37+
strictDeps = true;
38+
39+
nativeBuildInputs = [
40+
asciidoc
41+
cmake
42+
ninja
43+
pkg-config
44+
python3Minimal
45+
];
46+
47+
buildInputs = [
48+
brotli
49+
giflib
50+
gtest
51+
lcms2
52+
libhwy
53+
libjpeg
54+
libpng
55+
openexr
56+
];
57+
58+
cmakeFlags = [
59+
(lib.cmakeBool "JPEGXL_ENABLE_JPEGLI_LIBJPEG" false)
60+
(lib.cmakeBool "JPEGXL_BUNDLE_LIBPNG" false)
61+
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_BROTLI" true)
62+
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_GTEST" true)
63+
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_LCMS2" true)
64+
(lib.cmakeBool "JPEGXL_FORCE_SYSTEM_HWY" true)
65+
# Enable hardware-dependent optimizations
66+
(lib.cmakeBool "JPEGXL_ENABLE_SIZELESS_VECTORS" true)
67+
(lib.cmakeBool "JPEGXL_ENABLE_AVX512" true)
68+
(lib.cmakeBool "JPEGXL_ENABLE_AVX512_SPR" true)
69+
(lib.cmakeBool "JPEGXL_ENABLE_AVX512_ZEN4" true)
70+
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
71+
];
72+
73+
doCheck = true;
74+
75+
passthru = {
76+
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
77+
};
78+
79+
meta = {
80+
description = "Improved JPEG encoder and decoder implementation";
81+
homepage = "https://github.com/google/jpegli";
82+
license = lib.licenses.bsd3;
83+
platforms = lib.platforms.all;
84+
maintainers = with lib.maintainers; [
85+
jwillikers
86+
leiserfg
87+
];
88+
mainProgram = "cjpegli";
89+
};
90+
}

0 commit comments

Comments
 (0)