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

Image updates - maintenance release #55

Merged
merged 23 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c66cac9
base: update Go to v1.23.4 and Fyne to v2.5.3
lucor Dec 19, 2024
51ef0ea
base: fix docker syntax
lucor Dec 28, 2024
cb78140
darwin: verify zig download using minisign
lucor Dec 28, 2024
a53c999
darwin-sdk-extractor: update to support zig 0.13.0 syntax
lucor Dec 28, 2024
9390e73
freebsd: update to freebsd 14.2
lucor Dec 28, 2024
fd43ab2
doc: MacOS SDK to report only SDK 11.3 is supported
lucor Dec 28, 2024
d5f5af8
freebsd: update LLVM to v17
lucor Dec 28, 2024
bd4ece8
base: update to bookworm
lucor Dec 28, 2024
46f299a
base: Go do not auto-upgrade the gotoolchain
lucor Dec 28, 2024
dcc8d81
linux: add libdecor for better wayland support
lucor Dec 28, 2024
c6382c9
readme: fix some wording
lucor Dec 28, 2024
dbf4b96
freebsd: fix wrong repository for the llvm installation
lucor Jan 7, 2025
30b6df5
android: update openjdk version
lucor Jan 7, 2025
2506c71
web: remove GopherJS from docker image
lucor Jan 13, 2025
c58fd2a
freebsd: remove not necessary code
lucor Jan 13, 2025
c7394c4
CI: re-enable freebsd arm64 to check if works with latest updates
lucor Jan 13, 2025
a9678bf
CI: test fyne-cross@develop
lucor Jan 13, 2025
34a10e9
freebsd: rollback xorg package to minimal
lucor Jan 13, 2025
8798f45
CI: attempt to fix freebsd arm64 build
lucor Jan 13, 2025
563074f
base: update Go to 1.23.5
lucor Jan 19, 2025
60eee31
Merge branch 'main' into image-updates-2024
lucor Jan 19, 2025
9186ad4
CI: revert main changes
lucor Jan 19, 2025
250d0b6
minisign: install using binaries to support arm64
lucor Jan 19, 2025
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Fyne Cross Images

