Skip to content

Commit 6160515

Browse files
authored
video2x: init at 6.4.0 (#385636)
2 parents beb9682 + 7c12d2c commit 6160515

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
lib,
3+
stdenv,
4+
cmake,
5+
fetchFromGitHub,
6+
pkg-config,
7+
versionCheckHook,
8+
nix-update-script,
9+
boost,
10+
ffmpeg,
11+
glslang,
12+
llvmPackages,
13+
ncnn,
14+
spdlog,
15+
vulkan-headers,
16+
vulkan-loader,
17+
}:
18+
stdenv.mkDerivation (finalAttrs: {
19+
pname = "video2x";
20+
version = "6.4.0";
21+
22+
src = fetchFromGitHub {
23+
owner = "k4yt3x";
24+
repo = "video2x";
25+
tag = finalAttrs.version;
26+
hash = "sha256-DSsfGAkPOtqqj0FA1N33O+OYmv+CMUsrvmh5SrnF7eA=";
27+
fetchSubmodules = false;
28+
leaveDotGit = true;
29+
postFetch = ''
30+
pushd $out
31+
git reset --hard HEAD
32+
33+
# Fetch the dependencies that nixpkgs cannot provide (non-recursive)
34+
git submodule update --init third_party/librealesrgan_ncnn_vulkan
35+
git submodule update --init third_party/librealcugan_ncnn_vulkan
36+
git submodule update --init third_party/librife_ncnn_vulkan
37+
38+
# Cleanup
39+
rm -rf .git
40+
41+
popd
42+
'';
43+
};
44+
45+
postPatch = ''
46+
substituteInPlace src/fsutils.cpp \
47+
--replace-fail '/usr/share/video2x' '${placeholder "out"}/share/video2x'
48+
'';
49+
50+
strictDeps = true;
51+
52+
nativeBuildInputs = [
53+
cmake
54+
pkg-config
55+
glslang
56+
];
57+
58+
buildInputs =
59+
[
60+
boost
61+
ffmpeg
62+
ncnn
63+
spdlog
64+
vulkan-headers
65+
vulkan-loader
66+
]
67+
++ lib.optionals stdenv.cc.isClang [
68+
llvmPackages.openmp
69+
];
70+
71+
cmakeFlags = [
72+
# Don't build the libvideo2x shared library, we only need the CLI tool
73+
(lib.cmakeBool "BUILD_SHARED_LIBS" false)
74+
];
75+
76+
nativeInstallCheckInputs = [ versionCheckHook ];
77+
78+
versionCheckProgramArg = [ "--version" ];
79+
doInstallCheck = true;
80+
81+
passthru = {
82+
updateScript = nix-update-script { };
83+
};
84+
85+
meta = {
86+
description = "AI-powered video upscaling tool";
87+
changelog = "https://github.com/k4yt3x/video2x/releases/tag/${finalAttrs.version}/CHANGELOG.md";
88+
homepage = "https://github.com/k4yt3x/video2x";
89+
license = lib.licenses.agpl3Plus;
90+
platforms = [ "x86_64-linux" ];
91+
mainProgram = "video2x";
92+
maintainers = [ lib.maintainers.matteopacini ];
93+
};
94+
})

0 commit comments

Comments
 (0)