File: rules

package info (click to toggle)
xtensor 0.24.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,236 kB
  • sloc: cpp: 59,967; makefile: 210; python: 170; javascript: 8
file content (87 lines) | stat: -rwxr-xr-x 2,877 bytes parent folder | download
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  BUILD_OPTIONS += -DBUILD_TESTS=ON
else
  BUILD_OPTIONS += -DBUILD_TESTS=OFF
endif

# libxsimd-dev is available on some arches such as arm64, i386, m68k,
# but is buggy (arm64 does not have any field named ‘simd_complex_batch_bool’)
# or no xsimd instructions are actually available which can cause problems.
# So explicitly switch xsimd support off except for arches where it is known to work reliably.
XSIMD_ARCH_LIST := amd64 kfreebsd
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(XSIMD_ARCH_LIST)$(space)))
  BUILD_OPTIONS += -DXTENSOR_USE_XSIMD=ON
else
  BUILD_OPTIONS += -DXTENSOR_USE_XSIMD=OFF
endif

# try to avoid exhausting virtual memory on small-memory arches
SMALL_MEM_ARCH_LIST := armel mipsel hurd-i386
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(SMALL_MEM_ARCH_LIST)$(space)))
  export DEB_CXXFLAGS_MAINT_APPEND = -Os -g0
endif

# test_xnpy fails on some architectures, see Bug#985699,
# https://github.com/xtensor-stack/xtensor/issues/2328
# Other tests pass, so let these arches proceed without test_xnpy.
BAD_TEST_XNPY_ARCH_LIST := s390x hppa powerpc ppc64 sparc64
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(BAD_TEST_XNPY_ARCH_LIST)$(space)))
  BUILD_OPTIONS += -DBUILD_TEST_XNPY=OFF
endif

# -march=native on mipsel generates code that triggers "relocation truncated" errors
# That can be worked around using the -mxgot flag,
# but better to just switch off -march=native
# (allow it on other arches in order to test the typical user experience)
ifneq (,$(findstring $(DEB_HOST_ARCH),mipsel))
  BUILD_OPTIONS += -Darch_native_supported=OFF
endif

# mark i386 as having flakey tests (xreducer.average)
FLAKEY_TEST_ARCH_LIST := i386
ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(FLAKEY_TEST_ARCH_LIST)$(space)))
  export DEB_CXXFLAGS_MAINT_APPEND = -DMARK_FLAKEY_TEST
endif


%:
	dh $@ --with sphinxdoc

override_dh_auto_clean-indep:
	dh_auto_clean
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C docs clean
endif
	rm -rf docs/build docs/html

override_dh_auto_configure:
	dh_auto_configure -- $(BUILD_OPTIONS)

override_dh_auto_build-indep: export http_proxy=127.0.0.1:9
override_dh_auto_build-indep: export https_proxy=127.0.0.1:9
override_dh_auto_build-indep:
	dh_auto_build
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C docs html
endif

override_dh_auto_build-arch:
	dh_auto_build -a $(DH_AUTO_BUILD_OPTIONS)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	CTEST_OUTPUT_ON_FAILURE=1 dh_auto_test -- xtest
endif

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

get-orig-source:
	uscan --download-current-version --force-download --no-symlink