Skip to content

Commit 8cce620

Browse files
committed
chore(Deb): fix CI and Make target for building Debain package
1 parent 57720a3 commit 8cce620

File tree

4 files changed

+81
-119
lines changed

4 files changed

+81
-119
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -138,91 +138,3 @@ jobs:
138138
git add .SRCINFO PKGBUILD
139139
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
140140
git push origin master
141-
142-
publish-to-debian-bookworm:
143-
name: 🐧 Generate debian package
144-
needs: release
145-
if: needs.release.outputs.should_publish == 'yes'
146-
runs-on: ubuntu-latest
147-
148-
container:
149-
image: debian:bookworm
150-
151-
steps:
152-
- name: Checkout
153-
uses: actions/checkout@v4
154-
155-
- name: Install basic dependencies
156-
id: install-software
157-
run: |
158-
export DEBIAN_FRONTEND=noninteractive
159-
apt-get update
160-
apt-get install -y wget git lsb-release software-properties-common gnupg curl build-essential devscripts debhelper
161-
162-
- name: Install build dependencies
163-
id: install-build-deps
164-
run: |
165-
export DEBIAN_FRONTEND=noninteractive
166-
apt-get update
167-
apt-get install -y pkg-config libclang-dev libiio-dev libudev-dev libevdev-dev
168-
169-
- name: Install Rust and Cargo
170-
run: |
171-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
172-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
173-
. $HOME/.cargo/env
174-
175-
- name: Build deb package
176-
run: |
177-
make dist-deb
178-
179-
- name: Upload Debian package
180-
uses: actions/upload-artifact@v4
181-
with:
182-
name: inputplumber_debian-bookworm.deb
183-
path: dist/inputplumber_*.deb
184-
if-no-files-found: error
185-
186-
publish-to-ubuntu-noble:
187-
name: 🐧 Generate ubuntu 24.04 LTS package
188-
needs: release
189-
if: needs.release.outputs.should_publish == 'yes'
190-
runs-on: ubuntu-latest
191-
192-
container:
193-
image: ubuntu:noble
194-
195-
steps:
196-
- name: Checkout
197-
uses: actions/checkout@v4
198-
199-
- name: Install basic dependencies
200-
id: install-software
201-
run: |
202-
export DEBIAN_FRONTEND=noninteractive
203-
apt-get update
204-
apt-get install -y wget git lsb-release software-properties-common gnupg curl build-essential devscripts debhelper
205-
206-
- name: Install build dependencies
207-
id: install-build-deps
208-
run: |
209-
export DEBIAN_FRONTEND=noninteractive
210-
apt-get update
211-
apt-get install -y pkg-config libclang-dev libiio-dev libudev-dev libevdev-dev
212-
213-
- name: Install Rust and Cargo
214-
run: |
215-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
216-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
217-
. $HOME/.cargo/env
218-
219-
- name: Build deb package
220-
run: |
221-
make dist-deb
222-
223-
- name: Upload Debian package
224-
uses: actions/upload-artifact@v4
225-
with:
226-
name: inputplumber_ubuntu-noble_amd64.deb
227-
path: dist/inputplumber_*.deb
228-
if-no-files-found: error

.releaserc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ plugins:
5151
# Publish artifacts as a GitHub release
5252
- - "@semantic-release/github"
5353
- assets:
54+
- path: dist/inputplumber-*.deb
55+
- path: dist/inputplumber-*.deb.sha256.txt
5456
- path: dist/inputplumber-*.rpm
5557
- path: dist/inputplumber-*.rpm.sha256.txt
5658
- path: dist/inputplumber-*.tar.gz

Cargo.toml

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ version = "0.60.3"
44
edition = "2021"
55
license = "GPL-3.0-or-later"
66
description = "Open source input manager for Linux"
7-
authors = ["William Edwards <shadowapex@gmail.com>", "Derek J. Clark <derekjohn.clark@gmail.com>"]
7+
authors = [
8+
"William Edwards <shadowapex@gmail.com>",
9+
"Derek J. Clark <derekjohn.clark@gmail.com>",
10+
]
811

