Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 401717

Summary: dev-lang/scala-2.9.1 with USE=binary should not depend on ant
Product: Gentoo Linux Reporter: Joel <joel486>
Component: [OLD] JavaAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch for the scala-2.9.1 ebuild that removes the dependence on ant when USE=binary is set
Patch for 2.9.2 against my 2.9.1 ebuild

Description Joel 2012-01-31 23:01:59 UTC
Installing dev-lang/scala-2.9.1 (or earlier) with the binary use flag set pulls in ant-core and ant-nodeps.  However, since the Scala sources are not compiled, neither is used, and so the dependence is unnecessary

Reproducible: Always

Steps to Reproduce:
1. USE="binary" emerge -pv dev-lang/scala
Actual Results:  
Portage pulls in ant-core and ant-nodeps (if they are not installed).

Expected Results:  
Portage should not pull in any ant packages as they are not needed.

From my limited understanding of ant and portage, inheriting java-ant-2, which is needed for the eant task, automatically pulls in these dependencies.  Thus as far as i can tell the solution is to make a separate package, presumably dev-lang/scala-bin, with all the "if ! use binary" sections of the ebuild removed.

Note that if this is done, we can also do the following cleanups:
1) Remove the very old and out-of-date dev-java/scala-bin.
2) Have the new scala-bin ebuild drop its dependence on xz-utils, which is no longer needed.
3) Have the new scala-bin ebuild use the official Scala binary.
Comment 1 Ralph Sennhauser (RETIRED) gentoo-dev 2012-02-06 15:56:28 UTC
Another solution would be to remove WANT_ANT_TASKS, set JAVA_ANT_DISABLE_ANT_CORE_DEP=yes and add !binary? ( dev-java/ant-core:0 dev-java/ant-nodeps:0 ) to DEPEND.
Comment 2 Joel 2012-02-29 19:33:24 UTC
Created attachment 303769 [details, diff]
Patch for the scala-2.9.1 ebuild that removes the dependence on ant when USE=binary is set

Thanks for the information.  That works, which means there's no need to split out a separate scala-bin package.

I'm attaching a patch that works for me with USE=binary (I haven't tested it with USE=-binary).  I additionally changed to using the upstream binary package and made the dependence on xz-utils conditional on USE=-binary.  The final few lines of the patch deal with the fact that the source and binary packages have slightly different directory structures.
Comment 3 Joel 2012-05-01 22:32:43 UTC
Created attachment 310597 [details, diff]
Patch for 2.9.2 against my 2.9.1 ebuild

Scala 2.9.2 seems to change the filenames.  This patch against my 2.9.1 ebuild works for me with USE=binary.
Comment 4 Mark Wright gentoo-dev 2014-02-12 13:49:52 UTC
Fixed in dev-lang/scala-2.10.3.  Thanks to Joel for reporting and testing, thanks to sera for the fix.