summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ebed46d755abc8ea1b293af077ad31e12269ee3f (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer : Michael DeGuzis <mdeguzis@gmail.com>
# Contributor: Det <aur.archlinux.org/account/Det>
# Contributor: Nick Shvelidze <captain@pirrate.me>
# Contributor: Justin Dray <justin@dray.be>
# Contributor: Laurent Carlier <lordheavym@gmail.com>
# Contributor: K. Hampf <khampf@users.sourceforge.net>
# Contributor: Skunnyk <skunnyk@archlinux.fr>

# Build notes:
# http://wiki.playonlinux.com/index.php/Building_PlayOnLinux_5

_pkgname=playonlinux5
pkgname=${_pkgname}-git
pkgver=r1500.18b43a68
pkgrel=1
epoch=2
pkgdesc="GUI for managing Windows programs under linux (development version based on Java)"
arch=('any')
url="http://www.playonlinux.com/"
license=('GPL')
makedepends=('git' 'maven' 'java-openjfx' 'java-environment>=8')
depends=('wine' 'java-runtime>=8')
options=(!strip)
source=(
	"${_pkgname}::git://github.com/PlayOnLinux/POL-POM-5.git"
	'PlayOnLinux5.desktop'
	'PlayOnLinux.sh'
	)
sha256sums=(
	'SKIP'
	'4703fc813fb18d3e414cc1483f03cb3c0c306e5725b7681b3dbc43fb7f6630de'
	'a9a9c3d5ba3e9ebdbfe8153813a068ad703794bc6c9a4c6862a9a4c437ad2157'
	)

pkgver() {

  cd "${_pkgname}"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )

}

build() {

  cd "${_pkgname}"

  # Set environment
  if (( $(archlinux-java get | cut -d "-" -f2) < 8 )) || [[ ! -f /usr/bin/javac ]]; then

	# test for openjdk, fall back on other jdks if not found
	# Take the highest sorted version (alpahumericly,head -1)
	_openjdk=$(ls /usr/lib/jvm/java-{8,9}-openjdk/bin/javac 2>/dev/null | cut -d "/" -f-5)

	if [[ "${_openjdk}" ]]; then
		# choose the first one available
		export JAVA_HOME="${_openjdk[0]}"
	else
		# fall back to other JDKs
		export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
	fi

  fi

  # Build
  mvn package
  
}

package() {
  
  # Extract
  install -d "${pkgdir}/opt/"
  bsdtar -xf "${_pkgname}/phoenicis-dist/target/phoenicis-dist.zip"
  cp -r phoenicis-dist/ "${pkgdir}/opt/${_pkgname}/"

  # Launcher
  install -Dm755 "PlayOnLinux.sh"  "${pkgdir}/usr/bin/${_pkgname}"

  # Icon + Desktop
  install -Dm644 "$srcdir/${_pkgname}/phoenicis-javafx/target/classes/com/playonlinux/javafx/views/common/playonlinux.png" \
                 "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
  install -Dm644 PlayOnLinux5.desktop "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

}