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
|
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
include /usr/share/dh-dlang/dlang-flags.mk
INSTALL_DIR = $(CURDIR)/debian/dub/
DEB_VERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }')
export DEB_BUILD_MAINT_OPTIONS=optimize=-lto
export GITVER=$(DEB_VERSION)
# to make build reproducible
export DIFFABLE=1
ifeq ($(DC),ldc2)
ALLINST_FLAG=-allinst
DC_WRAP=ldmd2
else
ALLINST_FLAG=-fall-instantiations
EXTRA_DFLAGS=-wi -d
DC_WRAP=gdmd
# Translate/Filter out options that are accepted by GDC but not accepted by GDMD
DFLAGS := $(patsubst -O%,-O,$(DFLAGS))
DFLAGS := $(patsubst -W%,,$(DFLAGS))
endif
DFLAGS += $(EXTRA_DFLAGS) $(ALLINST_FLAG)
export DFLAGS
%:
dh $@
override_dh_auto_build:
DMD=$(DC_WRAP) DFLAGS="$(ALLINST_FLAG)" $(DC_WRAP) \
-run $(CURDIR)/build.d \
$(DFLAGS)
# create manual pages
cd $(CURDIR)/bin/ && \
HOME=$(CURDIR)/debian ./dub run -v --single --combined --compiler=$(DC_WRAP) $(CURDIR)/scripts/man/gen_man.d
override_dh_install:
dh_install
# install shell completions
mkdir -p $(INSTALL_DIR)/usr/share/bash-completion/completions/
cp $(CURDIR)/scripts/bash-completion/dub.bash $(INSTALL_DIR)/usr/share/bash-completion/completions/dub
mkdir -p $(INSTALL_DIR)/usr/share/fish/completions/
cp $(CURDIR)/scripts/fish-completion/dub.fish $(INSTALL_DIR)/usr/share/fish/completions/
override_dh_auto_clean:
dh_auto_clean
rm -f $(CURDIR)/scripts/man/*.1
|