diff --git a/Dockerfile b/Dockerfile index 7ebdb6963..089ca8d78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . diff --git a/Makefile b/Makefile index ef9bff99f..aa4d7228e 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 000000000..acdf6f978 --- /dev/null +++ b/debian/.gitignore @@ -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/ diff --git a/debian/cartesi-machine-emulator-dev.install b/debian/cartesi-machine-emulator-dev.install new file mode 100644 index 000000000..ae4e32c87 --- /dev/null +++ b/debian/cartesi-machine-emulator-dev.install @@ -0,0 +1,4 @@ +usr/bin/* +usr/include/* +usr/lib/*.a +usr/share/* diff --git a/debian/cartesi-machine-emulator0.install b/debian/cartesi-machine-emulator0.install new file mode 100644 index 000000000..727e496fd --- /dev/null +++ b/debian/cartesi-machine-emulator0.install @@ -0,0 +1,3 @@ +usr/lib/*.so +usr/lib/lua/5.4/*.so +usr/lib/lua/5.4/cartesi/*.so diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..677699da6 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cartesi-machine-emulator (0.17.0) UNRELEASED; urgency=medium + + * Initial release. + + -- root Thu, 25 Jul 2024 14:09:11 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..fe83ade95 --- /dev/null +++ b/debian/control @@ -0,0 +1,37 @@ +Source: cartesi-machine-emulator +Section: libs +Priority: optional +Maintainer: root +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: + + +Package: cartesi-machine-emulator0 +Architecture: any +Multi-Arch: same +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Description: + diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..4940d0f26 --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +export DEV_ENV_HAS_TOOLCHAIN=yes + +%: + dh $@ + +override_dh_auto_test: diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..89ae9db8f --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/tests/Makefile b/tests/Makefile index caf7c43f8..537c0a11e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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)