2021-09-18 10:52:07 +00:00
|
|
|
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL
|
2020-04-24 23:36:52 +00:00
|
|
|
, cudaSupport ? false, cudatoolkit ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waifu2x-converter-cpp";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "5.3.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "DeadSix27";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = [
|
|
|
|
# Remove the hard-coded compiler on Darwin and use the one in stdenv.
|
|
|
|
./waifu2x_darwin_build.diff
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
opencv3
|
|
|
|
] ++ lib.optional cudaSupport cudatoolkit
|
|
|
|
++ lib.optional stdenv.isDarwin OpenCL
|
|
|
|
++ lib.optionals stdenv.isLinux [ ocl-icd opencl-headers ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
2020-11-30 08:33:03 +00:00
|
|
|
wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
|
|
|
|
homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.xzfc ];
|
2021-09-18 10:52:07 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|