File: rules

package info (click to toggle)
libgnatcoll-bindings 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,412 kB
  • sloc: ada: 18,696; python: 1,597; ansic: 1,422; cpp: 581; makefile: 147; sh: 114
file content (73 lines) | stat: -rwxr-xr-x 2,594 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
#!/usr/bin/make -f
# Build script for GNATColl in Debian.
# Copyright (c) 2014-2023 Nicolas Boulenguez <nicolas@debian.org>

# This build script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.

libraries := cpp gmp iconv lzma omp python3 readline syslog zlib

DPKG_EXPORT_BUILDFLAGS := 1
DEB_BUILD_MAINT_OPTIONS := hardening=+all
DEB_LDFLAGS_MAINT_APPEND := \
  -Wl,--no-allow-shlib-undefined \
  -Wl,--no-copy-dt-needed-entries \
  -Wl,--no-undefined
include /usr/share/dpkg/buildflags.mk
include /usr/share/ada/packaging.mk

project = -P$*/gnatcoll_$(*:3=).gpr
static := -XLIBRARY_TYPE=static
shared = -XLIBRARY_TYPE=relocatable \
  -XGNATCOLL_VERSION=$(gnatcoll_$*_SO_VERSION)
vars := -XBUILD=PROD

build-python3 install-python3: vars += \
  -XGNATCOLL_PYTHON_CFLAGS=`pkg-config --cflags python3-embed` \
  -XGNATCOLL_PYTHON_LIBS=`pkg-config --libs python3-embed`

build-iconv install-iconv: vars += -XGNATCOLL_ICONV_OPT=

%:
	dh $@

override_dh_auto_build: $(libraries:%=build-%)

build-%: default.cgpr
	gprbuild $(project) $(static) -p $(GPRBUILDFLAGS) $(vars)
	gprbuild $(project) $(shared) -p $(GPRBUILDFLAGS) $(vars)

default.cgpr:
	gprconfig --batch $(GPRCONFIGFLAGS)

override_dh_auto_install: $(libraries:%=install-%)
  # The concrete project with all information available must be named
  # after the library name for dh-ada-library.
	sed s/GnatColl_Python/GnatColl_Python3/ \
	   debian/tmp/$(DEB_GNAT_PROJECT_DIR)/gnatcoll_python.gpr \
	 > debian/tmp/$(DEB_GNAT_PROJECT_DIR)/gnatcoll_python3.gpr
	rm debian/tmp/$(DEB_GNAT_PROJECT_DIR)/gnatcoll_python.gpr

install-%:
	gprinstall $(project) $(vars) $(static) $(static_GPRINSTALLFLAGS)
	gprinstall $(project) $(vars) $(shared) \
	  $(call shared_GPRINSTALLFLAGS,gnatcoll_$*)

execute_before_dh_install:
  # Install a wrapper project so that 'with "gnatcoll_python.gpr";' works..
	dh_install -plibgnatcoll-python3-dev debian/gnatcoll_python.gpr \
	  $(DEB_GNAT_PROJECT_DIR)

override_dh_gencontrol:
	dh_gencontrol -- -Vpython-version=$(shell \
	  python3 -V | sed 's/^Python \(3\.[0-9]\+\)\.[0-9]\+$$/\1/')