Skip to content

Commit

Permalink
fix: debian binary package well built
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromil committed Jan 8, 2025
1 parent 1d00628 commit 5c141b8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
14 changes: 6 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# this source code; if not, , see <https://www.gnu.org/licenses/>.

# POSIX system installation paths
PROG = cjit
PREFIX ?= /usr/local
DATADIR ?= ${PREFIX}/share/cjit
INCDIR ?= ${PREFIX}/include/cjit
Expand Down Expand Up @@ -104,20 +103,19 @@ _: ##

install: ## 🔌 Install the built binaries in PREFIX
$(info Installing CJIT in ${BUILDDIR}${PREFIX})
install -Dm755 cjit ${DESTDIR}${PREFIX}/bin/${PROG}
install -d ${DESTDIR}${DATADIR}
cp -ra README.md REUSE.toml LICENSES ${DESTDIR}${DATADIR}/
cp -ra examples ${DESTDIR}${DATADIR}/
${PROG} --xass="${DESTDIR}${INCDIR}"
@install -Dm755 cjit ${DESTDIR}${PREFIX}/bin/cjit
@install -d ${DESTDIR}${DATADIR}
@cp -ra README.md REUSE.toml LICENSES ${DESTDIR}${DATADIR}/
@cp -ra examples ${DESTDIR}${DATADIR}/

.PHONY: debian
debian:
$(info Creating the Debian package)
@rm -rf debian
@cp -ra build/debian .
@cp docs/cjit.1 debian/manpage.1
@uscan --force-download
@dpkg-buildpackage --build=binary --no-sign
@dpkg-buildpackage --no-sign --build=binary


clean: ## 🧹 Clean the source from all built objects
${MAKE} -C lib/tinycc clean distclean
Expand Down
2 changes: 1 addition & 1 deletion build/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cjit (0.15.4-1) UNRELEASED; urgency=medium
cjit (0.15.5-1) UNRELEASED; urgency=medium

* Initial release. (Closes: #nnnn) <nnnn is the bug number of your ITP>

Expand Down
1 change: 1 addition & 0 deletions build/debian/cjit.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/*
2 changes: 2 additions & 0 deletions build/debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[DEFAULT]
debian-branch = main
13 changes: 10 additions & 3 deletions build/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
# export DH_VERBOSE=1
# export DEB_BUILD_OPTIONS = noparallel

include /usr/share/dpkg/buildflags.mk

export PREFIX=/usr
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# VERSION := $(shell dpkg-parsechangelog --show-field Version)
# NAME := $(shell dpkg-parsechangelog --show-field Source)
# DEBPKGNAME := ${NAME}-${VERSION}

%:
dh $@

# Override the build target to call make.
override_dh_auto_build:
dh_auto_build -- meson-release

# Override the install target to call make install.
override_dh_auto_install:
dh_auto_install -- make install DESTDIR=$(CURDIR)/debian/$(DEBPKGNAME)
dh_auto_install --destdir=debian/tmp
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const char cli_help[] =
" -e fun\t run starting from entry function (-) main\n"
" -p pid\t write execution process ID to (+) pid\n"
" --verb\t don't go quiet, verbose logs\n"
#if defined(SHAREDTCC)
#if !defined(SHAREDTCC)
" --xass\t just extract runtime assets (=) to path\n"
#endif
#if defined(SELFHOST)
Expand Down
1 change: 1 addition & 0 deletions test/bats_setup
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ setup() {
fi
TCC="${R}/lib/tinycc/tcc"
[ -r "$TCC" ] || TCC="${R}/lib/tinycc/tcc.exe"
unset CFLAGS
}

0 comments on commit 5c141b8

Please sign in to comment.