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
|
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
INSTALL_DIR = $(CURDIR)/debian/tmp
BUILD_FLAGS = \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_BINDIR=lib/nrn/bin \
-DCMAKE_INSTALL_LIBDIR=lib/nrn \
-DNRN_3RDPARTY_USE_BACKWARD:BOOL=OFF \
-DNRN_3RDPARTY_USE_CATCH2:BOOL=OFF \
-DNRN_3RDPARTY_USE_RANDOM123:BOOL=OFF \
-DNRN_ENABLE_INTERVIEWS:BOOL=ON \
-DNRN_ENABLE_PYTHON:BOOL=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DNRN_ENABLE_PYTHON_DYNAMIC:BOOL=ON \
-DNRN_MODULE_INSTALL_OPTIONS:STRING=--prefix=$(INSTALL_DIR)/usr \
-DCMAKE_INSTALL_RPATH=/usr/lib/nrn
export NRN_UPSTREAM_VERSION := $(shell dpkg-parsechangelog --show-field Version | sed 's/-[^-]*$$//')
%:
dh $@ --buildsystem=cmake --with python3,numpy3
override_dh_auto_configure:
dh_auto_configure -- $(BUILD_FLAGS)
override_dh_auto_install:
dh_auto_install --buildsystem=cmake --destdir=$(INSTALL_DIR)
# files conflicting with nrn InterViews
rm $(INSTALL_DIR)/usr/include/ivstream.h
# unneeded files
rm -f $(INSTALL_DIR)/usr/lib/python/neuron/rxd/geometry3d/setup.py
# fix paths
sed -i '/exec_prefix=/{s|.*| exec_prefix=/usr/lib/nrn/|; :a;n;ba}' $(INSTALL_DIR)/usr/lib/nrn/bin/nrnivmodl
mv $(INSTALL_DIR)/usr/bin/modlunit $(INSTALL_DIR)/usr/lib/nrn/bin
mv $(INSTALL_DIR)/usr/bin/nocmodl $(INSTALL_DIR)/usr/lib/nrn/bin
# sort out private libraries
mkdir -p $(INSTALL_DIR)/usr/lib/nrn
mv $(INSTALL_DIR)/usr/lib/*.so $(INSTALL_DIR)/usr/lib/nrn
chrpath -r /usr/lib/nrn $(INSTALL_DIR)/usr/bin/nrniv
chrpath -d $(INSTALL_DIR)/usr/lib/nrn/libnrniv.so
find $(INSTALL_DIR)/usr/lib/ \
-name 'hoc.cpython*.so' \
-exec chrpath -r '/usr/lib/nrn' '{}' \;
|