You are not logged in.

#1 2024-07-20 22:08:23

mr.ingenious
Member
Registered: 2024-07-20
Posts: 2

PKGBUILD review: gnss-ui

Hi,

I wrote a small program called "gnss-ui" (initially intended as xgps alternative) and a PKGBUILD for it. It installs and runs correctly after creating a package with the PKGBUILD below. I kindly ask for review. Thanks!

# Maintainer: mr.ingenious@gmail.com
pkgname='gnss-ui'
pkgver=0.10.9
pkgrel=1
pkgdesc="A graphical User Interface for GNSS receivers. It includes a GPSD client and NMEA parser."

arch=('any')
url="https://github.com/mr-ingenious/gnss-ui"
license=('GPL3')

depends=('libshumate>=1.2.2' 'gtk4>=4.14.4' 'python' 'python-gobject')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('d13763c4de8e5c54cb6362bb3df9b09ce580b351a4b09f7efdfed98f787aa146')

package() {
    cd "$pkgname-$pkgver/src"
    local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

    # install python files
    install -Dm755 {gnss-ui,compass_panel,logger,config_provider,data_recorder_dashboard,data_recorder_panel}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {data_recorder,data_transformer,datamodel,gnss_info_panel,gps_data_provider,gpsd_client,gpsd_panel}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {gpsd_parser,left_menu_panel,map_panel,observer,panel,plot_window,position_info_panel,preferences_dialog2}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {recording_map,satellites_graphic_panel,map_panel,satellites_info_panel,shumate_map,tty_client}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    
    install -Dm755 gnss-ui.py -t \ "${pkgdir}${site_packages}/gnss-ui/"

    # install assets
    cd "../assets"

    local asset_files=$(ls -q *.css *.svg *.png background.jpg)

    install -Dm755 $asset_files -t "${pkgdir}${site_packages}/gnss-ui/assets/"

    cd ".."
    # install -Dm644 "pkg/gnss-ui.svg" -t "${pkgdir}${site_packages}/gnss-ui/images/"
    
    install -Dm644 "pkg/gnss-ui.metainfo.xml" -t "$pkgdir/usr/share/metainfo/"
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
    install -Dm644 pkg/gnss-ui.desktop -t "$pkgdir/usr/share/applications/"

    install -d "$pkgdir"/usr/{bin,share/icons/hicolor/scalable/apps}
    ln -s "${site_packages}/gnss-ui/gnss-ui.py" "$pkgdir/usr/bin/${pkgname}"
    ln -s "${site_packages}/gnss-ui/assets/gnss-ui.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/gnss-ui.svg"
}

Offline

#2 2024-07-21 10:34:03

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: PKGBUILD review: gnss-ui

Looks like you did study https://wiki.archlinux.org/title/Python … guidelines ?

Usually packages don't depend on specific versions as all archlinux users are assumed to run latest versions in repos.

The license looks like it should be listed as "GPL-3.0-or-later" to comply with the SPDX license identifier system archlinux prefers now.
https://wiki.archlinux.org/title/PKGBUILD#license

Since that license is included in the licenses package, you don't need to place it explicitly under /usr/share/licenses/$pkgname/ .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-07-21 18:16:54

mr.ingenious
Member
Registered: 2024-07-20
Posts: 2

Re: PKGBUILD review: gnss-ui

OK, thanks for the hints! I updated accordingly:

# Maintainer: mr.ingenious@gmail.com
pkgname='gnss-ui'
pkgver=0.10.9
pkgrel=1
pkgdesc="A graphical User Interface for GNSS receivers. It includes a GPSD client and NMEA parser."

arch=('any')
url="https://github.com/mr-ingenious/gnss-ui"
license=('GPL-3.0-or-later')

depends=('libshumate' 'gtk4' 'python' 'python-gobject')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('d13763c4de8e5c54cb6362bb3df9b09ce580b351a4b09f7efdfed98f787aa146')

package() {
    cd "$pkgname-$pkgver/src"
    local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

    # install python files
    install -Dm755 {gnss-ui,compass_panel,logger,config_provider,data_recorder_dashboard,data_recorder_panel}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {data_recorder,data_transformer,datamodel,gnss_info_panel,gps_data_provider,gpsd_client,gpsd_panel}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {gpsd_parser,left_menu_panel,map_panel,observer,panel,plot_window,position_info_panel,preferences_dialog2}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    install -Dm755 {recording_map,satellites_graphic_panel,map_panel,satellites_info_panel,shumate_map,tty_client}.py -t \
    "${pkgdir}${site_packages}/gnss-ui/"
    
    install -Dm755 gnss-ui.py -t \ "${pkgdir}${site_packages}/gnss-ui/"

    # install assets
    cd "../assets"

    local asset_files=$(ls -q *.css *.svg *.png background.jpg)

    install -Dm755 $asset_files -t "${pkgdir}${site_packages}/gnss-ui/assets/"

    cd ".."
    # install -Dm644 "pkg/gnss-ui.svg" -t "${pkgdir}${site_packages}/gnss-ui/images/"
    
    install -Dm644 "pkg/gnss-ui.metainfo.xml" -t "$pkgdir/usr/share/metainfo/"
    install -Dm644 pkg/gnss-ui.desktop -t "$pkgdir/usr/share/applications/"

    install -d "$pkgdir"/usr/{bin,share/icons/hicolor/scalable/apps}
    ln -s "${site_packages}/gnss-ui/gnss-ui.py" "$pkgdir/usr/bin/${pkgname}"
    ln -s "${site_packages}/gnss-ui/assets/gnss-ui.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/gnss-ui.svg"
}

Offline

Board footer

Powered by FluxBB