#! /usr/bin/make -f # from official debian package: testing welcome! ifeq ($(DEB_HOST_ARCH_CPU),$(filter $(DEB_HOST_ARCH_CPU),powerpc sparc)) export CC=gcc-4.8 # fixes #73363 endif ifeq ($(DEB_HOST_ARCH_CPU),arm) export CC=$(shell which gcc-4.8 || which gcc-4.7;) endif # To enable parallel building: # You can either set DEB_BUILD_OPTIONS=paralell= in your build environment # or provide the -j option to debuild or dpkg-buildpackage, which # ammounts to the same thing. ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) # use MFLAGS, rather than MAKEFLAGS as the latter is used by make internally MFLAGS += -j$(NUMJOBS) WAFFLAGS += -j$(NUMJOBS) endif # make .PHONY all the targets that have name collisions with the scripts # see http://www.debian.org/doc/manuals/maint-guide/dreq.en.html#rules .PHONY: clean build install # Apparently, the above isn't enough because of the "%" target. Make the problematic targets explicit clean: exec dh $@ build: exec dh $@ install: exec dh $@ # Handle all other targets in the usual way. # The --parallel flag to dh doesn't seem to have the intended effect # so leave it out. %: exec dh $@ # the dependencies must be built before mpv is configured ffmpeg_config: scripts/ffmpeg-config \ --enable-gnutls \ --enable-libgsm \ --enable-libmp3lame \ --enable-libopenjpeg \ --enable-libpulse \ --enable-libschroedinger \ --enable-libspeex \ --enable-libtheora \ --enable-libtwolame \ --enable-libvorbis \ --enable-libvpx \ --enable-libwavpack \ --enable-gpl --enable-libxvid --enable-libx264 \ --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc # --enable-libopus ffmpeg_build: ffmpeg_config scripts/ffmpeg-build $(MFLAGS) libass_config: scripts/libass-config libass_build: libass_config scripts/libass-build $(MFLAGS) # put the config in the right place and drop the local/ since it's package managed now override_dh_auto_configure: ffmpeg_build libass_build scripts/mpv-config --prefix=/usr --confdir=/etc/mpv override_dh_auto_build: scripts/mpv-build $(WAFLAGS) DOCSOURCE=mpv/DOCS TOOLSSOURCE=mpv/TOOLS DOCDEST=debian/mpv/usr/share/doc/mpv TOOLSDEST=$(DOCDEST)/TOOLS # call waf to install to the debian packageing dir override_dh_auto_install: cd mpv && python waf -v install --destdir=../debian/mpv find "$(DOCSOURCE)" -mindepth 1 -type d \ -not -regex '.*man.*' \ -not -regex '.*client_api_examples.*' \ -printf "%P\0" | \ xargs -0i /usr/bin/install -d "$(DOCDEST)/{}" find "$(DOCSOURCE)" -mindepth 1 -type f -not -regex '.*manu.*' \ -not -regex '.*man.*' \ -not -regex '.*client_api_examples.*' \ -not -name 'tech-overview.txt' \ -not -name 'waf-buildsystem.rst' \ -not -name 'crosscompile-mingw.md' \ -not -name 'coding-style.md' \ -printf "%P\0" | \ xargs -0i /usr/bin/install -m644 "$(DOCSOURCE)/{}" "$(DOCDEST)/{}" find "$(TOOLSSOURCE)" -mindepth 1 -type d \ -not -regex '.*osxbundle.*' \ -printf "%P\0" | \ xargs -0i /usr/bin/install -d "$(TOOLSDEST)/{}" find "$(TOOLSSOURCE)" -mindepth 1 -type f \ -not -regex '.*osxbundle.*' \ -not -name 'gen-x11-icon.sh' \ -not -name 'file2string.pl' \ -not -name 'uncrustify.cfg' \ -printf "%P\0" | \ xargs -0i /usr/bin/install -m644 "$(TOOLSSOURCE)/{}" "$(TOOLSDEST)/{}" # for manually installed dependencies override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info # call all the cleans override_dh_auto_clean: ./clean