summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 496c2a9b742353507752061ffe67ee32f4ec4e0a (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
107
108
109
110
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=ideology-git
pkgname=ideology-git
pkgver=r3.4c5f8cd
pkgrel=9
pkgdesc="IDEology is the IDE for the Snow programming language."
arch=($CARCH)
url="https://gitee.com/jcnc-org/IDEology"
license=('Apache-2.0')
groups=(snow-lang snow-lang-git)
provides=(${pkgbase%-git})
conflicts=(${pkgbase%-git})
replaces=()
depends=(
    at-spi2-core
    sh
    fontconfig
    gcc-libs
    glib2
    glibc
    gtk3
    hicolor-icon-theme
    libepoxy
    pango
)
makedepends=(
    cmake
    git
    ninja
    clang
    llvm
    pkgconf
    # AUR
    fvm
)
checkdepends=()
optdepends=()
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')
options=()
_engine_version=3.32.4

pkgver() {
    cd "${srcdir}/${pkgname}/"
    (
        set -o pipefail
        git describe --long --tag --abbrev=7 2>/dev/null | sed 's/^[vV]//g;s/\([^-]*-g\)/r\1/;s/-/./g' ||
            printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
    )
}

prepare() {
    git -C "${srcdir}/${pkgname}" clean -dfx
}

build() {
    export FVM_CACHE_PATH="$SRCDEST/fvm-cache"
    export CXX='clang++'
    export CXXFLAGS+=' -Wno-error=nontrivial-memcall'

    cd "${srcdir}/${pkgname}"

    pushd 'linux'
    fvm install "$_engine_version"
    fvm use -f "$_engine_version"

    fvm flutter --disable-analytics

    fvm flutter --no-version-check pub get
    fvm flutter build linux --release
    popd
}

package() {
    install -dm755 ${pkgdir}/usr/share/${pkgname%-git}
    cp -R "${srcdir}"/${pkgname}/build/linux/x64/release/bundle/* ${pkgdir}/usr/share/${pkgname%-git}
    install -Dm644 "${srcdir}"/${pkgname}/LICENSE -t ${pkgdir}/usr/share/licenses/${pkgname}

    local _icon
    for _icon in 192 512; do
        install -Dm0644 "${srcdir}"/${pkgname}/web/icons/Icon-${_icon}.png \
            ${pkgdir}/usr/share/icons/hicolor/${_icon}x${_icon}/apps/${pkgname%-git}.png
    done

    install -Dm755 /dev/stdin ${pkgdir}/usr/bin/${pkgname%-git} <<EOF
#!/usr/bin/env sh

cd /usr/share/${pkgname%-git}

./ideology "\$@"
EOF

    install -Dm0644 /dev/stdin ${pkgdir}/usr/share/applications/org.jcnc.snow.ideology.desktop <<EOF
[Desktop Entry]
Comment="IDEology is the IDE for the Snow programming language."
Comment[zh_CN]="IDEology 是 Snow 编程语言的 IDE"
GenericName="IDEology is the IDE for the Snow programming language."
GenericName[zh_CN]="IDEology 是 Snow 编程语言的 IDE"
Name=IDEology
Name[zh_CN]=IDEology
Exec=${pkgname%-git} %F
StartupNotify=false
Terminal=false
Type=Application
Categories=Development;Tool;IDE;
Icon=${pkgname%-git}.png
EOF

}