Skip to content

chore: add debian packaging #309

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,91 @@ jobs:
git add .SRCINFO PKGBUILD
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
git push origin master

publish-to-debian-bookworm:
name: 🐧 Generate debian package
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest

container:
image: debian:bookworm

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install basic dependencies
id: install-software
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y wget git lsb-release software-properties-common gnupg curl build-essential devscripts debhelper

- name: Install build dependencies
id: install-build-deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y pkg-config libclang-dev libiio-dev libudev-dev libevdev-dev

- name: Install Rust and Cargo
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
. $HOME/.cargo/env

- name: Build deb package
run: |
make dist-deb

- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: inputplumber_debian-bookworm.deb
path: dist/inputplumber_*.deb
if-no-files-found: error

publish-to-ubuntu-noble:
name: 🐧 Generate ubuntu 24.04 LTS package
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest

container:
image: ubuntu:noble

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install basic dependencies
id: install-software
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y wget git lsb-release software-properties-common gnupg curl build-essential devscripts debhelper

- name: Install build dependencies
id: install-build-deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y pkg-config libclang-dev libiio-dev libudev-dev libevdev-dev

- name: Install Rust and Cargo
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
. $HOME/.cargo/env

- name: Build deb package
run: |
make dist-deb

- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: inputplumber_ubuntu-noble_amd64.deb
path: dist/inputplumber_*.deb
if-no-files-found: error
25 changes: 25 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.49.2"
edition = "2021"
license = "GPL-3.0-or-later"
description = "Open source input manager for Linux"
authors = ["William Edwards <[email protected]>", "Derek J. Clark <[email protected]>"]

[package.metadata.generate-rpm]
assets = [
Expand Down Expand Up @@ -64,3 +65,27 @@ debug = false
strip = true
lto = true
codegen-units = 1

# debian package needs pkg-config, libclang-dev, libiio-dev and libudev-dev to build
# while runtime dependencies are libiio0 and libudev1
# libevdev2 and libevdev-dev are listed but not needed
[package.metadata.deb]
license-file = ["LICENSE", "4"]
extended-description = """\
Input routing and control daemon for Linux.
It can be used to combine any number of input devices
(like gamepads, mice, and keyboards) and translate
their input to a variety of virtual device formats."""
depends = "$auto"
section = "utility"
priority = "optional"
assets = [
["target/release/inputplumber", "usr/bin/inputplumber", "755"],
["rootfs/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", "usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", "644"],
["rootfs/usr/lib/systemd/system/*", "usr/lib/systemd/system/", "644"],
["rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb", "usr/lib/udev/hwdb.d/59-inputplumber.hwdb", "644"],
["rootfs/usr/share/inputplumber/devices/*", "usr/share/inputplumber/devices/", "644"],
["rootfs/usr/share/inputplumber/schema/*", "usr/share/inputplumber/schema/", "644"],
["rootfs/usr/share/inputplumber/capability_maps/*", "usr/share/inputplumber/capability_maps/", "644"],
["rootfs/usr/share/inputplumber/profiles/*", "usr/share/inputplumber/profiles/", "644"]
]
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ example:
##@ Distribution

.PHONY: dist
dist: dist/$(NAME).tar.gz dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm dist/$(NAME).raw ## Create all redistributable versions of the project
dist: dist/$(NAME).tar.gz dist/$(NAME)_$(VERSION)-1_$(ARCH).deb dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm dist/$(NAME).raw ## Create all redistributable versions of the project

.PHONY: dist-archive
dist-archive: dist/$(NAME).tar.gz ## Build a redistributable archive of the project
Expand All @@ -134,6 +134,15 @@ dist/$(NAME).tar.gz: build $(ALL_ROOTFS)
tar cvfz $@ -C $(CACHE_DIR) $(NAME)
cd dist && sha256sum $(NAME).tar.gz > $(NAME).tar.gz.sha256.txt

.PHONY: dist-deb
dist-deb: dist/$(NAME)_$(VERSION)-1_$(ARCH).deb ## Build a redistributable deb package
dist/$(NAME)_$(VERSION)-1_$(ARCH).deb: target/release/$(NAME)
mkdir -p dist
cargo install cargo-deb
cargo deb
cp ./target/debian/$(NAME)_$(VERSION)-1_$(ARCH).deb dist
cd dist && sha256sum $(NAME)_$(VERSION)-1_$(ARCH).deb > $(NAME)_$(VERSION)-1_$(ARCH).deb.sha256.txt

.PHONY: dist-rpm
dist-rpm: dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm ## Build a redistributable RPM package
dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm: target/release/$(NAME)
Expand Down