summaryrefslogtreecommitdiff
path: root/dev-java/sbt
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/sbt')
-rw-r--r--dev-java/sbt/Manifest7
-rw-r--r--dev-java/sbt/metadata.xml12
-rw-r--r--dev-java/sbt/sbt-0.13.13.ebuild161
3 files changed, 180 insertions, 0 deletions
diff --git a/dev-java/sbt/Manifest b/dev-java/sbt/Manifest
new file mode 100644
index 000000000000..fd1a6f111cd8
--- /dev/null
+++ b/dev-java/sbt/Manifest
@@ -0,0 +1,7 @@
+DIST sbt-0.13.13-gentoo-binary.tar.xz 58011476 BLAKE2B 87f829a5a6c4047b5120b9685c1caa1477d6ab5789835bf890d241ae512bae65cc3b0b2b60c15c18e15891210b6687ad2c8cd7dcc581f5224fc8788a576ff754 SHA512 9763b67ac4838e6ccac1848c17a03608bed61669671a10c93afc4c81d6dad06a3463ac4e4a9b7b3fb91325df5df6e0148847669d482e3cacf4fde957c110ccc1
+DIST sbt-0.13.13-ivy2-deps.tar.xz 121677604 BLAKE2B 7f6e508104a99c36f8f928550f7c0e41b742cefef3f3fccf2999fe7a5873cf690d693c0ded1df481535b59a7340a997cc21ef3ffd403b147fd8a323d1ee28620 SHA512 3301447a563e9a83431bb67a6281a6045630669012f1cc5cdde7a2cbae3f7db75f87abed003ecf8243fd230e2adea2ba3666468358ae29c51e346940235f5ed5
+DIST sbt-0.13.13-sbt-deps.tar.xz 34750700 BLAKE2B 5856f19d19255a6c4a373086962f3bff195d03193bb74d8d3aee1cfb2749ef3638f5c26dff7cb7c455c5b4ce67e8cf4fa46bbf9a8363f80dc26092e6df768d81 SHA512 0bfd35a6926545da7340f7ee72e420121f2bb2f83d98d420b7f65b465d207b1b30a48788914e7b1fdf575a4fee870f2632b0717f1a7a2c19e2f2d5794d08b4da
+DIST sbt-0.13.13-src.tar.xz 35911028 BLAKE2B 42157af03ae3567a2acc67cc0c96a9ffe19b69d60fddfde1cd65bbc410c14b09e5da0febb8225e49693c380a444b752296c29a21cc7f2239ee49ccef5128a3ff SHA512 351f18108a23014ee7ffd5c4713f390728fb98b742efdc139e094e64df7800f399d088600d245631635b0f6f4cb69c6cd327aafa3b0bf8a233fcbf0cb4ac5702
+DIST sbt-launch-0.13.13.jar 1210231 BLAKE2B 754abad78cec4f6b040fb63dcb62e549768174b22cf3f9ab7d2419736d4f09b53863cf645b38d7d534deb1c6e897f55d8b1b5fa82462ca9d906c410d22c0c198 SHA512 78e7ce21c610e83a532b04491e13d53b4193205328adce473252d523fe0ca0f3892dba900f01ff6e28d94a17c3ba1ebbe7d85fd6ce9900c48263bc4816da37ef
+EBUILD sbt-0.13.13.ebuild 5721 BLAKE2B 8b60ee0c4f58902e750b8b1a3d76f71a78aaa260e8a7bc53308cc903b71cdeea05b4d3d8758a09fc706036c1a762a1d217751ffc2b47d2eb75859106ccd7d1b4 SHA512 17bf873d8433d4d3f7faeef2cd9c6cb994914eedfac66eb92a8f5feab334c215c43a185c1e3ecbab7d3e6cacbe594e567dd075acb9af9dda48281fb61b5f62b5
+MISC metadata.xml 525 BLAKE2B c70c7e88be5a5b06cbc422d6f354535711d06590780285ee1fd7e6668a0205795a4295869d61fb91b201df9ec2c275e4d74a07734fcc39bac9d4fbf2632f4b9d SHA512 53269c8f362ba0415988cfb9889a7af2c67a6788d85fbe4d9008fbed1cc0a3d3bddc2a6049c6d0ba23c28e3ad2d65f240a9085ceaccc5d55d4387e4dd90c5505
diff --git a/dev-java/sbt/metadata.xml b/dev-java/sbt/metadata.xml
new file mode 100644
index 000000000000..6ccffa7db3e9
--- /dev/null
+++ b/dev-java/sbt/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>gienah@gentoo.org</email>
+</maintainer>
+<longdescription lang="en">
+The interactive build tool.
+Use Scala to define your tasks. Then run them in parallel from the shell.
+</longdescription>
+<use><flag name="binary">Install from (Gentoo-compiled) binary instead of building from sources. Set this when you run out of memory during build.</flag></use>
+</pkgmetadata>
diff --git a/dev-java/sbt/sbt-0.13.13.ebuild b/dev-java/sbt/sbt-0.13.13.ebuild
new file mode 100644
index 000000000000..16862a31628e
--- /dev/null
+++ b/dev-java/sbt/sbt-0.13.13.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+# repoman gives LIVEVCS.unmasked even with EGIT_COMMIT, so create snapshot
+inherit eutils java-pkg-2 # git-r3
+
+L_PN="sbt-launch"
+L_P="${L_PN}-${PV}"
+
+SV="2.11"
+
+DESCRIPTION="sbt is a build tool for Scala and Java projects that aims to do the basics well"
+HOMEPAGE="https://www.scala-sbt.org/"
+EGIT_COMMIT="v${PV}"
+EGIT_REPO_URI="https://github.com/sbt/sbt.git"
+SRC_URI="
+ !binary? (
+ https://dev.gentoo.org/~gienah/snapshots/${P}-src.tar.xz
+ https://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.xz
+ https://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.xz
+ http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/${L_PN}/${PV}/${L_PN}.jar -> ${L_P}.jar
+ )
+ binary? (
+ https://dev.gentoo.org/~gienah/files/dist/${P}-gentoo-binary.tar.xz
+ )"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="binary"
+
+DEPEND=">=virtual/jdk-1.8
+ >=dev-lang/scala-2.11.8:${SV}"
+RDEPEND=">=virtual/jre-1.8
+ >=dev-lang/scala-2.11.8:${SV}"
+
+# test hangs or fails
+RESTRICT="test"
+
+JAVA_GENTOO_CLASSPATH="scala-${SV}"
+
+# Note: to bump sbt, some things to try are:
+# 1. Create the sbt src snapshot:
+# git clone https://github.com/sbt/sbt.git ${P}
+# cd ${P}
+# git checkout v${PV}
+# cd ..
+# XZ_OPT=-9 tar --owner=portage --group=portage \
+# -cJf /usr/portage/distfiles/${P}-src.tar.xz ${P}
+# 2. remove the https://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.xz
+# https://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.xz and
+# binary? ( https://dev.gentoo.org/~gienah/files/dist/${P}-gentoo-binary.tar.xz )
+# from SRC_URI
+# 3. Comment the sbt publishLocal line in src_compile.
+# 4. try:
+# FEATURES='noclean -test' emerge -v -1 dev-java/sbt
+# It should fail in src_install since the sbt publishLocal is not done.
+# Check if it downloads more stuff in
+# src_compile to ${WORKDIR}/.ivy2 and ${WORKDIR}/.sbt.
+# 5. If some of the downloads fail, it might be necessary to run the sbt compile
+# again manually to obtain all the dependencies, if so:
+# cd to ${S}
+# export EROOT=/
+# export WORKDIR='/var/tmp/portage/dev-java/${P}/work'
+# export SV="2.11"
+# export L_P=${P}
+# export PATH="/usr/share/scala-${SV}/bin:${WORKDIR}/${L_P}:${PATH}"
+# sbt compile
+# cd ${WORKDIR}
+# find .ivy2 .sbt -uid 0 -exec chown portage:portage {} \;
+# 6. cd ${WORKDIR}
+# XZ_OPT=-9 tar --owner=portage --group=portage \
+# -cJf /usr/portage/distfiles/${P}-ivy2-deps.tar.xz .ivy2/cache
+# XZ_OPT=-9 tar --owner=portage --group=portage \
+# -cJf /usr/portage/distfiles/${P}-sbt-deps.tar.xz .sbt
+# Uncomment the sbt publishLocal line in src_compile.
+# 7. It *might* download more dependencies for src_test, however the presence
+# of some of these may cause the src_compile to fail. So download them
+# seperately as root so we can identify the
+# additional files. As root:
+# cd ${S}
+# ${S}/${P} test
+# cd ${WORKDIR}
+# XZ_OPT=-9 tar --owner=portage --group=portage \
+# -cJf /usr/portage/distfiles/${P}-test-deps.tar.xz \
+# $(find .ivy2/cache .sbt -uid 0 -type f -print)
+# Note: It might not download anything in src_test, in which case
+# ${P}-test-deps.tar.xz is not required.
+# 8. Create the binary
+# cd $WORDKIR
+# XZ_OPT=-9 tar --owner=portage --group=portage \
+# -cJf /usr/portage/distfiles/${P}-gentoo-binary.tar.xz ${P} .ivy2/local
+# 9. Undo the earlier temporary edits to the ebuild.
+
+src_unpack() {
+ # if ! use binary; then
+ # git-r3_src_unpack
+ # fi
+ # Unpack tar files only.
+ for f in ${A} ; do
+ [[ ${f} == *".tar."* ]] && unpack ${f}
+ done
+}
+
+src_prepare() {
+ default
+ if ! use binary; then
+ mkdir "${WORKDIR}/${L_P}" || die
+ cp -p "${DISTDIR}/${L_P}.jar" "${WORKDIR}/${L_P}/${L_PN}.jar" || die
+ cat <<- EOF > "${WORKDIR}/${L_P}/sbt"
+ #!/bin/sh
+ SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled"
+ java -Djavac.args="-encoding UTF-8" -Duser.home="${WORKDIR}" \${SBT_OPTS} -jar "${WORKDIR}/${L_P}/sbt-launch.jar" "\$@"
+ EOF
+ cat <<- EOF > "${S}/${P}"
+ #!/bin/sh
+ SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled"
+ java -Djavac.args="-encoding UTF-8" -Duser.home="${WORKDIR}" \${SBT_OPTS} -jar "${S}/launch/target/sbt-launch.jar" "\$@"
+ EOF
+ chmod u+x "${WORKDIR}/${L_P}/sbt" "${S}/${P}" || die
+ sed -e "s@scalaVersion := scala210,@scalaVersion := scala${SV/./},\n scalaHome := Some(file(\"${EROOT}usr/share/scala-${SV}\")),@" \
+ -i "${S}/build.sbt" || die
+
+ # suppress this warning in build.log:
+ # [warn] Credentials file /var/tmp/portage/dev-java/${P}/work/.bintray/.credentials does not exist
+ mkdir -p "${WORKDIR}/.bintray" || die
+ cat <<- EOF > "${WORKDIR}/.bintray/.credentials"
+ realm = Bintray API Realm
+ host = api.bintray.com
+ user =
+ password =
+ EOF
+ fi
+}
+
+src_compile() {
+ if ! use binary; then
+ export PATH="${EROOT}usr/share/scala-${SV}/bin:${WORKDIR}/${L_P}:${PATH}"
+ einfo "=== sbt compile ..."
+ "${WORKDIR}/${L_P}/sbt" -Dsbt.log.noformat=true compile || die
+ einfo "=== sbt publishLocal with jdk $(java-pkg_get-vm-version) ..."
+ cat <<- EOF | "${WORKDIR}/${L_P}/sbt" -Dsbt.log.noformat=true || die
+ set every javaVersionPrefix in javaVersionCheck := Some("$(java-pkg_get-vm-version)")
+ publishLocal
+ EOF
+ fi
+}
+
+src_test() {
+ export PATH="${EROOT}usr/share/scala-${SV}/bin:${S}:${PATH}"
+ "${S}/${P}" -Dsbt.log.noformat=true test || die
+}
+
+src_install() {
+ # Place sbt-launch.jar at the end of the CLASSPATH
+ java-pkg_dojar $(find "${WORKDIR}"/.ivy2/local -name \*.jar -print | grep -v sbt-launch.jar) \
+ $(find "${WORKDIR}"/.ivy2/local -name sbt-launch.jar -print)
+ local ja="-Dsbt.version=${PV} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled"
+ java-pkg_dolauncher sbt --jar sbt-launch.jar --java_args "${ja}"
+}