uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,74 @@
|
|||
From 439e2effe1cc372925daf6d5c28569663ffb93ed Mon Sep 17 00:00:00 2001
|
||||
From: Tadeo Kondrak <me@tadeo.ca>
|
||||
Date: Mon, 25 Jan 2021 11:17:44 -0700
|
||||
Subject: [PATCH] Call weak function to allow adding preloaded plugins after
|
||||
compile
|
||||
|
||||
---
|
||||
src/core/vscore.cpp | 19 +++++++++++++++++++
|
||||
src/core/vscore.h | 5 +++++
|
||||
2 files changed, 24 insertions(+)
|
||||
|
||||
diff --git a/src/core/vscore.cpp b/src/core/vscore.cpp
|
||||
index f8e69062..4ce4c623 100644
|
||||
--- a/src/core/vscore.cpp
|
||||
+++ b/src/core/vscore.cpp
|
||||
@@ -1791,6 +1791,20 @@ void VSCore::destroyFilterInstance(VSNode *node) {
|
||||
freeDepth--;
|
||||
}
|
||||
|
||||
+extern "C" {
|
||||
+void __attribute__((weak)) VSLoadPluginsNix(void (*load)(void *data, const char *path), void *data);
|
||||
+
|
||||
+struct VSLoadPluginsNixCallbackData {
|
||||
+ VSCore *core;
|
||||
+ const char *filter;
|
||||
+};
|
||||
+
|
||||
+static void VSLoadPluginsNixCallback(void *data, const char *path) {
|
||||
+ auto callbackData = static_cast<VSLoadPluginsNixCallbackData *>(data);
|
||||
+ callbackData->core->loadAllPluginsInPath(path, callbackData->filter);
|
||||
+}
|
||||
+}
|
||||
+
|
||||
VSCore::VSCore(int flags) :
|
||||
numFilterInstances(1),
|
||||
numFunctionInstances(0),
|
||||
@@ -1918,6 +1932,11 @@ VSCore::VSCore(int flags) :
|
||||
} // If neither exists, an empty string will do.
|
||||
#endif
|
||||
|
||||
+ if (VSLoadPluginsNix != nullptr) {
|
||||
+ VSLoadPluginsNixCallbackData data{this, filter.c_str()};
|
||||
+ VSLoadPluginsNix(VSLoadPluginsNixCallback, &data);
|
||||
+ }
|
||||
+
|
||||
VSMap *settings = readSettings(configFile);
|
||||
const char *error = vs_internal_vsapi.mapGetError(settings);
|
||||
if (error) {
|
||||
diff --git a/src/core/vscore.h b/src/core/vscore.h
|
||||
index 2ce0f56b..2982b133 100644
|
||||
--- a/src/core/vscore.h
|
||||
+++ b/src/core/vscore.h
|
||||
@@ -985,6 +985,9 @@ public:
|
||||
std::string getV3ArgString() const;
|
||||
};
|
||||
|
||||
+extern "C" {
|
||||
+static void VSLoadPluginsNixCallback(void *data, const char *path);
|
||||
+}
|
||||
|
||||
struct VSPlugin {
|
||||
friend struct VSPluginFunction;
|
||||
@@ -1140,6 +1143,8 @@ public:
|
||||
|
||||
explicit VSCore(int flags);
|
||||
void freeCore();
|
||||
+
|
||||
+ friend void VSLoadPluginsNixCallback(void *data, const char *path);
|
||||
};
|
||||
|
||||
#endif // VSCORE_H
|
||||
--
|
||||
2.32.0
|
||||
|
||||
60
pkgs/development/libraries/vapoursynth/default.nix
Normal file
60
pkgs/development/libraries/vapoursynth/default.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, makeWrapper
|
||||
, runCommandCC, runCommand, vapoursynth, writeText, patchelf, buildEnv
|
||||
, zimg, libass, python3, libiconv
|
||||
, ApplicationServices
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "vapoursynth";
|
||||
version = "59";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vapoursynth";
|
||||
repo = "vapoursynth";
|
||||
rev = "R${version}";
|
||||
sha256 = "sha256-6w7GSC5ZNIhLpulni4sKq0OvuxHlTJRilBFGH5PQW8U=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper ];
|
||||
buildInputs = [
|
||||
zimg libass
|
||||
(python3.withPackages (ps: with ps; [ sphinx cython ]))
|
||||
] ++ lib.optionals stdenv.isDarwin [ libiconv ApplicationServices ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = rec {
|
||||
# If vapoursynth is added to the build inputs of mpv and then
|
||||
# used in the wrapping of it, we want to know once inside the
|
||||
# wrapper, what python3 version was used to build vapoursynth so
|
||||
# the right python3.sitePackages will be used there.
|
||||
inherit python3;
|
||||
|
||||
withPlugins = import ./plugin-interface.nix {
|
||||
inherit lib python3 buildEnv writeText runCommandCC stdenv runCommand
|
||||
vapoursynth makeWrapper withPlugins;
|
||||
};
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/vspipe \
|
||||
--prefix PYTHONPATH : $out/${python3.sitePackages}
|
||||
|
||||
# VapourSynth does not include any plugins by default
|
||||
# and emits a warning when the system plugin directory does not exist.
|
||||
mkdir $out/lib/vapoursynth
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "A video processing framework with the future in mind";
|
||||
homepage = "http://www.vapoursynth.com/";
|
||||
license = licenses.lgpl21;
|
||||
platforms = platforms.x86_64;
|
||||
maintainers = with maintainers; [ rnhmjoj sbruder tadeokondrak ];
|
||||
};
|
||||
}
|
||||
59
pkgs/development/libraries/vapoursynth/editor.nix
Normal file
59
pkgs/development/libraries/vapoursynth/editor.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ lib, mkDerivation, fetchFromGitHub, makeWrapper, runCommand
|
||||
, python3, vapoursynth
|
||||
, qmake, qtbase, qtwebsockets
|
||||
}:
|
||||
|
||||
let
|
||||
unwrapped = mkDerivation rec {
|
||||
pname = "vapoursynth-editor";
|
||||
version = "R19-mod-4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "YomikoR";
|
||||
repo = pname;
|
||||
rev = lib.toLower version;
|
||||
sha256 = "sha256-+/9j9DJDGXbuTvE8ZXIu6wjcof39SyatS36Q6y9hLPg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ qmake ];
|
||||
buildInputs = [ qtbase vapoursynth qtwebsockets ];
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
||||
preConfigure = "cd pro";
|
||||
|
||||
preFixup = ''
|
||||
cd ../build/release*
|
||||
mkdir -p $out/bin
|
||||
for bin in vsedit{,-job-server{,-watcher}}; do
|
||||
mv $bin $out/bin
|
||||
wrapQtApp $out/bin/$bin
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = { inherit withPlugins; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Cross-platform editor for VapourSynth scripts";
|
||||
homepage = "https://github.com/YomikoR/VapourSynth-Editor";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ tadeokondrak ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
|
||||
withPlugins = plugins: let
|
||||
vapoursynthWithPlugins = vapoursynth.withPlugins plugins;
|
||||
in runCommand "${unwrapped.name}-with-plugins" {
|
||||
buildInputs = [ makeWrapper ];
|
||||
passthru = { withPlugins = plugins': withPlugins (plugins ++ plugins'); };
|
||||
} ''
|
||||
mkdir -p $out/bin
|
||||
for bin in vsedit{,-job-server{,-watcher}}; do
|
||||
makeWrapper ${unwrapped}/bin/$bin $out/bin/$bin \
|
||||
--prefix PYTHONPATH : ${vapoursynthWithPlugins}/${python3.sitePackages} \
|
||||
--prefix LD_LIBRARY_PATH : ${vapoursynthWithPlugins}/lib
|
||||
done
|
||||
'';
|
||||
in
|
||||
withPlugins []
|
||||
113
pkgs/development/libraries/vapoursynth/plugin-interface.nix
Normal file
113
pkgs/development/libraries/vapoursynth/plugin-interface.nix
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{ lib, python3, buildEnv, writeText, runCommandCC, stdenv, runCommand
|
||||
, vapoursynth, makeWrapper, withPlugins }:
|
||||
|
||||
plugins: let
|
||||
pythonEnvironment = python3.buildEnv.override {
|
||||
extraLibs = plugins;
|
||||
};
|
||||
|
||||
getRecursivePropagatedBuildInputs = pkgs: lib.flatten
|
||||
(map
|
||||
(pkg: let cleanPropagatedBuildInputs = lib.filter lib.isDerivation pkg.propagatedBuildInputs;
|
||||
in cleanPropagatedBuildInputs ++ (getRecursivePropagatedBuildInputs cleanPropagatedBuildInputs))
|
||||
pkgs);
|
||||
|
||||
deepPlugins = lib.unique (plugins ++ (getRecursivePropagatedBuildInputs plugins));
|
||||
|
||||
pluginsEnv = buildEnv {
|
||||
name = "vapoursynth-plugins-env";
|
||||
pathsToLink = [ "/lib/vapoursynth" ];
|
||||
paths = deepPlugins;
|
||||
};
|
||||
|
||||
pluginLoader = let
|
||||
source = writeText "vapoursynth-nix-plugins.c" ''
|
||||
void VSLoadPluginsNix(void (*load)(void *data, const char *path), void *data) {
|
||||
${lib.concatMapStringsSep "" (path: "load(data, \"${path}/lib/vapoursynth\");") deepPlugins}
|
||||
}
|
||||
'';
|
||||
in
|
||||
runCommandCC "vapoursynth-plugin-loader" {
|
||||
executable = true;
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} ''
|
||||
mkdir -p $out/lib
|
||||
$CC -shared -fPIC ${source} -o "$out/lib/libvapoursynth-nix-plugins${ext}"
|
||||
'';
|
||||
|
||||
ext = stdenv.targetPlatform.extensions.sharedLibrary;
|
||||
in
|
||||
runCommand "${vapoursynth.name}-with-plugins" {
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
passthru = {
|
||||
inherit python3;
|
||||
withPlugins = plugins': withPlugins (plugins ++ plugins');
|
||||
};
|
||||
} ''
|
||||
mkdir -p \
|
||||
$out/bin \
|
||||
$out/lib/pkgconfig \
|
||||
$out/lib/vapoursynth \
|
||||
$out/${python3.sitePackages}
|
||||
|
||||
for textFile in \
|
||||
lib/pkgconfig/vapoursynth{,-script}.pc \
|
||||
lib/libvapoursynth.la \
|
||||
lib/libvapoursynth-script.la \
|
||||
${python3.sitePackages}/vapoursynth.la
|
||||
do
|
||||
substitute ${vapoursynth}/$textFile $out/$textFile \
|
||||
--replace "${vapoursynth}" "$out"
|
||||
done
|
||||
|
||||
for binaryPlugin in ${pluginsEnv}/lib/vapoursynth/*; do
|
||||
ln -s $binaryPlugin $out/''${binaryPlugin#"${pluginsEnv}/"}
|
||||
done
|
||||
|
||||
for pythonPlugin in ${pythonEnvironment}/${python3.sitePackages}/*; do
|
||||
ln -s $pythonPlugin $out/''${pythonPlugin#"${pythonEnvironment}/"}
|
||||
done
|
||||
|
||||
for binaryFile in \
|
||||
lib/libvapoursynth${ext} \
|
||||
lib/libvapoursynth-script${ext}.0.0.0
|
||||
do
|
||||
old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
|
||||
new_rpath="$old_rpath:$out/lib"
|
||||
patchelf \
|
||||
--set-rpath "$new_rpath" \
|
||||
--output $out/$binaryFile \
|
||||
${vapoursynth}/$binaryFile
|
||||
patchelf \
|
||||
--add-needed libvapoursynth-nix-plugins${ext} \
|
||||
$out/$binaryFile
|
||||
done
|
||||
|
||||
for binaryFile in \
|
||||
${python3.sitePackages}/vapoursynth${ext} \
|
||||
bin/.vspipe-wrapped
|
||||
do
|
||||
old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
|
||||
new_rpath="''${old_rpath//"${vapoursynth}"/"$out"}"
|
||||
patchelf \
|
||||
--set-rpath "$new_rpath" \
|
||||
--output $out/$binaryFile \
|
||||
${vapoursynth}/$binaryFile
|
||||
done
|
||||
|
||||
ln -s \
|
||||
${pluginLoader}/lib/libvapoursynth-nix-plugins${ext} \
|
||||
$out/lib/libvapoursynth-nix-plugins${ext}
|
||||
ln -s ${vapoursynth}/include $out/include
|
||||
ln -s ${vapoursynth}/lib/vapoursynth/* $out/lib/vapoursynth
|
||||
ln -s \
|
||||
libvapoursynth-script${ext}.0.0.0 \
|
||||
$out/lib/libvapoursynth-script${ext}
|
||||
ln -s \
|
||||
libvapoursynth-script${ext}.0.0.0 \
|
||||
$out/lib/libvapoursynth-script${ext}.0
|
||||
|
||||
makeWrapper $out/bin/.vspipe-wrapped $out/bin/vspipe \
|
||||
--prefix PYTHONPATH : $out/${python3.sitePackages}
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue