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

Use autotools (autoconf, automake) to build keyd #831

Closed
wants to merge 17 commits into from
Closed
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
6 changes: 6 additions & 0 deletions .autom4te.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Disable autom4te cache to ensure that any change to the version extraction
# script triggers a rebuild of the configure script. See
# <https://lists.gnu.org/r/automake/2019-10/msg00002.html>.
begin-language: "Autoconf-without-aclocal-m4"
args: --no-cache
end-language: "Autoconf-without-aclocal-m4"
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
data/* -diff
layouts/* -diff
src/unicode.c -diff
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI
on:
push:
pull_request:

jobs:
test-debian-like:
strategy:
fail-fast: false
matrix:
image:
- ubuntu:latest
- ubuntu:22.04
- debian:testing
- debian:stable
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- name: install dependencies
run: |
apt-get update &&
apt-get install -y --no-install-recommends \
automake \
build-essential \
ca-certificates \
git \
pkg-config \
python3 \
scdoc \
&&
{
# /usr/share/pkgconfig/systemd.pc was moved from the systemd
# package to a new systemd-dev package in systemd 253-2 (Debian 13
# (trixie) and later, Ubuntu 23.10 (mantic) and later).
apt-get install -y --no-install-recommends systemd-dev ||
apt-get install -y --no-install-recommends systemd
}
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/checkout@v4
with:
# Fetch all commits and tags so that build-aux/git-version-gen can
# discover the version number.
fetch-depth: 0
# https://github.com/actions/checkout/issues/1169
- name: fix git permissions
run: git config --system --add safe.directory $(pwd)
- name: autogen
run: ./autogen
- name: configure
run: ./configure
- name: check
run: make VERBOSE=1 AM_COLOR_TESTS=always check
- name: distcheck
run: make VERBOSE=1 AM_COLOR_TESTS=always distcheck
- name: distribution tarball is complete
run: ./.github/workflows/scripts/dist-tarball-check
- if: ${{ matrix.image == 'debian:testing' }}
uses: actions/upload-artifact@v4
with:
name: distribution-tarball
path: keyd-*.tar.gz
59 changes: 59 additions & 0 deletions .github/workflows/scripts/dist-tarball-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh

pecho() { printf %s\\n "$*"; }
log() { pecho "$@"; }
warning() { log "::warning::$@"; }
error() { log "::error::$@"; }
fatal() { error "$@"; exit 1; }
try() { "$@" || fatal "'$@' failed"; }

dist_tarball=$(ls keyd-*.tar.gz) \
|| fatal "'make dist' must be run before this test"

tmpdir=$(try mktemp -d) || exit 1

log "Copying contents of Git repository..."
try git archive --format=tar --prefix=git-repo/ HEAD \
| try tar -C "${tmpdir}" -xv || exit 1
(
try cd "${tmpdir}"/git-repo
# Delete files checked into Git that shouldn't be in the distribution
# tarball.
try rm -rf \
.gitattributes \
.github \
.gitignore \
;
) || exit 1

log "Extracting distribution tarball..."
try tar -C "${tmpdir}" -xvzf "${dist_tarball}"
try mv "${tmpdir}/${dist_tarball%.tar.gz}" "${tmpdir}"/dist-tarball
(
try cd "${tmpdir}"/dist-tarball
# Delete generated files
try rm -rf \
.dist-version \
Makefile.in \
aclocal.m4 \
autoconfig.h.in \
build-aux/compile \
build-aux/depcomp \
build-aux/install-sh \
build-aux/missing \
build-aux/test-driver \
configure \
;
) || exit 1

log "Comparing Git repository with distribution tarball..."
cd "${tmpdir}"
diff -qNr git-repo dist-tarball >/dev/null || {
error "Unexpected diff between the repo and the distribution tarball."
error "You may need to add a file to EXTRA_DIST in Makefile.am."
error "Diff output:"
diff -uNr git-repo dist-tarball \
| while IFS= read -r line; do error "${line}"; done
exit 1
}
log "No difference"
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ tags
bin/
*.o
*.gch
.deps/
.dirstamp
/*.1
/.dist-version
/Makefile
/Makefile.in
/aclocal.m4
/autoconfig.h
/autoconfig.h.in
/autom4te.cache/
/build-aux/*
!/build-aux/git-version-gen
/compose.stamp
/compose.stamp.tmp
/config.log
/config.status
/configure
/keyd
/keyd-*.tar.gz
/keyd-application-mapper
/keyd.compose
/src/unicode.c
/stamp-h1
/t/*.log
/t/*.trs
/test-io
/test-suite.log
__pycache__
test.log
keyd.service
114 changes: 0 additions & 114 deletions Makefile

This file was deleted.

Loading