Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

63 lines
1.4 KiB
Nix

{
cmake,
fetchFromGitHub,
makeWrapper,
opencv4,
lib,
stdenv,
ocl-icd,
opencl-headers,
config,
cudaSupport ? config.cudaSupport,
cudatoolkit ? null,
}:
stdenv.mkDerivation rec {
pname = "waifu2x-converter-cpp";
version = "5.3.4";
src = fetchFromGitHub {
owner = "DeadSix27";
repo = "waifu2x-converter-cpp";
rev = "v${version}";
sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
};
patches = [
# Remove the hard-coded compiler on Darwin and use the one in stdenv.
./waifu2x_darwin_build.diff
];
buildInputs = [
opencv4
]
++ lib.optional cudaSupport cudatoolkit
++ lib.optionals stdenv.hostPlatform.isLinux [
ocl-icd
opencl-headers
];
nativeBuildInputs = [
cmake
makeWrapper
];
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
'';
cmakeFlags = [
# file RPATH_CHANGE could not write new RPATH
"-DCMAKE_SKIP_BUILD_RPATH=ON"
];
meta = {
description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.xzfc ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
mainProgram = "waifu2x-converter-cpp";
};
}