Bug 139438

Summary: [PATCH] audio/liblastfm: Fix build with ruby>=1.9
Product: Ports & Packages Reporter: Mel <mel>
Component: Individual Port(s)Assignee: Martin Wilke <miwi>
Status: Closed FIXED    
Severity: Affects Only Me CC: datahead4
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch-audio_liblastfm_Makefile none

Description Mel 2009-10-08 20:20:02 UTC
lang/ruby18 currently does not build in IA32 jail on amd64, so I'm forced to use
lang/ruby19, yet audio/liblastfm's build system uses ftools, which has been
replaced by fileutils.

How-To-Repeat: make -C /usr/ports/lang/ruby19 RUBY_DEFAULT_VER=1.9 install && \
	make -C /usr/ports/audio/liblastfm configure

(configure finishes, but no Makefile created so build fails with no target to
make).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-10-08 20:20:41 UTC
Maintainer of audio/liblastfm,

Please note that PR ports/139438 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139438

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2009-10-08 20:20:43 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Martin Wilke freebsd_committer freebsd_triage 2009-10-08 20:38:35 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 4 Matt 2009-10-08 21:38:56 UTC
On Thu, Oct 8, 2009 at 2:20 PM, Edwin Groothuis <edwin@freebsd.org> wrote:
> Maintainer of audio/liblastfm,
>
> Please note that PR ports/139438 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
> =A0 =A0http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/139438
>
There is an issue with the proposed patch which I am not sure how to
address.  Per the lang/ruby19 Makefile, if ${RUBY_VER} =3D=3D
${RUBY_DEFAULT_VER} is not true, then the Ruby binary is installed as
bin/ruby19 and not bin/ruby.  This affects the rest of the liblastfm
build system because there are other instances where the Ruby binary
is invoked as "ruby" and not "ruby19".

Any suggestions how to deal with this?

Regards,
Matt
Comment 5 Mel 2009-10-08 22:49:41 UTC
Hi,

that's not an issue with the patch, that problem existed before this patch.
The correct fix would be to not replace with ${LOCALBASE}/bin/ruby
but with ${RUBY_WITH_SUFFIX} as per Mk/bsd.ruby.mk. Maybe miwi@ can do
that "while in there". Patch updated to reflect that as well.

Note that while I believe this to be the correct fix, it's the 2nd time
I have ever looked into bsd.ruby.mk :)
-- 
Mel

--- patch-audio_liblastfm_Makefile begins here ---
Index: audio/liblastfm/Makefile
===================================================================
RCS file: /home/ncvs/ports/audio/liblastfm/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- audio/liblastfm/Makefile	5 Sep 2009 12:31:33 -0000	1.5
+++ audio/liblastfm/Makefile	8 Oct 2009 21:42:02 -0000
@@ -28,12 +28,16 @@
 
 USE_LDCONFIG=	yes
 
+.include <bsd.port.pre.mk>
 post-extract:
 	${REINPLACE_CMD} -e 's|#!/usr/bin/ruby|#!${LOCALBASE}/bin/ruby|' ${WRKSRC}/configure
 	${REINPLACE_CMD} -e 's|__demos __tests||' ${WRKSRC}/admin/Makefile.rb
 	${REINPLACE_CMD} -e '/QMAKE_CXXFLAGS_RELEASE.*/d' \
 		-e 's|linux:|unix:|'  ${WRKSRC}/.qmake.cache
 	${FIND} ${WRKSRC}/admin -type f | ${XARGS} \
-		 ${REINPLACE_CMD} -e 's|#!/usr/bin/ruby|#!${LOCALBASE}/bin/ruby|'
+		 ${REINPLACE_CMD} -e 's|#!/usr/bin/ruby|#!${RUBY_WITH_SUFFIX}|'
+.if ${RUBY_VERSION_CODE} >= 190000
+	${REINPLACE_CMD} -e "s|'ftools'|'fileutils'|" ${WRKSRC}/admin/qpp ${WRKSRC}/admin/Makefile.rb
+.endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--- patch-audio_liblastfm_Makefile ends here ---
Comment 6 Matt 2009-10-09 04:47:59 UTC
On Thu, Oct 8, 2009 at 4:49 PM, Mel <mel@rachie.is-a-geek.net> wrote:
> Hi,
>
> that's not an issue with the patch, that problem existed before this patch.

