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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
built_binaries := $(shell dh_listpackages)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4
export GIR_SONAME = 1
export GIR_API_VERSION = 1.0
export GIR_FORMAT = 1.2
POD_MANPAGES := debian/dh_girepository.1
$(POD_MANPAGES): %.1: %
pod2man -c "gobject-introspection" -r "$(DEB_VERSION)" $< $@
RST_MANPAGES := debian/g-ir-inspect.1
$(RST_MANPAGES): %.1: %.rst
rst2man $< $@
MANPAGES := $(POD_MANPAGES) $(RST_MANPAGES)
%:
dh $@ --builddir=_build
debian/extra-substvars:
dpkg-architecture -c debian/extra-substvars.py > debian/extra-substvars
debian/libgirepository-1.0-1.symbols: debian/libgirepository-1.0-1.symbols.in debian/extra-substvars
set -e; \
libffiN=$$(sed -ne 's/^local:libffiN=//p' debian/extra-substvars); \
sed -e "s/@libffiN@/$$libffiN/" < $< > $@
override_dh_clean:
dh_clean -Xorg.gtk.test.gschema.xml.orig -Xorg.gtk.test.gschema.override.orig
configure_options = \
-Dgir_dir_prefix=lib/${DEB_HOST_MULTIARCH} \
-Dcairo=enabled \
-Ddoctool=enabled \
-Dpython=python3 \
$(NULL)
ifeq ($(filter %-doc,$(built_binaries)),)
configure_options += -Dgtk_doc=false
else
configure_options += -Dgtk_doc=true
endif
ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
configure_options += --cross-file=$(CURDIR)/debian/meson-cross-for-build.ini
# This is a bit weird: gobject-introspection uses the build architecture
# gobject-introspection to build typelibs for the host architecture.
# That should maybe be fixed upstream, but for now force use of our
# appropriate $(DEB_HOST_GNU_TYPE)-g-ir-scanner and -compiler, which
# in turn will use the appropriate host gcc.
configure_options += --native-file=$(CURDIR)/debian/meson-cross-for-build.ini
configure_options += -Dgi_cross_binary_wrapper=$(DEB_HOST_GNU_TYPE)-cross-exe-wrapper
configure_options += -Dgi_cross_ldd_wrapper=$(CURDIR)/debian/deb-elf-get-needed-for-build
configure_options += -Dgi_cross_use_prebuilt_gi=true
endif
ifeq ($(filter gir1.2-%,$(built_binaries)),)
configure_options += -Dbuild_introspection_data=false
endif
override_dh_auto_configure:
dh_auto_configure -- $(configure_options)
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
execute_before_dh_auto_build: $(MANPAGES)
endif
execute_before_dh_auto_build: debian/cross-tools/deb-can-run-$(DEB_HOST_ARCH)
debian/cross-tools/deb-can-run-$(DEB_HOST_ARCH):
mkdir -p debian/cross-tools
$(DEB_HOST_GNU_TYPE)-gcc $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o$@ debian/can-run.c
execute_before_dh_auto_build: debian/deb-elf-get-needed
debian/deb-elf-get-needed:
$(DEB_HOST_GNU_TYPE)-gcc $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o$@ debian/elf-get-needed.c -lelf
execute_before_dh_auto_build: debian/deb-elf-get-needed-for-build
debian/deb-elf-get-needed-for-build:
$(DEB_BUILD_GNU_TYPE)-gcc \
$(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
-o$@ debian/elf-get-needed.c -lelf
execute_before_dh_auto_configure: debian/$(DEB_HOST_GNU_TYPE)-gobject-introspection.ini
debian/$(DEB_HOST_GNU_TYPE)-gobject-introspection.ini: debian/meson-cross-g-i.ini.in debian/rules
sed \
-e '/^exe_wrapper *=/d' \
-e 's|@DEB_HOST_GNU_TYPE@|$(DEB_HOST_GNU_TYPE)|' \
-e 's|@bindir@|/usr/bin|' \
< $< > $@.tmp
mv $@.tmp $@
execute_before_dh_auto_configure: debian/meson-cross-for-build.ini
debian/meson-cross-for-build.ini: debian/meson-cross-g-i.ini.in debian/rules
sed \
-e 's|@DEB_HOST_GNU_TYPE@|$(DEB_HOST_GNU_TYPE)|' \
-e 's|@bindir@|/usr/bin|' \
< $< > $@.tmp
mv $@.tmp $@
execute_before_dh_auto_configure: cross-tools emulated-cross-tools
cross_tools = \
g-ir-annotation-tool \
g-ir-doc-tool \
g-ir-scanner \
$(NULL)
emulated_cross_tools = \
g-ir-compiler \
g-ir-generate \
g-ir-inspect \
$(NULL)
cross-tools: debian/cross-g-ir-tool.in debian/rules
mkdir -p debian/cross-tools
set -e; for tool in $(cross_tools); do \
sed \
-e 's|@CAN_RUN@|/usr/lib/$(DEB_HOST_MULTIARCH)/gobject-introspection/deb-can-run-$(DEB_HOST_ARCH)|' \
-e 's|@DEB_HOST_ARCH@|$(DEB_HOST_ARCH)|' \
-e 's|@DEB_HOST_GNU_TYPE@|$(DEB_HOST_GNU_TYPE)|' \
-e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|' \
-e 's|@GET_NEEDED@|/usr/libexec/gobject-introspection-bin/deb-elf-get-needed|' \
-e 's|@TOOL@|'"$$tool"'|' \
-e 's|@TOOL_PATH@|/usr/bin/'"$$tool"'|' \
< $< > debian/cross-tool.tmp; \
chmod 0755 debian/cross-tool.tmp; \
mv debian/cross-tool.tmp debian/cross-tools/$(DEB_HOST_GNU_TYPE)-$$tool; \
done
emulated-cross-tools: debian/emulated-g-ir-tool.in debian/rules
mkdir -p debian/cross-tools
set -e; for tool in $(emulated_cross_tools); do \
sed \
-e 's|@CAN_RUN@|/usr/lib/$(DEB_HOST_MULTIARCH)/gobject-introspection/deb-can-run-$(DEB_HOST_ARCH)|' \
-e 's|@DEB_HOST_ARCH@|$(DEB_HOST_ARCH)|' \
-e 's|@DEB_HOST_GNU_TYPE@|$(DEB_HOST_GNU_TYPE)|' \
-e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|' \
-e 's|@TOOL@|'"$$tool"'|' \
-e 's|@TOOL_PATH@|/usr/lib/$(DEB_HOST_MULTIARCH)/gobject-introspection/'"$$tool"'|' \
< $< > debian/cross-tool.tmp; \
chmod 0755 debian/cross-tool.tmp; \
mv debian/cross-tool.tmp debian/cross-tools/$(DEB_HOST_GNU_TYPE)-$$tool; \
done
execute_after_dh_auto_install:
sed -i \
-e 's|^girdir=\(.*\)|girdir=$${datadir}/gir-1.0|' \
-e 's|^g_ir_\(.*\)=\(.*\)/g-ir-\(.*\)$$|g_ir_\1=$${bindir}/${DEB_HOST_GNU_TYPE}-g-ir-\3|' \
debian/tmp/usr/lib/*/pkgconfig/*.pc
execute_before_dh_makeshlibs: debian/libgirepository-1.0-1.symbols
ifneq ($(filter gir1.2-%,$(built_binaries)),)
execute_after_dh_shlibdeps:
@echo 'blhc: ignore-line-regexp: .*\s-o\s+debian/\S+/girepository-1\.0/.*\.typelib\.so\s.*'
perl -w debian/dh_girepository -v -Nlibgirepository1.0-dev
endif
execute_before_dh_python3:
dh_python3 /usr/lib/$(DEB_HOST_MULTIARCH)/gobject-introspection/giscanner/
override_dh_gencontrol: debian/extra-substvars
dh_gencontrol -- -Tdebian/extra-substvars
override_dh_installdocs:
dh_installdocs -pgobject-introspection-bin --doc-main-package=gobject-introspection
dh_installdocs --remaining-packages
override_dh_installexamples:
dh_installexamples -pgobject-introspection-bin --doc-main-package=gobject-introspection
dh_installexamples --remaining-packages
|