blob: 306ec24e4f302ce7065ac9f2456aba5f9a73045e (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# Maintainer: q234 rty <q23456yuiop at gmail dot com>
# Contributor: garionion <garionion at entr0py.de>
# Contributor: The one with the braid <info@braid.business>
# thanks to celogeek, sseneca, dr460nf1r3, dr460nf1r3 and AverytheFurry for pointing out multiple things
pkgname=simple-live-app
_pkgname=dart_simple_live
_appname=simple_live_app
pkgver=1.8.6
pkgrel=1
pkgdesc='An app for watching live'
arch=('x86_64' 'aarch64')
url='https://github.com/xiaoyaocz/dart_simple_live'
license=('GPL-3.0-only')
_flutterchannel=stable
_flutterversion=3.22.3
depends=('xdg-user-dirs' 'gtk3' 'mpv')
makedepends=('ninja' 'cmake' 'clang' 'git' 'patchelf')
source=(
"flutter-${_flutterversion}.tar.xz::https://storage.googleapis.com/flutter_infra_release/releases/${_flutterchannel}/linux/flutter_linux_${_flutterversion}-${_flutterchannel}.tar.xz"
"git+https://github.com/xiaoyaocz/dart_simple_live.git#tag=v${pkgver}"
)
sha256sums=('9c5f70ba118b9163552144901a2efd91d40b22a68a04e67271d6a5ad936e8368'
'5ca0186921c6818bbaa727aa5bd974b133098057bee1700357ac8cd6658b3a2f')
case "${CARCH}" in
"x86_64")
export _dartarch="x64"
;;
"aarch64")
export _dartarch="arm64"
# fix incompatible C(XX)FLAGS on Arch Linux on ARM
CXXFLAGS="${CXXFLAGS/-fstack-protector-strong/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CFLAGS="${CFLAGS/-fstack-protector-strong/}"
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
;;
esac
prepare() {
export PATH="${srcdir}/flutter/bin:$PATH"
flutter config --no-analytics
flutter config --enable-linux-desktop
cd ${_pkgname}/simple_live_app
sed -i "s/use_header_bar = TRUE/use_header_bar = FALSE/g" linux/my_application.cc
rm -rf pub-cache
mkdir pub-cache
export PUB_CACHE="${srcdir}/${_pkgname}-${pkgver}/${_appname}/pub-cache"
flutter clean
flutter pub get
}
build() {
export PATH="${srcdir}/flutter/bin:$PATH"
export PUB_CACHE="${srcdir}/${_pkgname}-${pkgver}/${_appname}/pub-cache"
cd ${_pkgname}/${_appname}
flutter build linux --no-pub
}
package() {
# enter the output directory of the Flutter build
cd "${srcdir}/${_pkgname}/simple_live_app/build/linux/$_dartarch/release"
# configure the installation directory using cmake
cmake -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr/lib/${_pkgname} .
# install the Flutter project using cmake
cmake -P cmake_install.cmake
for f in ${pkgdir}/usr/lib/${_pkgname}/lib/*.so; do patchelf --shrink-rpath --allowed-rpath-prefixes '$ORIGIN' "$f"; done
for f in ${pkgdir}/usr/lib/${_pkgname}/lib/*.so; do if [ -z "$(patchelf --print-rpath $f)" ]; then patchelf --remove-rpath "$f"; fi; done
# link executable into PATH
install -dm755 "${pkgdir}/usr/bin"
ln -s "/usr/lib/${_pkgname}/${_appname}" "${pkgdir}/usr/bin/${_pkgname}" # icon
install -Dm644 "${srcdir}/${_pkgname}/assets/logo.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# desktop entry
install -dm755 "${pkgdir}/usr/share/applications"
cat > ${pkgdir}/usr/share/applications/${_pkgname}.desktop << EOF
[Desktop Entry]
Type=Application
Version=${pkgver}
Name=Simple Live App
Comment=A Live Player
Exec=${_pkgname}
Icon=${_pkgname}
Terminal=false
EOF
}
# vim: set sw=2 ts=2 et:
|