summaryrefslogtreecommitdiff
blob: 23b1814c6af8fa04c5750a5c3c27746312401b73 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

SPEC_ALPHA_VER="0.5.238"        # https://github.com/clojure/spec.alpha/tags/
CORE_SPECS_ALPHA_VER="0.4.74"   # https://github.com/clojure/core.specs.alpha/tags/

TOOLS_NAMESPACE_VER="1.5.0"     # https://github.com/clojure/tools.namespace/tags/
JAVA_CLASSPATH_VER="1.1.0"		# https://github.com/clojure/java.classpath/tags/
TOOLS_READER_VER="1.4.2"		# https://github.com/clojure/tools.reader/tags/
TEST_GENERATIVE_VER="1.1.0"		# https://github.com/clojure/test.generative/tags/
DATA_GENERATORS_VER="1.1.0"		# https://github.com/clojure/data.generators/tags/
TEST_CHECK_VER="1.1.1"			# https://github.com/clojure/test.check/tags/

JAVA_PKG_IUSE="test"

inherit java-pkg-2

DESCRIPTION="General-purpose programming language with an emphasis on functional programming"
HOMEPAGE="https://clojure.org/
	https://github.com/clojure/clojure/"
SRC_URI="
	https://github.com/${PN}/${PN}/archive/${P}.tar.gz

	https://github.com/clojure/spec.alpha/archive/v${SPEC_ALPHA_VER}.tar.gz
		-> spec.alpha-${SPEC_ALPHA_VER}.tar.gz
	https://github.com/clojure/core.specs.alpha/archive/v${CORE_SPECS_ALPHA_VER}.tar.gz
		-> core.specs.alpha-${CORE_SPECS_ALPHA_VER}.tar.gz

	test? (
		https://github.com/clojure/tools.namespace/archive/v${TOOLS_NAMESPACE_VER}.tar.gz
			-> tools.namespace-${TOOLS_NAMESPACE_VER}.tar.gz
		https://github.com/clojure/java.classpath/archive/v${JAVA_CLASSPATH_VER}.tar.gz
			-> java.classpath-${JAVA_CLASSPATH_VER}.tar.gz
		https://github.com/clojure/tools.reader/archive/v${TOOLS_READER_VER}.tar.gz
			-> tools.reader-${TOOLS_READER_VER}.tar.gz
		https://github.com/clojure/test.generative/archive/v${TEST_GENERATIVE_VER}.tar.gz
			-> test.generative-${TEST_GENERATIVE_VER}.tar.gz
		https://github.com/clojure/data.generators/archive/v${DATA_GENERATORS_VER}.tar.gz
			-> data.generators-${DATA_GENERATORS_VER}.tar.gz
		https://github.com/clojure/test.check/archive/v${TEST_CHECK_VER}.tar.gz
			-> test.check-${TEST_CHECK_VER}.tar.gz
	)
"
S="${WORKDIR}/${PN}-${P}"

LICENSE="EPL-1.0 Apache-2.0 BSD"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="amd64 ~x86 ~x86-linux"
RESTRICT="!test? ( test )"

BDEPEND="
	>=dev-java/ant-1.10.14-r3
"
RDEPEND="
	>=virtual/jre-1.8:*
"
DEPEND="
	>=virtual/jdk-1.8:*
"

PATCHES=(
	"${FILESDIR}/add-compile-spec-ant-build-target.patch"
)

DOCS=( changes.md CONTRIBUTING.md readme.txt )

src_prepare() {
	default
	java-pkg-2_src_prepare

	ln -rs \
		../spec.alpha-${SPEC_ALPHA_VER}/src/main/clojure/clojure/spec \
		src/clj/clojure/spec || die "Could not create symbolic link for spec-alpha"
	ln -rs \
		../core.specs.alpha-${CORE_SPECS_ALPHA_VER}/src/main/clojure/clojure/core/specs \
		src/clj/clojure/core/specs || die "Could not create symbolic link for core-specs-alpha"
}

src_compile() {
	eant -f build.xml jar
}

src_test() {
	ln -rs \
		../tools.namespace-${TOOLS_NAMESPACE_VER}/src/main/clojure/clojure/tools \
		src/clj/clojure/tools || die "Could not create symbolic link for tools-namespace"
	mv \
		../java.classpath-${JAVA_CLASSPATH_VER}/src/main/clojure/clojure/java/* \
		src/clj/clojure/java || die "Could not move java-classpath"
	mv \
		../tools.reader-${TOOLS_READER_VER}/src/main/clojure/clojure/tools/* \
		src/clj/clojure/tools || die "Could not move tools-reader"
	mv \
		../test.generative-${TEST_GENERATIVE_VER}/src/main/clojure/clojure/test/* \
		src/clj/clojure/test || die "Could not move test-generative"
	ln -rs \
		../data.generators-${DATA_GENERATORS_VER}/src/main/clojure/clojure/data/ \
		src/clj/clojure/data || die "Could not create symbolic link for data-generators"
	mv \
		../test.check-${TEST_CHECK_VER}/src/main/clojure/clojure/test/* \
		src/clj/clojure/test || die "Could not move test-check"

	eant -f build.xml test
}

src_install() {
	java-pkg_newjar "${PN}.jar"
	java-pkg_dolauncher "${PN}" --main clojure.main

	einstalldocs
}