15 pythonEnvironment = python3.buildEnv.override { extraLibs = plugins; };
17 getRecursivePropagatedBuildInputs =
23 cleanPropagatedBuildInputs = lib.filter lib.isDerivation pkg.propagatedBuildInputs;
25 cleanPropagatedBuildInputs ++ (getRecursivePropagatedBuildInputs cleanPropagatedBuildInputs)
29 deepPlugins = lib.unique (plugins ++ (getRecursivePropagatedBuildInputs plugins));
31 pluginsEnv = buildEnv {
32 name = "vapoursynth-plugins-env";
33 pathsToLink = [ "/lib/vapoursynth" ];
37 # Override default plugin path through nixPluginDir symbol
39 runCommandCC "libvapoursynth-nix-plugins${ext}"
42 preferLocalBuild = true;
43 allowSubstitutes = false;
45 char const nixPluginDir[] = "${pluginsEnv}/lib/vapoursynth";
49 $CC -x c -shared -fPIC - -o "$out" <<<"$src"
52 ext = stdenv.hostPlatform.extensions.sharedLibrary;
54 runCommand "${vapoursynth.name}-with-plugins"
56 nativeBuildInputs = [ makeWrapper ];
59 inherit (vapoursynth) src version;
60 withPlugins = plugins': withPlugins (plugins ++ plugins');
67 $out/lib/vapoursynth \
68 $out/${python3.sitePackages}
71 lib/pkgconfig/vapoursynth{,-script}.pc \
72 lib/libvapoursynth.la \
73 lib/libvapoursynth-script.la \
74 ${python3.sitePackages}/vapoursynth.la
76 substitute ${vapoursynth}/$textFile $out/$textFile \
77 --replace "${vapoursynth}" "$out"
80 for binaryPlugin in ${pluginsEnv}/lib/vapoursynth/*; do
81 ln -s $binaryPlugin $out/''${binaryPlugin#"${pluginsEnv}/"}
84 for pythonPlugin in ${pythonEnvironment}/${python3.sitePackages}/*; do
85 ln -s $pythonPlugin $out/''${pythonPlugin#"${pythonEnvironment}/"}
89 lib/libvapoursynth${ext} \
90 lib/libvapoursynth-script${ext}.0.0.0
92 old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
93 new_rpath="$old_rpath:$out/lib"
95 --set-rpath "$new_rpath" \
96 --output $out/$binaryFile \
97 ${vapoursynth}/$binaryFile
99 --add-needed libvapoursynth-nix-plugins${ext} \
104 ${python3.sitePackages}/vapoursynth${ext} \
107 old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
108 new_rpath="''${old_rpath//"${vapoursynth}"/"$out"}"
110 --set-rpath "$new_rpath" \
111 --output $out/$binaryFile \
112 ${vapoursynth}/$binaryFile
115 ln -s ${nixPlugins} $out/lib/libvapoursynth-nix-plugins${ext}
116 ln -s ${vapoursynth}/include $out/include
117 ln -s ${vapoursynth}/lib/vapoursynth/* $out/lib/vapoursynth
119 libvapoursynth-script${ext}.0.0.0 \
120 $out/lib/libvapoursynth-script${ext}
122 libvapoursynth-script${ext}.0.0.0 \
123 $out/lib/libvapoursynth-script${ext}.0
125 makeWrapper $out/bin/.vspipe-wrapped $out/bin/vspipe \
126 --prefix PYTHONPATH : $out/${python3.sitePackages}