-
Notifications
You must be signed in to change notification settings - Fork 1
/
mpv-cuda.spec
277 lines (237 loc) · 8.54 KB
/
mpv-cuda.spec
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
%global gitdate 20240930
%global commit a0fba7be57f3822d967b04f0f6b6d6341e7516e7
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name : mpv-cuda
Version : 0.39.0
Release : %{gitdate}.%{shortcommit}
URL : https://github.com/mpv-player/mpv
Source0 : %{url}/archive/%{commit}/mpv-%{shortcommit}.tar.gz
Summary : media player
Group : Development/Tools
License : GPL-2.0 LGPL-2.1
Requires: libvdpau-lib
Requires: ffmpeg-cuda-libs
Requires: mpv-cuda-bin = %{version}-%{release}
Requires: mpv-cuda-data = %{version}-%{release}
Requires: mpv-cuda-lib = %{version}-%{release}
Requires: mpv-cuda-license = %{version}-%{release}
#Requires: mpv-cuda-filemap = %%{version}-%%{release}
BuildRequires : buildreq-meson
BuildRequires : Vulkan-Headers-dev
BuildRequires : Vulkan-Loader-dev
BuildRequires : SPIRV-Tools-dev
BuildRequires : SPIRV-Cross-dev
BuildRequires : libX11-dev
BuildRequires : libXScrnSaver-dev
BuildRequires : libXpresent-dev
BuildRequires : libXv-dev
BuildRequires : libvdpau-dev
BuildRequires : libva-dev
BuildRequires : mesa-dev
BuildRequires : ffmpeg-cuda-dev
BuildRequires : pkgconfig(alsa)
BuildRequires : pkgconfig(libass)
BuildRequires : pkgconfig(libplacebo)
BuildRequires : pkgconfig(libpulse)
BuildRequires : pkgconfig(libva)
BuildRequires : pkgconfig(libva-drm)
BuildRequires : pkgconfig(libva-x11)
BuildRequires : pkgconfig(wayland-client)
BuildRequires : pkgconfig(wayland-cursor)
BuildRequires : pkgconfig(wayland-protocols)
BuildRequires : pkgconfig(x11)
BuildRequires : pkgconfig(xext)
BuildRequires : pkgconfig(xinerama)
BuildRequires : pkgconfig(xkbcommon)
BuildRequires : pkgconfig(xrandr)
BuildRequires : pkgconfig(xscrnsaver)
BuildRequires : pkgconfig(xpresent)
BuildRequires : pkgconfig(xv)
BuildRequires : zlib-dev
BuildRequires : SDL2-dev
BuildRequires : LuaJIT-dev
BuildRequires : libjpeg-turbo-dev
BuildRequires : pkgconfig(libarchive)
BuildRequires : pipewire-dev
BuildRequires : shaderc-dev uchardet-dev zimg-dev SPIRV-Headers-dev
BuildRequires : pkgconfig(vapoursynth)
BuildRequires : pkgconfig(vapoursynth-script)
# fonts-related
BuildRequires : v4l-utils-dev fontconfig-dev fribidi-dev harfbuzz-dev libpng-dev
%description
TA ("Tree Allocator") is a wrapper around malloc() and related functions,
adding features like automatically freeing sub-trees of memory allocations if
a parent allocation is freed.
%package bin
Summary: bin components for the mpv package.
Group: Binaries
Requires: mpv-cuda-data = %{version}-%{release}
Requires: mpv-cuda-license = %{version}-%{release}
#Requires: mpv-cuda-filemap = %%{version}-%%{release}
%description bin
bin components for the mpv package.
%package data
Summary: data components for the mpv package.
Group: Data
%description data
data components for the mpv package.
%package dev
Summary: dev components for the mpv package.
Group: Development
Requires: mpv-cuda-lib = %{version}-%{release}
Requires: mpv-cuda-bin = %{version}-%{release}
Requires: mpv-cuda-data = %{version}-%{release}
Provides: mpv-cuda-devel = %{version}-%{release}
Requires: mpv-cuda = %{version}-%{release}
%description dev
dev components for the mpv package.
%package doc
Summary: doc components for the mpv package.
Group: Documentation
%description doc
doc components for the mpv package.
%package lib
Summary: lib components for the mpv package.
Group: Libraries
Requires: mpv-cuda-data = %{version}-%{release}
Requires: mpv-cuda-license = %{version}-%{release}
#Requires: mpv-cuda-filemap = %%{version}-%%{release}
%description lib
lib components for the mpv package.
%package license
Summary: license components for the mpv package.
Group: Default
%description license
license components for the mpv package.
%prep
%setup -q -n mpv-%{commit}
git config --global --add safe.directory /home
# newest nv-codev-headers
unset https_proxy
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
pushd nv-codec-headers
make
make PREFIX=/usr LIBDIR=lib64 install
popd
%build
export LANG=C.UTF-8
export GCC_IGNORE_WERROR=1
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
export PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig"
export LDFLAGS="-Wl,-rpath=/usr/local-cuda/lib64,-rpath=/opt/3rd-party/bundles/clearfraction/usr/local-cuda/lib64,-rpath=/opt/3rd-party/bundles/clearfraction/usr/lib64 "
export CFLAGS="$CFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export FCFLAGS="$FFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export FFLAGS="$FFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export CXXFLAGS="$CXXFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export LANG=C.UTF-8
export GCC_IGNORE_WERROR=1
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
export LDFLAGS="-Wl,-rpath=/opt/3rd-party/bundles/clearfraction/usr/lib64,-rpath=/usr/lib64 "
export CFLAGS="$CFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export FCFLAGS="$FFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export FFLAGS="$FFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
export CXXFLAGS="$CXXFLAGS -O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto -fno-semantic-interposition -mno-vzeroupper -mprefer-vector-width=256 "
meson --libdir=lib64 --prefix=/usr/local-cuda --buildtype=plain \
-Dalsa=enabled \
-Dbuild-date=false \
-Dcaca=disabled \
-Dcdda=disabled \
-Dcplayer=true \
-Dcplugins=enabled \
-Dcuda-hwaccel=enabled \
-Dcuda-interop=enabled \
-Ddmabuf-wayland=enabled \
-Ddrm=enabled \
-Ddvbin=enabled \
-Ddvdnav=disabled \
-Degl-drm=enabled \
-Degl-wayland=enabled \
-Degl-x11=enabled \
-Degl=enabled \
-Dgbm=enabled \
-Dgl-x11=enabled \
-Dgl=enabled \
-Dhtml-build=disabled \
-Dpdf-build=disabled \
-Diconv=enabled \
-Djack=disabled \
-Djavascript=disabled \
-Djpeg=enabled \
-Dlcms2=disabled \
-Dlibarchive=enabled \
-Dlibavdevice=enabled \
-Dlibbluray=disabled \
-Dlibmpv=true \
-Dlua=enabled \
-Dmanpage-build=disabled \
-Dopenal=disabled \
-Dopensles=disabled \
-Doss-audio=disabled \
-Dpipewire=enabled \
-Dplain-gl=enabled \
-Dpulse=enabled \
-Drubberband=disabled \
-Dsdl2-audio=disabled \
-Dsdl2-gamepad=disabled \
-Dsdl2-video=disabled \
-Dsdl2=disabled \
-Dshaderc=disabled \
-Dsndio=disabled \
-Dspirv-cross=disabled \
-Duchardet=enabled \
-Dvaapi-drm=enabled \
-Dvaapi-wayland=enabled \
-Dvaapi-x11=enabled \
-Dvaapi=enabled \
-Dvapoursynth=disabled \
-Dvdpau-gl-x11=disabled \
-Dvdpau=disabled \
-Dvector=enabled \
-Dvulkan=enabled \
-Dwayland=enabled \
-Dwerror=false \
-Dx11=enabled \
-Dxv=enabled \
-Dzimg=enabled \
-Dzlib=enabled builddir
ninja -v -C builddir
%install
DESTDIR=%{buildroot} ninja -C builddir install
rm -rvf %{buildroot}/usr/local-cuda/share/doc %{buildroot}/usr/local-cuda/etc
mv %{buildroot}/usr/local-cuda %{buildroot}/usr/local
%files
%defattr(-,root,root,-)
%files bin
%defattr(-,root,root,-)
/usr/local/bin/mpv
%files data
%defattr(-,root,root,-)
/usr/local/share/applications/mpv.desktop
/usr/local/share/icons/hicolor/16x16/apps/mpv.png
/usr/local/share/icons/hicolor/32x32/apps/mpv.png
/usr/local/share/icons/hicolor/64x64/apps/mpv.png
/usr/local/share/icons/hicolor/128x128/apps/mpv.png
/usr/local/share/icons/hicolor/scalable/apps/mpv.svg
/usr/local/share/icons/hicolor/symbolic/apps/mpv-symbolic.svg
/usr/local/share/zsh/site-functions/_mpv
/usr/local/share/bash-completion/completions/mpv
/usr/local/share/metainfo/mpv.metainfo.xml
%files dev
%defattr(-,root,root,-)
/usr/local/include/mpv/client.h
/usr/local/include/mpv/render.h
/usr/local/include/mpv/render_gl.h
/usr/local/include/mpv/stream_cb.h
/usr/local/lib64/libmpv.so*
/usr/local/lib64/pkgconfig/mpv.pc
%files doc
%defattr(0644,root,root,0755)
%files lib
%defattr(-,root,root,-)
/usr/local/lib64/libmpv.so.*
%files license
%defattr(0644,root,root,0755)