File: rules

package info (click to toggle)
spherepack 3.3~a1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,080 kB
  • sloc: f90: 43,382; python: 5,968; ansic: 110; makefile: 49
file content (65 lines) | stat: -rwxr-xr-x 1,918 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
#!/usr/bin/make -f

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

include /usr/share/debhelper/dh-fortran/fortran-support.mk

# magic debhelper rule
%:
	dh  $@  --buildsystem=pybuild

PYTHON3:=$(shell py3versions -vr)
PY3DEFAULT:=$(shell py3versions -vd)

FC:=$(shell basename $(shell readlink /etc/alternatives/f95))
F77:=$(shell basename $(shell readlink /etc/alternatives/f77))
export F77 FC

FLANG_COMPILER:=flang-new-17

DO_FLANG:=$(if $(wildcard /usr/bin/$(FLANG_COMPILER)),true, false)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DESTDIR:=$(CURDIR)/debian/tmp
LIBDIR:=$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)
LIBDIR_FC:=$(LIBDIR)/fortran/$(FC_DEFAULT)

LD_LIBRARY_PATH:=$(CURDIR)/debian/tmp:$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH

override_dh_auto_configure: $(PYTHON3:%=configure-python%)
	:

override_dh_auto_build: $(PYTHON3:%=build-python%)
	:
	# meson compile -C build-$(PY3DEFAULT) sphere:static_library sphere:shared_library

override_dh_auto_install: $(PYTHON3:%=install-python%)
	mkdir -p $(LIBDIR_FC) 
	mv $(DESTDIR)/usr/lib/python3/dist-packages/Src $(DESTDIR)/usr/lib/python3/dist-packages/sphere
	cp Lib/__init__.py Lib/sphere.py $(DESTDIR)/usr/lib/python3/dist-packages/sphere
	mv $(LIBDIR)/libsphere.a $(LIBDIR_FC)
	cp build-$(PY3DEFAULT)/Src/libsphere.so $(LIBDIR)/libsphere-$(FC_DEFAULT).so.0d
	ln -s libsphere-$(FC_DEFAULT).so.0d $(LIBDIR)/libsphere-$(FC_DEFAULT).so
	ln -s ../../libsphere-$(FC_DEFAULT).so.0d $(LIBDIR_FC)/libsphere.so
	dh_numpy3

override_dh_auto_test: $(PYTHON3:%=test-python%)
	:

override_dh_auto_clean:
	rm -rf build-* .pybuild

configure-python%:
	python$* /usr/bin/meson setup --prefix /usr --buildtype plain build-$* 

build-python%:
	python$* /usr/bin/meson compile -C build-$*

test-python%:
	python$* /usr/bin/meson test -C build-$*

install-python%:
	python$* /usr/bin/meson install -C build-$* --destdir $(DESTDIR)