Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 mkDerivation,
5 fetchFromGitHub,
6 makeWrapper,
7 runCommand,
8 python3,
9 vapoursynth,
10 qmake,
11 qtbase,
12 qtwebsockets,
13}:
14
15let
16 unwrapped = mkDerivation rec {
17 pname = "vapoursynth-editor";
18 version = "R19-mod-4";
19
20 src = fetchFromGitHub {
21 owner = "YomikoR";
22 repo = "vapoursynth-editor";
23 rev = lib.toLower version;
24 hash = "sha256-+/9j9DJDGXbuTvE8ZXIu6wjcof39SyatS36Q6y9hLPg=";
25 };
26
27 postPatch = ''
28 substituteInPlace pro/vsedit/vsedit.pro \
29 --replace-fail "TARGET = vsedit-32bit" "TARGET = vsedit"
30 '';
31
32 nativeBuildInputs = [ qmake ];
33 buildInputs = [
34 qtbase
35 vapoursynth
36 qtwebsockets
37 ];
38
39 dontWrapQtApps = true;
40
41 preConfigure = "cd pro";
42
43 preFixup = ''
44 cd ../build/release*
45 mkdir -p $out/bin
46 ''
47 + lib.optionalString stdenv.hostPlatform.isDarwin ''
48 mkdir -p $out/Applications
49 for bin in vsedit{,-job-server{,-watcher}}; do
50 mv $bin.app $out/Applications
51 makeQtWrapper $out/Applications/$bin.app/Contents/MacOS/$bin $out/bin/$bin
52 wrapQtApp $out/Applications/$bin.app/Contents/MacOS/$bin
53 done
54 ''
55 + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
56 for bin in vsedit{,-job-server{,-watcher}}; do
57 mv $bin $out/bin
58 wrapQtApp $out/bin/$bin
59 done
60 '';
61
62 passthru = {
63 inherit withPlugins;
64 };
65
66 meta = with lib; {
67 description = "Cross-platform editor for VapourSynth scripts";
68 homepage = "https://github.com/YomikoR/VapourSynth-Editor";
69 license = licenses.mit;
70 maintainers = [ ];
71 platforms = platforms.all;
72 };
73 };
74
75 withPlugins =
76 plugins:
77 let
78 vapoursynthWithPlugins = vapoursynth.withPlugins plugins;
79 in
80 runCommand "${unwrapped.name}-with-plugins"
81 {
82 nativeBuildInputs = [ makeWrapper ];
83 passthru = {
84 withPlugins = plugins': withPlugins (plugins ++ plugins');
85 };
86 }
87 ''
88 mkdir -p $out/bin
89 for bin in vsedit{,-job-server{,-watcher}}; do
90 makeWrapper ${unwrapped}/bin/$bin $out/bin/$bin \
91 --prefix PYTHONPATH : ${vapoursynthWithPlugins}/${python3.sitePackages} \
92 --prefix LD_LIBRARY_PATH : ${vapoursynthWithPlugins}/lib
93 done
94 '';
95in
96withPlugins [ ]