commit 71d19122132d23d0bd994c7a8bd46a84d6f0a3c3 Author: Arsen Musayelyan Date: Thu Nov 24 16:33:55 2022 -0800 Initial Commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..72c716d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM techknowlogick/xgo:latest + +# Add arm64 and armhf repos +COPY arm.list /etc/apt/sources.list.d/arm.list + +# Add all needed architectures +RUN dpkg --add-architecture arm64 \ + && dpkg --add-architecture armhf \ + && dpkg --add-architecture i386 + +# Set all current repos to only use amd64 and i386 +RUN sed -i 's/deb/deb \[arch=amd64,i386\]/g' /etc/apt/sources.list + +RUN apt-get update + +# Install Fyne dependencies +RUN apt-get install -y \ + xorg-dev \ + libgl1-mesa-dev \ + libx11-dev \ + libxrandr-dev \ + libxi-dev \ + libxcursor-dev \ + libxinerama-dev \ + libgl1-mesa-dev:i386 \ + libx11-dev:i386 \ + libxrandr-dev:i386 \ + libxi-dev:i386 \ + libxcursor-dev:i386 \ + libxinerama-dev:i386 \ + libgl1-mesa-dev:arm64 \ + libx11-dev:arm64 \ + libxrandr-dev:arm64 \ + libxi-dev:arm64 \ + libxcursor-dev:arm64 \ + libxinerama-dev:arm64 \ + libgl1-mesa-dev:armhf \ + libx11-dev:armhf \ + libxrandr-dev:armhf \ + libxi-dev:armhf \ + libxcursor-dev:armhf \ + libxinerama-dev:armhf + +RUN sed -i -e 's|/source|$\{SOURCE_DIR\}|g' -e 's|/build|$\{OUT_DIR\}|g' /build.sh + +ENTRYPOINT [] diff --git a/README.md b/README.md new file mode 100644 index 0000000..9cdc1fb --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# fyne-xgo-docker + +This project contains files for building a docker container based on [xgo](https://github.com/techknowlogick/xgo) that contains all of Fyne's dependencies for various architectures. + +This allows for building Fyne programs for multiple architectures easily. Currently, the following platforms are supported: + +- `linux/amd64` +- `linux/386` +- `linux/arm64` +- `linux/arm` (`GOARM=7`) + +The `xgo` build script has been modified so that the `SOURCE_DIR` and `BUILD_DIR` environment variables correspond to where `xgo` look for sources and where it puts its output binaries. This allows for easy use within Continuous Integration engines. + +The entrypoint has also been removed to allow running other commands, so run `/build.sh` if you want to start the build. diff --git a/arm.list b/arm.list new file mode 100644 index 0000000..2148055 --- /dev/null +++ b/arm.list @@ -0,0 +1,14 @@ +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic main restricted +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main restricted +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main restricted +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-backports main restricted + +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic universe +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security universe +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates universe +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-backports universe + +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic multiverse +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security multiverse +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates multiverse +deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-backports multiverse