You are not logged in.

#1 2020-10-30 09:45:25

bent
Member
Registered: 2020-10-30
Posts: 2

PKGBUILD review request: JetUML

This is the PKGBUILD:

# Maintainer: Bent Hillerkus <benthillerkus@gmail.com>

pkgrel=10
pkgver=3.0.2

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

_name=${_gitname}
_genericname="UML Diagrammer"
_exec="/usr/bin/java --module-path '/usr/lib/jvm/default/lib' --add-modules=javafx.controls,javafx.swing,java.desktop,java.prefs -jar ${_archivefolder}"
_categories="Development"
_comment="Create a new diagram"
_mimetypes="application/jet"

build() {
    gendesk -f -n --pkgname ${pkgname} --pkgdesc "${pkgdesc}" --name ${_gitname} --genericname "${_genericname}" --comment "${_comment}" --exec "${_exec}" --categories "${_categories}" --mimetypes "${_mimetypes}"
}

package() {
    install -Dm644 "${_archivename}" "${pkgdir}/${_archivefolder}"
    install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
    install -Dm644 "$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}

and for .CHANGELOG I've got

This release fixes a few leftover problems from 3.0.

## Usability Improvements
- Fixed bug causing the selection of fields in Object diagrams to changes their relative order (#377)
- Fixed insufficient name padding for some class diagram and use case diagram elements (#379)
- Fixed bug causing version migration between compatible versions.

## Code Improvement
- Removed unnecessary parameter in edge segmentation code (#378)

This is my first AUR submission, so I'd be eager to get all feedback; but I've also got some questions:

  • Should I include a shell script that starts the application instead of putting it only in the exec of the desktop file? If yes, how'd I do that, so that you can just run jetuml on a shell to start the program?

  • Does this actually work on systems other than mine? I had to remove some .jar in my java directory that provided a package that was already satisfied by base java.

  • Should I bother with the changelog? It's just copypasted from the GitHub releases page.

  • When I run makepkg, even with all the cleanup options, it leaves the two downloaded sources behind. Should I manually delete them in the install function after they've been copied into their target directories? Or is this just adding onto the cache that users purge manually?

Last edited by bent (2020-10-30 11:35:49)

Offline

#2 2020-10-30 13:02:58

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,138

Re: PKGBUILD review request: JetUML

bent wrote:

This is my first AUR submission, so I'd be eager to get all feedback; but I've also got some questions:

  • Should I include a shell script that starts the application instead of putting it only in the exec of the desktop file? If yes, how'd I do that, so that you can just run jetuml on a shell to start the program?

Yes. Desktop files are of little use for Users not runing a DE. Look at other java programs in the repos or in AUR for examples.

bent wrote:
  • Does this actually work on systems other than mine? I had to remove some .jar in my java directory that provided a package that was already satisfied by base java.

The Java version seems to be relevant to run it. I have openjdk 14 enabled, and it does not work.

bent wrote:
  • Should I bother with the changelog? It's just copypasted from the GitHub releases page.

*shrug*

bent wrote:
  • When I run makepkg, even with all the cleanup options, it leaves the two downloaded sources behind. Should I manually delete them in the install function after they've been copied into their target directories? Or is this just adding onto the cache that users purge manually?

That's completely normal. Do not touch these files.

Offline

#3 2020-10-30 13:28:04

a821
Member
Registered: 2012-10-31
Posts: 203

Re: PKGBUILD review request: JetUML

I would get rid of all the unnecessary `$_foobar` variables, specially if they are referenced just once. It makes the PKGBUILD unreadable. YMMV.

Edit: do you really need to generate the desktop file every time the package is built? I would just provide it like many other packages (it is not likely to change very often). In the exec line put the path to the launcher script (see above comment).

Last edited by a821 (2020-10-30 13:40:30)

Offline

#4 2020-10-30 15:35:30

bent
Member
Registered: 2020-10-30
Posts: 2

Re: PKGBUILD review request: JetUML

# Maintainer: Bent Hillerkus <benthillerkus+aur@gmail.com>

pkgrel=25
pkgver=3.0.2

pkgname=jetuml
_gitname=JetUML
_iconname=jet
_jarname=$_gitname-$pkgver
_installdirectory=/usr/share/java/$pkgname
_javaver=14
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=('400b9c6de6025419f8c0450317c41a15'
         '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*
}

ok, so i've reworked it quite a bit to incorporate the feedback.

a821 wrote:

do you really need to generate the desktop file every time the package is built?

Probably not, but I suppose it makes it easier for me to maintain this way.

Stefan Husmann wrote:

The Java version seems to be relevant to run it. I have openjdk 14 enabled, and it does not work.

Java 14 is the correct one. I've specified it in the dependencies more clearly.

It's a bit of a shame that I had to circumvent this misconfiguration in the way JavaFX is being installed with this solution, but alas, it works.

Last edited by bent (2020-10-30 17:02:59)

Offline

#5 2020-11-01 18:43:52

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,768

Re: PKGBUILD review request: JetUML

Please do not use gendesk, its value is highly questionable. The definition of the desktop file format is stable, and it is much easier to track the evolution of the file if you provide it as a source file directly; plus, it is faster and makes for a more concise PKGBUILD by separating data from code.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB