Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
gocache
Dockerfile
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
branches: [$default-branch]
pull_request:
branches: [$default-branch]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
debian_packages: [BULLSEYE, BUSTER]
arch: [armhf, amd64]

steps:
- uses: actions/checkout@v3

- name: Build
run: make build DEBIAN_PACKAGES=${{ matrix.debian_packages }} ARCH=${{ matrix.arch }}

- uses: actions/upload-artifact@v3
with:
name: deb-${{ matrix.debian_packages }}-${{ matrix.arch }}
path: build/**/*.deb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
gocache/
debian/changelog
pkg/
.vscode/
32 changes: 24 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
ARG IMAGE
FROM ${IMAGE}

SHELL ["/bin/bash", "-c"]

ARG TARGET_ARCH

# Note: dh-systemd doesn't exist on bullseye anymore (it's been merged with debhelper)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git build-essential \
debhelper devscripts fakeroot git-buildpackage dh-make dh-golang \
&& \
(apt-get install -y --no-install-recommends dh-systemd || true) \
&& \
if [[ `dpkg-architecture -q DEB_BUILD_ARCH` != "${TARGET_ARCH}" ]]; then \
dpkg --add-architecture ${TARGET_ARCH} && \
apt-get update && \
apt-get install -y --no-install-recommends \
crossbuild-essential-${TARGET_ARCH}; \
fi && \
apt-get install -y --no-install-recommends \
libcairo2-dev:${TARGET_ARCH} \
libgtk-3-dev:${TARGET_ARCH}

ARG GO_TAGS
ENV GO_TAGS=${GO_TAGS}

RUN apt-get update && apt-get install -y --no-install-recommends \
git build-essential \
debhelper devscripts fakeroot git-buildpackage dh-make dh-systemd dh-golang \
libcairo2-dev \
libgtk-3-dev

# We cache go get gtk, to speed up builds.
#RUN go get -tags ${GO_TAGS} -v github.com/gotk3/gotk3/gtk/...

ADD . ${GOPATH}/src/github.com/Z-Bolt/OctoScreen/
ADD . /OctoScreen/
#RUN go get -tags ${GO_TAGS} -v ./...

WORKDIR ${GOPATH}/src/github.com/Z-Bolt/OctoScreen/
WORKDIR /OctoScreen/
61 changes: 0 additions & 61 deletions Gopkg.lock

This file was deleted.

72 changes: 0 additions & 72 deletions Gopkg.toml

This file was deleted.

43 changes: 24 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ GOTEST = $(GOCMD) test -v
# Environment
WORKDIR := $(shell pwd)
BUILD_PATH := $(WORKDIR)/build
GOCACHE_PATH = $(WORKDIR)/gocache
DOCKER_IMAGE_BUILD = mcuadros/octoprint-tft-build

DEBIAN_PACKAGES = STRETCH
DEBIAN_PACKAGES = BUSTER
ARCH = armhf
# ARCH = amd64

BUSTER_NAME := buster
BUSTER_IMAGE := golang:1.15-buster
BUSTER_GO_TAGS := gtk_3_24

STRETCH_NAME := stretch
STRETCH_IMAGE := golang:1.9-stretch
STRETCH_GO_TAGS := gtk_3_22

JESSIE_NAME := jessie
JESSIE_IMAGE := golang:1.8-jessie
JESSIE_GO_TAGS := gtk_3_14
BULLSEYE_NAME := bullseye
BULLSEYE_IMAGE := golang:1.20-bullseye
BULLSEYE_GO_TAGS := "gtk_3_24 glib_deprecated glib_2_66"

# Buster's gtk 3.24.5 doesn't work with gtk_3_24 tag
# Using gtk_3_22 produces some deprecation warnings, but it compiles
# More info: https://github.com/gotk3/gotk3/issues/874
BUSTER_NAME := buster
BUSTER_IMAGE := golang:1.20-buster
BUSTER_GO_TAGS := "gtk_3_22 glib_deprecated glib_2_58 pango_1_42"

# Build information
#GIT_COMMIT = $(shell git rev-parse HEAD | cut -c1-7)
Expand All @@ -49,28 +50,32 @@ export

build-environment:
mkdir -p ${BUILD_PATH}
mkdir -p ${GOCACHE_PATH}

build: | build-environment $(DEBIAN_PACKAGES)

$(DEBIAN_PACKAGES):
docker build \
--build-arg IMAGE=${${@}_IMAGE} \
--build-arg TARGET_ARCH=${ARCH} \
--build-arg GO_TAGS=${${@}_GO_TAGS} \
-t ${DOCKER_IMAGE_BUILD}:${${@}_NAME} . \
-t ${DOCKER_IMAGE_BUILD}:${${@}_NAME}-${ARCH} . \
&& \
docker run -it --rm \
-v ${BUILD_PATH}/${${@}_NAME}:/build \
${DOCKER_IMAGE_BUILD}:${${@}_NAME} \
docker run --rm \
-e TARGET_ARCH=${ARCH} \
-v ${BUILD_PATH}/${${@}_NAME}-${ARCH}:/build \
-v ${GOCACHE_PATH}/${${@}_NAME}-${ARCH}:/gocache \
${DOCKER_IMAGE_BUILD}:${${@}_NAME}-${ARCH} \
make build-internal

build-internal: prepare-internal
#go build --tags ${GO_TAGS} -v -o /build/bin/${BINARY_NAME} main.go
cd $(WORKDIR); \
debuild --prepend-path=/usr/local/go/bin/ --preserve-env -us -uc; \
cp ../*.deb /build/;
GOCACHE=/gocache debuild --prepend-path=/usr/local/go/bin/ --preserve-env -us -uc -a${TARGET_ARCH} \
&& cp ../*.deb /build/;

prepare-internal:
dch --create -v $(VERSION)-1 --package $(PACKAGE_NAME) empty; \
dch --create -v $(VERSION)-1 --package $(PACKAGE_NAME) --controlmaint empty; \
cd $(WORKDIR)/..; \
tar -czf octoscreen_$(VERSION).orig.tar.gz --exclude-vcs OctoScreen

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You will also need to set up the video drivers for the display you are using. I

### Install From a .deb Package

There are two ways to install OctoScreen: the recommended and supported way is to install from a .deb package, or you can choose to install from building the sources yourself. The recommended way to install OctoScreen is use the `.deb` packages from the [Releases](https://github.com/Z-Bolt/OctoScreen/releases) page. The packages are available for Debian Stretch based distributions such as Raspbian and OctoPi.
There are two ways to install OctoScreen: the recommended and supported way is to install from a .deb package, or you can choose to install from building the sources yourself. The recommended way to install OctoScreen is use the `.deb` packages from the [Releases](https://github.com/Z-Bolt/OctoScreen/releases) page. The packages are available for Debian based distributions such as Raspbian and OctoPi.

For example, to install on a new RaspberryPi with OctoPi:
```sh
Expand Down Expand Up @@ -115,10 +115,10 @@ make build
ls -1 build/
```

The default build is for the STRETCH release of debian, but BUSTER and JESSIE are also possible. To build one of these targets, you just have to specify the package during make.
Example for BUSTER:
The default build is for the BUSTER release of debian, but BULLSEYE is also possible. To build one of these targets, you just have to specify the package during make.
Example for BULLSEYE:
```sh
make build DEBIAN_PACKAGES=BUSTER
make build DEBIAN_PACKAGES=BULLSEYE
ls -1 build/
```

Expand Down
7 changes: 4 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ Section: devel
Priority: optional
Maintainer: Debian Go Packaging Team <[email protected]>
Uploaders: Máximo Cuadros <[email protected]>
Build-Depends: debhelper (>= 9),
Build-Depends: debhelper (>= 9.20160709),
dh-golang,
dh-systemd,
libcairo2-dev (>= 1.14.0),
libgtk-3-dev (>= 3.14)
Standards-Version: 4.1.1
Expand All @@ -22,8 +21,10 @@ Depends: ${shlibs:Depends},
${misc:Depends},
libcairo2 (>= 1.14.0),
libgtk-3-0 (>= 3.14),
librsvg2-common,
xserver-xorg,
xinit
xinit,
x11-xserver-utils
Provides: x-display-manager
Description: A OctoPrint touch interface for TFT touch modules based on GTK+3
OOctoScreen OOctoScreen, a touch interface for TFT touch modules
Expand Down
Loading