Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add debian source package files #249

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ ENV DEV_ENV_HAS_TOOLCHAIN=yes

WORKDIR /usr/src/emulator

FROM --platform=$TARGETPLATFORM cartesi/toolchain:0.17.0-rv64ima-lp64 as debian-source-package
WORKDIR /usr/src/emulator
COPY debian debian
RUN apt update && \
apt build-dep --no-install-recommends -y .
COPY . .
RUN dch -v `make -s version` "Release `make -s version`" && \
dpkg-buildpackage

FROM --platform=$TARGETPLATFORM linux-env as dep-builder

COPY Makefile .
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ build-emulator-tests-builder-image: build-emulator-builder-image
build-debian-package:
docker build $(DOCKER_PLATFORM) --target debian-packager --build-arg RELEASE=$(release) --build-arg COVERAGE=$(coverage) --build-arg SANITIZE=$(sanitize) --build-arg MACHINE_EMULATOR_VERSION=$(MACHINE_EMULATOR_VERSION) -t $(DEBIAN_IMG) -f Dockerfile .

build-debian-source-package:
docker build $(DOCKER_PLATFORM) --target debian-source-package --build-arg MACHINE_EMULATOR_VERSION=$(MACHINE_EMULATOR_VERSION) -t $(DEBIAN_IMG) -f Dockerfile .

build-tests-debian-packages: build-emulator-builder-image
docker build $(DOCKER_PLATFORM) --target tests-debian-packager --build-arg MACHINE_EMULATOR_VERSION=$(MACHINE_EMULATOR_VERSION) --build-arg TAG=$(TAG) -t cartesi/machine-emulator:tests-debian-packager -f tests/Dockerfile .
$(MAKE) copy-tests-debian-packages
Expand Down
9 changes: 9 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.debhelper/
cartesi-machine-emulator-dev.substvars
cartesi-machine-emulator-dev/
cartesi-machine-emulator-docs.docs
cartesi-machine-emulator0.substvars
cartesi-machine-emulator0/
debhelper-build-stamp
files
tmp/
4 changes: 4 additions & 0 deletions debian/cartesi-machine-emulator-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
usr/bin/*
usr/include/*
usr/lib/*.a
usr/share/*
3 changes: 3 additions & 0 deletions debian/cartesi-machine-emulator0.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usr/lib/*.so
usr/lib/lua/5.4/*.so
usr/lib/lua/5.4/cartesi/*.so
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cartesi-machine-emulator (0.17.0) UNRELEASED; urgency=medium

* Initial release.

-- root <root@unknown> Thu, 25 Jul 2024 14:09:11 +0000
37 changes: 37 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Source: cartesi-machine-emulator
Section: libs
Priority: optional
Maintainer: root <root@unknown>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
devscripts,
libboost1.81-dev,
liblua5.4-dev,
libslirp-dev,
wget,
xxd,
Standards-Version: 4.6.2
Homepage: https://cartesi.io
#Vcs-Browser: https://salsa.debian.org/debian/cartesi-machine-emulator
#Vcs-Git: https://salsa.debian.org/debian/cartesi-machine-emulator.git

Package: cartesi-machine-emulator-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends:
cartesi-machine-emulator0 (= ${binary:Version}),
lua5.4,
${misc:Depends},
Description: <insert up to 60 chars description>
<Insert long description, indented with spaces.>

Package: cartesi-machine-emulator0
Architecture: any
Multi-Arch: same
Depends:
${shlibs:Depends},
${misc:Depends},
Description: <insert up to 60 chars description>
<Insert long description, indented with spaces.>
8 changes: 8 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/make -f

export DEV_ENV_HAS_TOOLCHAIN=yes

%:
dh $@

override_dh_auto_test:
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
3 changes: 2 additions & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ dependencies.sha256:
@shasum -a 256 $(BUILDDIR)/images/* > $@

clean:
@$(MAKE) -C ../third-party/riscv-arch-test/riscv-target/cartesi clean
@D=../third-party/riscv-arch-test/riscv-target/cartesi; \
if [ -d $$D ]; then $(MAKE) -C $$D clean; fi
@$(MAKE) -C misc clean
@rm -f *.profdata *.profraw *.gcda *.gcov
@rm -rf $(BUILDDIR)
Expand Down
Loading