#!/usr/bin/make -f
# -*- makefile-gmake -*-
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS

export DEB_BUILD_MAINT_OPTIONS=reproducible=-timeless

BUILD_TYPE=release

%:
	dh $@ --with gir,autoreconf

override_dh_autoreconf:
	dh_autoreconf \
	  --sourcedirectory=c_glib \
	  ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure \
	  --sourcedirectory=cpp \
	  --builddirectory=cpp_build \
	  -- \
	  -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
	  -DARROW_PYTHON=ON \
	  -DARROW_ORC=ON \
	  -DARROW_PARQUET=ON \
	  -DARROW_PLASMA=ON \
	  -DARROW_GANDIVA=ON \
	  -DARROW_GANDIVA_JAVA=OFF \
	  -DPythonInterp_FIND_VERSION=ON \
	  -DPythonInterp_FIND_VERSION_MAJOR=3 \
	  -DARROW_CUDA=ON
	dh_auto_configure \
	  --sourcedirectory=c_glib \
	  --builddirectory=c_glib_build \
	  -- \
	  --with-arrow-cpp-build-dir=$(CURDIR)/cpp_build \
	  --with-arrow-cpp-build-type=$(BUILD_TYPE) \
	  --enable-gtk-doc \
	  --with-html-dir=\$${prefix}/share/doc/libarrow-glib-doc

override_dh_auto_build:
	dh_auto_build				\
	  --sourcedirectory=cpp			\
	  --builddirectory=cpp_build
	env							\
	  LD_LIBRARY_PATH=$(CURDIR)/cpp_build/$(BUILD_TYPE)	\
	    dh_auto_build					\
	      --sourcedirectory=c_glib				\
	      --builddirectory=c_glib_build

override_dh_auto_install:
	dh_auto_install				\
	  --sourcedirectory=cpp			\
	  --builddirectory=cpp_build
	dh_auto_install				\
	  --sourcedirectory=c_glib		\
	  --builddirectory=c_glib_build

# disable 'make check'.
override_dh_auto_test:
