debian swirl logo

Back to the packages list gtk+3.0

#!/usr/bin/make -f

DEB_BUILDDIR = debian/build
DEB_MAKE_DESTDIRSKEL = $(CURDIR)/debian/install/@FLAVOR@
DEB_MAKE_FLAVORS = shared shared_udeb
DISABLE_UPDATE_UPLOADERS = 1

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_MODULE = gtk+

# Enable parallel build support
DEB_BUILD_PARALLEL = 1

# 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
DEBUG_PKG := $(SHARED_PKG)-dbg
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_DH_INSTALL_ARGS += --sourcedir=debian/install/shared
DEB_DH_INSTALL_ARGS_$(UDEB_PKG) += --sourcedir=debian/install/shared_udeb

DEB_CONFIGURE_EXTRA_FLAGS = \
				--libdir=/$(LIBDIR) \
				--enable-test-print-backend

DEB_CONFIGURE_FLAGS_shared = \
				--enable-broadway-backend \
				--enable-x11-backend \
				--enable-gtk-doc \
				--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

# 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
# Get failing tests' stdout/err so we have some information when a build fails
export VERBOSE= 1

DEB_MAKE_CHECK_TARGET = -k check
DEB_INSTALL_DOCS_ALL = AUTHORS
DEB_INSTALL_DOCS_$(COMMON_PKG) = README NEWS
DEB_INSTALL_DOCS_$(DOC_PKG) += -X.in
DEB_DH_MAKESHLIBS_ARGS_ALL += -X$(MODULES_BASE_PATH)
DEB_DH_MAKESHLIBS_ARGS_$(SHARED_PKG) += -V --add-udeb=$(UDEB_PKG) -- -c4
DEB_DH_MAKESHLIBS_ARGS_libgail-3-0 += -V -- -c4
DEB_DH_FIXPERMS_ARGS_ALL += -X$(LIBDIR)/$(SHARED_PKG)
DEB_DH_STRIP_ARGS = --dbg-package=$(if $(findstring libgail,$(cdbs_curpkg)),libgail-3-0-dbg,$(DEBUG_PKG))
DEB_DH_STRIP_ARGS_$(UDEB_PKG) = 

# macro computing the list of 'debian/.*" 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#@DEBUG_PKG@#$(DEBUG_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 > $@

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))

# So that gsettings can find the (uninstalled) gtk schemas
pre-build::
		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/

# Add dependencies to generate files from the debian/*.in ones
build-indep: $(call dh_subst_files,$(DEB_INDEP_PACKAGES))
build-arch: $(call dh_subst_files,$(DEB_ARCH_PACKAGES))

binary-install/$(SHARED_PKG)::
	# Install the binaries with a -3.0 suffix
		mv debian/$(SHARED_PKG)/$(LIBDIR)/$(SHARED_PKG)/gtk-update-icon-cache \
		    debian/$(SHARED_PKG)/$(LIBDIR)/$(SHARED_PKG)/gtk-update-icon-cache-3.0

binary-install/$(BIN_PKG)::
	# Install the binaries with a -3.0 suffix
		mv debian/$(BIN_PKG)/usr/share/man/man1/gtk-update-icon-cache.1 \
		    debian/$(BIN_PKG)/usr/share/man/man1/gtk-update-icon-cache-3.0.1
		install -m 0755 -D debian/update-icon-caches \
		    debian/$(BIN_PKG)/usr/sbin/update-icon-caches

list-missing:
	# FIXME: remove this when CDBS' list-missing works with multiple flavors
		perl -w debian/dh_listmissing.pl $(foreach f,$(DEB_MAKE_FLAVORS),debian/install/$(f)) 2>&1 | \
		    egrep -v '(\.la|$(LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/[^/]+/[^/]+\.a) has been installed' >&2

Builds:

gir1.2-gtk-3.0
gtk+ graphical user interface library -- gir bindings
gtk-3-examples
example files for gtk+ 3
libgail-3-0-dbg
gail libraries and debugging symbols
libgail-3-0
gnome accessibility implementation library -- shared libraries
libgail-3-dev
gnome accessibility implementation library -- development files
libgail-3-doc
documentation files of the gail library
libgtk-3-0-dbg
gtk+ libraries and debugging symbols
libgtk-3-0
gtk+ graphical user interface library
libgtk-3-0-udeb
gtk+ graphical user interface library - minimal runtime
libgtk-3-bin
programs for the gtk+ graphical user interface library
libgtk-3-common
common files for the gtk+ graphical user interface library
libgtk-3-dev
development files for the gtk+ library
libgtk-3-doc
documentation for the gtk+ graphical user interface library