File: rules

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (322 lines) | stat: -rwxr-xr-x 11,806 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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#!/usr/bin/make -f
# -*- makefile-gmake -*-
#
# import for DEB_HOST_MULTIARCH
include /usr/share/dpkg/architecture.mk

# In anticipation of a future version of r-cran.mk
origRsubdir=r/
debRreposname=cran
cranNameOrig=arrow
cranName=arrow
#include /usr/share/dh-r/r-cran.mk
ifeq ($(builttimeStamp),)
  builttime       := $(shell dpkg-parsechangelog -l$(CURDIR)/debian/changelog | awk -F': ' '/Date/ {print $$2}')
  builttimeStamp  := "--built-timestamp=\"$(builttime)\""
endif


SOVERSION=2300


export DH_VERBOSE=1
export DH_OPTIONS

export DEB_BUILD_MAINT_OPTIONS=reproducible=-timeless hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_CPPFLAGS_MAINT_APPEND  = -D_FORTIFY_SOURCE=2
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,now

# For CMAKE output not to hide executed commands
export VERBOSE=1

BUILD_TYPE=release
PYBUILD_NAME=pyarrow
#PYBUILD_SYSTEM=cmake
PYBUILD_CONFIGURE_ARGS= \
 -DArrowAcero_DIR=$(CURDIR)/cpp_build/src/arrow/acero \
 -DParquet_DIR=$(CURDIR)/cpp_build/src/parquet/ \
 -DCMAKE_INSTALL_INCLUDEDIR=$(CURDIR)/debian/tmp/libarrow-dev/usr/include

#PYBUILD_CONFIGURE_ARGS=-DCMAKE_INSTALL_INCLUDEDIR=$(CURDIR)/debian/tmp/libarrow-dev/usr/include
# Skipping cython tests because it builds modules and needs to
# find an arrow library to link against, which doesnI't work
# using files installed into debian/tmp

export PYBUILD_TEST_ARGS=
#-m not distutils

%:
	dh $@ --with gir,python3

override_dh_auto_configure:
	#  Not explicitly specifying default setting
	#  -DARROW_S3=OFF
	#  Build failure:
	#  -DARROW_JEMALLOC_USE_SHARED=ON
	#  -DARROW_JEMALLOC=OFF			\
	#
	# Settings from https://arrow.apache.org/docs/developers/cpp/building.html
	dh_auto_configure			\
	  --sourcedirectory=cpp			\
	  --builddirectory=cpp_build		\
	  --buildsystem=cmake+ninja		\
	  --					\
	  -D_FORTIFY_SOURCE=2		   	\
	  -DCMAKE_VERBOSE_MAKEFILE=ON   	\
	  -DARROW_BUILD_BENCHMARKS=OFF		\
	  -DARROW_BUILD_EXAMPLES=OFF		\
	  -DARROW_BUILD_INTEGRATION=OFF		\
	  -DARROW_BUILD_TESTS=OFF       	\
	  -DARROW_BUILD_UTILITIES=OFF		\
	  -DARROW_ACERO=ON			\
	  -DARROW_ENABLE_TIMING_TESTS=OFF	\
	  -DARROW_FUZZING=OFF			\
	  -DARROW_CUDA=OFF              	\
	  -DARROW_CSV=ON			\
	  -DARROW_COMPUTE=ON			\
	  -DARROW_DATASET=ON			\
	  -DARROW_DEPENDENCY_SOURCE=SYSTEM	\
	  -DARROW_FILESYSTEM=ON			\
	  -DARROW_FLIGHT=ON			\
	  -DARROW_GANDIVA=ON			\
	  -DARROW_GANDIVA_JAVA=OFF		\
	  -DARROW_GCS=OFF               	\
	  -DARROW_HDFS=ON			\
	  -DARROW_IPC=OFF			\
	  -DARROW_JSON=ON			\
	  -DARROW_MIMALLOC=OFF	          	\
	  -DARROW_ORC=OFF			\
	  -DARROW_OPENSSL_USE_SHARED=ON		\
	  -DARROW_PARQUET=ON			\
	  -DARROW_PYTHON=ON			\
	  -DARROW_SNAPPY_USE_SHARED=ON		\
	  -DARROW_SUBSTRAIT=OFF			\
	  -DARROW_TENSORFLOW=OFF		\
	  -DARROW_USE_CCACHE=OFF		\
	  -DARROW_USE_ASAN=OFF			\
	  -DARROW_USE_SYSTEM=ON			\
	  -DARROW_USE_TSAN=OFF			\
	  -DARROW_USE_UBSAN=OFF			\
	  -DARROW_VERBOSE_THIRDPARTY_BUILD=ON	\
	  -DARROW_WITH_BROTLI=OFF		\
	  -DARROW_BROTLI_USE_SHARED=ON		\
	  -DARROW_WITH_BZ2=ON			\
	  -DARROW_WITH_LZ4=ON			\
	  -DARROW_WITH_SNAPPY=ON		\
	  -DARROW_WITH_RE2=ON			\
	  -DARROW_WITH_UTF8PROC=ON		\
	  -DARROW_WITH_ZLIB=ON			\
	  -DARROW_WITH_ZSTD=ON			\
	  -DBZip2_SOURCE=SYSTEM			\
	  -DArrowAcero_DIR=$(CURDIR)/cpp_build/src/arrow/acero \
	  -DParquet_DIR=$(CURDIR)/cpp_build/src/parquet/ \
	  -DCMAKE_INSTALL_PREFIX=/usr/      	\
	  -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)

override_dh_auto_build:
	@echo " *** BUILD CPP *** "
	dh_auto_build				\
	  --sourcedirectory=cpp			\
	  --builddirectory=cpp_build		\
	  --buildsystem=cmake+ninja

	@echo " *** CONFIGURE GLIB *** "
	# Configure glib now that the primary library is built
	dh_auto_configure			\
	  --sourcedirectory=c_glib		\
	  --builddirectory=c_glib_build		\
	  --buildsystem=meson+ninja		\
	  --					\
	  -Darrow_cpp_build_type=$(BUILD_TYPE)	\
	  -Darrow_cpp_build_dir=../cpp_build	\
	  -Dgtk_doc=true

	@echo " *** BUILD GLIB *** "
	# Build glib version
	env					\
	  LD_LIBRARY_PATH=$(CURDIR)/cpp_build/$(BUILD_TYPE)	\
	  PKG_CONFIG_PATH=cpp_build/src/arrow/release/ \
	    dh_auto_build			\
	      --sourcedirectory=c_glib		\
	      --builddirectory=c_glib_build	\
	      --buildsystem=meson+ninja


override_dh_auto_install:

	@echo " *** INSTALL CPP *** "
	env					\
	  LD_LIBRARY_PATH=$(CURDIR)/cpp_build/$(BUILD_TYPE)	\
	  VERBOSE=1                             \
	dh_auto_install				\
	   --sourcedirectory=cpp		\
	   --builddirectory=cpp_build		\
	   --buildsystem=cmake+ninja

	@echo " *** INSTALL PYTHON *** "
	env	Arrow_DIR=$(CURDIR)/debian/tmp/usr \
		ArrowAcero_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowAcero \
		ArrowCompute_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowCompute \
		ArrowDataset_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowDataset \
		ArrowFlight_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowFlight \
		Gandiva_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Gandiva \
		Parquet_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Parquet \
		CMAKE_VERBOSE_MAKEFILE=ON	\
		PKG_CONFIG_PATH=cpp_build/src/arrow/release/ \
		VERBOSE=1			\
	dh_auto_install				\
	  --buildsystem=pybuild			\
	  --sourcedirectory=python		\
	  --builddirectory=python

	@echo " *** Clean up GLIB ***"
	# clean up glib version to reduce disk use
	env	PKG_CONFIG_PATH=cpp_build/src/arrow/release/ \
	dh_auto_clean				\
	  --sourcedirectory=c_glib		\
	  --builddirectory=c_glib_build		\
	  --buildsystem=meson+ninja

	# TODO: Explain why the second install is done here
	@echo " *** Install C++ library with ninja ***"
	# cpp library is installed and cleaned in install step
	# to reduce build disk usage.
	# #install C++ version
	env	PKG_CONFIG_PATH=cpp_build/src/arrow/release/ \
	        VERBOSE=1                       \
	dh_auto_install				\
	   --sourcedirectory=cpp		\
	   --builddirectory=cpp_build		\
	   --buildsystem=cmake+ninja

	@echo " *** Building and installing R package ***"
	mkdir -p debian/tmp/usr/lib/R/site-library
	cd r && env \
		ARROW_R_DEV=true \
	        ARROW_USE_PKG_CONFIG=TRUE \
	        ARROW_JEMALLOC=OFF \
		ARROW_USE_CCACHE=OFF \
		LIBARROW_MINIMAL=true \
		NOT_CRAN=TRUE \
		PKG_CPPFLAGS_SITE="-I. -I$(CURDIR)/debian/tmp/usr/include/" \
	        VERBOSE=1 \
	R CMD INSTALL $(builttimeStamp) --configure-vars="INCLUDE_DIR='$(CURDIR)/debian/tmp/usr/include/'" --library=../debian/tmp/usr/lib/R/site-library/ .

	@echo " *** Clean cache directories - whereever they are ***"
	find debian/ -name __pycache__ -type d | xargs -r rm -r

	@echo " *** Clean cache directories - remnants in debian/tmp ***"
	rm -rf debian/tmp/usr/lib/python*/dist-packages/.pytest_cache/
	# I don't know why the python build is installing these.
	# I couldn't find a cmake option to turn it off.
	rm -rf debian/tmp/usr/lib/python*/dist-packages/src/
	rm -rf debian/tmp/usr/lib/python*/dist-packages/include/
	rm -rf debian/tmp/usr/lib/python*/dist-packages/tests/
	rm -rf debian/tmp/usr/lib/python*/dist-packages/pyarrow/src/

override_dh_install:
	# Eliminating python3.13 directory
	for i in $$(find debian/ -name "python3.*"); do echo "I: Found='$$i'"; a=$$(dirname $$i); if [ ! -d "$$(dirname "$$a")/python3" ]; then echo "I: renaming to '$$a/python3'"; mv "$$i" "$$a/python3"; fi ; done

	# Now performing the installation as instructed by the .install files
	dh_install
	# avoid conflicts, libarrow-dev contains the file as well
	rm -rf debian/pyarrow-dev/usr/share/arrow/gdb/gdb_arrow.py
	# with libarrow-python$(SOVERSION)
	rm -rf debian/python3-pyarrow/usr/lib/python3/dist-packages/pyarrow/libarrow_python.so.$(SOVERSION).0.0
	rm -rf debian/python3-pyarrow/usr/lib/python3/dist-packages/pyarrow/libarrow_python.so.$(SOVERSION)
	# with libarrow-python-flight$(SOVERSION)
	find debian/python3-pyarrow/usr/ -name "libarrow_python_flight.so*" -delete
	find debian/python3-pyarrow/usr/lib/ -name "_flight.*so" -delete
	find debian/python3-pyarrow/usr/lib/ -name "lib.cpython-*.so" -delete
	# Fix dependencies on Python for all packages
	dh_python3
	#dh_python3 --package=libarrow-python-flight$(SOVERSION) usr/lib/python3/dist-packages/pyarrow/libarrow_python_flight.so.$(SOVERSION)
	# Files not yet addressed by .install instructions
	rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/python3*/dist-packages/pyarrow/vendored
	rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/python3.14

