This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Michael Zanetti 9c5a6fadb6 Add rpath to nymead binary
This allows to run it from the build directory without having to
specify LD_LIBRARY_PATH.

This is particularly useul when working with parts that require
special capabilities such as the NetworkDiscovery, given that
setcap on a binary disables LD_LIBRARY_LATH loading for security
reasons.

Building the dpkg package, the rpath will not be added.
2022-04-13 13:24:46 +02:00

59 lines
1.7 KiB
Makefile
Executable File

#!/usr/bin/make -f
# -*- makefile -*-
export DH_VERBOSE=1
export QT_QPA_PLATFORM=minimal
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
DEB_PARALLEL_JOBS += $(shell getconf _NPROCESSORS_ONLN)
endif
$(info Building with DEB_BUILD_OPTIONS: [${DEB_BUILD_OPTIONS}])
MAKE_TARGETS=all lrelease
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
MAKE_TARGETS += doc
endif
QMAKE_ADDITIONAL_ARGS = CONFIG+=norpath
ifneq (,$(filter coverage,$(DEB_BUILD_OPTIONS)))
QMAKE_ADDITIONAL_ARGS += CONFIG+=coverage CONFIG+=debug
else
QMAKE_ADDITIONAL_ARGS += CONFIG+=release
endif
DPKG_EXPORT_BUILDFLAGS = 1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
include /usr/share/dpkg/buildflags.mk
PREPROCESS_FILES := $(wildcard debian/*.in)
$(PREPROCESS_FILES:.in=): %: %.in
sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@
override_dh_auto_configure:
dh_auto_configure -- "$(QMAKE_ADDITIONAL_ARGS)"
override_dh_auto_build:
make -j$(DEB_PARALLEL_JOBS) $(MAKE_TARGETS)
override_dh_install: $(PREPROCESS_FILES:.in=)
# libnymea-core isn't public api... delete dev lib and just keep runtime libs.
rm $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnymea-core.so
# Make sure the docs directory exists, even if we didn't build them
mkdir -p $(CURDIR)/doc/html
dh_install --fail-missing
override_dh_auto_test:
dh_auto_test -- -k TESTARGS="-m 240 -p -o -p -,txt -p -o -p test-results.xml,xunitxml" TESTRUNNER="dbus-test-runner --bus-type=both --task"
override_dh_auto_clean:
dh_auto_clean
find . -name *.qm -exec rm {} \;
rm -rf $(PREPROCESS_FILES:.in=)
%:
dh $@ --buildsystem=qmake --parallel --with systemd