Skip to content

Commit 8afb7c0

Browse files
committed
Merge remote-tracking branch 'rhansen/autotools'
rvaiya/keyd#831
2 parents ca85596 + eb42c03 commit 8afb7c0

File tree

14 files changed

+852
-129
lines changed

14 files changed

+852
-129
lines changed

.autom4te.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Disable autom4te cache to ensure that any change to the version extraction
2+
# script triggers a rebuild of the configure script. See
3+
# <https://lists.gnu.org/r/automake/2019-10/msg00002.html>.
4+
begin-language: "Autoconf-without-aclocal-m4"
5+
args: --no-cache
6+
end-language: "Autoconf-without-aclocal-m4"

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
test-debian-like:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
image:
12+
- ubuntu:latest
13+
- ubuntu:22.04
14+
- debian:testing
15+
- debian:stable
16+
runs-on: ubuntu-latest
17+
container:
18+
image: ${{ matrix.image }}
19+
steps:
20+
- name: install dependencies
21+
run: |
22+
apt-get update &&
23+
apt-get install -y --no-install-recommends \
24+
automake \
25+
build-essential \
26+
ca-certificates \
27+
git \
28+
pkg-config \
29+
python3 \
30+
scdoc \
31+
&&
32+
{
33+
# /usr/share/pkgconfig/systemd.pc was moved from the systemd
34+
# package to a new systemd-dev package in systemd 253-2 (Debian 13
35+
# (trixie) and later, Ubuntu 23.10 (mantic) and later).
36+
apt-get install -y --no-install-recommends systemd-dev ||
37+
apt-get install -y --no-install-recommends systemd
38+
}
39+
env:
40+
DEBIAN_FRONTEND: noninteractive
41+
- uses: actions/checkout@v4
42+
with:
43+
# Fetch all commits and tags so that build-aux/git-version-gen can
44+
# discover the version number.
45+
fetch-depth: 0
46+
# https://github.com/actions/checkout/issues/1169
47+
- name: fix git permissions
48+
run: git config --system --add safe.directory $(pwd)
49+
- name: autogen
50+
run: ./autogen
51+
- name: configure
52+
run: ./configure
53+
- name: check
54+
run: make VERBOSE=1 AM_COLOR_TESTS=always check
55+
- name: distcheck
56+
run: make VERBOSE=1 AM_COLOR_TESTS=always distcheck
57+
- name: distribution tarball is complete
58+
run: ./.github/workflows/scripts/dist-tarball-check
59+
- if: ${{ matrix.image == 'debian:testing' }}
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: distribution-tarball
63+
path: keyd-*.tar.gz
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/sh
2+
3+
pecho() { printf %s\\n "$*"; }
4+
log() { pecho "$@"; }
5+
warning() { log "::warning::$@"; }
6+
error() { log "::error::$@"; }
7+
fatal() { error "$@"; exit 1; }
8+
try() { "$@" || fatal "'$@' failed"; }
9+
10+
dist_tarball=$(ls keyd-*.tar.gz) \
11+
|| fatal "'make dist' must be run before this test"
12+
13+
tmpdir=$(try mktemp -d) || exit 1
14+
15+
log "Copying contents of Git repository..."
16+
try git archive --format=tar --prefix=git-repo/ HEAD \
17+
| try tar -C "${tmpdir}" -xv || exit 1
18+
(
19+
try cd "${tmpdir}"/git-repo
20+
# Delete files checked into Git that shouldn't be in the distribution
21+
# tarball.
22+
try rm -rf \
23+
.gitattributes \
24+
.github \
25+
.gitignore \
26+
;
27+
) || exit 1
28+
29+
log "Extracting distribution tarball..."
30+
try tar -C "${tmpdir}" -xvzf "${dist_tarball}"
31+
try mv "${tmpdir}/${dist_tarball%.tar.gz}" "${tmpdir}"/dist-tarball
32+
(
33+
try cd "${tmpdir}"/dist-tarball
34+
# Delete generated files
35+
try rm -rf \
36+
.dist-version \
37+
Makefile.in \
38+
aclocal.m4 \
39+
autoconfig.h.in \
40+
build-aux/compile \
41+
build-aux/depcomp \
42+
build-aux/install-sh \
43+
build-aux/missing \
44+
build-aux/test-driver \
45+
configure \
46+
;
47+
) || exit 1
48+
49+
log "Comparing Git repository with distribution tarball..."
50+
cd "${tmpdir}"
51+
diff -qNr git-repo dist-tarball >/dev/null || {
52+
error "Unexpected diff between the repo and the distribution tarball."
53+
error "You may need to add a file to EXTRA_DIST in Makefile.am."
54+
error "Diff output:"
55+
diff -uNr git-repo dist-tarball \
56+
| while IFS= read -r line; do error "${line}"; done
57+
exit 1
58+
}
59+
log "No difference"

.gitignore

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,33 @@ tags
66
bin/
77
*.o
88
*.gch
9+
.deps/
10+
.dirstamp
11+
/*.1
12+
/.dist-version
13+
/Makefile
14+
/Makefile.in
15+
/aclocal.m4
16+
/autoconfig.h
17+
/autoconfig.h.in
18+
/autom4te.cache/
19+
/build-aux/*
20+
!/build-aux/git-version-gen
21+
/compose.stamp
22+
/compose.stamp.tmp
23+
/config.log
24+
/config.status
25+
/configure
26+
/keyd
27+
/keyd-*.tar.gz
28+
/keyd-application-mapper
29+
/keyd.compose
30+
/src/unicode.c
31+
/stamp-h1
32+
/t/*.log
33+
/t/*.trs
34+
/test-io
35+
/test-suite.log
936
__pycache__
1037
test.log
1138
keyd.service
12-
/data/*.1.gz
13-
/data/keyd.compose
14-
/src/unicode.c

Makefile

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)