1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-02 02:24:27 +00:00
nixpkgs/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix

39 lines
1 KiB
Nix
Raw Normal View History

2021-01-15 09:19:50 +00:00
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers
2019-04-29 01:49:55 +01:00
, cudaSupport ? false, cudatoolkit ? null
}:
stdenv.mkDerivation rec {
pname = "waifu2x-converter-cpp";
2021-01-26 14:19:42 +00:00
version = "5.3.4";
2019-04-29 01:49:55 +01:00
src = fetchFromGitHub {
owner = "DeadSix27";
repo = pname;
rev = "v${version}";
2021-01-26 14:19:42 +00:00
sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
2019-04-29 01:49:55 +01:00
};
patchPhase = ''
# https://github.com/DeadSix27/waifu2x-converter-cpp/issues/123
sed -i 's:{"PNG", false},:{"PNG", true},:' src/main.cpp
'';
buildInputs = [
ocl-icd opencv3 opencl-headers
2021-01-15 09:19:50 +00:00
] ++ lib.optional cudaSupport cudatoolkit;
2019-04-29 01:49:55 +01:00
nativeBuildInputs = [ cmake makeWrapper ];
preFixup = ''
wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
'';
2019-04-29 01:49:55 +01:00
meta = {
description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
2021-01-15 09:19:50 +00:00
license = lib.licenses.mit;
maintainers = [ lib.maintainers.xzfc ];
platforms = lib.platforms.linux;
2019-04-29 01:49:55 +01:00
};
}