Commit 2c487f56 authored by Mikael Voss's avatar Mikael Voss
Browse files

vapoursynth: Reformat and move according to guidelines

parent 3d87b65e
Loading
Loading
Loading
Loading
+80 −0
Original line number Diff line number Diff line
{ lib, mkDerivation, fetchFromGitHub, makeWrapper, runCommand
, python3, vapoursynth
, qmake, qtbase, qtwebsockets
{
  lib,
  mkDerivation,
  fetchFromGitHub,
  makeWrapper,
  runCommand,
  python3,
  vapoursynth,
  qmake,
  qtbase,
  qtwebsockets,
}:

let
@@ -16,7 +24,11 @@ let
    };

    nativeBuildInputs = [ qmake ];
    buildInputs = [ qtbase vapoursynth qtwebsockets ];
    buildInputs = [
      qtbase
      vapoursynth
      qtwebsockets
    ];

    dontWrapQtApps = true;

@@ -31,7 +43,9 @@ let
      done
    '';

    passthru = { inherit withPlugins; };
    passthru = {
      inherit withPlugins;
    };

    meta = with lib; {
      description = "Cross-platform editor for VapourSynth scripts";
@@ -42,12 +56,19 @@ let
    };
  };

  withPlugins = plugins: let
  withPlugins =
    plugins:
    let
      vapoursynthWithPlugins = vapoursynth.withPlugins plugins;
  in runCommand "${unwrapped.name}-with-plugins" {
    in
    runCommand "${unwrapped.name}-with-plugins"
      {
        nativeBuildInputs = [ makeWrapper ];
    passthru = { withPlugins = plugins': withPlugins (plugins ++ plugins'); };
  } ''
        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 \
+62 −22
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, makeWrapper
, runCommandCC, runCommand, vapoursynth, writeText, buildEnv
, zimg, libass, python3, libiconv, testers
, ApplicationServices
{
  lib,
  stdenv,
  fetchFromGitHub,
  pkg-config,
  autoreconfHook,
  makeWrapper,
  runCommandCC,
  runCommand,
  vapoursynth,
  writeText,
  buildEnv,
  zimg,
  libass,
  python3,
  libiconv,
  testers,
  ApplicationServices,
}:

stdenv.mkDerivation rec {
@@ -15,15 +29,28 @@ stdenv.mkDerivation rec {
    hash = "sha256-T2bCVNH0dLM9lFYChXzvD6AJM3xEtOVCb2tI10tIXJs=";
  };

  patches = [
    ./nix-plugin-loader.patch
  ];
  patches = [ ./nix-plugin-loader.patch ];

  nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper ];
  buildInputs = [
    zimg libass
    (python3.withPackages (ps: with ps; [ sphinx cython ]))
  ] ++ lib.optionals stdenv.isDarwin [ libiconv ApplicationServices ];
  nativeBuildInputs = [
    pkg-config
    autoreconfHook
    makeWrapper
  ];
  buildInputs =
    [
      zimg
      libass
      (python3.withPackages (
        ps: with ps; [
          sphinx
          cython
        ]
      ))
    ]
    ++ lib.optionals stdenv.isDarwin [
      libiconv
      ApplicationServices
    ];

  enableParallelBuilding = true;

@@ -35,8 +62,18 @@ stdenv.mkDerivation rec {
    inherit python3;

    withPlugins = import ./plugin-interface.nix {
      inherit lib python3 buildEnv writeText runCommandCC stdenv runCommand
        vapoursynth makeWrapper withPlugins;
      inherit
        lib
        python3
        buildEnv
        writeText
        runCommandCC
        stdenv
        runCommand
        vapoursynth
        makeWrapper
        withPlugins
        ;
    };

    tests.version = testers.testVersion {
@@ -61,7 +98,10 @@ stdenv.mkDerivation rec {
    homepage = "http://www.vapoursynth.com/";
    license = licenses.lgpl21;
    platforms = platforms.x86_64;
    maintainers = with maintainers; [ rnhmjoj sbruder ];
    maintainers = with maintainers; [
      rnhmjoj
      sbruder
    ];
    mainProgram = "vspipe";
  };
}
+140 −0
Original line number Diff line number Diff line
{ lib, python3, buildEnv, writeText, runCommandCC, stdenv, runCommand
, vapoursynth, makeWrapper, withPlugins }:
{
  lib,
  python3,
  buildEnv,
  writeText,
  runCommandCC,
  stdenv,
  runCommand,
  vapoursynth,
  makeWrapper,
  withPlugins,
}:

plugins: let
  pythonEnvironment = python3.buildEnv.override {
    extraLibs = plugins;
  };
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);
  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));

@@ -47,14 +62,16 @@ plugins: let

  ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
runCommand "${vapoursynth.name}-with-plugins" {
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 \
+2 −2
Original line number Diff line number Diff line
@@ -20148,11 +20148,11 @@ with pkgs;
  eigenmath = callPackage ../applications/science/math/eigenmath { };
  vapoursynth = callPackage ../development/libraries/vapoursynth {
  vapoursynth = callPackage ../by-name/va/vapoursynth/package.nix {
    inherit (darwin.apple_sdk.frameworks) ApplicationServices;
  };
  vapoursynth-editor = libsForQt5.callPackage ../development/libraries/vapoursynth/editor.nix { };
  vapoursynth-editor = libsForQt5.callPackage ../by-name/va/vapoursynth/editor.nix { };
  vapoursynth-mvtools = callPackage ../development/libraries/vapoursynth-mvtools { };
Loading