summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules233
1 files changed, 233 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..e803f94
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,233 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+include /usr/share/dpkg/buildflags.mk
+
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+DEBHELPER_VERSION = $(shell dpkg-query -W -f='$${source:Version}' debhelper)
+
+GTK_VERSIONS = 2.0 3.0
+
+CFLAGS += -Wall -fno-delete-null-pointer-checks
+LDFLAGS += -Wl,--as-needed
+
+COMMON_CONFIGURE_ARGUMENTS = \
+ --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
+ --disable-silent-rules \
+ --host=$(DEB_HOST_GNU_TYPE) \
+ --build=$(DEB_BUILD_GNU_TYPE) \
+ --enable-gtk-doc \
+ --enable-introspection \
+ --enable-geolocation
+
+# Sacrifice speed in order to make it more likely resource limits
+# won't be hit.
+ifeq ($(DEB_HOST_ARCH_BITS),32)
+ LDFLAGS += -Wl,--no-keep-memory
+endif
+
+ifeq ($(DEB_BUILD_ARCH),alpha)
+ LDFLAGS += -Wl,--no-relax
+endif
+
+# The size of the debugging symbols is causing problems
+# in all these arches, so use -g1
+ifneq (,$(filter $(DEB_BUILD_ARCH),i386 hurd-i386 ia64 kfreebsd-i386 kfreebsd-amd64 mips mipsel mips64el powerpc powerpcspe s390 s390x sparc armel armhf hppa arm64))
+ CFLAGS := $(CFLAGS:-g=-g1)
+endif
+
+# disable jit on some architectures (bug #651636)
+ifneq (,$(filter $(DEB_BUILD_ARCH),armel mips mipsel))
+ COMMON_CONFIGURE_ARGUMENTS += --disable-jit
+endif
+
+# See https://bugs.webkit.org/show_bug.cgi?id=113638
+ifeq (,$(filter $(DEB_BUILD_ARCH),i386 amd64 hurd-i386 kfreebsd-i386 kfreebsd-amd64 armel armhf mips mipsel))
+ CPPFLAGS += -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0
+endif
+
+# Disabling GLX on ARM will make it use EGL, which works better.
+ifneq (,$(filter $(DEB_BUILD_ARCH),armel armhf arm64))
+ COMMON_CONFIGURE_ARGUMENTS += --enable-glx=no
+endif
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ COMMON_CONFIGURE_ARGUMENTS += --disable-fast-malloc --disable-optimizations
+endif
+
+ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
+ COMMON_CONFIGURE_ARGUMENTS += --enable-debug
+else
+ CPPFLAGS += -DNDEBUG -DG_DISABLE_CAST_CHECKS
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEARGUMENTS += -j$(NUMJOBS)
+endif
+
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+ DEB_DH_GENCONTROL_ARGS += -- -Vgst:Recommends=""
+else
+ DEB_DH_GENCONTROL_ARGS += -- -Vgst:Recommends="gstreamer1.0-plugins-bad, gstreamer1.0-libav,"
+endif
+
+clean:
+ dh_testdir
+ dh_testroot
+
+ rm -f reconf-stamp build-stamp install-stamp
+ rm -rf build-*
+ rm -rf debian/tmp-*
+ rm -f Source/WebKit/gtk/docs/version.xml
+ find . -name \*.pyc -delete
+
+ dh_autoreconf_clean
+
+ dh_clean
+
+build: build-arch build-indep
+
+build-indep:
+
+build-arch: build-stamp
+
+reconf-stamp:
+ dh_testdir
+ # See https://bugs.webkit.org/show_bug.cgi?id=117334
+ dh_autoreconf autoreconf -- -fiv -I Source/autotools
+ touch reconf-stamp
+
+build-stamp: reconf-stamp
+ dh_testdir
+
+ifeq (3.0,$(filter 3.0,$(GTK_VERSIONS)))
+ test -d build-3.0 || mkdir build-3.0
+ cd build-3.0; \
+ env -u AR_FLAGS \
+ CFLAGS="$(CFLAGS)" \
+ CXXFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" \
+ ../configure --prefix=/usr \
+ --with-gtk=3.0 \
+ $(COMMON_CONFIGURE_ARGUMENTS) \
+ --disable-webkit2
+
+ $(MAKE) $(MAKEARGUMENTS) -C build-3.0
+
+ $(MAKE) -C build-3.0 install DESTDIR="$(CURDIR)"/debian/tmp-3.0
+ ln -s JavaScriptCore-3.0.typelib \
+ debian/tmp-3.0/usr/lib/$(DEB_HOST_MULTIARCH)/girepository-1.0/JSCore-3.0.typelib
+ mv debian/tmp-3.0/usr/bin/jsc-3 debian/tmp-3.0/usr/bin/jsc
+
+ rm -rf build-3.0
+endif
+
+ifeq (2.0,$(filter 2.0,$(GTK_VERSIONS)))
+ test -d build-2.0 || mkdir build-2.0
+ cd build-2.0; \
+ env -u AR_FLAGS \
+ CFLAGS="$(CFLAGS)" \
+ CXXFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" \
+ ../configure --prefix=/usr \
+ --with-gtk=2.0 \
+ $(COMMON_CONFIGURE_ARGUMENTS) \
+ --disable-webkit2
+
+ $(MAKE) $(MAKEARGUMENTS) -C build-2.0
+
+ $(MAKE) -C build-2.0 install DESTDIR="$(CURDIR)"/debian/tmp-2.0
+
+ rm -rf build-2.0
+endif
+
+ touch $@
+
+# Build architecture-independent files here.
+binary-indep: build
+ dh_testdir
+ dh_testroot
+ dh_installdocs -i
+ dh_installchangelogs -i
+ dh_install -plibwebkitgtk-doc
+ dh_link -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i -- -Zxz
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs -a
+ dh_installchangelogs -a
+ifeq (2.0,$(filter 2.0,$(GTK_VERSIONS)))
+ dh_install -plibjavascriptcoregtk-1.0-0 --sourcedir=debian/tmp-2.0
+ dh_install -plibjavascriptcoregtk-1.0-dev --sourcedir=debian/tmp-2.0
+ dh_install -plibjavascriptcoregtk-1.0-0-dbg --sourcedir=debian/tmp-2.0
+ dh_install -plibwebkitgtk-1.0-0 --sourcedir=debian/tmp-2.0
+ dh_install -plibwebkitgtk-dev --sourcedir=debian/tmp-2.0
+ dh_install -plibwebkitgtk-1.0-0-dbg --sourcedir=debian/tmp-2.0
+endif
+ifeq (3.0,$(filter 3.0,$(GTK_VERSIONS)))
+ dh_install -plibjavascriptcoregtk-3.0-0 --sourcedir=debian/tmp-3.0
+ dh_install -plibjavascriptcoregtk-3.0-dev --sourcedir=debian/tmp-3.0
+ dh_install -plibjavascriptcoregtk-3.0-0-dbg --sourcedir=debian/tmp-3.0
+ dh_install -plibjavascriptcoregtk-3.0-bin --sourcedir=debian/tmp-3.0
+ dh_install -pgir1.2-javascriptcoregtk-3.0 --sourcedir=debian/tmp-3.0
+ dh_install -plibwebkitgtk-3.0-0 --sourcedir=debian/tmp-3.0
+ dh_install -plibwebkitgtk-3.0-dev --sourcedir=debian/tmp-3.0
+ dh_install -plibwebkitgtk-3.0-0-dbg --sourcedir=debian/tmp-3.0
+ dh_install -pgir1.2-webkit-3.0 --sourcedir=debian/tmp-3.0
+ dh_installman -plibjavascriptcoregtk-3.0-bin
+endif
+ dh_link -a
+ifeq (2.0,$(filter 2.0,$(GTK_VERSIONS)))
+ if dpkg --compare-versions $(DEBHELPER_VERSION) ge 9.20151219; then \
+ dh_strip -plibjavascriptcoregtk-1.0-0 --ddeb-migration='libjavascriptcoregtk-1.0-0-dbg (<< 2.4.10)' ; \
+ dh_strip -plibwebkitgtk-1.0-0 --ddeb-migration='libwebkitgtk-1.0-0-dbg (<< 2.4.10)' ; \
+ fi
+endif
+ifeq (3.0,$(filter 3.0,$(GTK_VERSIONS)))
+ if dpkg --compare-versions $(DEBHELPER_VERSION) ge 9.20151219; then \
+ dh_strip -plibjavascriptcoregtk-3.0-0 --ddeb-migration='libjavascriptcoregtk-3.0-0-dbg (<< 2.4.10)'; \
+ dh_strip -plibwebkitgtk-3.0-0 --ddeb-migration='libwebkitgtk-3.0-0-dbg (<< 2.4.10)' ; \
+ fi
+endif
+ dh_strip -a
+ dh_compress -a
+ dh_fixperms -a
+ifeq (2.0,$(filter 2.0,$(GTK_VERSIONS)))
+ dh_makeshlibs -plibjavascriptcoregtk-1.0-0 -V 'libjavascriptcoregtk-1.0-0 (>= 1.5.1)' -- -c4
+ dh_makeshlibs -plibwebkitgtk-1.0-0 -V 'libwebkitgtk-1.0-0 (>= 1.3.9)' -- -c4
+endif
+ifeq (3.0,$(filter 3.0,$(GTK_VERSIONS)))
+ dh_makeshlibs -plibjavascriptcoregtk-3.0-0 -V 'libjavascriptcoregtk-3.0-0 (>= 1.5.1)' -- -c4
+ dh_makeshlibs -plibwebkitgtk-3.0-0 -V 'libwebkitgtk-3.0-0 (>= 1.3.9)' -- -c4
+ dh_girepository --package=gir1.2-javascriptcoregtk-3.0
+ dh_girepository --package=gir1.2-webkit-3.0
+endif
+ dh_installdeb -a
+ dh_shlibdeps -a
+ dh_gencontrol -a
+ dh_md5sums -a
+ DEB_BUILD_OPTIONS="$(filter-out parallel=%,$(DEB_BUILD_OPTIONS))" \
+ dh_builddeb -a -- -Zxz
+
+binary: binary-indep binary-arch
+
+.PHONY: build clean install binary binary-indep binary-arch