20 stdenv.mkDerivation rec {
21 pname = "vapoursynth";
24 src = fetchFromGitHub {
25 owner = "vapoursynth";
28 hash = "sha256-jkRjFKHNTekXluSKQ33QqsGRy7LKnkmG97U5WIjI6EM=";
40 (python3.withPackages (
47 ++ lib.optionals stdenv.hostPlatform.isDarwin [
52 enableParallelBuilding = true;
53 doInstallCheck = true;
56 # If vapoursynth is added to the build inputs of mpv and then
57 # used in the wrapping of it, we want to know once inside the
58 # wrapper, what python3 version was used to build vapoursynth so
59 # the right python3.sitePackages will be used there.
62 withPlugins = import ./plugin-interface.nix {
76 tests.version = testers.testVersion {
77 package = vapoursynth;
78 # Check Core version to prevent false positive with API version
79 version = "Core R${version}";
84 # Export weak symbol nixPluginDir to permit override of default plugin path
86 -e 's/(VS_PATH_PLUGINDIR)/(nixPluginDir ? nixPluginDir : \1)/g' \
87 -e '1i\extern char const __attribute__((weak)) nixPluginDir[];' \
92 wrapProgram $out/bin/vspipe \
93 --prefix PYTHONPATH : $out/${python3.sitePackages}
95 # VapourSynth does not include any plugins by default
96 # and emits a warning when the system plugin directory does not exist.
97 mkdir $out/lib/vapoursynth
100 installCheckPhase = ''
101 runHook preInstallCheck
103 libv="$out/lib/libvapoursynth${stdenv.hostPlatform.extensions.sharedLibrary}"
104 if ! $NM -g -P "$libv" | grep -q '^nixPluginDir w'; then
105 echo "Weak symbol nixPluginDir is missing from $libv." >&2
109 runHook postInstallCheck
113 broken = stdenv.hostPlatform.isDarwin; # see https://github.com/NixOS/nixpkgs/pull/189446 for partial fix
114 description = "Video processing framework with the future in mind";
115 homepage = "http://www.vapoursynth.com/";
116 license = licenses.lgpl21;
117 platforms = platforms.x86_64;
118 maintainers = with maintainers; [
123 mainProgram = "vspipe";