fyne-cross is a simple tool to cross compile and create distribution packages
for [Fyne](https://fyne.io) applications using docker images that include Linux,
the MinGW compiler for Windows, FreeBSD, and a macOS SDK, along with the Fyne
for [Fyne](https://fyne.io) applications using docker images that include Linux,
Windows, FreeBSD, and a macOS SDK, along with the Fyne
requirements.

This project provides the docker images required by fyne-cross to cross compile.
Expand Down Expand Up @@ -35,7 +35,7 @@ The supported architectures for the host are `amd64`and `arm64`.
| web | :white_check_mark: | :white_check_mark: |

> Note:
> - darwin images should work out of the box against MacOSX SDKs 11.3.
> - darwin images work against macOS SDK 11.3. Other SDKs are not supported.
> Other SDK versions could require a different min SDK version that can specified using the `--macosx-version-min` flag
> - android NDK is not available for linux/arm64, cross-compilation from arm64 hosts won't be supported in this initial release

Expand Down
2 changes: 1 addition & 1 deletion android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base
# Install Java
RUN apt-get update && \
apt-get upgrade -qy && \
apt-get install -qy openjdk-11-jdk p7zip-full && \
apt-get install -qy openjdk-17-jdk p7zip-full && \
apt-get -qy autoremove && \
apt-get clean && \
rm -r /var/lib/apt/lists/*;
Expand Down
36 changes: 21 additions & 15 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM debian:bullseye-slim AS base
# minisign is needed to verify the zig download
FROM jedisct1/minisign AS minisign

ENV GO_VERSION=1.22.5
# dev version of Zig to support windows-386 target
# see: https://github.com/ziglang/zig/pull/13569
FROM debian:bookworm-slim AS base

ENV GO_VERSION=1.23.4
ENV GO_AMD64_CHECKSUM="6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971"
ENV GO_ARM64_CHECKSUM="16e5017863a7f6071363782b1b8042eb12c6ca4f4cd71528b2123f0a1275b13e"
ENV ZIG_VERSION=0.13.0
ENV FYNE_VERSION=v2.4.4
ENV ZIG_MINISIGN_KEY="RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U"
ENV FYNE_VERSION=v2.5.3
ENV FIXUID_VERSION=0.5.1

# Install common dependencies
Expand Down Expand Up @@ -35,11 +39,11 @@ RUN set -eux; \
case "$arch" in \
'amd64') \
url="https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz";\
sha256='904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0'; \
sha256=${GO_AMD64_CHECKSUM};\
;; \
'arm64') \
url="https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz";\
sha256='8d21325bfcf431be3660527c1a39d3d9ad71535fabdf5041c826e44e31642b5a'; \
sha256=${GO_ARM64_CHECKSUM};\
;; \
*) echo >&2 "error: unsupported architecture '$arch'"; exit 1 ;; \
esac; \
Expand All @@ -54,40 +58,42 @@ ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH

# don't auto-upgrade the gotoolchain
# https://github.com/docker-library/golang/issues/472
ENV GOTOOLCHAIN=local

# Install Zig

# copy minisign
COPY --from=minisign /usr/local/bin/minisign /usr/local/bin/minisign

RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
url=; \
sha256=; \
public_key=${ZIG_MINISIGN_KEY}; \
case "$arch" in \
'amd64') \
# dev release
# url="https://ziglang.org/builds/zig-linux-x86_64-${ZIG_VERSION}.tar.xz";\
# stable release
url="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz";\
sha256='d45312e61ebcc48032b77bc4cf7fd6915c11fa16e4aad116b66c9468211230ea'; \
;; \
'arm64') \
# dev release
#url="https://ziglang.org/builds/zig-linux-aarch64-${ZIG_VERSION}.tar.xz";\
# stable release
url="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-aarch64-${ZIG_VERSION}.tar.xz";\
sha256='041ac42323837eb5624068acd8b00cd5777dac4cf91179e8dad7a7e90dd0c556'; \
;; \
*) echo >&2 "error: unsupported architecture '$arch'"; exit 1 ;; \
esac; \
curl -sSL ${url} -o zig.tar.xz; \
echo ${sha256} zig.tar.xz | sha256sum -c -; \
curl -sSL ${url}.minisig -o zig.tar.xz.minisig; \
minisign -Vm zig.tar.xz -P ${public_key}; \
tar -C /usr/local -Jxvf zig.tar.xz; \
mv /usr/local/zig-* /usr/local/zig; \
rm zig.tar.xz; \
zig version;

# Zig: add arm-features.h from glibc source to allow build on linux arm. See https://github.com/ziglang/zig/pull/12346
# TODO: remove once 0.10.1 or greater is released
RUN curl -SsL https://raw.githubusercontent.com/ziglang/zig/d9a754e5e39f6e124b9f5be093d89ba30f16f085/lib/libc/glibc/sysdeps/arm/arm-features.h > /usr/local/zig/lib/libc/glibc/sysdeps/arm/arm-features.h

##################################################################
### Tools section
### NOTE: Ensure all tools are installed under /usr/local/bin
Expand Down
6 changes: 2 additions & 4 deletions darwin-sdk-extractor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ ARG FYNE_CROSS_IMAGES_VERSION
ARG FYNE_CROSS_REPOSITORY

# fyne-cross image for linux
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base as build
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base AS build

RUN set -eux; \
apt-get update; \
apt-get install -y -q --no-install-recommends \
# required to complile xar and pbzx
libxml2-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev \
; \
# remove static libs to force zig to use dynamic lib
rm /usr/lib/*-linux-gnu/lib*.a; \
apt-get -qy autoremove; \
apt-get clean; \
rm -r /var/lib/apt/lists/*;
Expand All @@ -26,7 +24,7 @@ RUN set -eux; \
cd xar/xar; CC="zig cc" ./configure; \
cd /build; \
mv /tmp/build.zig . ; \
zig build
zig build -Doptimize=ReleaseSmall


# fyne-cross image for linux
Expand Down
103 changes: 55 additions & 48 deletions darwin-sdk-extractor/resources/build.zig
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
const std = @import("std");

pub fn build(b: *std.build.Builder) void {
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const xar = b.addStaticLibrary(.{
.name = "xar",
.root_source_file = null,
.target = target,
.optimize = optimize,
});
xar.addCSourceFiles(&.{
"xar/xar/lib/archive.c",
"xar/xar/lib/arcmod.c",
"xar/xar/lib/b64.c",
"xar/xar/lib/bzxar.c",
"xar/xar/lib/darwinattr.c",
"xar/xar/lib/data.c",
"xar/xar/lib/ea.c",
"xar/xar/lib/err.c",
"xar/xar/lib/ext2.c",
"xar/xar/lib/fbsdattr.c",
"xar/xar/lib/filetree.c",
"xar/xar/lib/hash.c",
"xar/xar/lib/io.c",
"xar/xar/lib/linuxattr.c",
"xar/xar/lib/lzmaxar.c",
"xar/xar/lib/macho.c",
"xar/xar/lib/script.c",
"xar/xar/lib/signature.c",
"xar/xar/lib/stat.c",
"xar/xar/lib/subdoc.c",
"xar/xar/lib/util.c",
"xar/xar/lib/zxar.c",
}, &[_][]const u8{});
xar.addIncludePath("xar/xar/include");
xar.addIncludePath("/usr/include");
xar.addIncludePath("/usr/include/libxml2");
xar.addIncludePath("/usr/include/x86_64-linux-gnu");
xar.addCSourceFiles(.{
.files = &[_][]const u8{
"xar/xar/lib/archive.c",
"xar/xar/lib/arcmod.c",
"xar/xar/lib/b64.c",
"xar/xar/lib/bzxar.c",
"xar/xar/lib/darwinattr.c",
"xar/xar/lib/data.c",
"xar/xar/lib/ea.c",
"xar/xar/lib/err.c",
"xar/xar/lib/ext2.c",
"xar/xar/lib/fbsdattr.c",
"xar/xar/lib/filetree.c",
"xar/xar/lib/hash.c",
"xar/xar/lib/io.c",
"xar/xar/lib/linuxattr.c",
"xar/xar/lib/lzmaxar.c",
"xar/xar/lib/macho.c",
"xar/xar/lib/script.c",
"xar/xar/lib/signature.c",
"xar/xar/lib/stat.c",
"xar/xar/lib/subdoc.c",
"xar/xar/lib/util.c",
"xar/xar/lib/zxar.c",
},
.flags = &[_][]const u8{},
});
xar.addIncludePath(b.path("xar/xar/include"));
xar.addIncludePath(.{ .cwd_relative = "/usr/include" });
xar.addIncludePath(.{ .cwd_relative = "/usr/include/libxml2" });
xar.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu" });
xar.defineCMacro("_GNU_SOURCE", "1");

xar.addLibraryPath("/usr/lib/x86_64-linux-gnu");
xar.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu" });
xar.linkSystemLibrary("lzma");
xar.linkSystemLibrary("bz2");
xar.linkSystemLibrary("z");
Expand All @@ -48,27 +51,29 @@ pub fn build(b: *std.build.Builder) void {
xar.linkLibC();
b.installArtifact(xar);

b.installDirectory(std.build.InstallDirectoryOptions{
.source_dir = "xar/xar/include",
b.installDirectory(.{
.source_dir = b.path("xar/xar/include"),
.install_dir = .header,
.install_subdir = "xar",
});

const xarexe = b.addExecutable(.{
.name = "xar",
.root_source_file = null,
.target = target,
.optimize = optimize,
});
xarexe.addCSourceFile("xar/xar/src/xar.c", &[_][]const u8{});
xarexe.addIncludePath("xar/xar/include");
xarexe.addIncludePath("/usr/include");
xarexe.addIncludePath("/usr/include/libxml2");
xarexe.addIncludePath("/usr/include/x86_64-linux-gnu");
xarexe.addCSourceFile(.{
.file = b.path("xar/xar/src/xar.c"),
.flags = &[_][]const u8{},
});
xarexe.addIncludePath(b.path("xar/xar/include"));
xarexe.addIncludePath(.{ .cwd_relative = "/usr/include" });
xarexe.addIncludePath(.{ .cwd_relative = "/usr/include/libxml2" });
xarexe.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu" });
xarexe.defineCMacro("_GNU_SOURCE", "1");

xarexe.addLibraryPath("zig-out/lib");
xarexe.addLibraryPath("/usr/lib/x86_64-linux-gnu");
xarexe.linkLibrary(xar);
xarexe.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu" });
xarexe.linkSystemLibrary("xml2");
xarexe.linkSystemLibrary("z");
xarexe.linkSystemLibrary("crypto");
Expand All @@ -81,17 +86,19 @@ pub fn build(b: *std.build.Builder) void {

const exe = b.addExecutable(.{
.name = "pbxz",
.root_source_file = null,
.target = target,
.optimize = optimize,
});
exe.addCSourceFile("pbzx/pbzx.c", &[_][]const u8{});
exe.addIncludePath("zig-out/include");
exe.addIncludePath("/usr/include");
exe.addIncludePath("/usr/include/x86_64-linux-gnu");
exe.addCSourceFile(.{
.file = b.path("pbzx/pbzx.c"),
.flags = &[_][]const u8{},
});
exe.addIncludePath(b.path("zig-out/include"));
exe.addIncludePath(.{ .cwd_relative = "/usr/include" });
exe.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu" });

exe.addLibraryPath("/usr/lib/x86_64-linux-gnu");
exe.addLibraryPath("zig-out/lib");
exe.linkLibrary(xar);
exe.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu" });
exe.linkSystemLibrary("xml2");
exe.linkSystemLibrary("z");
exe.linkSystemLibrary("crypto");
Expand Down
12 changes: 5 additions & 7 deletions darwin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,29 @@ ARG FYNE_CROSS_REPOSITORY
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base

# 0.9.1 version of Zig to support darwin targets
# see: ...
# see: https://github.com/ziglang/zig/issues/20689
ENV ZIG_VERSION=0.9.1

# Install Zig
RUN set -eux; \
rm -rf /usr/local/zig; \
arch="$(dpkg --print-architecture)"; \
url=; \
sha256=; \
public_key=${ZIG_MINISIGN_KEY}; \
case "$arch" in \
'amd64') \
# stable release
url="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz";\
sha256='be8da632c1d3273f766b69244d80669fe4f5e27798654681d77c992f17c237d7'; \
;; \
'arm64') \
# stable release
url="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-aarch64-${ZIG_VERSION}.tar.xz";\
sha256='5d99a39cded1870a3fa95d4de4ce68ac2610cca440336cfd252ffdddc2b90e66'; \
;; \
*) echo >&2 "error: unsupported architecture '$arch'"; exit 1 ;; \
esac; \
curl -sSL ${url} -o zig.tar.xz; \
echo ${sha256} zig.tar.xz | sha256sum -c -; \
curl -sSL ${url}.minisig -o zig.tar.xz.minisig; \
minisign -Vm zig.tar.xz -P ${public_key}; \
tar -C /usr/local -Jxvf zig.tar.xz; \
mv /usr/local/zig-* /usr/local/zig; \
rm zig.tar.xz; \
zig version;

10 changes: 5 additions & 5 deletions freebsd/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ ARG FYNE_CROSS_IMAGES_VERSION
ARG FYNE_CROSS_REPOSITORY

# fyne-cross image for linux
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-freebsd-base as pkg
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-freebsd-base AS pkg

# Download FreeBSD base, extract libs/includes, pkg keys and configs
# and install fyne dependencies
# Based on: https://github.com/myfreeweb/docker-freebsd-cross/tree/fc70196f62c00a10eb61a45a4798e09214e0cdfd
ENV ABI="FreeBSD:13:amd64"
ENV ABI="FreeBSD:14:amd64"
RUN mkdir /freebsd \
&& mkdir /etc/pkg/ \
&& curl https://download.freebsd.org/ftp/releases/amd64/13.3-RELEASE/base.txz | \
&& curl https://download.freebsd.org/ftp/releases/amd64/14.2-RELEASE/base.txz | \
bsdtar -xf - -C /freebsd ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc \
&& cp /freebsd/etc/pkg/FreeBSD.conf /etc/pkg/ \
&& ln -s /freebsd/usr/share/keys /usr/share/keys
Expand All @@ -19,8 +19,8 @@ RUN mkdir /freebsd \
ENV PKG_CONFIG_SYSROOT_DIR=/freebsd
ENV PKG_CONFIG_LIBDIR=/freebsd/usr/libdata/pkgconfig:/freebsd/usr/local/libdata/pkgconfig

RUN pkg fetch -o /tmp/download --yes -d xorg-minimal glfw; \
bsdtar -C /freebsd /tmp/download/All/*.pkg; \
RUN pkg fetch -o /tmp/download --yes -d xorg glfw; \
#bsdtar -C /freebsd /tmp/download/All/*.pkg; \
andydotxyz marked this conversation as resolved.
Show resolved Hide resolved
rm -rf /tmp/download/All/*llvm*; \
rm -rf /tmp/download/All/*perl*; \
rm -rf /tmp/download/All/*python*; \
Expand Down
4 changes: 2 additions & 2 deletions freebsd/arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-freebsd-base as pkg
# Download FreeBSD base, extract libs/includes, pkg keys and configs
# and install fyne dependencies
# Based on: https://github.com/myfreeweb/docker-freebsd-cross/tree/fc70196f62c00a10eb61a45a4798e09214e0cdfd
ENV ABI="FreeBSD:13:aarch64"
ENV ABI="FreeBSD:14:aarch64"
RUN mkdir /freebsd \
&& mkdir /etc/pkg/ \
&& curl https://download.freebsd.org/ftp/releases/arm64/13.3-RELEASE/base.txz | \
&& curl https://download.freebsd.org/ftp/releases/arm64/14.2-RELEASE/base.txz | \
bsdtar -xf - -C /freebsd ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc \
&& cp /freebsd/etc/pkg/FreeBSD.conf /etc/pkg/ \
&& ln -s /freebsd/usr/share/keys /usr/share/keys
Expand Down
6 changes: 3 additions & 3 deletions freebsd/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG FYNE_CROSS_IMAGES_VERSION
ARG FYNE_CROSS_REPOSITORY

# fyne-cross image for linux
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base as pkg
FROM ${FYNE_CROSS_REPOSITORY}:${FYNE_CROSS_IMAGES_VERSION}-base AS pkg

RUN set -eux; \
apt-get update; \
Expand Down Expand Up @@ -49,12 +49,12 @@ FROM pkg
COPY --from=pkg /pkg /pkg

ENV PATH=/pkg/sbin:${PATH}
ENV LLVM_VERSION=12
ENV LLVM_VERSION=17

RUN apt-get update -qq \
&& apt install -y -q --no-install-recommends gnupg \
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list > /dev/null \
&& echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${LLVM_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list > /dev/null \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
clang-${LLVM_VERSION} \
Expand Down
Loading
Loading