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
|
#!/usr/bin/make -f
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
VERSION = $(shell dpkg-parsechangelog|sed -n 's/^Version: //p')
DEBIAN_VERSION = $(shell echo $(VERSION)|sed -nr 's/[^:]+://; s/.*-([^-]+$$)/\1/p')
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
confflags := --build=$(DEB_BUILD_GNU_TYPE)
else
confflags := --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
endif
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
confflags += --disable-optimizations --disable-mmx --disable-sse --disable-altivec
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
else
# on i386 and amd64, we query the system unless overriden by DEB_BUILD_OPTIONS
ifneq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
NUMJOBS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
MAKEFLAGS += -j$(NUMJOBS)
endif
endif
LDFLAGS = -Wl,--as-needed
# configure flags
confflags += \
--config-cache \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-update-check \
--enable-fast-install \
--prefix=/usr \
--sysconfdir=/etc \
--with-binary-version=$(DEBIAN_VERSION) \
$(NULL)
# configure features
confflags += \
--enable-a52 \
--enable-aa \
--enable-bonjour \
--enable-caca \
--enable-dca \
--enable-dirac \
--enable-dvb \
--enable-dvbpsi \
--enable-dvdnav \
--enable-faad \
--enable-flac \
--enable-fluidsynth \
--enable-freetype \
--enable-fribidi \
--enable-ggi \
--enable-gnutls \
--enable-jack \
--enable-kate \
--enable-libass \
--enable-libmpeg2 \
--enable-libproxy \
--enable-libxml2 \
--enable-lirc \
--enable-live555 \
--enable-mad \
--enable-mkv \
--enable-mod \
--enable-mozilla \
--enable-mpc \
--enable-mtp \
--enable-mux_ogg \
--enable-ncurses \
--enable-notify \
--enable-ogg \
--enable-pulse \
--enable-qt4 \
--enable-realrtsp \
--enable-schroedinger \
--enable-sdl \
--enable-shout \
--enable-skins2 \
--enable-smb \
--enable-speex \
--enable-svg \
--enable-taglib \
--enable-theora \
--enable-twolame \
--enable-upnp \
--enable-vcd \
--enable-vcdx \
--enable-vorbis \
--enable-zvbi \
--with-kde-solid=/usr/share/kde4/apps/ \
--with-mozilla-pkg=libxul \
$(NULL)
# Reasons for disabling features:
# dxva2 -> Windows only
# gnomevfs -> poorly maintained
# goom -> not in Debian
# libva -> needs a vaapi enabled avcodec
# osso_screensaver -> not targetting maemo
# portaudio -> not needed
# projectm -> broken
# sqlite -> still in development
# telx -> incompatible with zvbi
# x264 -> not in Debian
confflags += \
--disable-dxva2 \
--disable-gnomevfs \
--disable-goom \
--disable-libva \
--disable-osso_screensaver \
--disable-portaudio \
--disable-projectm \
--disable-sqlite \
--disable-telx \
--disable-x264 \
$(NULL)
# Linux specific flags
ifeq ($(DEB_HOST_ARCH_OS),linux)
confflags += \
--enable-alsa \
--enable-atmo \
--enable-dc1394 \
--enable-dv \
--enable-pvr \
--enable-udev \
--enable-v4l \
--enable-v4l2 \
$(NULL)
endif
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
confflags += \
--disable-alsa \
$(NULL)
endif
# svgalib is only for x86 and x86-64 on Linux
ifneq ($(filter $(DEB_HOST_ARCH), amd64 i386),)
confflags += --enable-svgalib
endif
build: build-stamp
build-stamp:
dh_testdir
# We need to build the static library apart
# Else it's a mess when we build the modules
./configure --enable-static $(confflags)
$(MAKE) -C compat
$(MAKE) -C src libvlccore.la libvlc.la
mkdir -p tmp
cp src/.libs/libvlccore.a tmp/libvlccore.a
cp src/.libs/libvlc.a tmp/libvlc.a
./configure $(confflags)
$(MAKE)
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
# Check which plugins were built and whether they load properly.
@if test $$( id -u ) -eq 0 ; then \
echo "Not runing the test as you are compiling as root"; \
echo "Use 'dpkg-buildpackage -rfakeroot' rather than 'fakeroot dpkg-buildpackage'"; \
else \
command="./vlc -vvv --ignore-config --no-plugins-cache --list --no-color"; \
echo "$${command}"; $${command} ; \
fi
endif
endif
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
[ ! -f debian/vlc-nox.install.bak ] || mv -f debian/vlc-nox.install.bak \
debian/vlc-nox.install
rm -f debian/vlc-nox.install.kfreebsd
rm -f debian/vlc-nox.install.hurd
# Clean VLC
[ ! -f Makefile ] || $(MAKE) distclean
rm -rf tmp/
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add the optimization dirs only if present
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/
cp debian/vlc-nox.install debian/vlc-nox.install.bak
for dir in sse2 3dnow altivec arm_neon mmx mmxext ; do \
if test -d debian/tmp/usr/lib/vlc/plugins/$${dir}; then \
echo usr/lib/vlc/plugins/$${dir} >> debian/vlc-nox.install ; \
fi ; \
done
# Remove some modules on non-linux arch
sed -e '/\(lib\|libaccess_\)\(alsa\|atmo\|dc1394\|dv\|dvb\|fb\|v4l\|v4l2\|pvr\|udev\)_/d' \
debian/vlc-nox.install > debian/vlc-nox.install.kfreebsd
sed -e '/\(lib\|libaccess_\)\(probe_hal\)_/d' \
debian/vlc-nox.install.kfreebsd > debian/vlc-nox.install.hurd
cp tmp/libvlc.a debian/tmp/usr/lib
cp tmp/libvlccore.a debian/tmp/usr/lib
# Clean up libtool crap
find debian/tmp -name '*.la' -exec rm '{}' ';'
# Remove useless stuff
ln -sf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSans.ttf
ln -sf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSansBold.ttf
rm -f debian/tmp/usr/share/man/man1/vlc-config.1
# Install stuff
dh_install -si --fail-missing
# move .hosts
mkdir -p debian/vlc-data/etc/vlc/http
mv debian/vlc-data/usr/share/vlc/http/.hosts debian/vlc-data/etc/vlc/http
ln -s /etc/vlc/http/.hosts debian/vlc-data/usr/share/vlc/http/.hosts
mkdir -p debian/vlc-data/etc/vlc/lua/http
mv debian/vlc-data/usr/share/vlc/lua/http/.hosts debian/vlc-data/etc/vlc/lua/http
ln -s /etc/vlc/http/.hosts debian/vlc-data/usr/share/vlc/lua/http/.hosts
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
# Check that we did not install a plugin linked with libX11 or
# libxcb in vlc-nox
BORKED=no; \
for file in $$(find debian/vlc-nox/usr/lib/vlc -name '*.so'); do \
if objdump -x $$file | egrep -q -e '^ +NEEDED +libX11\.so' \
-e '^ +NEEDED +libxcb\.so'; then \
BORKED=yes; \
echo $$file depends on libX11 or libxcb; \
fi; \
done; \
if test "$$BORKED" = yes; then exit 1; fi
endif
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_link -i
dh_installdocs -p vlc-data
dh_installchangelogs ChangeLog -p vlc-data
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs -p vlc
dh_installdocs -p vlc-nox
dh_link -s
dh_buildinfo -p vlc-nox
dh_installmenu -s
dh_installmime -s
dh_installman -s
dh_installchangelogs ChangeLog -p vlc
dh_installchangelogs ChangeLog -p vlc-nox
dh_lintian
dh_bugfiles
dh_strip -s --dbg-package=vlc-dbg
dh_compress -s
dh_fixperms -s
dh_makeshlibs -plibvlc5
dh_makeshlibs -plibvlccore4
dh_installdeb -s
dh_shlibdeps -s -ldebian/libvlc5/usr/lib:debian/libvlccore4/usr/lib
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-indep binary-arch
.PHONY: build clean install binary-indep binary-arch binary
|