diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..caec7e1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "docker" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..ce02c41 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + - name: Build the Docker image + run: sh run.sh diff --git a/.gitignore b/.gitignore index 485dee6..4afcf19 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +build \ No newline at end of file diff --git a/README.md b/README.md index bfe3c9a..6ffe560 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,8 @@ TARGET_OPENJDK_VERSION="11" # 9, 10, 12, 13, 14 - retired, may not be working # loom or tip - experimental, may be broken # clone repository -git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git -cd openjdk-ev3 +# git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git +# cd openjdk-ev3 # prepare working directory mkdir -p "$TARGET_WORKSPACE" diff --git a/docs/images/build_process.png b/docs/images/build_process.png index 028e3aa..08ae0f7 100644 Binary files a/docs/images/build_process.png and b/docs/images/build_process.png differ diff --git a/docs/images/build_system_layers.png b/docs/images/build_system_layers.png index c2b1883..332a978 100644 Binary files a/docs/images/build_system_layers.png and b/docs/images/build_system_layers.png differ diff --git a/docs/images/host_machine_archs.png b/docs/images/host_machine_archs.png index 35c3d54..c669325 100644 Binary files a/docs/images/host_machine_archs.png and b/docs/images/host_machine_archs.png differ diff --git a/docs/images/packaging_process.png b/docs/images/packaging_process.png index 49d2063..f47fa5d 100644 Binary files a/docs/images/packaging_process.png and b/docs/images/packaging_process.png differ diff --git a/docs/images/release_process.png b/docs/images/release_process.png index 117d654..abed8de 100644 Binary files a/docs/images/release_process.png and b/docs/images/release_process.png differ diff --git a/packaging/Dockerfile b/packaging/Dockerfile index bbccd79..2615c41 100644 --- a/packaging/Dockerfile +++ b/packaging/Dockerfile @@ -14,7 +14,9 @@ RUN apt-get -qq update && \ zip unzip \ gnupg dctrl-tools dput \ liblcms2-2 \ - pigz xz-utils + pigz xz-utils \ + build-essential \ + g++ # prepare a nonroot user COPY compiler.sudoers /etc/sudoers.d/compiler diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..590e92e --- /dev/null +++ b/run.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +rm -rf build + +# define parameters +TARGET_WORKSPACE="$(pwd)/build" # 10 GB of free space should be sufficient, probably less +TARGET_DEBIAN_VERSION="stretch" # stretch or buster +TARGET_OPENJDK_VERSION="11" # 9, 10, 12, 13, 14 - retired, may not be working + # 11, 15 - most likely working + # loom or tip - experimental, may be broken + +# clone repository +# git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git +# cd openjdk-ev3 + +# prepare working directory +mkdir -p "$TARGET_WORKSPACE" +chmod -R 777 "$TARGET_WORKSPACE" # docker may not share UID with the current user + +# build base system container +docker build --build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \ + --build-arg ARCH="armel" \ + --tag "ev3dev-lang-java:jdk-cross-$TARGET_DEBIAN_VERSION" \ + --file ./system/Dockerfile.cross \ + ./system + +# on top of that, create a build scripts container +docker build --build-arg commit="$(git rev-parse HEAD)" \ + --build-arg extra="Manual build by $(whoami)" \ + --build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \ + --build-arg BUILD_TYPE="cross" \ + --tag "ev3dev-lang-java:jdk-cross-build" \ + ./scripts + +# now run the build +docker run --rm \ + --interactive \ + --tty \ + --volume "$TARGET_WORKSPACE:/build" \ + --env JDKVER="$TARGET_OPENJDK_VERSION" \ + --env JDKVM="client" \ + --env JDKPLATFORM="ev3" \ + --env JDKDEBUG="release" \ + --env AUTOBUILD="1" \ + ev3dev-lang-java:jdk-cross-build + +# finally, make workspace accessible for all users (i.e. current one too) and list files in its root +chmod -R 777 "$TARGET_WORKSPACE" +# and list the output directory (now it should contain three *-ev3.tar.gz files) +ls "$TARGET_WORKSPACE" \ No newline at end of file diff --git a/scripts/config.sh b/scripts/config.sh index bc094a9..d354024 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -19,7 +19,7 @@ TARBALL_MAX_DOWNLOADS=10 JRI_MODULES="java.se,jdk.jdwp.agent,jdk.unsupported,jdk.management.agent,jdk.jartool,jdk.crypto.ec" JTREG="$BUILDDIR/jtreg" -JTREG_URL="https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact/jtreg-4.2.0-tip.tar.gz" +JTREG_URL="https://ftp2.osuosl.org/pub/blfs/conglomeration/jdk/jtreg-4.2.0-tip.tar.gz" JTREG_FILE="$BUILDDIR/jtreg.tar.gz" ############################################################################### @@ -183,7 +183,7 @@ elif [ "$JDKVER" == "10" ]; then # OpenJDK 11 elif [ "$JDKVER" == "11" ]; then - VERSION_POLICY="latest_general_availability" + VERSION_POLICY="jdk-11.0.15+10" JAVA_SCM="git" JAVA_REPO="https://github.com/openjdk/jdk11u.git" PATCHVER="jdk11" diff --git a/system/Dockerfile.cross b/system/Dockerfile.cross index 1f0bcd7..48a9ab7 100644 --- a/system/Dockerfile.cross +++ b/system/Dockerfile.cross @@ -4,75 +4,75 @@ FROM debian:$DEBIAN_RELEASE ARG DEBIAN_RELEASE ARG ARCH -# this is a customized version of ev3dev-stretch-cross image +# This is a customized version of ev3dev-stretch-cross image -# setup repositories and install required packages +# Setup repositories and install required packages COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/ + +# Install native packages first RUN dpkg --add-architecture $ARCH && \ - apt-get -qq update && \ - DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ - bash-completion \ - ca-certificates \ - cmake \ - build-essential \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + ca-certificates wget curl less nano vim bash-completion tree sudo \ + man-db cmake build-essential gdb-multiarch pkg-config qemu-user-static \ + xz-utils zip pigz unzip cpio file make m4 gawk procps autoconf \ + autoconf-archive automake autotools-dev mercurial git systemtap \ + systemtap-sdt-dev zlib1g-dev gdb libarchive13 libbabeltrace-ctf1 \ + libbabeltrace1 libcurl3 libcurl3-gnutls libdw1 libgnutls30 \ + g++ + +# Install cross-compilation packages with ALL dependencies in one go +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ crossbuild-essential-$ARCH \ - gdb-multiarch \ - less \ - man-db \ - nano \ - pkg-config \ - qemu-user-static \ - sudo \ - tree \ - vim \ - wget \ - xz-utils \ - libcups2-dev:$ARCH \ - libfreetype6-dev:$ARCH \ + # X11 development libraries + libx11-dev:$ARCH \ + libxext-dev:$ARCH \ + libxrender-dev:$ARCH \ + libxrandr-dev:$ARCH \ + libxtst-dev:$ARCH \ + libxt-dev:$ARCH \ + # CUPS printing system + libcups2-dev:$ARCH \ + libcups2:$ARCH \ + libcupsimage2-dev:$ARCH \ + # Font and graphics + libfreetype6-dev:$ARCH \ + libfreetype6:$ARCH \ libfontconfig1-dev:$ARCH \ - libasound2-dev:$ARCH \ - libx11-dev:$ARCH \ - libxext-dev:$ARCH \ - libxrender-dev:$ARCH \ - libxrandr-dev:$ARCH \ - libxtst-dev:$ARCH \ - libxt-dev:$ARCH \ - libffi-dev:$ARCH \ - libpng-dev:$ARCH \ - libjpeg-dev:$ARCH \ - libgif-dev:$ARCH \ - liblcms2-dev:$ARCH \ - zlib1g-dev:$ARCH \ - systemtap \ - systemtap-sdt-dev \ - curl \ - make \ - m4 \ - cpio \ - gawk \ - file \ - zip \ - pigz \ - unzip \ - procps \ - autoconf \ - autoconf-archive \ - automake \ - autotools-dev \ - mercurial \ - git \ - zlib1g-dev && \ - ( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \ - wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \ + libfontconfig1:$ARCH \ + libexpat1-dev:$ARCH \ + # Multimedia + libasound2-dev:$ARCH \ + # Compression and images + libffi-dev:$ARCH \ + libpng-dev:$ARCH \ + libpng16-16:$ARCH \ + libjpeg-dev:$ARCH \ + libgif-dev:$ARCH \ + liblcms2-dev:$ARCH \ + zlib1g-dev:$ARCH \ + zlib1g:$ARCH \ + # Essential C development for cross-compilation + libc6-dev:$ARCH \ + linux-libc-dev:$ARCH \ + build-essential \ + g++ + +# Clean up +RUN rm -rf /var/lib/apt/lists/* + +# Download and extract architecture-specific systemtap-sdt-dev +RUN ( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \ + wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \ elif [ "$DEBIAN_RELEASE" = "buster" ]; then \ - wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \ + wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \ fi ) && \ dpkg-deb -x /tmp/systemtap.deb / && \ - rm -rf /tmp/systemtap.deb /var/lib/apt/lists/* + rm -rf /tmp/systemtap.deb -# prepare a nonroot user +# Prepare a nonroot user COPY compiler.sudoers /etc/sudoers.d/compiler RUN chmod 0440 /etc/sudoers.d/compiler && \ - adduser --disabled-password --gecos \"\" compiler && \ + adduser --disabled-password --gecos "" compiler && \ usermod -a -G sudo compiler diff --git a/system/Dockerfile.native b/system/Dockerfile.native index d7e5a5a..fff4218 100644 --- a/system/Dockerfile.native +++ b/system/Dockerfile.native @@ -9,58 +9,97 @@ ARG ARCH # setup repositories and install required packages COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/ -RUN apt-get -qq update && \ - DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ - bash-completion \ + +# Update package lists +RUN apt-get -qq update + +# Install core utilities +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ ca-certificates \ + wget \ + curl + +# Install text editors and pagers +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + less \ + nano \ + vim + +# Install shell utilities +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + bash-completion \ + tree + +# Install sudo and man-db +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + sudo \ + man-db + +# Install build tools and compilers +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ cmake \ build-essential \ gdb-multiarch \ - less \ - man-db \ - nano \ pkg-config \ - sudo \ - tree \ - vim \ - wget \ + g++ + +# Install compression and archiving tools +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ xz-utils \ - libcups2-dev \ - libfreetype6-dev \ - libfontconfig1-dev \ - libasound2-dev \ - libx11-dev \ - libxext-dev \ - libxrender-dev \ - libxrandr-dev \ - libxtst-dev \ - libxt-dev \ - libffi-dev \ - libpng-dev \ - libjpeg-dev \ - libgif-dev \ - liblcms2-dev \ - zlib1g-dev \ - systemtap \ - systemtap-sdt-dev \ - curl \ - make \ - m4 \ - cpio \ - gawk \ - file \ zip \ pigz \ unzip \ + cpio \ + file + +# Install build utilities +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + make \ + m4 \ + gawk \ procps \ autoconf \ autoconf-archive \ automake \ - autotools-dev \ + autotools-dev + +# Install version control systems +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ mercurial \ - git \ - zlib1g-dev && \ - rm -rf /var/lib/apt/lists/* + git + +# Install systemtap +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + systemtap \ + systemtap-sdt-dev + +# Install X11 and graphics libraries +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + libx11-dev \ + libxext-dev \ + libxrender-dev \ + libxrandr-dev \ + libxtst-dev \ + libxt-dev + +# Install multimedia libraries +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + libcups2-dev \ + libfreetype6-dev \ + libfontconfig1-dev \ + libasound2-dev + +# Install image and utility libraries +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \ + libffi-dev \ + libpng-dev \ + libjpeg-dev \ + libgif-dev \ + liblcms2-dev \ + zlib1g-dev + +# Clean up APT cache +RUN rm -rf /var/lib/apt/lists/* # prepare a nonroot user COPY compiler.sudoers /etc/sudoers.d/compiler diff --git a/system/sources.list.buster b/system/sources.list.buster index 17c1d92..0c843f0 100644 --- a/system/sources.list.buster +++ b/system/sources.list.buster @@ -1,4 +1,2 @@ -deb http://deb.debian.org/debian buster main contrib non-free -deb http://deb.debian.org/debian buster-updates main contrib non-free -deb http://deb.debian.org/debian-security buster/updates main contrib non-free -deb http://archive.ev3dev.org/debian buster main +deb [check-valid-until=no] http://archive.debian.org/debian buster main contrib non-free +deb http://archive.ev3dev.org/debian buster main diff --git a/system/sources.list.stretch b/system/sources.list.stretch index c0f063b..e96cbfe 100644 --- a/system/sources.list.stretch +++ b/system/sources.list.stretch @@ -1,4 +1,3 @@ -deb http://deb.debian.org/debian stretch main contrib non-free -deb http://deb.debian.org/debian stretch-updates main contrib non-free -deb http://deb.debian.org/debian-security stretch/updates main contrib non-free -deb http://archive.ev3dev.org/debian stretch main +deb [check-valid-until=no] http://archive.debian.org/debian stretch main contrib non-free +deb [check-valid-until=no] http://archive.debian.org/debian-security stretch/updates main contrib non-free +deb http://archive.ev3dev.org/debian stretch main \ No newline at end of file