From 042be9b782c53b99c3230ce8b85dd06dedc7285a Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Fri, 16 Sep 2022 21:40:24 +1200 Subject: [PATCH] vs-mlrt: init at 10 --- default.nix | 1 + plugins/vstrt/default.nix | 55 ++++++++++++++++++++++++ plugins/vstrt/no-git-call-in-cmake.patch | 15 +++++++ 3 files changed, 71 insertions(+) create mode 100644 plugins/vstrt/default.nix create mode 100644 plugins/vstrt/no-git-call-in-cmake.patch diff --git a/default.nix b/default.nix index 8e06080..2a9c8e8 100644 --- a/default.nix +++ b/default.nix @@ -65,6 +65,7 @@ in tnlmeans = prev.callPackage ./plugins/tnlmeans { }; ttempsmooth = prev.callPackage ./plugins/ttempsmooth { }; vivtc = prev.callPackage ./plugins/vivtc { }; + vstrt = prev.callPackage ./plugins/vstrt { }; wwxd = prev.callPackage ./plugins/wwxd { }; znedi3 = prev.callPackage ./plugins/znedi3 { }; diff --git a/plugins/vstrt/default.nix b/plugins/vstrt/default.nix new file mode 100644 index 0000000..984b7fe --- /dev/null +++ b/plugins/vstrt/default.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, vapoursynth +, cudatoolkit +, cudaPackages +}: + +stdenv.mkDerivation rec { + pname = "vstrt"; + version = "10"; + + src = fetchFromGitHub { + owner = "AmusementClub"; + repo = "vs-mlrt"; + rev = "v${version}"; + sha256 = "sha256-fnnVaWPvT/eqr1WEwyhX8zi26IK3Ndm7UHLkSLI1nFk="; + }; + + sourceRoot = "source/vstrt"; + + patches = [ + ./no-git-call-in-cmake.patch + ]; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + vapoursynth + cudatoolkit + cudaPackages.tensorrt + ]; + + cmakeFlags = [ + "-DVCS_TAG=v${version}" + "-DCMAKE_CXX_FLAGS=-I${vapoursynth}/include/vapoursynth" + "-DCMAKE_SKIP_RPATH=ON" + ]; + + postInstall = '' + mkdir $out/lib/vapoursynth + ln -s $out/lib/libvstrt.so $out/lib/vapoursynth + ''; + + meta = with lib; { + description = "TensorRT-based GPU Runtime"; + homepage = "https://github.com/AmusementClub/vs-mlrt"; + license = licenses.gpl3; + maintainers = with maintainers; [ aidalgol ]; + platforms = platforms.all; + }; +} diff --git a/plugins/vstrt/no-git-call-in-cmake.patch b/plugins/vstrt/no-git-call-in-cmake.patch new file mode 100644 index 0000000..2934655 --- /dev/null +++ b/plugins/vstrt/no-git-call-in-cmake.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,12 +61,6 @@ target_include_directories(vstrt PUBLIC + "${PROJECT_BINARY_DIR}" + ) + +-find_package(Git REQUIRED) +-execute_process( +- COMMAND ${GIT_EXECUTABLE} describe --tags --long --always +- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" +- OUTPUT_VARIABLE VCS_TAG +-) + string(STRIP ${VCS_TAG} VCS_TAG) + configure_file(config.h.in config.h) +