11{ lib
22, stdenv
33, cmake
4+ , darwin
45, fetchFromGitHub
56, lcms2
67, libGL
7- , libX11
88, libffi
99, libxkbcommon
1010, perl
1515, wrapGAppsHook3
1616, xorg
1717, zenity
18+ ,
1819} :
1920
2021stdenv . mkDerivation rec {
21- # Content to be used if in nixpkgs
22- # version = "2.3.1";
22+ pname = "tev" ;
23+ # version = "2.3.2";
24+
2325 # src = fetchFromGitHub {
2426 # owner = "Tom94";
2527 # repo = "tev";
26- # rev = "v${version}";
28+ # tag = "v${version}";
2729 # fetchSubmodules = true;
28- # hash = "sha256-wEvFeY7b9Au8ltg7X8EaPuifaDKKYOuDyhXK6gGf7Wo =";
30+ # hash = "sha256-RRGE/gEWaSwvbytmtR5fLAke8QqIeuYJQzwC++Z1bgc =";
2931 # };
3032
3133 # Extract version from CMakeLists.txt
@@ -39,7 +41,17 @@ stdenv.mkDerivation rec {
3941
4042 src = ./. ;
4143
42- pname = "tev" ;
44+ postPatch =
45+ let
46+ waylandLibPath = lib . makeLibraryPath [ wayland ] ;
47+ in
48+ ''
49+ substituteInPlace ./dependencies/nanogui/ext/glfw/src/wl_init.c \
50+ --replace-fail "libwayland-client.so" "${ waylandLibPath } /libwayland-client.so" \
51+ --replace-fail "libwayland-cursor.so" "${ waylandLibPath } /libwayland-cursor.so" \
52+ --replace-fail "libwayland-egl.so" "${ waylandLibPath } /libwayland-egl.so" \
53+ --replace-fail "libxkbcommon.so" "${ lib . makeLibraryPath [ libxkbcommon ] } /libxkbcommon.so"
54+ '' ;
4355
4456 nativeBuildInputs = [
4557 cmake
@@ -48,22 +60,21 @@ stdenv.mkDerivation rec {
4860 wrapGAppsHook3
4961 ] ;
5062
51- buildInputs =
52- [
53- lcms2
54- ]
55- ++ lib . optionals stdenv . isLinux [
56- libX11
57- xorg . libXrandr
58- xorg . libXinerama
59- xorg . libXcursor
60- xorg . libXi
61- wayland
62- wayland-protocols
63- wayland-scanner
64- libxkbcommon
65- libffi
66- ] ;
63+ buildInputs = [
64+ lcms2
65+ ]
66+ ++ lib . optionals stdenv . isLinux [
67+ libffi
68+ libxkbcommon
69+ wayland
70+ wayland-protocols
71+ wayland-scanner
72+ xorg . libX11
73+ xorg . libXcursor
74+ xorg . libXi
75+ xorg . libXinerama
76+ xorg . libXrandr
77+ ] ;
6778
6879 dontWrapGApps = true ; # We also need zenity (see below)
6980
@@ -75,19 +86,7 @@ stdenv.mkDerivation rec {
7586 postInstall = lib . optionalString stdenv . isLinux ''
7687 wrapProgram $out/bin/tev \
7788 "'' ${gappsWrapperArgs[@]}" \
78- --prefix PATH ":" "${ zenity } /bin" \
79- --prefix LD_LIBRARY_PATH ":" "${
80- lib . makeLibraryPath [
81- wayland
82- libxkbcommon
83- libGL
84- xorg . libX11
85- xorg . libXcursor
86- xorg . libXi
87- xorg . libXinerama
88- xorg . libXrandr
89- ]
90- } "
89+ --prefix PATH ":" "${ zenity } /bin"
9190 '' ;
9291
9392 env . CXXFLAGS = "-include cstdint" ;
@@ -104,7 +103,7 @@ stdenv.mkDerivation rec {
104103 changelog = "https://github.com/Tom94/tev/releases/tag/v${ version } " ;
105104 homepage = "https://github.com/Tom94/tev" ;
106105 license = lib . licenses . gpl3 ;
107- maintainers = with lib . maintainers ; [ ] ;
106+ maintainers = with lib . maintainers ; [ tom94 ] ;
108107 platforms = lib . platforms . unix ;
109108 } ;
110109}
0 commit comments