blob: 239ccdc7e146dbc3bb75666a17e7c83bf5f1fe15 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
# Maintainer: memdmp <memdmp@estrogen.zone>
_reponame="typewriter"
_repoowner="lightonflux"
_repourl="https://${GNOME_GITLAB_URL:-"gitlab.gnome.org"}/${_repoowner}/${_reponame}"
_reporef="37f6320be5fae77473e5e91919da530e45245f55" # Must be a TAG OR COMMIT! Anything else may break shit.
_reporefdate="20250508" # YYYYMMDD of the ref
pkgname="gnome-typewriter-meson"
pkgver=0.0.0
pkgrel=1
pkgdesc="The GNOME Typewriter Project - Pakcaged using Meson"
url="$_repourl"
arch="x86 x86_64 aarch64 riscv64"
license="AGPL-3.0-or-later"
# depends="glib pango gdk-pixbuf openssl gtksourceview5 libadwaita libpanel" # FIXME: explain why this needs to link against openssl(-dev) (cargo errors without it but idk why)
depends="" # .so's will get computed on their own by abuild - the above line remains just as a reference
makedepends="cargo meson findutils gettext glib-dev gtk-update-icon-cache desktop-file-utils pango-dev gdk-pixbuf-dev openssl-dev gtksourceview5-dev libadwaita-dev libpanel-dev blueprint-compiler"
install=""
subpackages=""
source=""
options=""
provides="gnome-typewriter"
# if complaints about schemas and icon cache etc appear, we may needa make a hook that runs `/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas && /usr/bin/gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor && /usr/bin/update-desktop-database -q /usr/share/applications` (skipped hooks usually ran when DESTDIR isnt set)
_pkgver="${pkgver}"
if [[ "${pkgver}" != "${_reporef}" ]] && [[ "${pkgver}" != "v${_reporef}" ]]; then pkgver="${pkgver}_git${_reporefdate}";from_tag=false;else from_tag=true; fi
# prepare snapshotting environment so IPv6-only can work
if [[ "$DISALLOW_SNAPSHOTS" == "1" ]]; then
# This works but requires IPv4 due to GNOME's Gitlab
source="${source}
${_reponame}-${_reporef}.tar.gz::${_repourl}/-/archive/${_reporef}/${_reponame}-${_reporef}.tar.gz"
builddir="${srcdir}/${_reponame}-${_reporef}"
else
_distpath="archive/gnome-typewriter"
# TODO: if we ever contribute this upstream, set VENDOR_SOURCE to default to dev.alpinelinux.org
_disturl="${VENDOR_SOURCE:-"consequences.neobot.systems"}:${DIST_UPLOAD_PATH:-""}/$_distpath/"
# example usage for local files: VENDOR_SOURCE_PROTOCOL=/var/cache/distfiles/ VENDOR_SOURCE=.
# example usage for neobot.systems: VENDOR_SOURCE=consequences.neobot.systems
source="${source}
${_reponame}-${_reporef}.tar.gz::${VENDOR_SOURCE_PROTOCOL:-"https://"}${VENDOR_SOURCE:-"consequences.neobot.systems"}/${_distpath}/src.$pkgname-$pkgver-$_reporef.tar.gz
${_reponame}-${_reporef}-vendor.tar.gz::${VENDOR_SOURCE_PROTOCOL:-"https://"}${VENDOR_SOURCE:-"consequences.neobot.systems"}/${_distpath}/$_srcdest/pkg.$pkgname-$pkgver-$_reporef.tar.gz"
builddir="${srcdir}/${pkgname}"
fi
# and now we snapshot!
snapshot() {
clean
makedepends="git rsync tar gzip cargo" deps
# Prepare Git Repo
_srcdest="${SRCDEST:-"$srcdir"}"
mkdir -p "$srcdir" "$_srcdest"
cd "${SRCDEST:-"$srcdir"}"
if ! [ -d $pkgname.git ]; then
mkdir "$pkgname.git"
cd "$pkgname.git"
git init
git remote add origin "$_repourl"
git fetch origin "$_reporef" || return 1
else
cd "$pkgname.git"
git fetch origin "$_reporef" || return 1
fi
# Archive it
git archive --prefix="$pkgname/" -o "$_srcdest/src.$pkgname-$pkgver-$_reporef.tar.gz" "$_reporef"
# Reset to the repo ref and run cargo vendor
git reset --hard "$_reporef"
cargo vendor vendor --locked
tar czf "$_srcdest/pkg.$pkgname-$pkgver-$_reporef.tar.gz" vendor
if [ -n "$_disturl" ]; then # should never happen but just incase
for archiveKind in src pkg; do
rsync --progress -La "$_srcdest/$archiveKind.$pkgname-$pkgver-$_reporef.tar.gz" "$_disturl"
done
fi
}
build() {
if [[ "$DISALLOW_SNAPSHOTS" != "1" ]]; then
mkdir -p ".cargo"
echo '
[source.crates-io]
replace-with = "vendored-sources"
[source."git+https://gitlab.gnome.org/JanGernert/sourceview5-rs.git?branch=test-fixes"]
git = "https://gitlab.gnome.org/JanGernert/sourceview5-rs.git"
branch = "test-fixes"
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"' >> ".cargo/config.toml"
ln -s "$srcdir/vendor" vendor
fi
meson setup --optimization 3 --buildtype release --prefix /usr build
meson compile -C build
}
check() {
meson test -C build
}
package() {
DESTDIR="$pkgdir" meson install -C build
}
sha512sums="
d25be1ac6c432cae46146ea0eb3702625cf859805e702476a75b06edfbfb325e84eee66c03b55021ba7fa1d0a9b912e72ec036037a2989a8dce71a78246e313e typewriter-37f6320be5fae77473e5e91919da530e45245f55.tar.gz
5bf2aa9513654bdd16a91551a96521cf8ca9c5b435274357665262b6d2ddf8936fb21ec326b3a67c61f021530f11726865ace9d11f303ae2c27a77e30ab54a28 typewriter-37f6320be5fae77473e5e91919da530e45245f55-vendor.tar.gz
"
|