summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5528e9cb9623d10d95416f6f2f85146359b9f3dd (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Maintainer: Roald Clark <roaldclark@gmail.com>

_name=rune
_pkgname=rune-player
pkgname=rune-player-git
pkgver=1.0.0.beta.2.r17.g56be8a2
pkgrel=1
pkgdesc="The player that blends classic design with modern technology"
arch=('x86_64')
url="https://github.com/Losses/${_name}"
license=('MPL-2.0')
depends=(
    'alsa-lib'
    'at-spi2-core'
    'ayatana-ido'
    'cairo'
    'dbus'
    'fontconfig'
    'gcc-libs'
    'gdk-pixbuf2'
    'glib2'
    'glibc'
    'gtk3'
    'harfbuzz'
    'hicolor-icon-theme'
    'libayatana-appindicator'
    'libayatana-indicator'
    'libdbusmenu-glib'
    'libepoxy'
    'libnotify'
    'pango'
    'zlib'
)
makedepends=(
    'flutter-intellij-patch'
    'flutter-target-linux'
    'flutter-tool'
    'git'
    'patchelf'
    'protobuf'
    'protoc-gen-dart'
    'protoc-gen-prost'
    'rustup'
)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
options=(!lto)
source=(
    "${_pkgname}::git+${url}.git"
    "${_name}.desktop"
)
sha256sums=('SKIP'
            '8c680492966831e2da2968007f2d5d3dbfbf72fdab670592689ac42f37af2121')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "${srcdir}/${_pkgname}"
    flutter pub get
}

build() {
    cd "${srcdir}/${_pkgname}"
    export LDFLAGS="${LDFLAGS} -Wl,--no-as-needed"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    flutter pub run rinf message
    flutter build linux --no-pub --release --verbose
}

package() {
    cd "${srcdir}/${_pkgname}"

    install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"

    pushd assets/icons
    #find . \( -path "./android" -o -path "./fluent" -o -path "./macos" \) -prune -o -type f -exec install -v -Dm644 {} ${pkgdir}/usr/share/icons/{} \;
    find ./breeze ./gnome -type f -exec install -v -Dm644 {} ${pkgdir}/usr/share/icons/{} \;
    cd Papirus
    find . -type f -exec install -v -Dm644 {} ${pkgdir}/usr/share/icons/hicolor/{} \;
    popd
    ln -sfrv ${pkgdir}/usr/share/icons/breeze/apps/1024/${_name}.png ${pkgdir}/usr/share/icons/${_name}.png

    cd build/linux/x64/release/bundle
    install -Dm755 ${_name} -t "${pkgdir}/usr/lib/${_pkgname}/"
    pushd lib
    find . -type f -exec install -v -Dm644 {} ${pkgdir}/usr/lib/${_pkgname}/lib/{} \;
    popd
    pushd data
    find . -type f -exec install -v -Dm644 {} ${pkgdir}/usr/lib/${_pkgname}/data/{} \;
    popd
    install -dm755 "${pkgdir}/usr/bin"
    ln -sfrv "${pkgdir}/usr/lib/${_pkgname}/${_name}" "${pkgdir}/usr/bin/${_name}"

    # Fix rpath that causes 'Insecure RUNPATH'
    for shared_lib in "${pkgdir}/usr/lib/${_pkgname}/lib"/*.so; do
        [[ -z $(patchelf --print-rpath "${shared_lib}") ]] && continue
        [[ $(patchelf --print-rpath "${shared_lib}") == '$ORIGIN' ]] && continue
        patchelf --set-rpath '$ORIGIN' "${shared_lib}"
    done

    install -Dm644 "${srcdir}/${_name}.desktop" -t "${pkgdir}/usr/share/applications/"
}