Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging for ArchLinux questions #6

Open
NicoHood opened this issue Aug 10, 2021 · 0 comments
Open

Packaging for ArchLinux questions #6

NicoHood opened this issue Aug 10, 2021 · 0 comments

Comments

@NicoHood
Copy link
Contributor

Hi Andreas,
as you can see I finally took the time to package the new geckocircuits version. It works quite well, here is my code:

# Maintainer: NicoHood <archlinux {cat} nicohood {dog} de>
# PGP ID: 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
# Contributor: ValHue <vhuelamo at gmail dot com>
# Contributor: Jonas Amstutz <amstutjo at student dot ethz dot ch>

pkgname="geckocircuits"
_pkgname="GeckoCIRCUITS"
pkgver=2.02
pkgrel=1
pkgdesc="Powerful Circuit Simulator developed by PES/ETH Zürich"
arch=('any')
url="https://github.com/geckocircuits/GeckoCIRCUITS"
license=('GPL3')
depends=('java-runtime>=9' 'sh')
makedepends=('imagemagick' 'java-environment>=9' 'maven')
provides=("${pkgname}")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/geckocircuits/GeckoCIRCUITS/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('c6bb21b6d6224d176f6d0c0406991be2a4bff13e40f0768c6a241a17868019294f3328b1078377f995f6c0f22f2477217f21de8a652f0260c1d5565b31695a56')
# validpgpkeys=('') TODO

_geckocircuits_desktop="[Desktop Entry]
Encoding=UTF-8
Version=${pkgver}
Name=GeckoCircuits
Icon=geckocircuits
GenericName=Powerful Circuit Simulator
Comment=Powerful Circuit Simulator for Electronic Systems
Exec=/usr/bin/geckocircuits
Terminal=false
Type=Application
Categories=Development;"

_geckocircuits_sh="#!/bin/sh
exec /usr/bin/java -Xmx3G -Dpolyglot.js.nashorn-compat=true -jar '/opt/geckocircuits/geckocircuits.jar' \"\$@\""

build() {
    echo -e "${_geckocircuits_desktop}" > "geckocircuits.desktop"
    echo -e "${_geckocircuits_sh}" > "geckocircuits.sh"

    cd "${srcdir}/${_pkgname}-${pkgver}"
    mvn package
    mvn package assembly:single
}

package() {
    # Install binary jar file
    install -Dm644 "${_pkgname}-${pkgver}/target/gecko-1.0-jar-with-dependencies.jar" "${pkgdir}/opt/geckocircuits/geckocircuits.jar"

    # Install Desktop file and icon
    install -Dm644 "geckocircuits.desktop" "${pkgdir}/usr/share/applications/geckocircuits.desktop"
    # TODO fix https://github.com/geckocircuits/GeckoCIRCUITS/issues/5
    #convert "${_pkgname}-${pkgver}/gecko.ico" ${pkgdir}/usr/share/pixmaps/geckocircuits.png

    # Create starter file and symlink pointing to it
    install -Dm755 "geckocircuits.sh" "${pkgdir}/opt/geckocircuits/geckocircuits.sh"
    mkdir -p "${pkgdir}/usr/bin"
    ln -s "/opt/geckocircuits/geckocircuits.sh" "${pkgdir}/usr/bin/geckocircuits"

    # TODO add pdf and software version file
    install -Dm 644 "${_pkgname}-${pkgver}/README.md" \
        "${pkgdir}/usr/share/doc/geckocircuits/README.md"
}

A few questions:

  1. Is calling mvn twice correct?
  2. Is it possible to use the version without dependencies? It crashed for me (possibyly due to missing deps). If it is possible to use system libraries, we would want to do so. Maybe you can explain a bit more how the non-bundled version can be used.
  3. I've seen some additional pdf and folders inside the github release zip file. If there is any specific reason why you've chosen those, I can include them in the package as well. What would you say makes sense to add in a system package?
  4. There is also a software version file in the zip file. Is it somehow required to have?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant