From 58d11808942e4cc57b431555e699edbca34265ec Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 22 Jan 2021 16:50:31 +0100 Subject: [PATCH] vapoursynthPlugins: set libdir in meson config This replaces the custom installPhase. --- plugins/addgrain/default.nix | 10 ++++------ plugins/bm3d/default.nix | 12 ++++-------- plugins/eedi2/default.nix | 10 ++++------ plugins/eedi3m/default.nix | 10 ++++------ plugins/retinex/default.nix | 5 +++++ plugins/tcanny/default.nix | 10 ++++------ 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/plugins/addgrain/default.nix b/plugins/addgrain/default.nix index c8d3a6c..ce2d5e6 100644 --- a/plugins/addgrain/default.nix +++ b/plugins/addgrain/default.nix @@ -14,12 +14,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth ]; - installPhase = - let - ext = stdenv.targetPlatform.extensions.sharedLibrary; - in '' - install -D libaddgrain${ext} $out/lib/vapoursynth/libaddgrain${ext} - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; meta = with lib; { description = "AddGrain filter for VapourSynth"; diff --git a/plugins/bm3d/default.nix b/plugins/bm3d/default.nix index 0aa52b1..582cb10 100644 --- a/plugins/bm3d/default.nix +++ b/plugins/bm3d/default.nix @@ -14,14 +14,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth fftwSinglePrec ]; - # i could not find a way to override the default meson install dir. - # patching the file didn't work - installPhase = - let - ext = stdenv.targetPlatform.extensions.sharedLibrary; - in '' - install -D libbm3d${ext} $out/lib/vapoursynth/libbm3d${ext} - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; meta = with lib; { description = "BM3D denoising filter for VapourSynth"; diff --git a/plugins/eedi2/default.nix b/plugins/eedi2/default.nix index 5e4e9d4..81751ec 100644 --- a/plugins/eedi2/default.nix +++ b/plugins/eedi2/default.nix @@ -14,12 +14,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth ]; - installPhase = - let - ext = stdenv.targetPlatform.extensions.sharedLibrary; - in '' - install -D libeedi2${ext} $out/lib/vapoursynth/libeedi2${ext} - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; meta = with lib; { description = "EEDI2 filter for VapourSynth"; diff --git a/plugins/eedi3m/default.nix b/plugins/eedi3m/default.nix index ff8e822..9cd7005 100644 --- a/plugins/eedi3m/default.nix +++ b/plugins/eedi3m/default.nix @@ -14,12 +14,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth boost opencl-headers ocl-icd ]; - installPhase = - let - ext = stdenv.targetPlatform.extensions.sharedLibrary; - in '' - install -D libeedi3m${ext} $out/lib/vapoursynth/libeedi3m${ext} - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; meta = with lib; { description = "Renewed EEDI3 filter for VapourSynth"; diff --git a/plugins/retinex/default.nix b/plugins/retinex/default.nix index 2a106d7..db96386 100644 --- a/plugins/retinex/default.nix +++ b/plugins/retinex/default.nix @@ -14,6 +14,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth ]; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; + installPhase = let ext = stdenv.targetPlatform.extensions.sharedLibrary; diff --git a/plugins/tcanny/default.nix b/plugins/tcanny/default.nix index 19ea9b8..5cb64a5 100644 --- a/plugins/tcanny/default.nix +++ b/plugins/tcanny/default.nix @@ -14,12 +14,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ vapoursynth boost opencl-headers ocl-icd ]; - installPhase = - let - ext = stdenv.targetPlatform.extensions.sharedLibrary; - in '' - install -D libtcanny${ext} $out/lib/vapoursynth/libtcanny${ext} - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace "vapoursynth_dep.get_pkgconfig_variable('libdir')" "get_option('libdir')" + ''; meta = with lib; { description = "TCanny filter for VapourSynth";