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
|
#!/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_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
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 debug,$(DEB_BUILD_OPTIONS)))
confflags += --enable-debug
endif
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
confflags += --disable-optimizations --disable-mmx --disable-sse --disable-altivec
endif
# configure flags
confflags += \
CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
CPPFLAGS="$(shell dpkg-buildflags --get CPPFLAGS)" \
CXXFLAGS="$(shell dpkg-buildflags --get CXXFLAGS)" \
LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)" \
--config-cache \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-update-check \
--enable-fast-install \
--prefix=/usr \
--docdir=/usr/share/doc/vlc-nox \
--sysconfdir=/etc \
--with-binary-version=$(DEBIAN_VERSION) \
$(NULL)
# configure features
confflags += \
--enable-a52 \
--enable-aa \
--enable-bluray \
--enable-bonjour \
--enable-caca \
--enable-dbus \
--enable-dca \
--enable-dirac \
--enable-directfb \
--enable-dvbpsi \
--enable-dvdnav \
--enable-faad \
--enable-flac \
--enable-fluidsynth \
--enable-freetype \
--enable-fribidi \
--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-mpc \
--enable-mtp \
--enable-mux_ogg \
--enable-ncurses \
--enable-notify \
--enable-ogg \
--enable-oss \
--enable-pulse \
--enable-qt4 \
--enable-realrtsp \
--enable-samplerate \
--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-x264 \
--enable-zvbi \
--with-kde-solid=/usr/share/kde4/apps/solid/actions/ \
$(NULL)
# Reasons for disabling features:
# dxva2 -> Windows only
# gnomevfs -> poorly maintained
# goom -> not in Debian
# portaudio -> not needed
# projectm -> broken
# sqlite -> still in development
# telx -> incompatible with zvbi
confflags += \
--disable-dxva2 \
--disable-gnomevfs \
--disable-goom \
--disable-portaudio \
--disable-projectm \
--disable-sqlite \
--disable-telx \
$(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)
confflags += \
--enable-alsa \
--enable-atmo \
--enable-dc1394 \
--enable-dv \
--enable-fbosd \
--enable-libva \
--enable-linsys \
--enable-omxil \
--enable-pvr \
--enable-udev \
$(NULL)
else
confflags += \
--disable-alsa \
--disable-atmo \
--disable-dc1394 \
--disable-dv \
--disable-fbosd \
--disable-libva \
--disable-linsys \
--disable-omxil \
--disable-pvr \
--disable-udev \
$(NULL)
removeplugins += \
alsa \
libatmo \
libdc1394 \
libdtv \
libaccess_dv \
libfb \
libfbosd \
libomxil \
linsys \
libpvr \
libudev \
$(NULL)
endif
# Linux and kFreeBSD specific flags
ifneq ($(filter $(DEB_HOST_ARCH_OS),linux kfreebsd),)
confflags += --enable-v4l2
else
confflags += --disable-v4l2
removeplugins += libv4l2
endif
# Linux amd64 and i386 specific flags
ifneq ($(filter $(DEB_HOST_ARCH),amd64 i386),)
confflags += --enable-crystalhd
else
confflags += --disable-crystalhd
removeplugins += libcrystalhd
endif
# amd64 and i386 specific optimizations
ifneq ($(filter $(DEB_HOST_ARCH_CPU),amd64 i386),)
confflags += --enable-mmx --enable-sse
else
confflags += --disable-mmx --disable-sse
removeplugins += 3dn mmx mmxext sse2
endif
# ARM specific optimizations
ifneq ($(filter $(DEB_HOST_ARCH_CPU),armhf),)
confflags += --enable-neon
else
confflags += --disable-neon
removeplugins += neon
endif
# PowerPC specific optimizations
ifneq ($(filter $(DEB_HOST_ARCH_CPU),powerpc),)
confflags += --enable-altivec
else
confflags += --disable-altivec
removeplugins += altivec
endif
%:
dh $@ --parallel --with autoreconf
override_dh_autoreconf:
dh_autoreconf --as-needed
override_dh_auto_clean:
[ ! -f debian/vlc-nox.install.bak ] || mv -f debian/vlc-nox.install.bak debian/vlc-nox.install
rm -rf tmp/
dh_auto_clean
override_dh_auto_configure:
# 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
$(MAKE) -C lib libvlc.la
mkdir -p tmp
cp src/.libs/libvlccore.a tmp/libvlccore.a
cp lib/.libs/libvlc.a tmp/libvlc.a
dh_auto_configure -- $(confflags)
override_dh_auto_test:
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
override_dh_install:
# Remove disabled plugins
test -f debian/vlc-nox.install.bak || cp debian/vlc-nox.install debian/vlc-nox.install.bak
sed -i "/\($(shell echo $(removeplugins) | sed 's/ /\\|/g')\)_/d" debian/vlc-nox.install
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' -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
# Install stuff
dh_install --fail-missing
# move .hosts
if test -d debian/vlc-data; then \
mkdir -p debian/vlc-data/etc/vlc/lua/http/dialogs && \
mv debian/vlc-data/usr/share/vlc/lua/http/dialogs/.hosts debian/vlc-data/etc/vlc/lua/http/dialogs && \
ln -s /etc/vlc/lua/http/dialogs/.hosts debian/vlc-data/usr/share/vlc/lua/http/dialogs/.hosts && \
mv debian/vlc-data/usr/share/vlc/lua/http/.hosts debian/vlc-data/etc/vlc/lua/http && \
ln -s /etc/vlc/lua/http/.hosts debian/vlc-data/usr/share/vlc/lua/http/.hosts; \
fi
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
$(if $(shell dpkg-vendor --is Ubuntu && echo true),dh_install -pvlc-nox debian/source_vlc.py usr/share/apport/package-hooks/)
dh_buildinfo -p vlc-nox
override_dh_strip:
dh_strip --dbg-package=vlc-dbg
override_dh_installdocs:
dh_installdocs -p vlc-data
dh_installdocs -p vlc-nox
override_dh_installchangelogs:
dh_installchangelogs ChangeLog -p vlc-data
dh_installchangelogs ChangeLog -p vlc-nox
override_dh_builddeb:
dh_builddeb -- -Zxz
|