summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9758056ea2e86057f8c25730e4ac8c9818d87b42 (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
# Maintainer: Bent Hillerkus <benthillerkus+aur@gmail.com>

pkgrel=0
pkgver=3.4

pkgname=jetuml
_gitname=JetUML
_iconname=jet
_jarname=$_gitname-$pkgver
_installdirectory=/usr/share/java/$pkgname
_javaver=18
pkgdesc="A desktop application for fast UML diagramming"
changelog=CHANGELOG
arch=('any')
url="https://github.com/prmr/$_gitname"
license=('GPL3')
depends=("java-runtime-openjdk=$_javaver" 'java-openjfx')
makedepends=('gendesk')
source=("https://github.com/prmr/$_gitname/releases/download/v$pkgver/$_jarname.jar"
        "$pkgname.png::https://raw.githubusercontent.com/prmr/$_gitname/v$pkgver/icons/$_iconname.png")
noextract=("$_jarname.jar")
md5sums=('901a95241b74c31e9e122fdc91719213'
         '3b8e71028b14563205716aeb592e0803')

prepare() {
    # Generate a runnable shell script
    echo "#!/bin/sh
/usr/bin/java --module-path $_installdirectory/lib --add-modules=javafx.controls,javafx.swing,java.desktop,java.prefs -jar $_installdirectory/$_jarname.jar" \
    > $pkgname

    # Generate a desktop entry
    # -f: forces and overrides the file if any
    # -n: do not download an icon
    # This tool assumes the icon has the same name as pkgname.
    # For categories see https://standards.freedesktop.org/menu-spec/latest/apa.html
    gendesk -f -n \
        --pkgname $pkgname \
        --pkgdesc "$pkgdesc" \
        --name $_gitname \
        --genericname "UML Diagrammer" \
        --comment "Create a new UML diagram" \
        --exec "/usr/bin/$pkgname" \
        --categories "Development;FlowChart;2DGraphics;ComputerScience;Java" \
        --mimetypes "application/jet"
}

package() {
    # Taking cues from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=asciidocfx

    install -dm755 "$pkgdir/usr/bin"
    install -m755 "$pkgname" "$pkgdir/usr/bin/$pkgname"

    install -Dm644 "$_jarname.jar" "$pkgdir/$_installdirectory/$_jarname.jar"
    install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
    install -Dm644 "$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"

    # Workaround for FS#64121
    install -dm755 "$pkgdir/$_installdirectory/lib"
    cp -t "$pkgdir/$_installdirectory/lib" /usr/lib/jvm/java-$_javaver-openjdk/lib/javafx*
}