diff options
Diffstat (limited to 'dev-java/sbt')
-rw-r--r-- | dev-java/sbt/Manifest | 6 | ||||
-rw-r--r-- | dev-java/sbt/metadata.xml | 12 | ||||
-rw-r--r-- | dev-java/sbt/sbt-0.13.8.ebuild | 148 |
3 files changed, 166 insertions, 0 deletions
diff --git a/dev-java/sbt/Manifest b/dev-java/sbt/Manifest new file mode 100644 index 000000000000..9436c22ed4f7 --- /dev/null +++ b/dev-java/sbt/Manifest @@ -0,0 +1,6 @@ +DIST sbt-0.13.8-gentoo-binary.tar.bz2 1048674 SHA256 4a2b22c9d9fbe922d5a5336d88ca21f18b2545850fec16485c824aee43df53e1 SHA512 9a5707601387d604b746ea21145a3c7735dd4b6d36541111b47519b66e5abc929ecc96ff52e144ed39a3db947204a1956e19394a1848e3fd8904f9a98ec24816 WHIRLPOOL 4fb1bde15ab57260a25b0a4a1634122af2e2b9d6cd35d3a9c693d9bba6c398bee489f05bf29a763a60d7a04f54823bdd9fc54ec5a2809900b28f890930649fc7 +DIST sbt-0.13.8-ivy2-deps.tar.bz2 124672043 SHA256 565ba7434316a3ab2f61f58b4bc57317e5c2ae7c9ee95061c39cfddd5767a355 SHA512 47b2f235b7d5883086f8246265e9081a50dcdaede43550a1c0de1c85a9ebf24b47e1331b662aa5c0faebaf22a37849ffb2c1f25a7592c461e62f582984ad4b70 WHIRLPOOL f92b2cd087d51f0ae31d5ac93d1dca7214ace6df8c06b050287007f05697e81ac14758368730e6df45043ba80167b9581e636b0364d5ba3a5c7352fafd7e5007 +DIST sbt-0.13.8-sbt-deps.tar.bz2 88352931 SHA256 d0eab3858f389e201277d1ead68352172830b17dd8343f09e0e63e4880a5e20e SHA512 a6e886f5f18821c26df28a2e8cf2773b4841854fc1bd4dfa43924089966020da5affd635da96a8e13efc7c06be6a5bf53697ca91f5fbf41efcdf8dda00e8428d WHIRLPOOL 54744676b33b11ffb350b5a543986efd5cd629594ce4bac5154a78df233619a92a2a4842659acf9c15533e764d24333183372f136b3b1f7463bbe55347c41b8f +DIST sbt-0.13.8-src.tar.bz2 32766054 SHA256 5225864c54e5718dc68cfcd554a7215bd028947d61ed9522e2ad9d0a19cbdd83 SHA512 f6c834c6294c957e8d5b89a3a616f23a980cca1f882695d09a6e0080d1013227ba3bac86942b39c13e49fb6ac9fb72c3478df24ec8549b8b9812ea352932fff8 WHIRLPOOL 5054578505fe35b6c5f269c72b921920cf232a1efed18da5cd1833457d46f4e4342988be46539001b4dcfcfc6c807785915f4d0791af939dc83018ffcc03effe +DIST sbt-0.13.8-test-deps.tar.bz2 40704285 SHA256 7cb252d69b5868905e0592df7ef9a83ce09f75cb10a72bc9dcd649286bb524a3 SHA512 a79ea9c81abc436168f04f674ffef4fee6f7c7a5dede5a3060e2e2bd9a9863dd5f1c7b31c02f3823fb5a67b2bb43c44d306efb59468f625e4db277cface47cd0 WHIRLPOOL 268ea150c5ca2fe1988317e0616262de814e2aa7213f64b99baf389c3e67e2093a04765ac27f08bd585fe33c77d9dd8c7a0ba8d3bd77d937d9a7260dab72c23a +DIST sbt-launch-0.13.7.jar 1208385 SHA256 6570bb03df6138ffaa7ac0bbe35eb4ea79062d1146b6929c75cf238d14dd9158 SHA512 ddc62dd85b552a7157ae0c19d0161d77a929adeb4ea81042a3a38c3d979e32674b9174aef47d458e9a7c8ea7942c08f1a7177b9bc739f7cd9e0484aef9915204 WHIRLPOOL 63841a401739aa3eab24632fcec41dc5c186502f4b80fe782106a0c6448b1da2321bf2a7a0b0f83473f7c073cce2ac8f5f85440d955acc191a73bd95200cb2cf diff --git a/dev-java/sbt/metadata.xml b/dev-java/sbt/metadata.xml new file mode 100644 index 000000000000..a2d342d21424 --- /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> + <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.8.ebuild b/dev-java/sbt/sbt-0.13.8.ebuild new file mode 100644 index 000000000000..576b73678727 --- /dev/null +++ b/dev-java/sbt/sbt-0.13.8.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +# 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}" + +B_PV="0.13.7" +BL_P="${L_PN}-${B_PV}" +B_P="${PN}-${B_PV}" + +SV="2.10" + +# creating the sbt src snapshot: +# git clone https://github.com/sbt/sbt.git sbt-0.13.8 +# cd sbt-0.13.8 +# git checkout v0.13.8 +# cd .. +# tar --owner=portage --group=portage -cjf sbt-0.13.8-src.tar.bz2 sbt-0.13.8 + +# creating the binary: +# cd $WORDKIR +# tar -cjf sbt-0.13.8-gentoo-binary.tar.bz2 sbt-0.13.8/sbt-launch/target/sbt-launch.jar + +DESCRIPTION="sbt is a build tool for Scala and Java projects that aims to do the basics well" +HOMEPAGE="http://www.scala-sbt.org/" +EGIT_COMMIT="v${PV}" +EGIT_REPO_URI="https://github.com/sbt/sbt.git" +SRC_URI="!binary? +( + http://dev.gentoo.org/~gienah/snapshots/${P}-src.tar.bz2 + http://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.bz2 + http://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.bz2 + http://dev.gentoo.org/~gienah/snapshots/${P}-test-deps.tar.bz2 + http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/${L_PN}/${PV}/${L_PN}.jar -> ${BL_P}.jar +) +binary? ( http://dev.gentoo.org/~gienah/files/dist/${P}-gentoo-binary.tar.bz2 )" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="binary" + +DEPEND="virtual/jdk:1.6 + >=dev-lang/scala-2.10.4-r1:${SV}" +RDEPEND=">=virtual/jre-1.6 + dev-lang/scala:*" + +# test hangs or fails +RESTRICT="test" + +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 +} + +java_prepare() { + if ! use binary; then + # Note: to bump sbt, some things to try are: + # 1. remove the http://dev.gentoo.org/~gienah/snapshots/${P}-ivy2-deps.tar.bz2 + # http://dev.gentoo.org/~gienah/snapshots/${P}-sbt-deps.tar.bz2 and + # http://dev.gentoo.org/~gienah/snapshots/${P}-test-deps.tar.bz2 from SRC_URI + # 2. Comment the sbt publishLocal line in src_compile. + # 3. try: + # FEATURES='noclean -test' emerge -v 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. + # 4. If some of the downloads fail, it might be necessary to run the sbt compile + # again manually to obtain all the dependencies, if so (with jdk 1.6): + # cd to ${S} + # export EROOT=/ + # export WORKDIR='/var/tmp/portage/dev-java/sbt-0.13.8/work' + # export SV="2.10" + # export B_P=sbt-0.13.7 + # export PATH="/usr/share/scala-${SV}/bin:${WORKDIR}/${B_P}:${PATH}" + # sbt compile + # cd ${WORKDIR} + # find .ivy2 .sbt -uid 0 -exec chown portage:portage {} \; + # 5. cd ${WORKDIR} + # tar -cjf sbt-0.13.8-ivy2-deps.tar.bz2 .ivy2 + # tar -cjf sbt-0.13.8-sbt-deps.tar.bz2 .sbt + # 6. It downloads 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. Note: src_test creates some files in ${WORKDIR}/.m2 which are can + # hopefully be ignored. As root: + # cd ${S} + # sbt test + # cd ${WORKDIR} + # find .ivy2 .sbt -uid 0 -print + # Then add those files to sbt-0.13.8-ivy2-test-deps.tar.bz2 except the files in the directories + # .ivy2/local + # .ivy2/cache/org.scala-sbt + # Something like: + # tar --owner=portage --group=portage -cjf sbt-0.13.8-test-deps.tar.bz2 <list of files as described above> + # 7. Undo the earlier temporary edits to the ebuild. + + mkdir "${WORKDIR}/${B_P}" || die + cp -p "${DISTDIR}/${BL_P}.jar" "${WORKDIR}/${B_P}/${L_PN}.jar" || die + cat <<- EOF > "${WORKDIR}/${B_P}/sbt" + #!/bin/sh + SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M" + java -Djavac.args="-encoding UTF-8" -Duser.home="${WORKDIR}" \${SBT_OPTS} -jar "${WORKDIR}/${B_P}/sbt-launch.jar" "\$@" + EOF + chmod u+x "${WORKDIR}/${B_P}/sbt" || die + local SCALA_PVR="$(java-config --query=PVR --package=scala-${SV})" + local SFV="${SCALA_PVR/-*}" + sed -e "s@scalaVersion := \"2.10.4\",@scalaVersion := \"${SFV}\",\n scalaHome := Some(file(\"/usr/share/scala-${SV}\")),@" \ + -i "${S}/build.sbt" || die + fi +} + +src_compile() { + if ! use binary; then + export PATH="${EROOT}usr/share/scala-${SV}/bin:${WORKDIR}/${B_P}:${PATH}" + einfo "=== sbt compile ..." + "${WORKDIR}/${B_P}/sbt" -Dsbt.log.noformat=true compile || die + einfo "=== sbt publishLocal ..." + "${WORKDIR}/${B_P}/sbt" -Dsbt.log.noformat=true publishLocal || die + fi +} + +src_test() { + if ! use binary; then + export PATH="${EROOT}usr/share/scala-${SV}/bin:${WORKDIR}/${B_P}:${PATH}" + "${WORKDIR}/${B_P}/sbt" -Dsbt.log.noformat=true test || die + fi +} + +src_install() { + if ! use binary; then + pushd sbt-launch/target || die + mv ${L_P}.jar ${L_PN}.jar || die + popd + fi + java-pkg_dojar sbt-launch/target/${L_PN}.jar + java-pkg_dolauncher sbt --main xsbt.boot.Boot --java_args "-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M" +} |