-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add debian source package files
- Loading branch information
Showing
13 changed files
with
170 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,22 @@ ARG RELEASE=no | |
ARG COVERAGE=no | ||
ARG SANITIZE=no | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ | ||
build-essential vim wget git clang-tidy-16 clang-format-16 lcov \ | ||
libboost1.81-dev libssl-dev libslirp-dev \ | ||
ca-certificates pkg-config lua5.4 liblua5.4-dev \ | ||
luarocks xxd procps && \ | ||
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 120 && \ | ||
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-16 120 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN luarocks install --lua-version=5.4 luasocket && \ | ||
luarocks install --lua-version=5.4 luasec && \ | ||
luarocks install --lua-version=5.4 luaposix && \ | ||
luarocks install --lua-version=5.4 lpeg && \ | ||
luarocks install --lua-version=5.4 dkjson && \ | ||
luarocks install --lua-version=5.4 luacheck && \ | ||
cargo install [email protected] --features lua54 | ||
# Install dependencies | ||
COPY debian debian | ||
RUN <<EOF | ||
set -e | ||
apt update | ||
apt build-dep . --no-install-recommends -y # Packages from Build-Depends on debian/control | ||
|
||
apt install --no-install-recommends -y \ | ||
clang-format-16 \ | ||
clang-tidy-16 | ||
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 120 | ||
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-16 120 | ||
cargo install [email protected] --features lua54 | ||
|
||
rm -rf /var/lib/apt/lists/* | ||
EOF | ||
|
||
# Environment has the riscv64-cartesi-linux-gnu-* toolchain | ||
ENV DEV_ENV_HAS_TOOLCHAIN=yes | ||
|
@@ -36,27 +34,38 @@ COPY third-party third-party | |
FROM --platform=$TARGETPLATFORM dep-builder as builder | ||
|
||
COPY . . | ||
RUN make -j$(nproc) git_commit=$GIT_COMMIT release=$RELEASE coverage=$COVERAGE sanitize=$SANITIZE | ||
RUN dpkg-buildpackage # Make invoked by debian/rules | ||
|
||
FROM --platform=$TARGETPLATFORM builder as debian-packager | ||
ARG MACHINE_EMULATOR_VERSION=0.0.0 | ||
|
||
RUN make install-uarch debian-package DESTDIR=$PWD/_install | ||
|
||
##RUN make install-uarch debian-package DESTDIR=$PWD/_install | ||
# | ||
FROM --platform=$TARGETPLATFORM debian:bookworm-20230725-slim | ||
ARG MACHINE_EMULATOR_VERSION=0.0.0 | ||
ARG TARGETARCH | ||
|
||
COPY --from=debian-packager \ | ||
/usr/src/emulator/cartesi-machine-v${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
cartesi-machine.deb | ||
COPY --from=debian-packager /usr/local/lib/lua /usr/local/lib/lua | ||
COPY --from=debian-packager /usr/local/share/lua /usr/local/share/lua | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ | ||
./cartesi-machine.deb \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm cartesi-machine.deb | ||
/usr/src/cartesi-machine0_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
. | ||
COPY --from=debian-packager \ | ||
/usr/src/cartesi-machine-dev_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
. | ||
|
||
RUN <<EOF | ||
set -e | ||
export DEBIAN_FRONTEND="noninteractive" | ||
|
||
apt update | ||
apt install --no-install-recommends -y \ | ||
./cartesi-machine0_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
./cartesi-machine-dev_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb | ||
|
||
rm -rf \ | ||
./cartesi-machine0_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
./cartesi-machine-dev_${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \ | ||
/var/lib/apt/lists/* | ||
EOF | ||
|
||
RUN addgroup --system --gid 102 cartesi && \ | ||
adduser --system --uid 102 --ingroup cartesi --disabled-login --no-create-home --home /nonexistent --gecos "cartesi user" --shell /bin/false cartesi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usr/lib | ||
usr/include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
usr/bin/cartesi-machine | ||
usr/bin/cartesi-machine-stored-hash | ||
usr/bin/jsonrpc-remote-cartesi-machine | ||
usr/bin/merkle-tree-hash | ||
usr/include/cartesi-machine/* | ||
usr/lib/lib*.a | ||
usr/share/cartesi-machine/* | ||
usr/share/cartesi-machine/gdb/gdbinit | ||
usr/share/lua/5.4/cartesi-machine-stored-hash.lua | ||
usr/share/lua/5.4/cartesi-machine.lua | ||
usr/share/lua/5.4/cartesi/gdbstub.lua | ||
usr/share/lua/5.4/cartesi/proof.lua | ||
usr/share/lua/5.4/cartesi/util.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
usr/lib/lib*.so | ||
usr/lib/lua/5.4/cartesi.so | ||
usr/lib/lua/5.4/cartesi/jsonrpc.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cartesi-machine (0.17.0) UNRELEASED; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- root <root@unknown> Fri, 28 Jun 2024 15:46:07 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Source: cartesi-machine | ||
Section: libs | ||
Priority: optional | ||
Maintainer: root <root@unknown> | ||
Rules-Requires-Root: no | ||
Build-Depends: | ||
build-essential, | ||
ca-certificates, | ||
clang-format-16, | ||
clang-tidy-16, | ||
debhelper, | ||
debhelper-compat (= 13), | ||
devscripts, | ||
git, | ||
lcov, | ||
libboost1.81-dev, | ||
liblua5.4-dev, | ||
libslirp-dev, | ||
libslirp-dev, | ||
lua5.4, | ||
luarocks, | ||
pkg-config, | ||
procps, | ||
vim, | ||
wget, | ||
xxd, | ||
Standards-Version: 4.6.2 | ||
Homepage: <insert the upstream URL, if relevant> | ||
#Vcs-Browser: https://salsa.debian.org/debian/cartesi-machine | ||
#Vcs-Git: https://salsa.debian.org/debian/cartesi-machine.git | ||
|
||
Package: cartesi-machine-dev | ||
Section: libdevel | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: | ||
libboost1.81-dev, | ||
liblua5.4-dev, | ||
libslirp-dev, | ||
lua5.4, | ||
cartesi-machine0 (= ${binary:Version}), | ||
Description: The Cartesi Machine Emulator is the reference off-chain implementation of the Cartesi Machine Specification. | ||
It's written in C/C++ with POSIX dependencies restricted to the terminal, process, and memory-mapping facilities. | ||
It is distributed as a library and scriptable in the Lua programming language. | ||
|
||
Package: cartesi-machine0 | ||
Architecture: any | ||
Multi-Arch: same | ||
Depends: | ||
lua5.4, | ||
libslirp0, | ||
Description: The Cartesi Machine Emulator is the reference off-chain implementation of the Cartesi Machine Specification. | ||
It's written in C/C++ with POSIX dependencies restricted to the terminal, process, and memory-mapping facilities. | ||
It is distributed as a library and scriptable in the Lua programming language. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Source: <url://example.com> | ||
Upstream-Name: cartesi-machine | ||
Upstream-Contact: <preferred name and address to reach the upstream project> | ||
|
||
Files: | ||
* | ||
Copyright: | ||
<years> <put author's name and email here> | ||
<years> <likewise for another author> | ||
License: <special license> | ||
<Put the license of the package here indented by 1 space> | ||
<This follows the format of Description: lines in control file> | ||
. | ||
<Including paragraphs> | ||
|
||
# If you want to use GPL v2 or later for the /debian/* files use | ||
# the following clauses, or change it to suit. Delete these two lines | ||
Files: | ||
debian/* | ||
Copyright: | ||
2024 root <root@unknown> | ||
License: LGPL-3 | ||
. | ||
Comment: | ||
. | ||
|
||
# Please also look if there are files or directories which have a | ||
# different copyright/license attached and list them here. | ||
# Please avoid picking licenses with terms that are more restrictive than the | ||
# packaged work, as it may make Debian's contributions unacceptable upstream. | ||
# | ||
# If you need, there are some extra license texts available in two places: | ||
# /usr/share/debhelper/dh_make/licenses/ | ||
# /usr/share/common-licenses/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/make -f | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_auto_test: # skip | ||
override_dh_auto_build: | ||
make -j$(nproc) uarch all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters