Skip to content

Commit

Permalink
Add gtk (#139)
Browse files Browse the repository at this point in the history
* Add gtk

* Add GTK to installers and CI

* Fix Windows CI
  • Loading branch information
MOZGIII authored Aug 18, 2023
1 parent 1d16a10 commit 6989979
Show file tree
Hide file tree
Showing 18 changed files with 659 additions and 9 deletions.
77 changes: 77 additions & 0 deletions .github/actions/build-gtk-windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Build GTK"
description: "Build GTK from source on Windows using msvc toolchain"
runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: cache
with:
path: c:/gnome
key: ${{ runner.os }}-gtk
restore-keys: |
${{ runner.os }}-gtk
- name: Set up the PATH environment
shell: bash
run: |
echo "C:\pkg-config-lite-0.28-1\bin" >>"$GITHUB_PATH"
echo "C:\gnome\bin" >>"$GITHUB_PATH"
echo "PKG_CONFIG_PATH=C:\gnome\lib\pkgconfig" >>"$GITHUB_ENV"
- name: Install pkgconfig-lite
shell: pwsh
run: |
Invoke-WebRequest -Uri https://deac-fra.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip -OutFile /pkg_config_lite.zip -MaximumRetryCount 5
Expand-Archive /pkg_config_lite.zip -DestinationPath C:\
ls C:\
ls C:\pkg-config-lite-0.28-1
ls C:\pkg-config-lite-0.28-1\bin
pkg-config --version
- name: Clone GTK
shell: pwsh
working-directory: /
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://gitlab.gnome.org/GNOME/gtk.git --depth 1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Python Dependencies
shell: pwsh
run: pip install meson ninja

- name: Prepare GTK build
shell: pwsh
working-directory: /gtk
if: steps.cache.outputs.cache-hit != 'true'
run: |
meson setup builddir `
--prefix="C:/gnome" `
--backend=ninja `
-Dbackend_max_links=1 `
-Dbuild-demos=false `
-Dbuild-tests=false `
-Dmedia-gstreamer=disabled `
-Dbuild-examples=false `
-Dglib:tests=false `
-Dharfbuzz:tests=disabled `
-Dharfbuzz:docs=disabled `
-Dgraphene:tests=false `
-Dgdk-pixbuf:tests=false `
-Dcairo:tests=disabled
- name: Build and install GTK
shell: pwsh
working-directory: /gtk
if: steps.cache.outputs.cache-hit != 'true'
run: |
meson install -C builddir
- name: List the contents
shell: bash
run: |
ls -laR "C:/gnome"
12 changes: 8 additions & 4 deletions .github/actions/common-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ runs:
run: rustup show
if: ${{ inputs.requiresRust == 'true' }}

- name: Set up Vistual Studio Command Prompt (Windows only)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'

- name: Build GTK (Windows only)
uses: ./.github/actions/build-gtk-windows
if: runner.os == 'Windows'

- name: Prepare the build environment
run: ${{ inputs.buildEnvScript }}
shell: bash
if: ${{ inputs.buildEnvScript != 'skip' }}

- name: Set up Vistual Studio Command Prompt (Windows only)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'

- name: Print build environment info
shell: bash
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/build_env/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sudo apt-get install -y \
python3-setuptools \
python3-wheel \
ninja-build \
llvm
llvm \
libgtk-4-dev

sudo pip3 install meson
3 changes: 2 additions & 1 deletion .github/scripts/build_env/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -euo pipefail
brew install \
ninja \
meson \
llvm
llvm \
gtk4
1 change: 1 addition & 0 deletions .github/scripts/packaging/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ARTIFACTS=(
target/release/rebootinto-tui.exe
target/release/rebootinto-iui.exe
target/release/rebootinto-iced.exe
target/release/rebootinto-gtk.exe
)

cp -t "$ARTIFACTS_DIR" "${ARTIFACTS[@]}"
4 changes: 2 additions & 2 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
with:
platformCacheKey: ${{ matrix.platform.cacheKey }}
buildEnvScript: ${{ matrix.platform.buildEnvScript }}
timeout-minutes: 10
timeout-minutes: 25

- name: Run cargo ${{ matrix.mode.cargoCommand }}
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
with:
platformCacheKey: ${{ matrix.platform.cacheKey }}
buildEnvScript: ${{ matrix.platform.packagingEnvScript }}
timeout-minutes: 10
timeout-minutes: 25

- name: Run cargo build (release)
uses: actions-rs/cargo@v1
Expand Down
Loading

0 comments on commit 6989979

Please sign in to comment.