File: rules

package info (click to toggle)
octave 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 123,280 kB
  • sloc: cpp: 315,443; ansic: 59,071; fortran: 20,979; objc: 8,034; sh: 7,603; yacc: 4,299; lex: 3,886; perl: 1,519; java: 1,309; awk: 1,257; makefile: 424; xml: 103
file content (111 lines) | stat: -rwxr-xr-x 4,481 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Configure default Java paths using javahelper except on some archs.
# We require at least OpenJDK 9 (otherwise JAVA_LIBDIR below will not work)
# The following arches do not have OpenJDK 9: hppa, hurd-*, kfreebsd-*, riscv64
# The following arches have crashes with Java
# - as of OpenJDK 9: armel
# - as of OpenJDK 10: mipsel, powerpc
# This arch list must be kept in sync with the arch list qualifying
# default-jre in debian/control.
# The arch list qualifying default-jdk in the Build-Depends should be a subset
# of $(NO_JDK_ARCHS) (it’s the archs that really do not have a JDK, see also
# #947959).
include /usr/share/dpkg/architecture.mk
NO_JDK_ARCHS := armel hppa hurd-i386 kfreebsd-amd64 kfreebsd-i386 mipsel powerpc riscv64
ifneq (,$(filter $(DEB_HOST_ARCH),$(NO_JDK_ARCHS)))
WITH_JAVA_FLAGS := --disable-java
else
JAVA_HOME := /usr/lib/jvm/default-java
JAVA_LIBDIR := $(shell if test -d $(JAVA_HOME)/lib/client; then echo $(JAVA_HOME)/lib/client; else echo $(JAVA_HOME)/lib/server; fi)
WITH_JAVA_FLAGS := --with-java-homedir=$(JAVA_HOME) --with-java-libdir=$(JAVA_LIBDIR)
endif

# Disable the experimental JIT unconditionally for now. The LLVM library
# interface is unstable. Linking with LLVM may also cause conflicts with other
# libraries, for example the mesa graphics stack which also uses LLVM.
JIT_FLAG := --disable-jit

# Needed to force the serial version of HDF5 even if other flavours are
# installed.
ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  HDF5_FLAGS := --with-hdf5-includedir=/usr/include/hdf5/serial \
	--with-hdf5-libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
endif

# Support the nodoc flag of DEB_BUILD_OPTIONS
ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
override_dh_auto_configure:
DOC_FLAG := --disable-docs
endif

# On mipsel, disable debugging symbols. Otherwise, it FTBFS because the
# assembler hits the virtual space memory limit of 2Gb. See e.g.
# https://buildd.debian.org/status/fetch.php?pkg=octave&arch=mipsel&ver=5.1.0-2&stamp=1569871716
# See also this thread:
# https://lists.debian.org/debian-devel/2019/08/msg00171.html
ifeq ($(DEB_HOST_ARCH),mipsel)
export DEB_CXXFLAGS_MAINT_STRIP := -g
endif

# Get the current API version
API_VERSION = $(shell grep ^OCTAVE_API_VERSION= configure.ac | sed -e 's/OCTAVE_API_VERSION="api-v\(.*\)"/\1/')

%:
	dh $@

override_dh_auto_configure:
	# Enforce generic BLAS (in order to avoid tying the binary to OpenBLAS or ATLAS)
	# Also pass OpenMP flag (#631831)
	# Pass the install directory of fonts-freefont-otf package
	dh_auto_configure -- \
		--with-blas=blas --enable-openmp \
		--with-system-freefont=/usr/share/fonts/opentype/freefont \
		$(WITH_JAVA_FLAGS) $(JIT_FLAG) $(HDF5_FLAGS) $(DOC_FLAG)

ifneq (,$(filter $(DEB_HOST_ARCH),$(NO_JDK_ARCHS)))
override_dh_auto_build-indep:
	# We can not build octave.jar, and hence octave-common, on these
	false
endif

# dh_auto_test tries to run "make test", so override it
override_dh_auto_test:
	make check
	# Run builtin-features to ensure important features are included
	env OCTAVE=./run-octave debian/tests/builtin-features

# override normal dh_compress call to avoid compressing .pdf files
override_dh_compress:
	dh_compress --exclude=.pdf

execute_after_dh_auto_install:
	# Delete .la files (for liboctgui)
	find debian/tmp -name '*.la' -delete

# The info files have references to .png images, so also ship those.
# Note that we do not install all doc/interpreter/*.png, since some are not referenced
# when compiling the output info (using @ifnotinfo macro).
# We used to rename them by prefixing their name with "octave-", but this was breaking some
# info files (see #816534).
execute_after_dh_installinfo-indep:
	for f in `grep -a src=\".*\" doc/interpreter/*.info* | sed 's/.*src="\([^"]*\)".*/\1/'`; do \
		cp doc/interpreter/$$f debian/octave-doc/usr/share/info/; \
	done

# Strip the executable bit from the .oct files
# Cannot be done in dh_fixperms, as then dh_strip and dh_shlibdeps don't take the
# .oct files into account
execute_after_dh_shlibdeps:
	find debian/octave -name '*.oct' -exec chmod 644 '{}' ';'

# Avoid useless call of ldconfig in the triggers script of the octave
# package
override_dh_makeshlibs:
	dh_makeshlibs --package=octave --noscripts
	dh_makeshlibs --no-package=octave

# Make liboctaveN provide the virtual package octave-abi-MM
override_dh_gencontrol:
	dh_gencontrol -- -Voctave-abi:Provides=octave-abi-$(API_VERSION)