# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT # The build function is executed in the source directory # This function is used to compile the source code build() { BUILDCC=gcc ./configure --prefix=/usr \ --sysconfdir=/etc \ --disable-chromaprint \ --disable-fdkaac \ --disable-libgcrypt \ --disable-libplacebo \ --disable-opencv \ --disable-rpath \ --disable-schroedinger \ --disable-update-check \ --enable-aa \ --enable-alsa \ --enable-aom \ --enable-archive \ --enable-aribsub \ --enable-avahi \ --enable-avcodec \ --enable-avformat \ --enable-chromecast \ --enable-dav1d \ --enable-flac \ --enable-fontconfig \ --enable-freetype \ --enable-fribidi \ --enable-gnutls \ --enable-gst-decode \ --enable-harfbuzz \ --enable-jack \ --enable-jpeg \ --enable-kwallet \ --enable-libass \ --enable-libva \ --enable-libxml2 \ --enable-mad \ --enable-mpc \ --enable-mpg123 \ --enable-mtp \ --enable-ncurses \ --enable-nfs \ --enable-nls \ --enable-notify \ --enable-ogg \ --enable-oggspots \ --enable-opus \ --enable-png \ --enable-postproc \ --enable-pulse \ --enable-qt \ --enable-samplerate \ --enable-sdl-image \ --enable-secret \ --enable-sftp \ --enable-skins2 \ --enable-speex \ --enable-svg \ --enable-svgdec \ --enable-taglib \ --enable-vcd \ --enable-vdpau \ --enable-vlc \ --enable-vorbis \ --enable-vpx \ --enable-x264 \ --enable-x265 \ # prevent excessive overlinking due to libtool sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } _pick() { local p="$1" f d; shift for f; do [ -d "$BPM_WORKDIR"/output_"$p" ] || { echo "Split package $p not found"; exit 1; } d="$BPM_WORKDIR"/output_"$p"/"${f#$BPM_OUTPUT}" mkdir -p "$(dirname "$d")" mv "$f" "$d" rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" done } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package_vlc() { make DESTDIR="$BPM_OUTPUT" install cd "$BPM_OUTPUT" # Move library files into split package _pick libvlc usr/include _pick libvlc usr/lib/libvlc* _pick libvlc usr/lib/pkgconfig _pick libvlc usr/lib/vlc/vlc-cache-gen # Move plugins into split package _pick vlc-plugins usr/lib/vlc/plugins _pick vlc-plugins usr/lib/vlc/lua # Install package license install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/vlc } package_libvlc() { # Install BPM hook install -Dm644 "$BPM_WORKDIR"/update-vlc-plugin-cache.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/update-vlc-plugin-cache.bpmhook # Create empty plugin cache install -d "$BPM_OUTPUT"/usr/lib/vlc/plugins touch "$BPM_OUTPUT"/usr/lib/vlc/plugins/plugins.dat # Install package license install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/vlc } package_vlc-plugins() { # Install package license install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/vlc }