Files
gtk3/debian/rules
Emilio Pozuelo Monfort 221416afd2 reorder some targets
didn't do it earlier to keep the diff cleaner, but this makes more sense as
it's closer to the order dh runs them
2017-09-11 16:14:03 +00:00

201 lines
6.6 KiB
Makefile

#!/usr/bin/make -f
GNOME_MODULE = gtk+
DISABLE_UPDATE_UPLOADERS = 1
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
# Ensure the build aborts when there are still references to undefined symbols
# currently fails at least in the im-multipress im module
#LDFLAGS += -Wl,-z,defs
# Make the linker work a bit harder so dynamic loading can be done faster
LDFLAGS += -Wl,-O1
APIVER := 3
SONAME := 0
LIBDIR := usr/lib/$(DEB_HOST_MULTIARCH)
# earliest version that this release has backwards binary compatibility for
GTK_BINARY_VERSION := 3.0.0
# Gtk binary version virtual Provide
GTK_BINVER_DEP := gtk$(APIVER)-binver-$(GTK_BINARY_VERSION)
# relative base directory for configuration
CONFDIR := etc/gtk-3.0
# relative base directory for all types of modules
MODULES_BASE_PATH := $(LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)
OLD_MODULES_BASE_PATH := usr/lib/gtk-3.0/$(GTK_BINARY_VERSION)
# package names
SHARED_PKG := libgtk-$(APIVER)-$(SONAME)
COMMON_PKG := libgtk-$(APIVER)-common
DEV_PKG := libgtk-$(APIVER)-dev
UDEB_PKG := $(SHARED_PKG)-udeb
DOC_PKG := libgtk-$(APIVER)-doc
BIN_PKG := libgtk-$(APIVER)-bin
EXAMPLES_PKG := gtk-$(APIVER)-examples
# files larger than 4k in size will be compressed by dh_compress
# so append a .gz suffix to avoid dangling symlinks
NEWS := NEWS$(shell find -maxdepth 1 -size +4k -name NEWS -exec echo ".gz" \;)
README := README$(shell find -maxdepth 1 -size +4k -name README -exec echo ".gz" \;)
DEB_CONFIGURE_EXTRA_FLAGS = \
--libdir=/$(LIBDIR) \
--enable-test-print-backend
DEB_CONFIGURE_FLAGS_shared = \
--enable-broadway-backend \
--enable-x11-backend \
--enable-gtk-doc \
--enable-man \
--enable-shared \
--enable-introspection \
--enable-cloudprint \
--disable-static
ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
DEB_CONFIGURE_FLAGS_shared += --enable-colord
else
DEB_CONFIGURE_FLAGS_shared += --disable-colord
endif
ifeq (linux,$(DEB_HOST_ARCH_OS))
DEB_CONFIGURE_FLAGS_shared += --enable-wayland-backend
else
DEB_CONFIGURE_FLAGS_shared += --disable-wayland-backend
endif
DEB_CONFIGURE_FLAGS_shared_udeb = \
--disable-broadway-backend \
--disable-wayland-backend \
--enable-x11-backend \
--disable-introspection \
--disable-cloudprint \
--disable-colord \
--disable-xcomposite \
--disable-xdamage \
--disable-xfixes \
--disable-xrandr
%:
dh $@ --with gir
override_dh_autoreconf:
dh_autoreconf "NOCONFIGURE=true ./autogen.sh"
override_dh_auto_configure: debian/control
dh_auto_configure \
--builddirectory=debian/build/deb \
-- \
$(DEB_CONFIGURE_EXTRA_FLAGS) \
$(DEB_CONFIGURE_FLAGS_shared) \
$(NULL)
dh_auto_configure \
--builddirectory=debian/build/udeb \
-- \
$(DEB_CONFIGURE_EXTRA_FLAGS) \
$(DEB_CONFIGURE_FLAGS_shared_udeb) \
$(NULL)
override_dh_auto_build:
# Mark reftests with known failures as non-fatal
touch testsuite/reftests/nonresizable-size.ui.known_fail
touch testsuite/reftests/window-show-contents-on-map.ui.known_fail
touch testsuite/reftests/inherit-and-initial.ui.known_fail
touch testsuite/reftests/textview-margins.ui.known_fail
# So that gsettings can find the (uninstalled) gtk schemas
mkdir -p debian/build/glib-2.0/schemas/
cp gtk/org.gtk.* debian/build/glib-2.0/schemas/
glib-compile-schemas debian/build/glib-2.0/schemas/
dh_auto_build --builddirectory=debian/build/deb
dh_auto_build --builddirectory=debian/build/udeb
override_dh_auto_test:
# Remove LD_PRELOAD so we don't run with fakeroot, which makes dbus-related tests fail
env -u LD_PRELOAD dh_auto_test --builddirectory=debian/build/deb -- -k check -j1
override_dh_auto_install:
dh_auto_install --builddirectory=debian/build/udeb --destdir=debian/install/udeb
dh_auto_install --builddirectory=debian/build/deb --destdir=debian/install/deb
override_dh_install:
dh_install -p$(UDEB_PKG) --sourcedir=debian/install/udeb
dh_install --remaining-packages --sourcedir=debian/install/deb
override_dh_missing:
dh_missing --sourcedir=debian/install/udeb --list-missing -X.la
dh_missing --sourcedir=debian/install/deb --list-missing -X.la
override_dh_installdocs:
dh_installdocs -p$(COMMON_PKG) AUTHORS README NEWS
dh_installdocs -p$(DOC_PKG) AUTHORS -X.in
dh_installdocs --remaining-packages -A AUTHORS
override_dh_makeshlibs:
dh_makeshlibs -p$(SHARED_PKG) -V --add-udeb=$(UDEB_PKG) -X$(MODULES_BASE_PATH) -- -c4
dh_makeshlibs -plibgail-3-0 -V -- -c4
dh_makeshlibs --remaining-packages -X$(MODULES_BASE_PATH)
# Avoid test failures on buildd environments
export HOME=$(CURDIR)/debian/build
export XDG_RUNTIME_DIR=$(HOME)
# So that gsettings can find the (uninstalled) gtk schemas
export XDG_DATA_DIRS=/usr/share:$(CURDIR)/debian/build
# Put these back to their defaults if we are not running with a clean
# environment, so that they are based on the temporary $HOME above
unexport XDG_CACHE_HOME
unexport XDG_CONFIG_DIRS
unexport XDG_CONFIG_HOME
unexport XDG_DATA_HOME
# Get failing tests' stdout/err so we have some information when a build fails
export VERBOSE=1
# macro computing the list of 'debian/<pkg>.*" files which have a
# corresponding ".in" file; pass the list of packages in $(1)
dh_subst_files = $(patsubst %.in,%,$(wildcard $(addprefix debian/, $(addsuffix *.in, $(1)))))
debian/%: debian/%.in
dh_testdir
sed \
-e "s#@SONAME@#$(SONAME)#g" \
-e "s#@APIVER@#$(APIVER)#g" \
-e "s#@VERSION@#$(DEB_UPSTREAM_VERSION)#g" \
-e "s#@GTK_BINVER_DEP@#$(GTK_BINVER_DEP)#g" \
-e "s#@SHARED_PKG@#$(SHARED_PKG)#g" \
-e "s#@COMMON_PKG@#$(COMMON_PKG)#g" \
-e "s#@DEV_PKG@#$(DEV_PKG)#g" \
-e "s#@UDEB_PKG@#$(UDEB_PKG)#g" \
-e "s#@DOC_PKG@#$(DOC_PKG)#g" \
-e "s#@BIN_PKG@#$(BIN_PKG)#g" \
-e "s#@EXAMPLES_PKG@#$(EXAMPLES_PKG)#g" \
-e "s#@GNOME_TEAM@#$(UPLOADERS)#g" \
-e "s#@GTK_BINARY_VERSION@#$(GTK_BINARY_VERSION)#g" \
-e "s#@LIBDIR@#$(LIBDIR)#g" \
-e 's#@CONFDIR@#$(CONFDIR)#g' \
-e "s#@MODULES_BASE_PATH@#$(MODULES_BASE_PATH)#g" \
-e "s#@OLD_MODULES_BASE_PATH@#$(OLD_MODULES_BASE_PATH)#g" \
-e "s#@NEWS@#$(NEWS)#g" \
-e "s#@README@#$(README)#g" \
$@.in > $@
override_dh_clean: debian/control
# gross kludge to force control generation with the %.in target
touch debian/control.in
rm -f $(call dh_subst_files,$(DEB_ALL_PACKAGES))
rm -f testsuite/reftests/*.ui.known_fail
rm -rf debian/build debian/install
dh_clean
DEB_INDEP_PACKAGES = $(shell dh_listpackages -i)
DEB_ARCH_PACKAGES = $(shell dh_listpackages -a)
DEB_ALL_PACKAGES = $(shell dh_listpackages)
# Add dependencies to generate files from the debian/*.in ones
override_dh_auto_build-indep: $(call dh_subst_files,$(DEB_INDEP_PACKAGES))
override_dh_auto_build-arch: $(call dh_subst_files,$(DEB_ARCH_PACKAGES))
override_dh_auto_build: $(call dh_subst_files,$(DEB_ALL_PACKAGES))