summaryrefslogtreecommitdiff
blob: 1ce329fd716ecbe94683b0e9de6bb0a5f3db3091 (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
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

COMMIT="790b666"
JAVA_PKG_IUSE="doc source"

inherit toolchain-funcs java-pkg-2 java-ant-2 vcs-snapshot

DESCRIPTION="An implementation of an API for game controller discovery and polled input"
HOMEPAGE="https://java.net/projects/jinput"
SRC_URI="https://github.com/${PN}/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

CDEPEND="dev-java/jutils:0"

RDEPEND=">=virtual/jre-1.4
	${CDEPEND}"

DEPEND=">=virtual/jdk-1.4
	${CDEPEND}"

JAVA_PKG_BSFIX="off"
EANT_BUILD_TARGET="dist"

src_prepare() {
	# http://java.net/jira/browse/JINPUT-44
	# http://java.net/jira/browse/JINPUT-45
	eapply "${FILESDIR}"/{javah-classpath,nostrip,remove-getDeviceUsageBits,unbundle}.patch

	sed -i \
		-e "s/\"cc\"/\"$(tc-getCC)\"/g" \
		-e "s/-O[0-9]/${CFLAGS} ${LDFLAGS}/g" \
		plugins/linux/src/native/build.xml || die

	java-pkg_jar-from --into lib jutils
}

src_install() {
	java-pkg_dojar dist/${PN}.jar
	java-pkg_doso dist/lib${PN}-*.so

	# Only core API docs, others would conflict.
	use doc && java-pkg_dojavadoc coreAPI/apidocs
	use source && java-pkg_dosrc */src/java/* */**/src/java/*
}