blob: 352dd4aa838d4a446a3ff58b88fa18d161523aa3 (
plain)
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
|
# Maintainer: Trevor Bergeron <aur@sec.gd>
_pkgname=cwtch
pkgname=$_pkgname-git
pkgver=1.2.0.r0.g7737085
pkgrel=1
pkgdesc="UI for Privacy Preserving Infrastructure for Asynchronous, Decentralized and Metadata Resistant Applications (git)"
arch=('x86_64')
url="https://cwtch.im/"
license=('MIT')
depends=('libcwtch-go')
# flutter-beta until 2.5
makedepends=('flutter-beta' 'go' 'git')
provides=("$_pkgname")
source=("$_pkgname::git+https://git.openprivacy.ca/cwtch.im/cwtch-ui")
sha512sums=('SKIP')
pkgver() {
cd "$srcdir/$_pkgname"
( set -o pipefail
git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
build() {
cd "$srcdir/$_pkgname"
# If using the AUR 'flutter'/'flutter-beta' packages, we need a group.
if ! id -nG | grep -qw flutterusers ; then
if [ "`which flutter`" == "/usr/bin/flutter" ] ; then
warning "You are not in the 'flutterusers' group. The build will probably fail."
warning "Run 'sudo usermod -a -G flutterusers $USER' and reboot to fix."
fi
fi
flutter="flutter --suppress-analytics"
# no way to local-enable this... let's try to clean up after ourselves
$flutter config | grep -qE '^\s*enable-linux-desktop: true\b' || flutter_set_linux=y
flutter_set_linux="$?"
[ "$flutter_set_linux" == "y" ] || $flutter config --enable-linux-desktop
# See https://git.openprivacy.ca/cwtch.im/cwtch-ui/src/branch/trunk/.drone.yml
$flutter pub get
$flutter build linux \
--dart-define BUILD_VER="${pkgver}-${pkgrel}-ARCH" \
--dart-define BUILD_DATE="`date +%G-%m-%d-%H-%M`"
[ "$flutter_set_linux" == "y" ] || $flutter config --no-enable-linux-desktop
}
package() {
cd "$srcdir/$_pkgname"
builddir="$srcdir/$_pkgname/build/linux/x64/release/bundle"
# See linux/ package-release.sh and install-sys.sh
install -Dm0755 "linux/cwtch.sys.sh" "$pkgdir/usr/bin/cwtch"
install -Dm0644 "linux/cwtch.png" -t "$pkgdir/usr/share/icons/"
install -dm0755 "$pkgdir/usr/share/cwtch/"
cp -r "$builddir/data" "$pkgdir/usr/share/cwtch/"
install -dm0755 "$pkgdir/usr/lib/cwtch/"
install -Dm0755 "$builddir/cwtch" -t "$pkgdir/usr/lib/cwtch/"
cp -r "$builddir/lib/"* "$pkgdir/usr/lib/cwtch/"
install -Dm0644 "linux/cwtch.sys.desktop" "$pkgdir/usr/share/applications/cwtch.desktop"
}
|