#!/usr/bin/make -f DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed DEB_BUILD_MAINT_OPTIONS=hardening=+all include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/vendor.mk # custom build option: debug # VLC enables assertions if --enable-debug is passed to the configure script. To debug issues, it # might be useful to have them enabled. In that case, rebuilding the package with # DEB_BUILD_OPTIONS=debug produces a build with the assertions enabled. ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS))) confflags += --enable-debug else confflags += --disable-debug endif # configure flags confflags += \ --config-cache \ --disable-update-check \ --enable-fast-install \ --docdir=/usr/share/doc/vlc \ --with-binary-version=$(DEB_VERSION) \ $(NULL) # configure features confflags += \ --enable-a52 \ --enable-aa \ --enable-aom \ --enable-aribsub \ --enable-avahi \ --enable-bluray \ --enable-caca \ --enable-chromaprint \ --enable-chromecast \ --enable-dbus \ --enable-dca \ --enable-dvbpsi \ --enable-dvdnav \ --enable-faad \ --enable-flac \ --enable-fluidsynth \ --enable-freetype \ --enable-fribidi \ --enable-gles2 \ --enable-gnutls \ --enable-harfbuzz \ --enable-jack \ --enable-kate \ --enable-libass \ --enable-libmpeg2 \ --enable-libxml2 \ --enable-lirc \ --enable-live555 \ --enable-mad \ --enable-matroska \ --enable-mod \ --enable-mpc \ --enable-mpg123 \ --enable-mtp \ --enable-ncurses \ --enable-notify \ --enable-ogg \ --enable-opus \ --enable-pulse \ --enable-qt \ --enable-realrtsp \ --enable-samplerate \ --enable-sdl-image \ --enable-sftp \ --enable-shine \ --enable-shout \ --enable-skins2 \ --enable-sndio \ --enable-soxr \ --enable-spatialaudio \ --enable-speex \ --enable-svg \ --enable-svgdec \ --enable-taglib \ --enable-theora \ --enable-twolame \ --enable-upnp \ --enable-vdpau \ --enable-vnc \ --enable-vorbis \ --enable-x264 \ --enable-x265 \ --enable-zvbi \ --with-kde-solid=/usr/share/solid/actions/ \ $(NULL) # Reasons for disabling features: # d3d11va: Windows only # decklink: not in Debian # directx: Windows only # dsm: not in Debian # dxva2: Windows only # fdkaac: in Debian contrib # fluidlite: fluidsynth is enabled # freerdp: scheduled for removal (#888323) # goom: not in Debian # gst-decode: not needed when having libavcodec # libtar: security issue (#737534) # macosx*: MacOX only # microdns: functionality already provided by avahi # mfx: currently not supported on Linux # opencv: developer plugin not required by end users # projectm: broken # schroedinger: removed from Debian (#845037) # sparkle: MacOS X only # srt: not in Debian # telx: incompatible with zvbi # vpx: not needed when having libavcodec # vsxu: not in Debian # wasapi: Windows only confflags += \ --disable-d3d11va \ --disable-decklink \ --disable-directx \ --disable-dsm \ --disable-dxva2 \ --disable-fdkaac \ --disable-fluidlite \ --disable-freerdp \ --disable-goom \ --disable-gst-decode \ --disable-libtar \ --disable-macosx \ --disable-macosx-avfoundation \ --disable-macosx-qtkit \ --disable-microdns \ --disable-mfx \ --disable-opencv \ --disable-projectm \ --disable-schroedinger \ --disable-sparkle \ --disable-srt \ --disable-telx \ --disable-vpx \ --disable-vsxu \ --disable-wasapi \ $(NULL) # Linux specific flags ifeq ($(DEB_HOST_ARCH_OS),linux) # omxil should be enabled on all systems, but libomxil-bellagio does # not build on kfreebsd and hurd (currently). # V4L2 is disabled on kFreeBSD due to a build failure. confflags += \ --enable-alsa \ --enable-dc1394 \ --enable-dv1394 \ --enable-libplacebo \ --enable-linsys \ --enable-nfs \ --enable-omxil \ --enable-udev \ --enable-v4l2 \ --enable-wayland \ $(NULL) else confflags += \ --disable-alsa \ --disable-dc1394 \ --disable-dv1394 \ --disable-libplacebo \ --disable-linsys \ --disable-nfs \ --disable-omxil \ --disable-udev \ --disable-v4l2 \ --disable-wayland \ $(NULL) removeplugins += \ alsa \ dc1394 \ dtv \ dv1394 \ dvb \ fb \ linsys \ nfs \ omxil \ systemd \ udev \ v4l2 \ wayland \ $(NULL) endif # Linux and kFreeBSD specific flags (disabled on Hurd) ifeq (,$(filter-out linux kfreebsd,$(DEB_HOST_ARCH_OS))) confflags += \ --enable-libva \ --enable-vcd \ --enable-smbclient \ $(NULL) else confflags += \ --disable-libva \ --disable-vcd \ --disable-smbclient \ $(NULL) removeplugins += \ cdda \ libva \ smbclient \ vcd \ $(NULL) endif # kFreeBSD specific flags ifeq (,$(filter-out kfreebsd,$(DEB_HOST_ARCH_OS))) confflags += --enable-oss else # Note: Use PulseAudio/ALSA on Linux instead of OSS. confflags += --disable-oss removeplugins += oss endif # Linux amd64 and i386 specific flags ifeq (,$(filter-out amd64 i386,$(DEB_HOST_ARCH))) confflags += --enable-crystalhd else confflags += --disable-crystalhd removeplugins += crystalhd endif ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) confflags += \ --disable-optimizations \ --disable-mmx \ --disable-sse \ --disable-altivec \ --disable-neon \ $(NULL) removeplugins += mmx sse2 altivec neon else # amd64 and i386 specific optimizations ifeq (,$(filter-out amd64 i386,$(DEB_HOST_ARCH_CPU))) confflags += --enable-mmx --enable-sse else confflags += --disable-mmx --disable-sse removeplugins += mmx sse2 endif # ARM specific optimizations ifeq (,$(filter-out armhf,$(DEB_HOST_ARCH_CPU))) confflags += --enable-neon else confflags += --disable-neon removeplugins += neon endif # PowerPC specific optimizations (excluding powerpcspe) ifeq (,$(filter-out powerpc,$(DEB_HOST_ARCH_CPU))$(filter powerpcspe,$(DEB_HOST_ARCH))) confflags += --enable-altivec else confflags += --disable-altivec removeplugins += altivec endif # PowerPCSPE specific optimizations ifeq (,$(filter-out powerpcspe,$(DEB_HOST_ARCH))) DEB_CFLAGS_MAINT_APPEND += -mtune=8548 DEB_CXXFLAGS_MAINT_APPEND += -mtune=8548 endif endif export DEB_BUILD_MAINT_OPTIONS export DEB_CFLAGS_MAINT_APPEND export DEB_CXXFLAGS_MAINT_APPEND export DEB_LDFLAGS_MAINT_APPEND export removeplugins %: dh $@ override_dh_autoreconf: dh_autoreconf --as-needed override_dh_auto_configure: dh_auto_configure -- $(confflags) override_dh_auto_build: dh_auto_build ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) # Build zsh completion BUILDDIR=$(CURDIR) \ cd extras/analyser && ./zsh_completion.sh endif override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) ./vlc -vvv --ignore-config --no-plugins-cache --list --no-color endif endif override_dh_install: # Remove plugin cache find debian/tmp/usr/lib -name plugins.dat -delete # Clean up libtool la files find debian/tmp -name '*.la' -delete # Remove useless stuff ln -sf /usr/share/fonts/truetype/freefont/FreeSans.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSans.ttf ln -sf /usr/share/fonts/truetype/freefont/FreeMonoBold.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSansBold.ttf rm -f debian/tmp/usr/share/man/man1/vlc-config.1 # Remove additional license files find debian/tmp -name LICENSE -delete # Remove examples installed in -dev packages rm -rf debian/tmp/usr/share/doc/vlc/libvlc # Install dh_install ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) # Install zsh completion dh_install -pvlc-bin extras/analyser/_vlc usr/share/zsh/vendor-completions endif ifeq (Ubuntu,$(DEB_VENDOR)) dh_install -pvlc-bin debian/source_vlc.py usr/share/apport/package-hooks/ endif # Create empty directory for plugins.dat mkdir -p debian/libvlc-bin/usr/lib/${DEB_HOST_MULTIARCH}/vlc/plugins override_dh_missing: dh_missing --fail-missing override_dh_installchangelogs: dh_installchangelogs NEWS override_dh_makeshlibs: dh_makeshlibs -Xlibvlc_vdpau -Xlibvlc_pulse -Xlibvlc_xcb_events debian/shlibs.local: echo "libvlc 5 libvlc5 (>= $(DEB_VERSION_UPSTREAM))" > debian/shlibs.local echo "libvlccore 9 libvlccore9 (>= $(DEB_VERSION_UPSTREAM))" >> debian/shlibs.local override_dh_shlibdeps: debian/shlibs.local dh_shlibdeps override_dh_bugfiles: dh_bugfiles -A override_dh_installdeb-arch: sed 's/#DEB_HOST_MULTIARCH#/${DEB_HOST_MULTIARCH}/g' \ debian/libvlc-bin.postinst.in > debian/libvlc-bin.postinst sed 's/#DEB_HOST_MULTIARCH#/${DEB_HOST_MULTIARCH}/g' \ debian/libvlc-bin.prerm.in > debian/libvlc-bin.prerm echo 'interest-noawait /usr/lib/${DEB_HOST_MULTIARCH}/vlc/plugins' > debian/libvlc-bin.triggers dh_installdeb -a override_dh_gencontrol-arch: sed -n 's/^# define MODULE_SYMBOL \([0-9][_0-9a-z]*\)/-Vvlc:PluginABI=vlc-plugin-abi-\1/p' \ include/vlc_plugin.h | tr _ - | xargs dh_gencontrol -a --