You're right of course.  It was just never exposed in my tinderbox
runs before because they were all set to use the default version of
Ruby as directed by bsd.ruby.mk.

> The correct fix would be to not replace with ${LOCALBASE}/bin/ruby
> but with ${RUBY_WITH_SUFFIX} as per Mk/bsd.ruby.mk. Maybe miwi@ can do
> that "while in there". Patch updated to reflect that as well.

As I looked at this a little further, I realized that I was seeing
this issue because I had forced the RUBY_VER setting in my tinderbox
environment instead of forcing the RUBY_DEFAULT_VER as was indicated
in the initial PR description.  I'm no expert in Ruby settings, but it
does look like setting RUBY_DEFAULT_VER is the right way to change the
version of Ruby used by the ports infrastructure.  If this is the case
then the issue I described earlier about the name of the Ruby binary
becomes a non-issue because bsd.ruby.mk sets
RUBY_VER?=${RUBY_DEFAULT_VER}.

> Note that while I believe this to be the correct fix, it's the 2nd time
> I have ever looked into bsd.ruby.mk :)

There is another open PR for liblastfm at
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139315 which requests
a change be made to make the port install properly when a custom
${PREFIX} is used.  Perhaps that PR and this one could be merged into
a single update?

Regards,
Matt
Comment 7 Mel 2009-10-09 16:09:27 UTC
On Friday 09 October 2009 05:47:59 Matt wrote:
> On Thu, Oct 8, 2009 at 4:49 PM, Mel <mel@rachie.is-a-geek.net> wrote:

> > The correct fix would be to not replace with ${LOCALBASE}/bin/ruby
> > but with ${RUBY_WITH_SUFFIX} as per Mk/bsd.ruby.mk. Maybe miwi@ can do
> > that "while in there". Patch updated to reflect that as well.
> 
> As I looked at this a little further, I realized that I was seeing
> this issue because I had forced the RUBY_VER setting in my tinderbox
> environment instead of forcing the RUBY_DEFAULT_VER as was indicated
> in the initial PR description.  I'm no expert in Ruby settings, but it
> does look like setting RUBY_DEFAULT_VER is the right way to change the
> version of Ruby used by the ports infrastructure.

Yes, but lang/ruby18 and lang/ruby19 don't conflict, hence it's possible to 
have them both installed, set RUBY_DEFAULT_VER to the desired default, but 
RUBY_VER at build time to override the default one. One can then end up with 
RUBY_DEFAULT_VER being ruby18 and building liblastfm with RUBY_VER=1.9. As far 
as I can tell, RUBY_WITH_SUFFIX will then be ruby19, even though 
/usr/local/bin/ruby is ruby18. I gathered this from reading the various files, 
but perhaps you can run a tinderbox with RUBY_DEFAULT_VER=1.8 and building 
liblastfm with RUBY_VER=1.9 to confirm what just said :).

$ make -C /usr/ports/audio/liblastfm -V RUBY_WITH_SUFFIX RUBY_DEFAULT_VER=1.8 
RUBY_VER=1.9
/usr/local/bin/ruby19

-- 
Mel
Comment 8 Martin Wilke freebsd_committer freebsd_triage 2009-11-02 20:48:34 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!
Comment 9 dfilter service freebsd_committer freebsd_triage 2009-11-02 20:48:53 UTC
miwi        2009-11-02 20:48:26 UTC

  FreeBSD ports repository

  Modified files:
    audio/liblastfm      Makefile 
  Log:
  - Fix build with ruby>= 1.9
  
  PR:             139438
  Submitted by:   Mel <mel@rachie.is-a-geek.net>
  Approved by:    maintainer
  
  Revision  Changes    Path
  1.6       +6 -2      ports/audio/liblastfm/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"