summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a525523c51df57ed5cabcce9744d0a2aaa836548 (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
# Maintainer: envolution
# Contributor: Michael Goehler <somebody dot here at gmx dot de>

pkgname=remarkable
pkgver=1.95
pkgrel=2
pkgdesc="A free fully featured markdown editor for Linux."
arch=('i686' 'x86_64')
url="http://remarkableapp.github.io"
license=('MIT')
depends=('python'
         'python-cairo'
         'python-gobject'
         'python-markdown'
         'python-beautifulsoup4'
         'python-gtkspellcheck'
         'webkitgtk-6.0'
         'wkhtmltopdf')
options=('!emptydirs' '!strip')
install="${pkgname}.install"
source=(
  "${pkgname}-${pkgver}.tar.gz::https://github.com/jamiemcg/Remarkable/archive/refs/tags/v${pkgver}.tar.gz"
  "${pkgname}.install"
)
md5sums=('206c28415fddc594cb6162cbe51cb793'
         '4230de2876e8789bcd5a7cdc84b2a30b')

package() {
    cd "$srcdir/${pkgname^}-${pkgver}"

    # Install the main binary
    install -Dm755 bin/remarkable "$pkgdir/usr/share/$pkgname/$pkgname.bin"
    install -Dm755 /dev/stdin "$pkgdir/usr/bin/${pkgname}" << EOF
#!/bin/bash
export PYTHONPATH="/usr/share/${pkgname}:/usr/share/${pkgname}/${pkgname}:\$PYTHONPATH"
exec /usr/share/${pkgname}/remarkable.bin "\$@"
EOF

    # Install desktop entry
    install -Dm644 ${pkgname}.desktop "$pkgdir/usr/share/applications/${pkgname}.desktop"

    # Install icons
    install -Dm644 data/media/remarkable.png "$pkgdir/usr/share/pixmaps/${pkgname}.png"
    install -Dm644 data/media/remarkable.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"

    # Install glib schema
    install -Dm644 data/glib-2.0/schemas/net.launchpad.remarkable.gschema.xml \
        "$pkgdir/usr/share/glib-2.0/schemas/net.launchpad.remarkable.gschema.xml"

    # Recursively copy all necessary directories and files
    for dir in data remarkable remarkable_lib pdfkit; do
        if [[ -d $dir ]]; then
            cp -r "$dir" "$pkgdir/usr/share/${pkgname}/"
        fi
    done

    # Install additional scripts if present
    [[ -f run.sh ]] && install -Dm755 run.sh "$pkgdir/usr/share/${pkgname}/run.sh"

    # License and documentation
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 README.md "$pkgdir/usr/share/doc/${pkgname}/README.md"
}