Repository navigation
Expand file tree
/
Copy pathrules
More file actions
executable file
·63 lines (51 loc) · 2.46 KB
/
Copy pathrules
File metadata and controls
executable file
·63 lines (51 loc) · 2.46 KB
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
#!/usr/bin/make -f
export CTEST_OUTPUT_ON_FAILURE=ON
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_TARGET_ARCH ?= $(shell dpkg-architecture -qDEB_TARGET_ARCH)
DEB_TARGET_GNU_CPU ?= $(shell dpkg-architecture -qDEB_TARGET_GNU_CPU)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
VERSION_CODENAME ?= $(shell sh -c 'codename=$$(grep "^VERSION_CODENAME=" /etc/os-release 2>/dev/null | head -n1 | cut -d= -f2 | tr -d "\""); if [ -n "$$codename" ]; then echo "$$codename"; else echo unknown; fi')
CMAKE_EXTRA_FLAGS = -Denable_testing=ON
RUN_TESTS = no
# python3-goby3 is Architecture: all, so like the documentation it is built on the native amd64
# build only. Pinned off elsewhere rather than left to autodetection, which would otherwise
# install files into the staging tree that no binary package claims on those builds.
PYTHON_CMAKE_FLAGS = -Dbuild_python=OFF
ifneq ($(DEB_BUILD_ARCH),$(DEB_TARGET_ARCH))
# cross compiling
CMAKE_EXTRA_FLAGS += -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$(DEB_TARGET_GNU_CPU)
export CC=$(DEB_HOST_GNU_TYPE)-gcc
export CXX=$(DEB_HOST_GNU_TYPE)-g++
else
# only run unit tests and build documentation on x86_64
ifeq ($(shell (dpkg-architecture -qDEB_BUILD_ARCH | egrep -q "amd64") && echo "yes"),yes)
CMAKE_EXTRA_FLAGS += -Dbuild_doc=ON
RUN_TESTS = yes
# dist-packages rather than the interpreter's own purelib: on Debian and derivatives that is
# the versioned /usr/local path, which is not where a packaged pure Python module belongs
PYTHON_CMAKE_FLAGS = -Dbuild_python=ON -DGOBY_PYTHON_INSTALL_DIR=/usr/lib/python3/dist-packages
endif
endif
CMAKE_EXTRA_FLAGS += $(PYTHON_CMAKE_FLAGS)
$(info $$DEB_BUILD_ARCH is [${DEB_BUILD_ARCH}])
$(info $$DEB_TARGET_ARCH is [${DEB_TARGET_ARCH}])
$(info $$CMAKE_EXTRA_FLAGS is [${CMAKE_EXTRA_FLAGS}])
%:
dh $@ --with python3
override_dh_auto_configure:
dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
override_dh_auto_test:
ifeq ($(RUN_TESTS),yes)
LD_LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib dh_auto_test
endif
override_dh_shlibdeps:
dh_shlibdeps -l$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib -pgoby3-clang-tool -- --ignore-missing-info
dh_shlibdeps -l$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib --remaining-packages
override_dh_dwz:
ifeq ($(VERSION_CODENAME),noble)
# Ubuntu noble 24.04 dwz fails on goby_clang_tool with:
# "Unknown debugging section .debug_addr"
@echo "Skipping dh_dwz on Ubuntu noble due to dwz .debug_addr handling issue"
else
dh_dwz -a
endif