pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Avoiding getting .buildlink path in installed [python|ruby]scripts?



On Sun, 20 Dec 2009 21:34:00 +0900, Fredrik Pettai <pettai%nordu.net@localhost> 
wrote:

> On 12/20/09 1:41 AM, OBATA Akio wrote:
>> Hi!
>>
>> On Sun, 20 Dec 2009 07:20:23 +0900, Fredrik Pettai 
>> <pettai%nordu.net@localhost> wrote:
>>> Two package examples:
>>>
>>> wip/py-4Suite, which installs /usr/pkg/bin/4xml among many other files.
>>>
>>> If I look at that python script more closely:
>>> -bash-4.0$ head -1 /usr/pkg/bin/4xml
>>> #!/usr/pkgsrc/wip/py-4Suite/work/.tools/bin/env python
>>>
>>> wip/opendnssec, which installs /usr/pkg/bin/ods-kaspcheck among many
>>> other files.
>>>
>>> -bash-4.0$ head -1 /usr/pkg/bin/ods-kaspcheck
>>> #!/usr/pkgsrc/wip/opendnssec/work/.buildlink/bin/ruby
>>> -I/usr/pkg/lib/opendnssec
>>>
>>> How do I solve this the "correct" way?
>>
>> You can replace those shebang
>>   for python:
>>    include lang/python/application.mk and use REPLACE_PYTHON.
>>   for ruby:
>>    include lang/ruby/replace.mk and use REPLACE_RUBY.
>
> That seems to be done in the pre-configure phase:
>
> => Replacing ruby18 interpreter in bin/ods-auditor bin/ods-kaspcheck.
> WARNING: [replace-interpreter] Skipping non-existent file "bin/ods-auditor".
> WARNING: [replace-interpreter] Skipping non-existent file
> "bin/ods-kaspcheck".
>
> I need to do it in the post-build/pre-install phase, then the script
> files have been built/generated.

You can tell ruby paths to configure with
CONFIGURE_ENV+= RUBY=${RUBY}

or for this case, you can subst by yourself:

SUBST_CLASSES.ruby
SUBST_STAGE.ruby=       pre-configure
SUBST_FILES.ruby=       auditor/ods-auditor.in auditor/ods-kaspcheck.in
SUBST_VARS.ruby=        RUBY    

>>> Btw. wouldn't it be nice if PKG_DEVELOPER=yes would catch this? (It
>>> already catches missing interpreters in installed script files)
>>
>> CHECK_WRKREF+= buildlink ? (from mk/check/check-wrkref.mk).
>
> That didn't seem to trigger any warnings?
> (I added it to the command line, eg. make PKG_DEVELOPER=yes
> CHECK_WRKREF+=buildlink USE_DESTDIR=yes install)

You should not put "+=" on command line, use CHECK_WRKREF=buildlink instead.

-- 
"Of course I love NetBSD":-)
OBATA Akio / obache%users.sourceforge.net@localhost

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index