aboutsummaryrefslogtreecommitdiff
path: root/linux/makepkg/PKGBUILD
blob: 5e27542e42689e1294d86f3794ced8ac7434fc8a (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
111
112
113
114
115
116
117
# Maintainer: Aqua-sama <aqua at iserlohn-fortress dot net>

## not-use flags
# Enable plugin signing:
_signPlugins=0
# Enable breakpad integraton:
_enableBreakpad=0
# install prefix
_prefix='/usr/local'

pkgname=smolbote-git
pkgdesc='Yet another no-frills browser'
pkgver=0
pkgrel=1

url="https://neueland.iserlohn-fortress.net/gitea/smolbote"
install="smolbote.install"

arch=('x86_64' 'aarch64')
license=('GPL3')

depends=('qt5-webengine>=5.11.0' 'spdlog')
makedepends=('git' 'meson' 'python-kconfiglib' 'openssl' 'qt5-tools' 'scdoc' 'catch2')
if [ $_enableBreakpad == "1" ]; then
  makedepends+=('breakpad-git')
fi
optdepends=('firejail: launch a sandboxed instance')

# this isn't a hard requirement, simply a workaround as the build script
# sets some additional hardening flags that the default makepkg.conf
# will turn down
options=(!buildflags)

# use git+file:///path/to/your/repo to build from a local repo
source=("git+https://library.iserlohn-fortress.net/aqua/smolbote.git"
        "https://neueland.iserlohn-fortress.net/releases/SingleApplication-3.1.1a.tar.xz"{,.sig}
        "https://neueland.iserlohn-fortress.net/releases/args.hxx-6.2.2.tar.xz"{,.sig})

b2sums=('SKIP'
        'cec3de8dbf252bfa6dc488e5a1440695f4dd3abffdf30948b7d1a3df3d9c85911e981c802ed5a882f1407315114529f4016e55c7d05fbbd1dafe5495b0a63f4a'
        'SKIP'
        '440e357006883fbf1b1a796051500a6b068858a35947cd1119767bed8e0a86a7db4aff16498934d7217c375fe643da03c22007e438f30899e247153f25c922b6'
        'SKIP')

validgpgkeys=(BB1C090188E3E32B375C13FD095DE26BC16D2E98) # Aqua-sama <aqua@iserlohn-fortress.net>

prepare() {
    mkdir "$srcdir/smolbote/subprojects/packagecache/"
    ln -s "$srcdir/SingleApplication-3.1.1a" "$srcdir/smolbote/subprojects/"
    ln -s "$srcdir/args.hxx-6.2.2" "$srcdir/smolbote/subprojects/"
}

pkgver() {
    cd smolbote
    # Without version tag
    echo r$(git rev-list --count HEAD)-$(git rev-parse --short HEAD) | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    mkdir -p $srcdir/build
    cd $srcdir/smolbote
    KCONFIG_CONFIG=linux/.config alldefconfig

    # For a list of configureable options, check smolbote/meson_options.txt, or
    # run `meson configure` in $srcdir/build

    # --wrap-mode=nodownload - disable meson from downloading dependency wraps. This will cause it to fail if makedepends are not found by pkg-config or cmake.
    # --wrap-mode=nofallback - disable downloads as a fallback too. Implies --wrap-mode=nodownload
    # --buildtype=plain - meson won't add any flags to the command line
    # --prefix=... - install prefix
    # --auto-features=disabled - features should be explicitly enabled
    # b_pie: Build executables as position independent
    # b_lto: Use link time optimization
    meson --buildtype=release --wrap-mode=nodownload \
        --prefix=$_prefix --auto-features=disabled \
        -Db_pie=true -Ddefault_library=static \
        -Dmanpage=enabled \
        $srcdir/build

    if [ $_enableBreakpad == "1" ]; then
        msg2 "Enabling crashhandler"
        meson configure -Ddebug=true -Dcrashhandler=enabled
        KCONFIG_CONFIG=linux/.config setconfig USEBREAKPAD=y
    fi

    # Run menuconfig
    #KCONFIG_CONFIG=linux/.config menuconfig

    # Build
    ninja -C $srcdir/build "$MAKEFLAGS"
}

check() {
    ninja -C $srcdir/build test
}

package() {
    # Install
    cd $srcdir/build
    DESTDIR="$pkgdir" ninja install

    if [ $_signPlugins == "1" ]; then
    msg "Signing plugins"
    for so in $pkgdir/$_prefix/lib/smolbote/plugins/*.so; do
        openssl dgst -sha256 -sign $srcdir/build/lib/pluginloader/privateKey.pem -out $so.sig $so
        msg2 "Signed $(basename $so)"
    done
    fi

    if [ $_enableBreakpad == "1" ]; then
        msg "Installing debug symbols"
        ninja -C $srcdir/build linux/poi.sym
        install -dm644 $pkgdir/$_prefix/lib/smolbote/symbols/poi/$(head -n1 linux/poi.sym | awk '{ print $(NF-1) }') 
        install -m644 -t $pkgdir/$_prefix/lib/smolbote/symbols/poi/$(head -n1 linux/poi.sym | awk '{ print $(NF-1) }') $srcdir/build/linux/poi.sym
    fi
}