From a3c1bf404d1da4da860a97dfeea270ab52507ee2 Mon Sep 17 00:00:00 2001 From: Marcelo Politzer <251334+mpolitzer@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:47:44 -0300 Subject: [PATCH] feat: add make option to build debian source --- Dockerfile | 9 +++++++++ Makefile | 3 +++ 2 files changed, 12 insertions(+) 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