forked from AkarinVS/vapoursynth-plugin
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpackage.nix
More file actions
107 lines (97 loc) · 2.4 KB
/
Copy pathpackage.nix
File metadata and controls
107 lines (97 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
lib,
stdenv,
darwinMinVersionHook,
buildPythonPackage,
hatchling,
meson,
ninja,
packaging,
pkg-config,
vapoursynth,
libllvm,
libxml2,
boost,
vapoursynth-lib ? builtins.head vapoursynth.buildInputs,
withBoostCharconv ? stdenv.hostPlatform.isDarwin,
}:
buildPythonPackage {
pname = "vapoursynth-akarin";
version = "1.5.0";
pyproject = true;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ./.)) (
lib.fileset.unions [
./banding
./expr
./expr2
./ngx
./text
./vfx
./meson_options.txt
./meson.build
./plugin.cpp
./plugin.h
./version.h.in
./hatch_build.py
./pyproject.toml
./README.md
]
);
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "meson==1.12.0" "meson" \
--replace-fail "ninja==1.13.0" "ninja" \
--replace-fail "vapoursynth>=74" "vapoursynth"
substituteInPlace meson.build \
--replace-fail \
"py = import('python').find_installation(pure: false)
r = run_command(
py,
'-c',
'import vapoursynth as vs; print(vs.get_include())',
check: true,
)
inc_vs = include_directories(r.stdout().strip())
incdir += inc_vs" \
"deps += dependency('vapoursynth')"
'';
nativeBuildInputs = [
libllvm.dev
libxml2.dev
pkg-config
];
build-system = [
hatchling
meson
ninja
packaging
vapoursynth
];
env = lib.optionalAttrs withBoostCharconv {
MESON_ARGS = "-Dboost-charconv=true";
BOOST_LIBRARYDIR = "${boost.out}/lib";
BOOST_INCLUDEDIR = "${boost.dev}/include";
};
buildInputs =
[
libllvm
libxml2.out
vapoursynth-lib
]
++ lib.optional withBoostCharconv boost
# `std::to_chars()` for floating-point types was introduced in macOS 13.3.
# But then `darwinMinVersionHook "13.0"` yields "error: 'from_chars' is
# unavailable: introduced in macOS 26.0".
++ lib.optional (stdenv.hostPlatform.isDarwin && !withBoostCharconv) (darwinMinVersionHook "26.0");
dependencies = [
vapoursynth
];
meta = {
homepage = "https://github.com/Jaded-Encoding-Thaumaturgy/akarin-vapoursynth-plugin";
license = lib.licenses.lgpl3;
platforms = lib.platforms.all;
};
}