| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
INSTALL_DIR = $(CURDIR)/debian/tmp |
| 6 |
PYTHON_EXECUTABLES := $(shell py3versions -s | tr ' ' '\n' | sed 's|^|/usr/bin/|' | paste -sd';' -) |
| 7 |
|
| 8 |
BUILD_FLAGS = \ |
| 9 |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 10 |
-DCMAKE_INSTALL_BINDIR=lib/nrn/bin \ |
| 11 |
-DCMAKE_INSTALL_LIBDIR=lib/nrn \ |
| 12 |
-DNRN_3RDPARTY_USE_BACKWARD:BOOL=OFF \ |
| 13 |
-DNRN_3RDPARTY_USE_CATCH2:BOOL=OFF \ |
| 14 |
-DNRN_3RDPARTY_USE_RANDOM123:BOOL=OFF \ |
| 15 |
-DNRN_ENABLE_INTERVIEWS:BOOL=ON \ |
| 16 |
-DNRN_ENABLE_PYTHON:BOOL=ON \ |
| 17 |
-DNRN_ENABLE_PYTHON_DYNAMIC=ON \ |
| 18 |
-DNRN_PYTHON_DYNAMIC="$(PYTHON_EXECUTABLES)" \ |
| 19 |
-DNRN_ENABLE_PYTHON_DYNAMIC:BOOL=ON \ |
| 20 |
-DNRN_MODULE_INSTALL_OPTIONS:STRING=--prefix=$(INSTALL_DIR)/usr \ |
| 21 |
-DCMAKE_INSTALL_RPATH=/usr/lib/nrn |
| 22 |
|
| 23 |
export NRN_UPSTREAM_VERSION := $(shell dpkg-parsechangelog --show-field Version | sed 's/-[^-]*$$//') |
| 24 |
|
| 25 |
%: |
| 26 |
dh $@ --buildsystem=cmake --with python3,numpy3 |
| 27 |
|
| 28 |
override_dh_auto_configure: |
| 29 |
dh_auto_configure -- $(BUILD_FLAGS) |
| 30 |
|
| 31 |
override_dh_auto_install: |
| 32 |
dh_auto_install --buildsystem=cmake --destdir=$(INSTALL_DIR) |
| 33 |
|
| 34 |
# files conflicting with nrn InterViews |
| 35 |
rm $(INSTALL_DIR)/usr/include/ivstream.h |
| 36 |
|
| 37 |
# unneeded files |
| 38 |
rm -f $(INSTALL_DIR)/usr/lib/python/neuron/rxd/geometry3d/setup.py |
| 39 |
|
| 40 |
# fix paths |
| 41 |
sed -i '/exec_prefix=/{s|.*| exec_prefix=/usr/lib/nrn/|; :a;n;ba}' $(INSTALL_DIR)/usr/lib/nrn/bin/nrnivmodl |
| 42 |
|
| 43 |
mv $(INSTALL_DIR)/usr/bin/modlunit $(INSTALL_DIR)/usr/lib/nrn/bin |
| 44 |
mv $(INSTALL_DIR)/usr/bin/nocmodl $(INSTALL_DIR)/usr/lib/nrn/bin |
| 45 |
|
| 46 |
# sort out private libraries |
| 47 |
mkdir -p $(INSTALL_DIR)/usr/lib/nrn |
| 48 |
mv $(INSTALL_DIR)/usr/lib/*.so $(INSTALL_DIR)/usr/lib/nrn |
| 49 |
|
| 50 |
chrpath -r /usr/lib/nrn $(INSTALL_DIR)/usr/bin/nrniv |
| 51 |
chrpath -d $(INSTALL_DIR)/usr/lib/nrn/libnrniv.so |
| 52 |
find $(INSTALL_DIR)/usr/lib/ \ |
| 53 |
-name 'hoc.cpython*.so' \ |
| 54 |
-exec chrpath -r '/usr/lib/nrn' '{}' \; |