summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 173b627aaa89e7ecc4fe4f436d17b0bf930ec3f3 (plain)
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# Maintainer Denis Benato <benato dot denis96 [at] gmail dot com>
# Original (ffmpeg-amd-full): Nathaniel Chin <thegamingorangutans+aur at gmail.com>
# Original (ffmpeg-full): Daniel Bermond <dbermond@archlinux.org> > https://aur.archlinux.org/packages/ffmpeg-full
# Contributor: Marko Korhonen <reekymarko at reekynet.com>
# Contributor: Bruno Filipe < gmail-com: bmilreu >

pkgname=ffmpeg-nonvidia
pkgver=6.0
pkgrel=1
epoch=2
pkgdesc='Complete solution to record, convert and stream audio and video. Almost everything non-nVidia related is enabled. Started as a clone of ffmpeg-amd-full.'
arch=(x86_64)
url=https://ffmpeg.org/
license=(GPL3)

# 'pocketsphinx' actually disabled: ffmpeg does not support the new version 5.0.0
depends=(
  alsa-lib
  aom
  bzip2
  fontconfig
  fribidi
  gmp
  gnutls
  gsm
  jack
  lame
  libass.so
  libavc1394
  libbluray.so
  libbs2b.so
  libdav1d.so
  libdrm
  libfreetype.so
  libgl
  libiec61883
  libmfx
  libopenmpt.so
  libpulse
  librav1e.so
  libraw1394
  librsvg-2.so
  libsoxr
  libssh
  libtheora
  libva.so
  libva-drm.so
  libva-x11.so
  libvdpau
  libvidstab.so
  libvorbisenc.so
  libvorbis.so
  libvpx.so
  libvulkan.so
  libwebp
  libx11
  libx264.so
  libx265.so
  libxcb
  libxext
  libxml2
  libxv
  libxvidcore.so
  libzimg.so
  ocl-icd
  opencore-amr
  openjpeg2
  opus
  sdl2
  speex
  srt
  svt-av1
  v4l-utils
  vmaf
  xz
  zlib
  aribb24
  avisynthplus
  celt
  codec2
  freetype2
  glslang
  frei0r-plugins
  kvazaar
  ladspa
  lcms2
  lensfun-git
  libbluray
  libcaca
  libcdio-paranoia
  libdc1394
  libfdk-aac
  libgme
  libgcrypt
  libilbc
  libjxl
  libmodplug
  libmysofa
  libomxil-bellagio
  libplacebo
  lilv
  lv2
  openal
  openh264
  openjpeg2
  rubberband
  rtmpdump
  sdl2
  smbclient
  snappy
  sndio
  spirv-tools
  srt
  svt-hevc
  svt-vp9
  tesseract
  twolame
  vapoursynth
  vulkan-icd-loader
  zeromq
  zimg
  zvbi
  chromaprint-fftw
  davs2
  flite1
  libklvanc-git
  librist
  shine
  uavs3d-git
  vo-amrwbenc
  xavs
  xavs2
  decklink-sdk
)
makedepends=(
  amf-headers
  avisynthplus
  clang
  git
  ladspa
  mesa
  nasm
  opencl-headers
  vulkan-headers
)
optdepends=(
  'intel-media-sdk: Intel QuickSync support'
)
provides=(
  libavcodec.so
  libavdevice.so
  libavfilter.so
  libavformat.so
  libavutil.so
  libpostproc.so
  libswresample.so
  libswscale.so
  ffmpeg
  ffmpeg-full
)

#options=(
#  debug
#)
conflicts=('ffmpeg')
_tag=3949db4d261748a9f34358a388ee255ad1a7f0c0
_svt_hevc_ver='eb24a06ba4ee4948f219a3246b88439a8090bd37'
_svt_vp9_ver='aaa8140c8cdf6c073eaa6aaa5d003d1535fd0059'
source=(
    git+https://git.ffmpeg.org/ffmpeg.git?signed#tag=${_tag}
    "010-ffmpeg-add-svt-hevc-g${_svt_hevc_ver:0:7}.patch"::"https://raw.githubusercontent.com/OpenVisualCloud/SVT-HEVC/${_svt_hevc_ver}/ffmpeg_plugin/master-0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch"
    "030-ffmpeg-add-svt-vp9-g${_svt_vp9_ver:0:7}.patch"::"https://raw.githubusercontent.com/OpenVisualCloud/SVT-VP9/${_svt_vp9_ver}/ffmpeg_plugin/master-0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch"
    "040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch"
    "060-ffmpeg-fix-segfault-with-avisynthplus.patch"
    "LICENSE"
)
sha256sums=(
    'SKIP'
    'e8fdc940474f3819b9a8d30cab8164774584c051322acb6194bcb03d56e8175a'
    'd8b91ea5f07d0208cbe0290567083808708014a1953fda322d13cb619349c9ee'
    '2df82046908015bf26bc1303275cf52ba01fa380029a54ea6415373e389e423c'
    'b1d68f626168f2409a4b0987acf5b208e7ced2ddab49b11990a10f458d377e9a'
    '04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36'
)

validpgpkeys=(
    'DD1EC9E8DE085C629B3E1846B18E8928B3948D64' # Michael Niedermayer <michael@niedermayer.cc>
    'FCF986EA15E6E293A5644F10B4322F04D67658D8'
)

prepare() {
    cd ffmpeg
    rm -f "libavcodec/"libsvt_{hevc,vp9}.c
    patch -Np1 -i "${srcdir}/010-ffmpeg-add-svt-hevc-g${_svt_hevc_ver:0:7}.patch"
    patch -Np1 -i "${srcdir}/030-ffmpeg-add-svt-vp9-g${_svt_vp9_ver:0:7}.patch"
    patch -Np1 -i "${srcdir}/040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch" # https://crbug.com/1251779
    patch -Np1 -i "${srcdir}/060-ffmpeg-fix-segfault-with-avisynthplus.patch"
}

pkgver() {
  cd ffmpeg
  git describe --tags | sed 's/^n//'
}

build() {
  cd ffmpeg
  
  export CC="gcc" # not compiling with clang...
  export CXX="g++" # same as above
  export CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection -Wno-error=restrict"
  export CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
  export LDFLAGS="-Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now"

  ./configure \
    --prefix=/usr \
    --disable-debug \
    --disable-static \
    --disable-stripping \
    --enable-nonfree \
    --enable-amf \
    --enable-avisynth \
    --enable-lto \
    --enable-fontconfig \
    --enable-gmp \
    --enable-gcrypt \
    --enable-gnutls \
    --enable-gpl \
    --enable-ladspa \
    --enable-lcms2 \
    --enable-libaom \
    --enable-libaribb24 \
    --enable-libass \
    --enable-libbluray \
    --enable-libbs2b \
    --enable-libcaca \
    --enable-libcelt \
    --enable-libcdio \
    --enable-libcodec2 \
    --enable-libdav1d \
    --enable-libdavs2 \
    --enable-libdc1394 \
    --enable-libfdk-aac \
    --enable-libglslang \
    --enable-libilbc \
    --enable-libgme \
    --enable-libflite \
    --enable-libdrm \
    --enable-libfreetype \
    --enable-libfribidi \
    --enable-libgsm \
    --enable-libiec61883 \
    --enable-libjack \
    --enable-libmfx \
    --enable-libmp3lame \
    --enable-libopencore_amrnb \
    --enable-libopencore_amrwb \
    --disable-libopencv \
    --enable-libopenh264 \
    --enable-libopenjpeg \
    --enable-libopenmpt \
    --enable-libopus \
    --enable-libpulse \
    --enable-librav1e \
    --enable-librist \
    --enable-librsvg \
    --enable-librubberband \
    --enable-librtmp  \
    --enable-libshine \
    --enable-libsmbclient \
    --enable-libsnappy \
    --enable-libmysofa \
    --enable-libsoxr \
    --enable-libspeex \
    --enable-librabbitmq \
    --enable-libsrt \
    --enable-libssh \
    --enable-libsvtav1 \
    --enable-libsvthevc \
    --enable-libsvtvp9 \
    --disable-libtensorflow \
    --enable-libtesseract \
    --enable-libtheora \
    --disable-libtls \
    --enable-libtwolame \
    --enable-libuavs3d \
    --enable-iconv \
    --enable-libv4l2 \
    --enable-v4l2-m2m \
    --enable-libvidstab \
    --enable-libvmaf \
    --enable-libvo-amrwbenc \
    --enable-libvorbis \
    --enable-libvpx \
    --enable-libwebp \
    --enable-libx264 \
    --enable-libx265 \
    --enable-libxavs \
    --enable-libxavs2 \
    --enable-libxcb \
    --enable-libxml2 \
    --enable-libxcb-shm \
    --enable-libxcb-xfixes \
    --enable-libxcb-shape \
    --enable-libxvid \
    --enable-libzimg \
    --enable-libzmq \
    --enable-libzvbi \
    --enable-openal \
    --enable-opencl \
    --enable-opengl \
    --enable-shared \
    --enable-version3 \
    --enable-vulkan \
    --enable-libjxl \
    --enable-libklvanc \
    --enable-libkvazaar \
    --enable-liblensfun \
    --enable-libmodplug \
    --enable-sdl2 \
    --enable-vapoursynth \
    --enable-libplacebo \
    --enable-lv2 \
    --enable-lzma \
    --disable-decklink \
    --enable-sndio \
    --enable-xlib \
    --enable-libpulse \
    --enable-omx \
    --enable-vdpau \
    --enable-vaapi \
    --disable-cuda-nvcc \
    --disable-cuda-llvm \
    --disable-cuvid \
    --disable-ffnvcodec \
    --disable-libmfx \
    --disable-libnpp \
    --disable-nvdec \
    --disable-nvenc \
    --disable-rkmpp \
    --disable-libopenvino
  make
  make tools/qt-faststart
  make doc/ff{mpeg,play}.1
}

package() {
  make DESTDIR="${pkgdir}" -C ffmpeg install install-man
  install -Dm 755 ffmpeg/tools/qt-faststart "${pkgdir}"/usr/bin/
  install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et: