-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathpackage.nix
More file actions
100 lines (92 loc) · 2.29 KB
/
package.nix
File metadata and controls
100 lines (92 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
lib,
stdenv,
cmake,
dbus,
fetchFromGitHub,
lcms2,
libGL,
libffi,
libx11,
libxcursor,
libxi,
libxinerama,
libxkbcommon,
libxrandr,
nasm,
ninja,
perl,
pkg-config,
wayland,
wayland-protocols,
wayland-scanner,
}:
stdenv.mkDerivation rec {
pname = "tev";
# Extract version from CMakeLists.txt
version =
with builtins;
let
cmakeContents = readFile ./CMakeLists.txt;
versionMatch = match ".*VERSION[[:space:]]+([0-9]+\\.[0-9]+\\.[0-9]+).*" cmakeContents;
in
if versionMatch == null then
throw "Could not find version in CMakeLists.txt"
else
head versionMatch;
src = ./.;
postPatch = lib.optionalString stdenv.hostPlatform.isLinux (
let
waylandLibPath = "${lib.getLib wayland}/lib";
in
''
substituteInPlace ./dependencies/nanogui/ext/glfw/src/wl_init.c \
--replace-fail "libwayland-client.so" "${waylandLibPath}/libwayland-client.so" \
--replace-fail "libwayland-cursor.so" "${waylandLibPath}/libwayland-cursor.so" \
--replace-fail "libwayland-egl.so" "${waylandLibPath}/libwayland-egl.so" \
--replace-fail "libxkbcommon.so" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so"
''
);
nativeBuildInputs = [
cmake
nasm
ninja
perl
pkg-config
];
buildInputs = [
lcms2
]
++ lib.optionals stdenv.hostPlatform.isLinux ([
dbus
libffi
libGL
libxkbcommon
wayland
wayland-protocols
wayland-scanner
libx11
libxcursor
libxi
libxinerama
libxrandr
]);
cmakeFlags = [
"-DTEV_DEPLOY=1"
];
meta = {
description = "High dynamic range (HDR) image viewer for people who care about colors";
mainProgram = "tev";
longDescription = ''
High dynamic range (HDR) image viewer for people who care about colors. It is
- Lightning fast: starts up instantly, loads hundreds of images in seconds.
- Accurate: understands color profiles and displays HDR.
- Versatile: supports many formats, histograms, pixel peeping, tonemaps, etc.
'';
changelog = "https://github.com/Tom94/tev/releases/tag/v${version}";
homepage = "https://github.com/Tom94/tev";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ tom94 ];
platforms = lib.platforms.unix;
};
}