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 if stdenv.hostPlatform.isDarwin then
55 vapoursynth.overrideAttrs (previousAttrs: {
56 pname = "vapoursynth-with-plugins";
57 configureFlags = (previousAttrs.configureFlags or [ ]) ++ [
58 "--with-plugindir=${pluginsEnv}/lib/vapoursynth"
62 runCommand "${vapoursynth.name}-with-plugins"
64 nativeBuildInputs = [ makeWrapper ];
67 inherit (vapoursynth) src version;
68 withPlugins = plugins': withPlugins (plugins ++ plugins');
75 $out/lib/vapoursynth \
76 $out/${python3.sitePackages}
79 lib/pkgconfig/vapoursynth{,-script}.pc \
80 lib/libvapoursynth.la \
81 lib/libvapoursynth-script.la \
82 ${python3.sitePackages}/vapoursynth.la
84 substitute ${vapoursynth}/$textFile $out/$textFile \
85 --replace "${vapoursynth}" "$out"
88 for binaryPlugin in ${pluginsEnv}/lib/vapoursynth/*; do
89 ln -s $binaryPlugin $out/''${binaryPlugin#"${pluginsEnv}/"}
92 for pythonPlugin in ${pythonEnvironment}/${python3.sitePackages}/*; do
93 ln -s $pythonPlugin $out/''${pythonPlugin#"${pythonEnvironment}/"}
97 lib/libvapoursynth${ext} \
98 lib/libvapoursynth-script${ext}.0.0.0
100 old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
101 new_rpath="$old_rpath:$out/lib"
103 --set-rpath "$new_rpath" \
104 --output $out/$binaryFile \
105 ${vapoursynth}/$binaryFile
107 --add-needed libvapoursynth-nix-plugins${ext} \
112 ${python3.sitePackages}/vapoursynth${ext} \
115 old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
116 new_rpath="''${old_rpath//"${vapoursynth}"/"$out"}"
118 --set-rpath "$new_rpath" \
119 --output $out/$binaryFile \
120 ${vapoursynth}/$binaryFile
123 ln -s ${nixPlugins} $out/lib/libvapoursynth-nix-plugins${ext}
124 ln -s ${vapoursynth}/include $out/include
125 ln -s ${vapoursynth}/lib/vapoursynth/* $out/lib/vapoursynth
127 libvapoursynth-script${ext}.0.0.0 \
128 $out/lib/libvapoursynth-script${ext}
130 libvapoursynth-script${ext}.0.0.0 \
131 $out/lib/libvapoursynth-script${ext}.0
133 makeWrapper $out/bin/.vspipe-wrapped $out/bin/vspipe \
134 --prefix PYTHONPATH : $out/${python3.sitePackages}