1 { cmake, fetchFromGitHub, makeWrapper, opencv4, lib, stdenv, ocl-icd, opencl-headers, OpenCL
3 , cudaSupport ? config.cudaSupport, cudatoolkit ? null
6 stdenv.mkDerivation rec {
7 pname = "waifu2x-converter-cpp";
10 src = fetchFromGitHub {
14 sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
18 # Remove the hard-coded compiler on Darwin and use the one in stdenv.
19 ./waifu2x_darwin_build.diff
24 ] ++ lib.optional cudaSupport cudatoolkit
25 ++ lib.optional stdenv.hostPlatform.isDarwin OpenCL
26 ++ lib.optionals stdenv.hostPlatform.isLinux [ ocl-icd opencl-headers ];
28 nativeBuildInputs = [ cmake makeWrapper ];
30 preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
31 wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
35 # file RPATH_CHANGE could not write new RPATH
36 "-DCMAKE_SKIP_BUILD_RPATH=ON"
40 description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
41 homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
42 license = lib.licenses.mit;
43 maintainers = [ lib.maintainers.xzfc ];
44 platforms = lib.platforms.linux ++ lib.platforms.darwin;
45 mainProgram = "waifu2x-converter-cpp";