diff --git a/pkgs/by-name/va/vapoursynth-nnedi3/package.nix b/pkgs/by-name/va/vapoursynth-nnedi3/package.nix index 1fe4b8597d72..a40d9742ba67 100644 --- a/pkgs/by-name/va/vapoursynth-nnedi3/package.nix +++ b/pkgs/by-name/va/vapoursynth-nnedi3/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, autoreconfHook, pkg-config, vapoursynth, @@ -19,6 +20,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-jd/PCXhbCZGMsoXjekbeqMSRVBJAy4INdpkTbZFjVO0="; }; + patches = [ + (fetchpatch { + name = "build-fixes-for-aarch64-apple-silicon.patch"; + url = "https://github.com/dubhater/vapoursynth-nnedi3/commit/15c15080ed4406929aa0d2d6a3f83ca3e26bc979.patch"; + hash = "sha256-8gNj4LixfrGq0MaIYdZuwSK/2iyh1E9s/uuSBJHZwx8="; + }) + ]; + nativeBuildInputs = [ autoreconfHook pkg-config diff --git a/pkgs/by-name/va/vapoursynth-znedi3/package.nix b/pkgs/by-name/va/vapoursynth-znedi3/package.nix index cd5b7f90fa29..fbde9b6d26ef 100644 --- a/pkgs/by-name/va/vapoursynth-znedi3/package.nix +++ b/pkgs/by-name/va/vapoursynth-znedi3/package.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation { installPhase = '' runHook preInstall - install -D -t $out/lib/vapoursynth vsznedi3${stdenv.hostPlatform.extensions.sharedLibrary} + install -D -t $out/lib/vapoursynth vsznedi3.so install -D -m644 -t $out/share/nnedi3 nnedi3_weights.bin runHook postInstall diff --git a/pkgs/by-name/va/vapoursynth/editor.nix b/pkgs/by-name/va/vapoursynth/editor.nix index 25d583148eb2..b426d111c799 100644 --- a/pkgs/by-name/va/vapoursynth/editor.nix +++ b/pkgs/by-name/va/vapoursynth/editor.nix @@ -1,5 +1,6 @@ { lib, + stdenv, mkDerivation, fetchFromGitHub, makeWrapper, @@ -23,6 +24,11 @@ let hash = "sha256-+/9j9DJDGXbuTvE8ZXIu6wjcof39SyatS36Q6y9hLPg="; }; + postPatch = '' + substituteInPlace pro/vsedit/vsedit.pro \ + --replace-fail "TARGET = vsedit-32bit" "TARGET = vsedit" + ''; + nativeBuildInputs = [ qmake ]; buildInputs = [ qtbase @@ -34,14 +40,25 @@ let 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 - ''; + preFixup = + '' + cd ../build/release* + mkdir -p $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin.app $out/Applications + makeQtWrapper $out/Applications/$bin.app/Contents/MacOS/$bin $out/bin/$bin + wrapQtApp $out/Applications/$bin.app/Contents/MacOS/$bin + done + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin $out/bin + wrapQtApp $out/bin/$bin + done + ''; passthru = { inherit withPlugins; diff --git a/pkgs/by-name/va/vapoursynth/package.nix b/pkgs/by-name/va/vapoursynth/package.nix index 88f341bfb699..f2b57cddf493 100644 --- a/pkgs/by-name/va/vapoursynth/package.nix +++ b/pkgs/by-name/va/vapoursynth/package.nix @@ -12,9 +12,7 @@ zimg, libass, python3, - libiconv, testers, - ApplicationServices, }: stdenv.mkDerivation rec { @@ -33,24 +31,19 @@ stdenv.mkDerivation rec { autoreconfHook makeWrapper ]; - buildInputs = - [ - zimg - libass - (python3.withPackages ( - ps: with ps; [ - sphinx - cython - ] - )) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ApplicationServices - ]; + buildInputs = [ + zimg + libass + (python3.withPackages ( + ps: with ps; [ + sphinx + cython + ] + )) + ]; enableParallelBuilding = true; - doInstallCheck = true; + doInstallCheck = !stdenv.hostPlatform.isDarwin; passthru = rec { # If vapoursynth is added to the build inputs of mpv and then @@ -80,7 +73,7 @@ stdenv.mkDerivation rec { }; }; - postPatch = '' + postPatch = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' # Export weak symbol nixPluginDir to permit override of default plugin path sed -E -i \ -e 's/(VS_PATH_PLUGINDIR)/(nixPluginDir ? nixPluginDir : \1)/g' \ @@ -110,11 +103,10 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - broken = stdenv.hostPlatform.isDarwin; # see https://github.com/NixOS/nixpkgs/pull/189446 for partial fix description = "Video processing framework with the future in mind"; homepage = "http://www.vapoursynth.com/"; license = licenses.lgpl21; - platforms = platforms.x86_64; + platforms = platforms.all; maintainers = with maintainers; [ rnhmjoj sbruder diff --git a/pkgs/by-name/va/vapoursynth/plugin-interface.nix b/pkgs/by-name/va/vapoursynth/plugin-interface.nix index 2716c27225cf..a9abdd63abef 100644 --- a/pkgs/by-name/va/vapoursynth/plugin-interface.nix +++ b/pkgs/by-name/va/vapoursynth/plugin-interface.nix @@ -51,77 +51,85 @@ let ext = stdenv.hostPlatform.extensions.sharedLibrary; in -runCommand "${vapoursynth.name}-with-plugins" - { - nativeBuildInputs = [ makeWrapper ]; - passthru = { - inherit python3; - inherit (vapoursynth) src version; - withPlugins = plugins': withPlugins (plugins ++ plugins'); - }; - } - '' - mkdir -p \ - $out/bin \ - $out/lib/pkgconfig \ - $out/lib/vapoursynth \ - $out/${python3.sitePackages} +if stdenv.hostPlatform.isDarwin then + vapoursynth.overrideAttrs (previousAttrs: { + pname = "vapoursynth-with-plugins"; + configureFlags = (previousAttrs.configureFlags or [ ]) ++ [ + "--with-plugindir=${pluginsEnv}/lib/vapoursynth" + ]; + }) +else + runCommand "${vapoursynth.name}-with-plugins" + { + nativeBuildInputs = [ makeWrapper ]; + passthru = { + inherit python3; + inherit (vapoursynth) src version; + 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 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 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 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 + 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//"${vapoursynth}"/"$out"}" + new_rpath="$old_rpath:$out/lib" patchelf \ --set-rpath "$new_rpath" \ --output $out/$binaryFile \ ${vapoursynth}/$binaryFile - done + patchelf \ + --add-needed libvapoursynth-nix-plugins${ext} \ + $out/$binaryFile + done - ln -s ${nixPlugins} $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 + 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 - makeWrapper $out/bin/.vspipe-wrapped $out/bin/vspipe \ - --prefix PYTHONPATH : $out/${python3.sitePackages} - '' + ln -s ${nixPlugins} $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} + '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d90d34584a80..dd74e39a5bdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9033,10 +9033,6 @@ with pkgs; eigen2 = callPackage ../development/libraries/eigen/2.0.nix { }; - vapoursynth = callPackage ../by-name/va/vapoursynth/package.nix { - inherit (darwin.apple_sdk.frameworks) ApplicationServices; - }; - vapoursynth-editor = libsForQt5.callPackage ../by-name/va/vapoursynth/editor.nix { }; vmmlib = callPackage ../development/libraries/vmmlib {