From 1512158f0d1c9cb1ed5ebf5d5266c60fac565526 Mon Sep 17 00:00:00 2001 From: Matt Harlum Date: Tue, 25 Mar 2025 21:57:25 +1300 Subject: [PATCH] Initial commit. --- .gitignore | 2 ++ Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ build.sh | 5 +++++ gwlicense.ini | 3 +++ run-gw.sh | 3 +++ 5 files changed, 54 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100755 build.sh create mode 100644 gwlicense.ini create mode 100755 run-gw.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bbe2346 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +license.lic +*.tar.gz diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b13e4e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:focal + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get -y update && \ + apt-get -y install \ + vim \ + make \ + git \ + curl \ + python3 \ + python3-pip \ + libgl1 \ + libnss3 \ + libxcomposite1 \ + libxdamage1 \ + libxrandr2 \ + libxtst6 \ + libxkbcommon0 \ + libdbus-1-3 \ + libglib2.0-0 \ + libasound2 \ + libfontconfig1 \ + libfreetype6 \ + x11-apps \ + qt5-default \ + kmod + +ADD Gowin_V1.9.11.01_linux.tar.gz /opt/gowin + +COPY gwlicense.ini /opt/gowin/IDE/bin/gwlicense.ini + +RUN useradd -s /bin/bash -m ubuntu + +ENV PATH=/opt/gowin/IDE/bin:/opt/gowin/Programmer/bin:$PATH + +ENV QT_QPA_PLATFORM=xcb +ENV LD_LIBRARY_PATH=/opt/gowin/IDE/lib + +USER ubuntu +WORKDIR /home/ubuntu diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7bb9018 --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +TAG=$(git rev-parse --short HEAD) +REPO=liv2/gowin +docker build -t ${REPO}:${TAG} . +docker tag ${REPO}:${TAG} ${REPO}:latest diff --git a/gwlicense.ini b/gwlicense.ini new file mode 100644 index 0000000..3c6997d --- /dev/null +++ b/gwlicense.ini @@ -0,0 +1,3 @@ +[license] +lic="/opt/gowin/license.lic" + diff --git a/run-gw.sh b/run-gw.sh new file mode 100755 index 0000000..bc6597f --- /dev/null +++ b/run-gw.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker run --rm -it -e DISPLAY=$DISPLAY -v /dev/bus:/dev/bus --device-cgroup-rule='c *:* rmw' -v /tmp/.X11-unix:/tmp/.X11-unix --hostname gowin --mac-address ${MAC} -v ~/.Xauthority:/home/ubuntu/.Xauthority -e XAUTHORITY=/home/ubuntu/.Xauthority -v ${PWD}/license.lic:/opt/gowin/license.lic -it liv2/gowin +