override_dh_auto_test:
	@echo " *** Starting tests ***"
	env	Arrow_DIR=$(CURDIR)/debian/tmp/usr \
		ArrowAcero_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowAcero \
		ArrowCompute_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowCompute \
		ArrowDataset_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowDataset \
		ArrowFlight_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/ArrowFlight \
		Gandiva_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Gandiva \
		Parquet_DIR=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Parquet \
		CMAKE_VERBOSE_MAKEFILE=ON	\
		VERBOSE=1			\
		LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
	pytest || echo "E: dh_auto_test failed - error ignored."
	#dh_auto_test \
	#  --buildsystem=pybuild \
	#  --sourcedirectory=python || echo "E: dh_auto_test failed - error ignored."

override_dh_auto_clean:
	# clean up cpp version to reduce disk, needs to be after
	# installing glib version because of dependencies
	dh_auto_clean				\
	  --sourcedirectory=cpp			\
	  --builddirectory=cpp_build

	dh_auto_clean				\
	  --buildsystem=pybuild			\
	  --sourcedirectory=python		\
	  --builddirectory=python

	rm -f python/.eggs/README.txt python/pyarrow.egg-info/SOURCES.txt
	rm -rf c_glib_build
	rm -rf .pybuild .pytest_cache
	rm -rf cpp_build
	rm -f r/src/Makevars
	find . -name "*bin" -type f -delete
	find . -name a.out -delete
	find r/ -name "*.o" -delete
	find r/ -name "*.so" -delete
	rm -f r/inst/*.tar.gz
	rm -f r/*.tar.gz
	# Not building these packages
	rm -rf debian/gir1.2-arrow-1.0  debian/gir1.2-arrow-dataset-1.0  debian/gir1.2-parquet-1.0
	rm -f debian/gir1.2-arrow-1.0.substvars debian/gir1.2-arrow-dataset-1.0.substvars debian/gir1.2-parquet-1.0.substvars

override_dh_missing:
	#dh_missing --fail-missing
	dh_missing


# libarrow.so: avoid failing with "Unknown DWARF DW_OP_172"
# libgandiva.so: avoid failing with "Unknown DWARF DW_OP_255"
#   See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949296
# plasma-store-server: avoid failing with "Unknown DWARF DW_OP_1"
override_dh_dwz:
	dh_dwz \
		--exclude=libarrow.so \
		--exclude=libgandiva.so \
		--exclude=plasma-store-server

override_dh_makeshlibs:
	dh_makeshlibs -plibarrow$(SOVERSION)
	dh_makeshlibs -plibarrow-acero$(SOVERSION)
	dh_makeshlibs -plibarrow-dataset$(SOVERSION)
	dh_makeshlibs -plibarrow-flight$(SOVERSION)
	dh_makeshlibs -plibparquet$(SOVERSION)
	dh_makeshlibs -plibgandiva$(SOVERSION)
	dh_makeshlibs -plibarrow-python$(SOVERSION)
	dh_makeshlibs -plibarrow-python-flight$(SOVERSION)

override_dh_shlibdeps:
	dh_shlibdeps \
	    -l$(CURDIR)/debian/libarrow$(SOVERSION)/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -l$(CURDIR)/debian/libarrow-acero$(SOVERSION)/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -l$(CURDIR)/debian/libarrow-dataset$(SOVERSION)/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -l$(CURDIR)/debian/libarrow-flight$(SOVERSION)/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -l$(CURDIR)/debian/libparquet$(SOVERSION)/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -l$(CURDIR)/debian/libarrow-python$(SOVERSION)/usr/lib/python3.14/dist-packages/pyarrow


debian/upstream/signing-key.asc:
	# This is what I had done to create this file - please correct if erroneous
	wget -O - https://downloads.apache.org/arrow/KEYS | gpg --import-keys
	gpg --export -a > debian/upstream/signing-key.asc