Repository navigation
Expand file tree
/
Copy pathrender-pkgbuild.sh
More file actions
executable file
·58 lines (57 loc) · 2.95 KB
/
Copy pathrender-pkgbuild.sh
File metadata and controls
executable file
·58 lines (57 loc) · 2.95 KB
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
#!/bin/bash
# Writes the AUR's amcli-bin PKGBUILD for a release to standard output, from the release's version
# and the SHA-256 of its three Linux archives. The man page, the completion script and the licence
# are fetched from the tag, so they are hashed as the tag has them: PACKAGING_REF names it, v2.6.0
# for 2.6.0, and is the release's tag where the workflow runs this.
# https://github.com/asc-community/AngouriMath/issues/1660
set -euo pipefail
version="${1:?usage: render-pkgbuild.sh VERSION SHA256_LINUX_X64 SHA256_LINUX_ARM64 SHA256_LINUX_ARM}"
x64="${2:?}"; arm64="${3:?}"; arm="${4:?}"
ref="${PACKAGING_REF:-v$version}"
sum() { git show "$ref:$1" | sha256sum | cut -d' ' -f1; }
# A pkgver has no hyphen: 2.7.0-beta.1 is packed as 2.7.0_beta.1, from the tag v2.7.0-beta.1.
cat <<PKGBUILD
# Generated by Sources/Terminal/AngouriMath.Terminal/packaging/render-pkgbuild.sh in
# https://github.com/asc-community/AngouriMath for each release.
pkgname=amcli-bin
pkgver=${version//-/_}
pkgrel=1
pkgdesc="AngouriMath's terminal and command-line computer algebra system"
arch=('x86_64' 'aarch64' 'armv7h')
url="https://am.angouri.org"
license=('MIT')
depends=('icu' 'zlib' 'openssl' 'krb5' 'gcc-libs')
provides=('amcli')
conflicts=('amcli')
options=('!strip' '!debug')
_tag="v${version}"
_release="https://github.com/asc-community/AngouriMath/releases/download/\${_tag}"
_raw="https://raw.githubusercontent.com/asc-community/AngouriMath/\${_tag}"
source=("amcli-\${_tag}.1::\${_raw}/Sources/Terminal/AngouriMath.Terminal/amcli.1"
"amcli-\${_tag}.bash::\${_raw}/Sources/Terminal/AngouriMath.Terminal/amcli.bash"
"LICENSE-\${_tag}.md::\${_raw}/LICENSE.md")
source_x86_64=("angourimath-terminal-linux-x64-\${_tag}.zip::\${_release}/angourimath-terminal-linux-x64.zip")
source_aarch64=("angourimath-terminal-linux-arm64-\${_tag}.zip::\${_release}/angourimath-terminal-linux-arm64.zip")
source_armv7h=("angourimath-terminal-linux-arm-\${_tag}.zip::\${_release}/angourimath-terminal-linux-arm.zip")
sha256sums=('$(sum Sources/Terminal/AngouriMath.Terminal/amcli.1)'
'$(sum Sources/Terminal/AngouriMath.Terminal/amcli.bash)'
'$(sum LICENSE.md)')
sha256sums_x86_64=('${x64}')
sha256sums_aarch64=('${arm64}')
sha256sums_armv7h=('${arm}')
package() {
case "\$CARCH" in
x86_64) _runtime=linux-x64 ;;
aarch64) _runtime=linux-arm64 ;;
armv7h) _runtime=linux-arm ;;
esac
install -d "\$pkgdir/opt/amcli" "\$pkgdir/usr/bin"
cp -r "\$srcdir/\$_runtime/." "\$pkgdir/opt/amcli/"
# The runtime's tracing provider wants LTTng, which nothing here uses.
rm -f "\$pkgdir/opt/amcli/libcoreclrtraceptprovider.so"
ln -s /opt/amcli/AngouriMath.Terminal "\$pkgdir/usr/bin/amcli"
install -Dm644 "amcli-\${_tag}.1" "\$pkgdir/usr/share/man/man1/amcli.1"
install -Dm644 "amcli-\${_tag}.bash" "\$pkgdir/usr/share/bash-completion/completions/amcli"
install -Dm644 "LICENSE-\${_tag}.md" "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE.md"
}
PKGBUILD