Skip to content

Commit b8e3a5e

Browse files
authored
Merge pull request #20 from linuxdeploy/gtk4
GTK 4 support
2 parents 65a5042 + 6096f6f commit b8e3a5e

12 files changed

+349
-27
lines changed

.github/workflows/containers.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Containers
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
containers:
7+
strategy:
8+
matrix:
9+
gtk-version: [gtk3, gtk4]
10+
linux-distro: [debian, fedora, opensuse, ubuntu]
11+
12+
name: ${{ matrix.linux-distro }} ${{ matrix.gtk-version }}
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
GTK_VERSION: ${{ matrix.gtk-version }}
17+
LINUX_DISTRO: ${{ matrix.linux-distro }}
18+
ARTIFACT_DIR: "${{ github.workspace }}/AppImages"
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Build container
25+
run: |
26+
mkdir -pv "${ARTIFACT_DIR}"
27+
buildah bud \
28+
--squash \
29+
-v "${ARTIFACT_DIR}:/AppImage:rw,z,shared" \
30+
-t "linuxdeploy-plugin-${GTK_VERSION}:${LINUX_DISTRO}" \
31+
-f "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" \
32+
.
33+
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
name: ${{ matrix.linux-distro }} with ${{ matrix.gtk-version }}
37+
path: ${{ env.ARTIFACT_DIR }}/
38+
retention-days: 30

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ jobs:
77
name: Linux x64_64
88
runs-on: ubuntu-latest
99

10+
env:
11+
REPODIR: "${{ github.workspace }}"
12+
APPDIR: "/tmp/AppDir"
13+
DEPLOY_GTK_VERSION: 3
14+
1015
steps:
1116
- uses: actions/checkout@v2
1217

13-
- name: Set environment variables
14-
run: |
15-
echo "REPODIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
16-
echo "APPDIR=/tmp/AppDir" >> $GITHUB_ENV
17-
1818
- name: Setup dependencies
1919
run: |
2020
sudo apt-get update -y -qq
@@ -29,7 +29,7 @@ jobs:
2929
3030
- name: Run test script
3131
run: |
32-
mkdir -pv "$APPDIR"
32+
mkdir -pv "$APPDIR/usr/bin"
3333
./test-plugins.sh
3434
3535
- name: Display files inside AppDir

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
# linuxdeploy-plugin-gtk
22

3-
This is an (as of yet experimental) plugin for linuxdeploy. Its job is to bundle additional resources for applications that use Gtk+ 2 or 3, and for common dependencies. Those involve GLib schemas for instance.
3+
This is an (as of yet experimental) plugin for linuxdeploy. Its job is to bundle additional resources for applications that use GTK, and for common dependencies. Those involve GLib schemas for instance.
44

5+
## Dependencies
6+
7+
This plugin requires the following dependencies in order to work properly:
8+
9+
- `patchelf` command
10+
- `file` command
11+
- `find` command
12+
- `pkg-config` or `pkgconf` command
13+
- librsvg2 development files
14+
- GTK development files
515

616
## Usage
717

@@ -10,6 +20,9 @@ This is an (as of yet experimental) plugin for linuxdeploy. Its job is to bundle
1020
> wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
1121
> wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
1222

23+
# get list of variables
24+
> ./linuxdeploy-plugin-gtk.sh --help
25+
1326
# first option: install your app into your AppDir via `make install` etc.
1427
# second option: bundle your app's main executables manually
1528
# see https://docs.appimage.org/packaging-guide/from-source/native-binaries.html for more information

containers/gtk3/Dockerfile.debian

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM docker.io/debian:buster AS build-stage
2+
WORKDIR /linuxdeploy
3+
ENV APPIMAGE_EXTRACT_AND_RUN=1
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ARG APPDIR=/AppDir
6+
ARG TZ=UTC
7+
RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone
8+
RUN apt-get update && \
9+
apt-get install -y wget patchelf librsvg2-dev file findutils pkg-config libgtk-3-0 libgtk-3-dev gtk-3-examples
10+
COPY . .
11+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
12+
RUN chmod +x *.sh *.AppImage
13+
RUN ./linuxdeploy-x86_64.AppImage \
14+
--appdir ${APPDIR} \
15+
--plugin gtk \
16+
--output appimage \
17+
--executable /usr/bin/gtk3-widget-factory \
18+
--desktop-file /usr/share/applications/gtk3-widget-factory.desktop \
19+
--icon-file /usr/share/icons/hicolor/256x256/apps/gtk3-widget-factory.png
20+
21+
FROM docker.io/debian:buster
22+
VOLUME ["/AppImage"]
23+
WORKDIR /AppImage
24+
ENV APPIMAGE_EXTRACT_AND_RUN=1
25+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
26+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk3/Dockerfile.fedora

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM docker.io/fedora:33 AS build-stage
2+
WORKDIR /linuxdeploy
3+
ENV APPIMAGE_EXTRACT_AND_RUN=1
4+
ARG APPDIR=/AppDir
5+
RUN dnf install -y wget patchelf librsvg2-devel file findutils pkgconfig gtk3 gtk3-devel
6+
COPY . .
7+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
8+
RUN chmod +x *.sh *.AppImage
9+
RUN ./linuxdeploy-x86_64.AppImage \
10+
--appdir ${APPDIR} \
11+
--plugin gtk \
12+
--output appimage \
13+
--executable /usr/bin/gtk3-widget-factory \
14+
--desktop-file /usr/share/applications/gtk3-widget-factory.desktop \
15+
--icon-file /usr/share/icons/hicolor/256x256/apps/gtk3-widget-factory.png
16+
17+
FROM docker.io/fedora:33
18+
VOLUME ["/AppImage"]
19+
WORKDIR /AppImage
20+
ENV APPIMAGE_EXTRACT_AND_RUN=1
21+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
22+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk3/Dockerfile.opensuse

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM docker.io/opensuse/leap:15 AS build-stage
2+
WORKDIR /linuxdeploy
3+
ENV APPIMAGE_EXTRACT_AND_RUN=1
4+
ARG APPDIR=/AppDir
5+
RUN zypper install -y wget patchelf librsvg2-devel file findutils pkg-config gtk3 gtk3-devel
6+
COPY . .
7+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
8+
RUN chmod +x *.sh *.AppImage
9+
RUN ./linuxdeploy-x86_64.AppImage \
10+
--appdir ${APPDIR} \
11+
--plugin gtk \
12+
--output appimage \
13+
--executable /usr/bin/gtk3-widget-factory \
14+
--desktop-file /usr/share/applications/gtk3-widget-factory.desktop \
15+
--icon-file /usr/share/icons/hicolor/256x256/apps/gtk3-widget-factory.png
16+
17+
FROM docker.io/opensuse/leap:15
18+
VOLUME ["/AppImage"]
19+
WORKDIR /AppImage
20+
ENV APPIMAGE_EXTRACT_AND_RUN=1
21+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
22+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk3/Dockerfile.ubuntu

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM docker.io/ubuntu:focal AS build-stage
2+
WORKDIR /linuxdeploy
3+
ENV APPIMAGE_EXTRACT_AND_RUN=1
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ARG APPDIR=/AppDir
6+
ARG TZ=UTC
7+
RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone
8+
RUN apt-get update && \
9+
apt-get install -y wget patchelf librsvg2-dev file findutils pkg-config libgtk-3-0 libgtk-3-dev gtk-3-examples
10+
COPY . .
11+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
12+
RUN chmod +x *.sh *.AppImage
13+
RUN ./linuxdeploy-x86_64.AppImage \
14+
--appdir ${APPDIR} \
15+
--plugin gtk \
16+
--output appimage \
17+
--executable /usr/bin/gtk3-widget-factory \
18+
--desktop-file /usr/share/applications/gtk3-widget-factory.desktop \
19+
--icon-file /usr/share/icons/hicolor/256x256/apps/gtk3-widget-factory.png
20+
21+
FROM docker.io/ubuntu:focal
22+
VOLUME ["/AppImage"]
23+
WORKDIR /AppImage
24+
ENV APPIMAGE_EXTRACT_AND_RUN=1
25+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
26+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk4/Dockerfile.debian

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# GTK4 is not yet supported on Debian Stable
2+
FROM docker.io/debian:experimental AS build-stage
3+
WORKDIR /linuxdeploy
4+
ENV APPIMAGE_EXTRACT_AND_RUN=1
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
ARG APPDIR=/AppDir
7+
ARG TZ=UTC
8+
RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone
9+
RUN apt-get update && \
10+
apt-get install -y wget patchelf librsvg2-dev file findutils pkg-config && \
11+
apt-get install -y -t experimental libgtk-4-1 libgtk-4-dev gtk-4-examples
12+
COPY . .
13+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
14+
RUN chmod +x *.sh *.AppImage
15+
RUN ./linuxdeploy-x86_64.AppImage \
16+
--appdir ${APPDIR} \
17+
--plugin gtk \
18+
--output appimage \
19+
--executable /usr/bin/gtk4-widget-factory \
20+
--desktop-file /usr/share/applications/org.gtk.WidgetFactory4.desktop \
21+
--icon-file /usr/share/icons/hicolor/scalable/apps/org.gtk.WidgetFactory4.svg
22+
23+
FROM docker.io/debian:experimental
24+
VOLUME ["/AppImage"]
25+
WORKDIR /AppImage
26+
ENV APPIMAGE_EXTRACT_AND_RUN=1
27+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
28+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk4/Dockerfile.fedora

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM docker.io/fedora:33 AS build-stage
2+
WORKDIR /linuxdeploy
3+
ENV APPIMAGE_EXTRACT_AND_RUN=1
4+
ARG APPDIR=/AppDir
5+
RUN dnf install -y wget patchelf librsvg2-devel file findutils pkgconfig gtk4 gtk4-devel
6+
COPY . .
7+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
8+
RUN chmod +x *.sh *.AppImage
9+
RUN ./linuxdeploy-x86_64.AppImage \
10+
--appdir ${APPDIR} \
11+
--plugin gtk \
12+
--output appimage \
13+
--executable /usr/bin/gtk4-widget-factory \
14+
--desktop-file /usr/share/applications/org.gtk.WidgetFactory4.desktop \
15+
--icon-file /usr/share/icons/hicolor/scalable/apps/org.gtk.WidgetFactory4.svg
16+
17+
FROM docker.io/fedora:33
18+
VOLUME ["/AppImage"]
19+
WORKDIR /AppImage
20+
ENV APPIMAGE_EXTRACT_AND_RUN=1
21+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
22+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

containers/gtk4/Dockerfile.opensuse

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# GTK4 is not yet supported on openSUSE Leap
2+
FROM docker.io/opensuse/tumbleweed:latest AS build-stage
3+
WORKDIR /linuxdeploy
4+
ENV APPIMAGE_EXTRACT_AND_RUN=1
5+
ARG APPDIR=/AppDir
6+
RUN zypper install -y wget patchelf librsvg2-devel file findutils pkg-config gtk4 gtk4-devel
7+
COPY . .
8+
ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" .
9+
RUN chmod +x *.sh *.AppImage
10+
RUN ./linuxdeploy-x86_64.AppImage \
11+
--appdir ${APPDIR} \
12+
--plugin gtk \
13+
--output appimage \
14+
--executable /usr/bin/gtk4-widget-factory \
15+
--desktop-file /usr/share/applications/org.gtk.WidgetFactory4.desktop \
16+
--icon-file /usr/share/icons/hicolor/scalable/apps/org.gtk.WidgetFactory4.svg
17+
18+
FROM docker.io/opensuse/tumbleweed:latest
19+
VOLUME ["/AppImage"]
20+
WORKDIR /AppImage
21+
ENV APPIMAGE_EXTRACT_AND_RUN=1
22+
COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" .
23+
ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"]

0 commit comments

Comments
 (0)