summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10a86e8e2a7daf554a713afe6ac0b06c9009ed0c (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
# Maintainer: jooch <jooch at gmx dot com>
pkgname=universal-gcode-sender
pkgver=2.0.18
pkgrel=1
pkgdesc="Java based GRBL compatible cross-platform G-Code sender"
arch=(any)
url="https://github.com/winder/Universal-G-Code-Sender"
license=(GPL3)
makedepends=(jdk13-openjdk-bin npm maven)
depends=(jdk13-openjdk-bin npm)
provides=(universal-gcode-sender)
conflicts=(universal-gcode-sender-git)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/winder/Universal-G-Code-Sender/archive/v${pkgver}.tar.gz"
	"universal-gcode-sender.desktop"
	"ugs_logo_square.svg")
sha256sums=('d893f6d63513d698d3968d5c76ec62415ae4466b1a1d8635f963b32130012d07'
	    'bb2c016d343490bdbf666aeb1c7de479af21d9cb1c37d506e289fc9122e00b7d'
	    '821f25d7fb74e6fc831a05d3220e1a70561833f725cd43b8566854ca05290d9a')

prepare() {
  cd "${srcdir}/Universal-G-Code-Sender-${pkgver}"
}

build() {
  cd "${srcdir}/Universal-G-Code-Sender-${pkgver}"

  export MAVEN_OPTS="-Xmx2048m"
  export JAVA_HOME=/usr/lib/jvm/java-13.0.1-openjdk
  mvn test install -B -Djava.util.logging.config.file=scripts/logging.config
  mvn package -pl ugs-classic assembly:assembly -DskipTests=true
  mvn package -pl ugs-platform/application -P create-linux-package -DskipTests=true
}

package() {
  mkdir -p "${pkgdir}/opt/universal-gcode-sender"

  # classic
  cp "${srcdir}/Universal-G-Code-Sender-${pkgver}/ugs-classic/target/UniversalGcodeSender.jar" "${pkgdir}/opt/universal-gcode-sender/."
  cp "${srcdir}/Universal-G-Code-Sender-${pkgver}/ugs-classic/release_files/start.sh" "${pkgdir}/opt/universal-gcode-sender/."
  chmod +x "${pkgdir}/opt/universal-gcode-sender/start.sh"
  sed -i "/^unamestr=.*/a export PATH=/usr/lib/jvm/java-13.0.1-openjdk/bin:$PATH" ${pkgdir}/opt/universal-gcode-sender/start.sh

  # platform
  cp -a "${srcdir}/Universal-G-Code-Sender-${pkgver}/ugs-platform/application/target/ugsplatform" "${pkgdir}/opt/universal-gcode-sender/."
  sed -i "/^PRG=.*/a jdkhome=/usr/lib/jvm/java-13.0.1-openjdk" ${pkgdir}/opt/universal-gcode-sender/ugsplatform/bin/ugsplatform

  mkdir -p "${pkgdir}/usr/bin"
  ln -s "/opt/universal-gcode-sender/start.sh" "${pkgdir}/usr/bin/ugs-classic"
  ln -s "/opt/universal-gcode-sender/ugsplatform/bin/ugsplatform" "${pkgdir}/usr/bin/ugs"

  # desktop launcher
  install -D -m644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"

  # icons
  cp ugs_logo_square.svg "$pkgdir/opt/universal-gcode-sender/."
}