summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 625b0500137b152748e9862b6f3dcecd7a16be06 (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:
# Contributor: Oliver Braunschweig <olt78 at web dot de>
# Contributor: Andrew Crerar <crerar@archlinux.org>

: ${_use_sodeps:=false}

_pkgname="vlc"
pkgbase="vlc-git"
pkgname=(
  "vlc-git"
  "vlc-plugin-lua-git"
)
pkgver=4.0.0.r34890.gdf46fce
pkgrel=1
pkgdesc="Multi-platform MPEG, VCD/DVD, and DivX player"
url="https://github.com/videolan/vlc"
license=('GPL-2.0-or-later' 'LGPL-2.1-or-later')
arch=('i686' 'x86_64')

depends=(
  'aribb24'
  'chromaprint'
  'faad2'
  'ffmpeg'
  'fontconfig'
  'freetype2'
  'fribidi'
  'gnutls'
  'harfbuzz'
  'libarchive'
  'libdvbpsi'
  'libebur128'
  'libidn'
  'libmad'
  'libmatroska'
  'libmpcdec'
  'libplacebo'
  'libsecret'
  'libupnp'
  'libxinerama'
  'libxml2'
  'libxpm'
  'qt6-base'
  'qt6-declarative'
  'rnnoise'
  'taglib'
  'xcb-util-keysyms'
)
makedepends=(
  'ffnvcodec-headers'
  'git'
  'lua'
  'meson'
  'qt6-shadertools'
  'qt6-tools'
  'vulkan-headers'
  'wayland-protocols'
)
optdepends=(
  'kwallet: kwallet keystore' # via D-Bus
  'libva-intel-driver: video backend intel'
  'libva-vdpau-driver: vdpau backend nvidia'
)

_optdeps=(
  'aom: AOM AV1 codec'
  'aribb25: aribcam support'
  'avahi: service discovery using bonjour protocol'
  'dav1d: dav1d AV1 decoder'
  'flac: Free Lossless Audio Codec plugin'
  'fluidsynth: FluidSynth based MIDI playback plugin'
  'gst-plugins-base-libs: for libgst plugins'
  'gtk3: notification plugin'
  'jack: jack audio server'
  'kwindowsystem: kwin background blur effect'
  'libass: Subtitle support'
  'libavc1394: devices using the 1394ta AV/C'
  'libbluray: Blu-Ray video input'
  'libcaca: colored ASCII art video output'
  'libdc1394: IEEE 1394 access plugin'
  'libdvdnav: DVD with navigation input module'
  'libdvdread: DVD input module'
  'libgme: Game Music Emu plugin'
  'libgoom2: Goom visualization'
  'libjpeg-turbo: JPEG support'
  'libkate: Kate codec'
  'libmicrodns: mDNS services discovery (chromecast etc)'
  'libmodplug: MOD output plugin'
  'libmtp: MTP devices discovery'
  'libnfs: NFS access'
  'libnotify: notification plugin'
  'libogg: Ogg and OggSpots codec'
  'libpng: PNG support'
  'libpulse: PulseAudio audio output'
  'librsvg: SVG plugin'
  'libsamplerate: audio Resampler'
  'libshout: shoutcast/icecast output plugin'
  'libsoxr: SoX audio Resampler'
  'libssh2: sftp access'
  'libtheora: theora codec'
  'libtiger: Tiger rendering for Kate streams'
  'libvorbis: Vorbis decoder/encoder'
  'libvpx: VP8 and VP9 codec'
  'libxkbcommon: X11 XCB support'
  'lirc: lirc control'
  'live-media: streaming over RTSP'
  'mpg123: mpg123 codec'
  'opus: opus codec'
  'pcsclite: aribcam support'
  'projectm: ProjectM visualisation'
  'protobuf: chromecast streaming'
  'smbclient: SMB access plugin'
  'speex: Speex codec'
  'srt: SRT input/output plugin'
  'systemd-libs: udev services discovery'
  'twolame: TwoLAME mpeg2 encoder plugin'
  'zvbi: VBI/Teletext/webcam/v4l2 capture/decoding'
)

for i in "${_optdeps[@]}"; do
  makedepends+=("${i%%:*}")
  optdepends+=("$i")
done

options=('!emptydirs' '!lto')

_pkgsrc="$_pkgname.github"
source=(
  "$_pkgsrc"::"git+$url.git"
  'update-vlc-plugin-cache.hook'
)
sha256sums=(
  'SKIP'
  'b98043683dd90d3f5a3f501212dfc629839b661100de5ac79fd30cb7b4a06f13'
)

prepare() {
  cd "$_pkgsrc"
  ./bootstrap
  autoreconf -vf

  sed -e 's:truetype/ttf-dejavu:TTF:g' -i modules/visualization/projectm.cpp
  sed -e 's|-Werror-implicit-function-declaration||g' \
    -e 's|whoami|echo builduser|g' \
    -e 's|hostname -f|echo arch|g' \
    -i configure

  # fix for ffmpeg 8
  sed -E -e 's|\bFF_PROFILE_|AV_PROFILE_|g' -i modules/codec/avcodec/encoder.c modules/codec/avcodec/vaapi.c
  sed -E -e 's|\bFF_MIN_BUFFER_SIZE\b|16384|' -i modules/codec/avcodec/avcommon_compat.h
}

pkgver() {
  cd "$_pkgsrc"
  printf "%s.r%s.g%s" "$(grep 'AC_INIT' configure.ac | sed 's/[^0-9\.]*//g')" "$(git describe --tags --long | cut -d '-' -f 3)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  export CFLAGS+=" -I/usr/include/samba-4.0 -ffat-lto-objects"
  export CPPFLAGS+=" -I/usr/include/samba-4.0"
  export CXXFLAGS="${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS/} -std=c++17"

  export RCC=/usr/lib/qt6/rcc
  export QMAKE=/usr/bin/qmake6
  export QTPATHS6="/usr/lib/qt6/bin/qtpaths6"

  # gawk -v RS="### config-options ###\n" 'NR==2{print}' PKGBUILD | sort -t'-' -k'4' | xclip -sel clip
  local _config_opts=(
    --prefix=/usr
    --sysconfdir=/etc
    --libexecdir=/usr/lib
    --with-kde-solid=/usr/share/solid/actions/

    --disable-rpath
    --disable-sse
    --disable-avx

    ### config-options ###
    --enable-alsa
    --enable-aribb25
    --enable-aom
    --enable-archive
    --enable-aribsub
    --enable-avahi
    --enable-avcodec
    --enable-avformat
    --enable-bluray
    --enable-caca
    --enable-chromaprint
    --enable-chromecast
    --enable-dav1d
    --enable-dc1394
    --disable-decklink
    --enable-dv1394
    --enable-dvbpsi
    --enable-dvdnav
    --enable-dvdread
    --enable-ebur128
    --enable-faad
    --disable-fdkaac
    --enable-flac
    --enable-fluidsynth
    --enable-fontconfig
    --enable-freetype
    --enable-fribidi
    --enable-gme
    --enable-gnutls
    --enable-goom
    --enable-gst-decode
    --enable-harfbuzz
    --enable-jack
    --enable-jpeg
    --enable-kate
    --enable-kwallet
    --enable-libass
    --disable-libgcrypt
    --enable-libplacebo
    --enable-libva
    --enable-libxml2
    --enable-lirc
    --enable-live555
    --enable-mad
    --enable-matroska
    --enable-microdns
    --enable-mod
    --enable-mpc
    --enable-mpg123
    --enable-mtp
    --enable-ncurses
    --enable-nfs
    --enable-nls
    --enable-notify
    --enable-ogg
    --enable-oggspots
    --disable-opencv
    --enable-opus
    --enable-png
    --enable-postproc
    --enable-projectm
    --enable-pulse
    --enable-qt
    --enable-qtdeclarative
    --enable-qtshadertools
    --enable-qtsvg
    --enable-qtwayland
    --disable-rist
    --enable-samplerate
    --disable-schroedinger
    --enable-secret
    --enable-sftp
    --enable-shout
    --enable-skins2
    --enable-smbclient
    --enable-soxr
    --enable-speex
    --enable-srt
    --enable-svg
    --enable-svgdec
    --enable-taglib
    --enable-tiger
    --enable-twolame
    --disable-update-check
    --enable-upnp
    --enable-vcd
    --enable-vdpau
    --enable-vlc
    --enable-vorbis
    --enable-vpx
    --enable-wayland
    --enable-x264
    --enable-x265
    --enable-zvbi
    ### config-options ###
  )

  cd "$_pkgsrc"
  ./configure "${_config_opts[@]}"

  # prevent excessive overlinking due to libtool
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
  make DESTDIR="$srcdir/fakeinstall" install

  cd "$srcdir"
  local _filelist=(
    usr/lib/vlc/lua
    usr/lib/vlc/plugins/lua
    usr/share/doc/vlc/lua
    usr/share/vlc/lua
  )
  local i
  for i in "${_filelist[@]}"; do
    mkdir -p "fakeinstall_lua/$i"
    mv "fakeinstall/$i"/* "fakeinstall_lua/$i/"
  done
}

package_vlc-git() {
  pkgdesc+=" (monolithic)"

  if [[ "${_use_sodeps::1}" == "t" ]]; then
    eval "depends+=(
      'libavcodec.so'  # ffmpeg
      'libavformat.so' # ffmpeg
      'libavutil.so'   # ffmpeg
      'libswscale.so'  # ffmpeg
      'libtiger.so'    # ffmpeg
      'libvpx.so'      # libvpx
      'libx264.so'     # x264
    )"
  fi

  provides=(
    'libvlc.so'
    'libvlccore.so'
    "vlc=${pkgver%.g*}"
    "libvlc=${pkgver%.g*}"
    vlc-cli
    vlc-gui-{ncurses,qt,skins2}
    vlc-plugin-{a52dec,aalib,alsa,aom,archive,aribb24,aribb25,ass,avahi,bluray,caca,cddb,chromecast,dav1d,dbus,dbus-screensaver,dca,dvb,dvd,faad2,ffmpeg,firewire,flac,fluidsynth,freetype,gme,gnutls,gstreamer,inflate,jack,journal,jpeg,kate,kwallet,libsecret,lirc,live555,mad,matroska,mdns,modplug,mpeg2,mpg123,mtp,musepack,nfs,notify,ogg,opus,png,pulse,quicksync,samplerate,sdl,sftp,shout,smb,soxr,speex,srt,svg,tag,theora,twolame,udev,upnp,vorbis,vpx,x264,x265,xml,zvbi}
    vlc-plugins-{all,base,extra,video-output,visualization}
  )
  conflicts=(
    vlc
    libvlc
    vlc-cli
    vlc-gui-{ncurses,qt,skins2}
    vlc-plugin-{a52dec,aalib,alsa,aom,archive,aribb24,aribb25,ass,avahi,bluray,caca,cddb,chromecast,dav1d,dbus,dbus-screensaver,dca,dvb,dvd,faad2,ffmpeg,firewire,flac,fluidsynth,freetype,gme,gnutls,gstreamer,inflate,jack,journal,jpeg,kate,kwallet,libsecret,lirc,live555,mad,matroska,mdns,modplug,mpeg2,mpg123,mtp,musepack,nfs,notify,ogg,opus,png,pulse,quicksync,samplerate,sdl,sftp,shout,smb,soxr,speex,srt,svg,tag,theora,twolame,udev,upnp,vorbis,vpx,x264,x265,xml,zvbi}
    vlc-plugins-{all,base,extra,video-output,visualization}
  )

  mv fakeinstall/* "$pkgdir/"

  install -Dm644 "$_pkgsrc/share/icons/256x256/vlc.png" -t "$pkgdir/usr/share/pixmaps/"
  install -Dm644 "$srcdir/update-vlc-plugin-cache.hook" -t "$pkgdir/usr/share/libalpm/hooks/"
}

package_vlc-plugin-lua-git() {
  pkgdesc+=" - Lua scripting plugins"

  depends=(
    libvlc libvlccore.so
    lua
  )
  optdepends=(
    'lua-socket: for http interface'
  )

  provides=("vlc-plugin-lua")
  conflicts=("vlc-plugin-lua")

  mv fakeinstall_lua/* "$pkgdir/"
}