Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add alternative headless and libadwaita builds #227

Merged
merged 14 commits into from
Dec 9, 2023
Merged
8 changes: 6 additions & 2 deletions .github/workflows/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build-packages:
strategy:
matrix:
target-os: [debian-12, ubuntu-2204, fedora-38, fedora-39, arch]
target-os: [ debian-12, ubuntu-2204, fedora-38, fedora-39, fedora-39-libadwaita, arch, arch-libadwaita ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,6 +19,10 @@ jobs:
run: |
curl -L -o /tmp/pkger.deb https://github.com/vv9k/pkger/releases/download/0.11.0/pkger-0.11.0-0.amd64.deb
sudo apt -y install /tmp/pkger.deb

- name: Set libadwaita target
if: contains(matrix.target-os, 'libadwaita')
run: sed -i 's/\&\& make/\&\& make build-release-libadwaita/g' pkg/recipes/lact/recipe.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woulnd't it be better to keep the original recipe intact and just create another one for libadwaita?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to avoid the duplicate build steps between the recipes, ideally this would be done by passing some build flag when building the package, but unfortunately it doesn't seem possible

Copy link
Owner Author

@ilya-zlobintsev ilya-zlobintsev Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ended up creating separate recipes after all so it's easier to manage


- name: Build packages
run: pkger -c .pkger.yml build lact -i ${{ matrix.target-os }}
Expand All @@ -37,7 +41,7 @@ jobs:
NAME="${FILE%.*}"
EXT="${FILE##*.}"

OUT_NAME="$OUT_DIR/$NAME.$DISTRO.$EXT"
OUT_NAME="$OUT_DIR/$NAME.$DISTRO.${{ matrix.edition }}.$EXT"
cp $FILE $OUT_NAME
done
cd ..
Expand Down
4 changes: 4 additions & 0 deletions .pkger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ images:
target: rpm
- name: fedora-39
target: rpm
- name: fedora-39-libadwaita
target: rpm
- name: ubuntu-2204
target: deb
- name: arch
target: pkg
- name: arch-libadwaita
target: pkg
custom_simple_images: ~
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ PREFIX ?= /usr/local

build-release:
cargo build --release

build-release-libadwaita:
cargo build --release --features=adw

install:
install -Dm755 target/release/lact $(DESTDIR)$(PREFIX)/bin/lact
Expand Down
1 change: 1 addition & 0 deletions lact-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
[features]
default = ["gtk-tests"]
gtk-tests = []
adw = []

[dependencies]
lact-client = { path = "../lact-client" }
Expand Down
1 change: 1 addition & 0 deletions lact/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
[features]
default = ["lact-gui", "drm"]
drm = ["lact-daemon/drm"]
adw = ["lact-gui/adw"]

[dependencies]
lact-daemon = { path = "../lact-daemon", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions pkg/images/arch-libadwaita/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM archlinux:latest
1 change: 1 addition & 0 deletions pkg/images/fedora-39-libadwaita/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM fedora:39
12 changes: 8 additions & 4 deletions pkg/recipes/lact/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ metadata:
depends:
all: [ hwdata ]
debian-12+ubuntu-2204: [ libgtk-4-1 ]
fedora-38+fedora-39: [ gtk4, libdrm ]
arch: [ gtk4 ]
fedora-38+fedora-39+fedora-39-libadwaita: [ gtk4, libdrm ]
fedora-39-libadwaita: [ libadwaita ]
arch+arch-libadwaita: [ gtk4 ]
arch-libadwaita: [ libadwaita ]
build_depends:
all: [ curl, make, dbus, clang ]
debian-12+ubuntu-2204: [ libgtk-4-dev, pkg-config, build-essential, libdrm-dev ]
fedora-38+fedora-39: [ gtk4-devel, gcc, libdrm-devel, blueprint-compiler ]
arch: [ gtk4, blueprint-compiler ]
fedora-38+fedora-39+fedora-39-libadwaita: [ gtk4-devel, gcc, libdrm-devel, blueprint-compiler ]
fedora-39-libadwaita: [ libadwaita-devel ]
arch+arch-libadwaita: [ gtk4, blueprint-compiler ]
arch-libadwaita: [ libadwaita ]
all_images: true
env:
RUSTUP_URL: https://sh.rustup.rs
Expand Down