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
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
include /usr/share/dpkg/architecture.mk
N_CPUS=$(shell grep -c "^processor" /proc/cpuinfo 2>/dev/null)
make_options += release=1
make_options += verbose=1
make_options += progress=1
make_options += threads=$(N_CPUS)
make_options += CRYSTAL_CONFIG_PATH="lib:/usr/lib/crystal/lib"
make_options += CRYSTAL_CACHE_DIR="/tmp/crystal"
make_options += interpreter=1
%:
dh $@
override_dh_auto_build:
dh_auto_build -- $(make_options)
override_dh_auto_install: DESTDIR=$(CURDIR)/debian/tmp
override_dh_auto_install:
dh_auto_install -- PREFIX=/usr
#
# clean lib dir, but without deleting (needed by extensions loading):
# - ext/libcrystal.a
# - llvm/ext/{find-llvm-config, llvm_ext.o)
#
find "$(DESTDIR)/usr/share/crystal/src" \
-iname "sigfault.o" -or \
-iname "*.c" -or \
-iname "*.cc" \
| xargs rm
make install_docs PREFIX=/usr DESTDIR=$(DESTDIR)
# fix privacy-breach-generic links on html docs
sed -i '/<p><a href=/{:a;N;/alt="Crystal - Born and raised at Manas" \/><\/a><\/p>/!ba};//d' \
$(DESTDIR)/usr/share/doc/crystal/docs/index.html
# remove vcs file in examples
rm -f $(DESTDIR)/usr/share/doc/crystal/examples/.gitignore
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
make $(make_options) compiler_spec
make $(make_options) std_spec
make $(make_options) primitives_spec
endif
override_dh_clean:
dh_clean
rm -f man/*.gz
rm -Rf docs
|