1 |
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI="6"
|
|
4 |
EAPI="7"
|
5 |
5 |
|
6 |
6 |
JAVA_PKG_IUSE="doc source"
|
7 |
7 |
|
8 |
|
inherit check-reqs java-pkg-2 versionator
|
|
8 |
inherit check-reqs java-pkg-2
|
9 |
9 |
|
10 |
|
SV="$(get_version_component_range 1-2)"
|
|
10 |
SV="$(ver_cut 1-2)"
|
|
11 |
SBTV="0.13.18"
|
11 |
12 |
|
12 |
13 |
# Note: to bump scala, some things to try are:
|
13 |
|
# 1. update all the sha1s in JURI
|
14 |
|
# 2. remove the https://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.gz
|
|
14 |
# 1. remove the https://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.gz
|
15 |
15 |
# and https://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.gz from
|
16 |
16 |
# SRC_URI
|
17 |
|
# 3. try emerge scala. Check if it downloads more stuff in src_compile to
|
|
17 |
# 2. try emerge scala, with network-sandbox disabled:
|
|
18 |
# FEATURES="noclean -network-sandbox" emerge dev-lang/scala
|
|
19 |
# Check if it downloads more stuff in src_compile to
|
18 |
20 |
# ${WORKDIR}/.ivy2 or ${WORKDIR}/.sbt or /root/.ivy2 or /root/.sbt
|
19 |
|
# 4. tar up all the .ivy2 and .sbt junk into ${P}-ivy2-deps.tar.xz and
|
20 |
|
# ${P}-sbt-deps.tar.xz and add them to SRC_URI:
|
|
21 |
# 3. tar up all the .ivy2 and .sbt junk into ${P}-ivy2-deps.tar.xz and
|
|
22 |
# ${P}-sbt-deps.tar.xz and add them to SRC_URI, in ${WORKDIR}:
|
21 |
23 |
# XZ_OPT=-9 tar --owner=portage --group=portage \
|
22 |
24 |
# -cJf /usr/portage/distfiles/${P}-ivy2-deps.tar.xz .ivy2/cache
|
23 |
25 |
# XZ_OPT=-9 tar --owner=portage --group=portage \
|
24 |
26 |
# -cJf /usr/portage/distfiles/${P}-sbt-deps.tar.xz .sbt
|
25 |
|
|
26 |
|
# creating the binary:
|
27 |
|
# FEATURES="noclean -test" USE="doc source" emerge dev-lang/scala
|
|
27 |
# 4. Add these tar files to SRC_URI (undo step 1).
|
|
28 |
# 5. Try emerging it again, with network-sandbox, and create the bianry
|
|
29 |
# tar archive:
|
|
30 |
# FEATURES="noclean network-sandbox -test" USE="doc source" emerge dev-lang/scala
|
28 |
31 |
# cd $WORDKIR
|
29 |
32 |
# XZ_OPT=-9 tar --owner=portage --group=portage \
|
30 |
33 |
# -cJf /usr/portage/distfiles/${P}-gentoo-binary.tar.xz .ivy2/local \
|
... | ... | |
32 |
35 |
# ${P}/src/library ${P}/src/library-aux ${P}/src/reflect ${P}/doc/README \
|
33 |
36 |
# ${P}/build/scaladoc
|
34 |
37 |
|
35 |
|
# In the pullJarFiles function in tools/binary-repo-lib.sh it executes find commands
|
36 |
|
# to search for .desired.sha1 files, which contain sha1 hashes that are appended
|
37 |
|
# to ${BURI} along with the subdirectory and filename to form the list of jar files
|
38 |
|
# listed in SRC_URI. The output of this find command can be hacked into the desired format:
|
39 |
|
# find . -name \*.desired.sha1 -exec sed -e 's@\([0-9a-f]*\).*@\1@' {} \; -print
|
40 |
|
# After editing it into the desired format: sort -t / -k 3 file
|
41 |
|
|
42 |
|
BURI="http://repo.typesafe.com/typesafe/scala-sha-bootstrap/org/scala-lang/bootstrap"
|
43 |
|
|
44 |
|
declare -a JURI=(
|
45 |
|
"${BURI}/943cd5c8802b2a3a64a010efb86ec19bac142e40/lib/ant/ant-contrib.jar -> ${P}-ant-contrib.jar"
|
46 |
|
"${BURI}/3fc1e35ca8c991fc3488548f7a276bd9053c179d/lib/ant/ant-dotnet-1.0.jar -> ${P}-ant-dotnet-1.0.jar"
|
47 |
|
"${BURI}/7b456ca6b93900f96e58cc8371f03d90a9c1c8d1/lib/ant/ant.jar -> ${P}-ant.jar"
|
48 |
|
"${BURI}/7e50e3e227d834695f1e0bf018a7326e06ee4c86/lib/ant/maven-ant-tasks-2.1.1.jar -> ${P}-maven-ant-tasks-2.1.1.jar"
|
49 |
|
"${BURI}/2c61d6e9a912b3253194d5d6d3e1db7e2545ac4b/lib/ant/vizant.jar -> ${P}-vizant.jar"
|
50 |
|
"${BURI}/e737b123d31eede5594ceda07caafed1673ec472/test/files/codelib/code.jar -> ${P}-code.jar"
|
51 |
|
"${BURI}/02fe2ed93766323a13f22c7a7e2ecdcd84259b6c/test/files/lib/annotations.jar -> ${P}-annotations.jar"
|
52 |
|
"${BURI}/981392dbd1f727b152cd1c908c5fce60ad9d07f7/test/files/lib/enums.jar -> ${P}-enums.jar"
|
53 |
|
"${BURI}/b1ec8a095cec4902b3609d74d274c04365c59c04/test/files/lib/genericNest.jar -> ${P}-genericNest.jar"
|
54 |
|
"${BURI}/346d3dff4088839d6b4d163efa2892124039d216/test/files/lib/jsoup-1.3.1.jar -> ${P}-jsoup-1.3.1.jar"
|
55 |
|
"${BURI}/3794ec22d9b27f2b179bd34e9b46db771b934ec3/test/files/lib/macro210.jar -> ${P}-macro210.jar"
|
56 |
|
"${BURI}/be8454d5e7751b063ade201c225dcedefd252775/test/files/lib/methvsfield.jar -> ${P}-methvsfield.jar"
|
57 |
|
"${BURI}/cd33e0a0ea249eb42363a2f8ba531186345ff68c/test/files/lib/nest.jar -> ${P}-nest.jar"
|
58 |
|
"${BURI}/1b11ac773055c1e942c6b5eb4aabdf02292a7194/test/files/speclib/instrumented.jar -> ${P}-instrumented.jar"
|
59 |
|
)
|
60 |
|
|
61 |
38 |
DESCRIPTION="The Scala Programming Language"
|
62 |
39 |
HOMEPAGE="https://www.scala-lang.org/"
|
63 |
40 |
SRC_URI="
|
... | ... | |
65 |
42 |
https://github.com/scala/scala/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
66 |
43 |
https://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.xz
|
67 |
44 |
https://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.xz
|
68 |
|
${JURI[@]} )
|
|
45 |
)
|
69 |
46 |
binary? (
|
70 |
|
https://dev.gentoo.org/~gienah/files/dist/${P}-gentoo-binary.tar.xz )"
|
|
47 |
https://dev.gentoo.org/~gienah/distfiles/${P}-gentoo-binary.tar.xz
|
|
48 |
)"
|
71 |
49 |
LICENSE="BSD"
|
72 |
50 |
SLOT="${SV}/${PV}"
|
73 |
|
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux"
|
|
51 |
KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux"
|
74 |
52 |
|
75 |
53 |
IUSE="binary emacs"
|
76 |
54 |
|
... | ... | |
79 |
57 |
|
80 |
58 |
DEPEND="${COMMON_DEP}
|
81 |
59 |
!binary? (
|
82 |
|
=virtual/jdk-1.8*
|
83 |
|
>=dev-java/sbt-0.13.13
|
|
60 |
>=dev-java/sbt-${SBTV}:0
|
84 |
61 |
media-gfx/graphviz
|
85 |
62 |
)
|
86 |
|
>=virtual/jdk-1.8
|
|
63 |
>=virtual/jdk-1.8:*
|
87 |
64 |
app-arch/xz-utils:0"
|
88 |
65 |
|
89 |
66 |
RDEPEND="${COMMON_DEP}
|
90 |
|
>=virtual/jre-1.8
|
|
67 |
>=virtual/jre-1.8:*
|
91 |
68 |
app-eselect/eselect-scala
|
92 |
69 |
!dev-lang/scala-bin:0"
|
93 |
70 |
|
... | ... | |
109 |
86 |
fi
|
110 |
87 |
}
|
111 |
88 |
|
|
89 |
pkg_pretend() {
|
|
90 |
if ! use binary; then
|
|
91 |
check-reqs_pkg_pretend
|
|
92 |
fi
|
|
93 |
}
|
|
94 |
|
112 |
95 |
src_unpack() {
|
113 |
96 |
# Unpack tar files only.
|
114 |
97 |
for f in ${A} ; do
|
... | ... | |
117 |
100 |
}
|
118 |
101 |
|
119 |
102 |
src_prepare() {
|
120 |
|
java-pkg_getjars ant-core,jline-2
|
|
103 |
java-pkg_getjars ant-core,jline-2,sbt
|
121 |
104 |
|
122 |
105 |
if ! use binary; then
|
123 |
106 |
local a
|
... | ... | |
132 |
115 |
done
|
133 |
116 |
|
134 |
117 |
# gentoo patch (by gienah) to stop it calling git log in the build
|
135 |
|
eapply "${FILESDIR}/${PN}-2.12.4-no-git.patch"
|
|
118 |
eapply "${FILESDIR}/${PN}-2.12.10-no-git.patch"
|
136 |
119 |
|
137 |
120 |
local SBT_PVR="$(java-config --query=PVR --package=sbt)"
|
138 |
|
sed -e "s@sbt.version=0.13.11@sbt.version=${SBT_PVR}@" \
|
|
121 |
sed -e "s@sbt.version=${SBTV}@sbt.version=${SBT_PVR}@" \
|
139 |
122 |
-i "${S}/project/build.properties" \
|
140 |
123 |
|| die "Could not set sbt.version=${SBT_PVR} in project/build.properties"
|
141 |
124 |
|
... | ... | |
143 |
126 |
#!/bin/bash
|
144 |
127 |
gjl_package=sbt
|
145 |
128 |
gjl_jar="sbt-launch.jar"
|
146 |
|
gjl_java_args="-Dsbt.version=0.13.13 -Dfile.encoding=UTF8 -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -Duser.home="${WORKDIR}""
|
|
129 |
gjl_java_args="-Dsbt.version=${SBT_PVR} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -Duser.home="${WORKDIR}""
|
147 |
130 |
source "${EPREFIX}"/usr/share/java-config-2/launcher/launcher.bash
|
148 |
131 |
EOF
|
149 |
132 |
chmod u+x "${S}/sbt" || die
|
... | ... | |
158 |
141 |
|
159 |
142 |
src_compile() {
|
160 |
143 |
if ! use binary; then
|
161 |
|
export PATH="${EROOT}usr/share/scala-${SV}/bin:${WORKDIR}/${L_P}:${PATH}"
|
|
144 |
export PATH="${EROOT}/usr/share/scala-${SV}/bin:${WORKDIR}/${L_P}:${PATH}"
|
|
145 |
export LANG="en_US.UTF-8"
|
162 |
146 |
einfo "=== scala compile ..."
|
163 |
147 |
"${S}"/sbt -Dsbt.log.noformat=true compile || die "sbt compile failed"
|
164 |
148 |
einfo "=== sbt publishLocal with jdk $(java-pkg_get-vm-version) ..."
|
... | ... | |
207 |
191 |
|
208 |
192 |
local DOCS=( "doc/README" )
|
209 |
193 |
local HTML_DOCS=( "build/scaladoc" )
|
210 |
|
einstalldocs
|
|
194 |
use doc && einstalldocs
|
211 |
195 |
}
|