912
[package.metadata.generate-rpm]
1013
assets = [
@@ -26,6 +29,67 @@ auto-req = "no"
2629
libiio = "*"
2730
libevdev = "*"
2831

32+
# debian package needs pkg-config, libclang-dev, libiio-dev and libudev-dev to build
33+
# while runtime dependencies are libiio0 and libudev1
34+
# libevdev2 and libevdev-dev are listed but not needed
35+
[package.metadata.deb]
36+
license-file = ["LICENSE", "4"]
37+
extended-description = """\
38+
Input routing and control daemon for Linux.
39+
It can be used to combine any number of input devices
40+
(like gamepads, mice, and keyboards) and translate
41+
their input to a variety of virtual device formats."""
42+
depends = "$auto"
43+
section = "utility"
44+
priority = "optional"
45+
assets = [
46+
[
47+
"target/release/inputplumber",
48+
"usr/bin/inputplumber",
49+
"755",
50+
],
51+
[
52+
"rootfs/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf",
53+
"usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf",
54+
"644",
55+
],
56+
[
57+
"rootfs/usr/lib/systemd/system/*",
58+
"usr/lib/systemd/system/",
59+
"644",
60+
],
61+
[
62+
"rootfs/usr/lib/udev/hwdb.d/*",
63+
"usr/lib/udev/hwdb.d/",
64+
"644",
65+
],
66+
[
67+
"rootfs/usr/lib/udev/rules.d/*",
68+
"usr/lib/udev/rules.d/",
69+
"644",
70+
],
71+
[
72+
"rootfs/usr/share/inputplumber/devices/*",
73+
"usr/share/inputplumber/devices/",
74+
"644",
75+
],
76+
[
77+
"rootfs/usr/share/inputplumber/schema/*",
78+
"usr/share/inputplumber/schema/",
79+
"644",
80+
],
81+
[
82+
"rootfs/usr/share/inputplumber/capability_maps/*",
83+
"usr/share/inputplumber/capability_maps/",
84+
"644",
85+
],
86+
[
87+
"rootfs/usr/share/inputplumber/profiles/*",
88+
"usr/share/inputplumber/profiles/",
89+
"644",
90+
],
91+
]
92+
2993
[[bin]]
3094
name = "generate"
3195
path = "./src/generate.rs"
@@ -75,26 +139,3 @@ strip = true
75139
lto = true
76140
codegen-units = 1
77141

78-
# debian package needs pkg-config, libclang-dev, libiio-dev and libudev-dev to build
79-
# while runtime dependencies are libiio0 and libudev1
80-
# libevdev2 and libevdev-dev are listed but not needed
81-
[package.metadata.deb]
82-
license-file = ["LICENSE", "4"]
83-
extended-description = """\
84-
Input routing and control daemon for Linux.
85-
It can be used to combine any number of input devices
86-
(like gamepads, mice, and keyboards) and translate
87-
their input to a variety of virtual device formats."""
88-
depends = "$auto"
89-
section = "utility"
90-
priority = "optional"
91-
assets = [
92-
["target/release/inputplumber", "usr/bin/inputplumber", "755"],
93-
["rootfs/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", "usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", "644"],
94-
["rootfs/usr/lib/systemd/system/*", "usr/lib/systemd/system/", "644"],
95-
["rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb", "usr/lib/udev/hwdb.d/59-inputplumber.hwdb", "644"],
96-
["rootfs/usr/share/inputplumber/devices/*", "usr/share/inputplumber/devices/", "644"],
97-
["rootfs/usr/share/inputplumber/schema/*", "usr/share/inputplumber/schema/", "644"],
98-
["rootfs/usr/share/inputplumber/capability_maps/*", "usr/share/inputplumber/capability_maps/", "644"],
99-
["rootfs/usr/share/inputplumber/profiles/*", "usr/share/inputplumber/profiles/", "644"]
100-
]

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ PREFIX ?= /usr
99
CACHE_DIR := .cache
1010
ENABLE_METRICS ?= 1
1111

12+
ifeq ($(ARCH),x86_64)
13+
ARCH_DEB = amd64
14+
endif
15+
ifeq ($(ARCH),aarch64)
16+
ARCH_DEB = arm64
17+
endif
18+
1219
# Build variables
1320
BUILD_TYPE ?= release
1421
LOG_LEVEL ?= debug
@@ -137,7 +144,7 @@ example:
137144
##@ Distribution
138145

139146
.PHONY: dist
140-
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
147+
dist: dist/$(NAME)-$(ARCH).tar.gz dist/$(NAME)_$(VERSION)-1_$(ARCH_DEB).deb dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm dist/$(NAME)-$(ARCH).raw ## Create all redistributable versions of the project
141148

142149
.PHONY: dist-archive
143150
dist-archive: dist/$(NAME)-$(ARCH).tar.gz ## Build a redistributable archive of the project
@@ -150,13 +157,13 @@ dist/$(NAME)-$(ARCH).tar.gz: build $(ALL_ROOTFS)
150157
cd dist && sha256sum $(NAME)-$(ARCH).tar.gz > $(NAME)-$(ARCH).tar.gz.sha256.txt
151158

152159
.PHONY: dist-deb
153-
dist-deb: dist/$(NAME)_$(VERSION)-1_$(ARCH).deb ## Build a redistributable deb package
154-
dist/$(NAME)_$(VERSION)-1_$(ARCH).deb: target/$(TARGET_ARCH)/release/$(NAME)
160+
dist-deb: dist/$(NAME)_$(VERSION)-1_$(ARCH_DEB).deb ## Build a redistributable deb package
161+
dist/$(NAME)_$(VERSION)-1_$(ARCH_DEB).deb: target/$(TARGET_ARCH)/release/$(NAME)
155162
mkdir -p dist
156-
cargo install cargo-deb
157-
cargo deb
158-
cp ./target/$(TARGET_ARCH)/debian/$(NAME)_$(VERSION)-1_$(ARCH).deb dist
159-
cd dist && sha256sum $(NAME)_$(VERSION)-1_$(ARCH).deb > $(NAME)_$(VERSION)-1_$(ARCH).deb.sha256.txt
163+
cargo install --version 3.2.1 cargo-deb
164+
cargo deb --target $(TARGET_ARCH)
165+
cp ./target/$(TARGET_ARCH)/debian/$(NAME)_$(VERSION)-1_$(ARCH_DEB).deb dist
166+
cd dist && sha256sum $(NAME)_$(VERSION)-1_$(ARCH_DEB).deb > $(NAME)_$(VERSION)-1_$(ARCH_DEB).deb.sha256.txt
160167

161168
.PHONY: dist-rpm
162169
dist-rpm: dist/$(NAME)-$(VERSION)-1.$(ARCH).rpm ## Build a redistributable RPM package

0 commit comments

Comments
 (0)