diff mbox series

[2/3] perl: add vendorprefix

Message ID 20180810144724.16347-1-chrismcc@gmail.com
State Changes Requested
Headers show
Series [1/3] fake-hwclock: new package | expand

Commit Message

Christopher McCrory Aug. 10, 2018, 2:47 p.m. UTC
This adds vendorprefix to configure args

Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
---
 package/perl/perl.mk | 3 +++
 1 file changed, 3 insertions(+)

Comments

Francois Perrad Aug. 10, 2018, 6:13 p.m. UTC | #1
2018-08-10 16:47 GMT+02:00 Christopher McCrory <chrismcc@gmail.com>:

> This adds vendorprefix to configure args
>
> Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
>


What is the rational of this patch ?

Currently, core modules (ie. built directly with the perl distribution) are
installed in /usr/lib/perl5/5.xx.y,
others modules (built by the perl-package infrastructure) are installed in
/usr/lib/perl5/site-perl/5.xx.y.
Why adding /usr/lib/perl5/vendor-perl/5.xx.y ?

François

---
>  package/perl/perl.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index b0eea3eff4..19a8f95f7b 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -48,6 +48,7 @@ PERL_CONF_OPTS = \
>         --target=$(GNU_TARGET_NAME) \
>         --target-tools-prefix=$(TARGET_CROSS) \
>         --prefix=/usr \
> +       --vendorprefix=/usr \
>         -Dld="$(TARGET_CC)" \
>         -Dccflags="$(TARGET_CFLAGS)" \
>         -Dldflags="$(TARGET_LDFLAGS) -lm" \
> @@ -92,6 +93,7 @@ endef
>  HOST_PERL_CONF_OPTS = \
>         -des \
>         -Dprefix="$(HOST_DIR)" \
> +       -Dvendorprefix="$(HOST_DIR)" \
>         -Dcc="$(HOSTCC)"
>
>  define HOST_PERL_CONFIGURE_CMDS
> @@ -111,6 +113,7 @@ $(eval $(generic-package))
>  $(eval $(host-generic-package))
>
>  define PERL_FINALIZE_TARGET
> +       mkdir -p $(TARGET_DIR)/usr/lib/perl5/
> vendor_perl/$(PERL_VERSION)/$(PERL_ARCHNAME)
>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(
> PERL_VERSION)/$(PERL_ARCHNAME)/CORE
>         find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 |
> xargs -0 rm -f
> --
> 2.14.4
>
>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-08-10 16:47 GMT+02:00 Christopher McCrory <span dir="ltr">&lt;<a href="mailto:chrismcc@gmail.com" target="_blank">chrismcc@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This adds vendorprefix to configure args<br>
<br>
Signed-off-by: Christopher McCrory &lt;<a href="mailto:chrismcc@gmail.com">chrismcc@gmail.com</a>&gt;<br></blockquote><div><br></div><div><br>What is the rational of this patch ?<br><br>Currently, core modules (ie. built directly with the perl distribution) are installed in /usr/lib/perl5/5.xx.y,<br>others modules (built by the perl-package infrastructure) are installed in /usr/lib/perl5/site-perl/5.xx.y.<br>Why adding /usr/lib/perl5/vendor-perl/5.xx.y ?<br><br>François<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a> | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a> b/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
index b0eea3eff4..19a8f95f7b 100644<br>
--- a/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
+++ b/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
@@ -48,6 +48,7 @@ PERL_CONF_OPTS = \<br>
        --target=$(GNU_TARGET_NAME) \<br>
        --target-tools-prefix=$(<wbr>TARGET_CROSS) \<br>
        --prefix=/usr \<br>
+       --vendorprefix=/usr \<br>
        -Dld=&quot;$(TARGET_CC)&quot; \<br>
        -Dccflags=&quot;$(TARGET_CFLAGS)&quot; \<br>
        -Dldflags=&quot;$(TARGET_LDFLAGS) -lm&quot; \<br>
@@ -92,6 +93,7 @@ endef<br>
 HOST_PERL_CONF_OPTS = \<br>
        -des \<br>
        -Dprefix=&quot;$(HOST_DIR)&quot; \<br>
+       -Dvendorprefix=&quot;$(HOST_DIR)&quot; \<br>
        -Dcc=&quot;$(HOSTCC)&quot;<br>
<br>
 define HOST_PERL_CONFIGURE_CMDS<br>
@@ -111,6 +113,7 @@ $(eval $(generic-package))<br>
 $(eval $(host-generic-package))<br>
<br>
 define PERL_FINALIZE_TARGET<br>
+       mkdir -p $(TARGET_DIR)/usr/lib/perl5/<wbr>vendor_perl/$(PERL_VERSION)/$(<wbr>PERL_ARCHNAME)<br>
        rm -rf $(TARGET_DIR)/usr/lib/perl5/$(<wbr>PERL_VERSION)/pod<br>
        rm -rf $(TARGET_DIR)/usr/lib/perl5/$(<wbr>PERL_VERSION)/$(PERL_ARCHNAME)<wbr>/CORE<br>
        find $(TARGET_DIR)/usr/lib/perl5/ -name &#39;extralibs.ld&#39; -print0 | xargs -0 rm -f<br>
<span class="gmail-HOEnZb"><font color="#888888">-- <br>
2.14.4<br>
<br>
</font></span></blockquote></div><br></div></div>
Christopher McCrory Aug. 10, 2018, 6:45 p.m. UTC | #2
On Fri, Aug 10, 2018 at 11:13 AM, François Perrad <francois.perrad@gadz.org>
wrote:

>
>
> 2018-08-10 16:47 GMT+02:00 Christopher McCrory <chrismcc@gmail.com>:
>
>> This adds vendorprefix to configure args
>>
>> Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
>>
>
>
> What is the rational of this patch ?
>
> Currently, core modules (ie. built directly with the perl distribution)
> are installed in /usr/lib/perl5/5.xx.y,
> others modules (built by the perl-package infrastructure) are installed in
> /usr/lib/perl5/site-perl/5.xx.y.
> Why adding /usr/lib/perl5/vendor-perl/5.xx.y ?
>


I'm far from a perl expert.  Short answer is so it is there.

Longer answer, I'm trying to package ZoneMinder for buildroot.  It is a
complicated package to say the least.  It is written in C++, configured
with cmake, and perl, and php.  It uses the vendor perl directories.  So
when it installs, instead of using TARGET_DIR/usr/lib/perl5/site_perl/...
it uses  TARGET_DIR/ .  So all the perl bits end up in the top directory,
which is sub optimal.  The ZoneMinder authors provide prebuilt binaries for
the major distributions because it is very difficult to successfully
compile from source.  Cross compiling with buildroot adds even more
challenges.  Adding a vendor directory to perl like most other
distributions is the easiest solution by far.

That said, if you don't want to add this change, I would understand.





>
> François
>
> ---
>>  package/perl/perl.mk | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
>> index b0eea3eff4..19a8f95f7b 100644
>> --- a/package/perl/perl.mk
>> +++ b/package/perl/perl.mk
>> @@ -48,6 +48,7 @@ PERL_CONF_OPTS = \
>>         --target=$(GNU_TARGET_NAME) \
>>         --target-tools-prefix=$(TARGET_CROSS) \
>>         --prefix=/usr \
>> +       --vendorprefix=/usr \
>>         -Dld="$(TARGET_CC)" \
>>         -Dccflags="$(TARGET_CFLAGS)" \
>>         -Dldflags="$(TARGET_LDFLAGS) -lm" \
>> @@ -92,6 +93,7 @@ endef
>>  HOST_PERL_CONF_OPTS = \
>>         -des \
>>         -Dprefix="$(HOST_DIR)" \
>> +       -Dvendorprefix="$(HOST_DIR)" \
>>         -Dcc="$(HOSTCC)"
>>
>>  define HOST_PERL_CONFIGURE_CMDS
>> @@ -111,6 +113,7 @@ $(eval $(generic-package))
>>  $(eval $(host-generic-package))
>>
>>  define PERL_FINALIZE_TARGET
>> +       mkdir -p $(TARGET_DIR)/usr/lib/perl5/ve
>> ndor_perl/$(PERL_VERSION)/$(PERL_ARCHNAME)
>>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
>>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(
>> PERL_VERSION)/$(PERL_ARCHNAME)/CORE
>>         find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 |
>> xargs -0 rm -f
>> --
>> 2.14.4
>>
>>
>
Francois Perrad Aug. 11, 2018, 10:14 a.m. UTC | #3
2018-08-10 20:45 GMT+02:00 Christopher McCrory <chrismcc@gmail.com>:

>
>
> On Fri, Aug 10, 2018 at 11:13 AM, François Perrad <
> francois.perrad@gadz.org> wrote:
>
>>
>>
>> 2018-08-10 16:47 GMT+02:00 Christopher McCrory <chrismcc@gmail.com>:
>>
>>> This adds vendorprefix to configure args
>>>
>>> Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
>>>
>>
>>
>> What is the rational of this patch ?
>>
>> Currently, core modules (ie. built directly with the perl distribution)
>> are installed in /usr/lib/perl5/5.xx.y,
>> others modules (built by the perl-package infrastructure) are installed
>> in /usr/lib/perl5/site-perl/5.xx.y.
>> Why adding /usr/lib/perl5/vendor-perl/5.xx.y ?
>>
>
>
> I'm far from a perl expert.  Short answer is so it is there.
>
> Longer answer, I'm trying to package ZoneMinder for buildroot.  It is a
> complicated package to say the least.  It is written in C++, configured
> with cmake, and perl, and php.  It uses the vendor perl directories.  So
> when it installs, instead of using TARGET_DIR/usr/lib/perl5/site_perl/...
> it uses  TARGET_DIR/ .  So all the perl bits end up in the top directory,
> which is sub optimal.  The ZoneMinder authors provide prebuilt binaries for
> the major distributions because it is very difficult to successfully
> compile from source.  Cross compiling with buildroot adds even more
> challenges.  Adding a vendor directory to perl like most other
> distributions is the easiest solution by far.
>
> That said, if you don't want to add this change, I would understand.
>
>
>
OK, for configuring vendorprefix.

But a target-finalize hook is not the right place to create a directory
(see https://buildroot.org/downloads/manual/manual.html#hooks).

You could create the directory usr/lib/perl5/vendor_perl in the
INSTALL_TARGET_CMDS of your package ZoneMinder.

François


>
>
>
>>
>> François
>>
>> ---
>>>  package/perl/perl.mk | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
>>> index b0eea3eff4..19a8f95f7b 100644
>>> --- a/package/perl/perl.mk
>>> +++ b/package/perl/perl.mk
>>> @@ -48,6 +48,7 @@ PERL_CONF_OPTS = \
>>>         --target=$(GNU_TARGET_NAME) \
>>>         --target-tools-prefix=$(TARGET_CROSS) \
>>>         --prefix=/usr \
>>> +       --vendorprefix=/usr \
>>>         -Dld="$(TARGET_CC)" \
>>>         -Dccflags="$(TARGET_CFLAGS)" \
>>>         -Dldflags="$(TARGET_LDFLAGS) -lm" \
>>> @@ -92,6 +93,7 @@ endef
>>>  HOST_PERL_CONF_OPTS = \
>>>         -des \
>>>         -Dprefix="$(HOST_DIR)" \
>>> +       -Dvendorprefix="$(HOST_DIR)" \
>>>         -Dcc="$(HOSTCC)"
>>>
>>>  define HOST_PERL_CONFIGURE_CMDS
>>> @@ -111,6 +113,7 @@ $(eval $(generic-package))
>>>  $(eval $(host-generic-package))
>>>
>>>  define PERL_FINALIZE_TARGET
>>> +       mkdir -p $(TARGET_DIR)/usr/lib/perl5/ve
>>> ndor_perl/$(PERL_VERSION)/$(PERL_ARCHNAME)
>>>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
>>>         rm -rf $(TARGET_DIR)/usr/lib/perl5/$(
>>> PERL_VERSION)/$(PERL_ARCHNAME)/CORE
>>>         find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 |
>>> xargs -0 rm -f
>>> --
>>> 2.14.4
>>>
>>>
>>
>
>
> --
> Christopher McCrory
> To the optimist, the glass is half full.
> To the pessimist, the glass is half empty.
> To the engineer, the glass is twice as big as it needs to be.
>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-08-10 20:45 GMT+02:00 Christopher McCrory <span dir="ltr">&lt;<a href="mailto:chrismcc@gmail.com" target="_blank">chrismcc@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Fri, Aug 10, 2018 at 11:13 AM, François Perrad <span dir="ltr">&lt;<a href="mailto:francois.perrad@gadz.org" target="_blank">francois.perrad@gadz.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>2018-08-10 16:47 GMT+02:00 Christopher McCrory <span dir="ltr">&lt;<a href="mailto:chrismcc@gmail.com" target="_blank">chrismcc@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This adds vendorprefix to configure args<br>
<br>
Signed-off-by: Christopher McCrory &lt;<a href="mailto:chrismcc@gmail.com" target="_blank">chrismcc@gmail.com</a>&gt;<br></blockquote><div><br></div></span><div><br>What is the rational of this patch ?<br><br>Currently, core modules (ie. built directly with the perl distribution) are installed in /usr/lib/perl5/5.xx.y,<br>others modules (built by the perl-package infrastructure) are installed in /usr/lib/perl5/site-perl/5.xx.<wbr>y.<br>Why adding /usr/lib/perl5/vendor-perl/5.x<wbr>x.y ?<span class="gmail-m_-3682809839695127731HOEnZb"><font color="#888888"><br></font></span></div></div></div></div></blockquote><div><br></div><div><br></div></span><div>I&#39;m far from a perl expert.  Short answer is so it is there.  <br></div><div><br></div><div>Longer answer, I&#39;m trying to package ZoneMinder for buildroot.  It is a complicated package to say the least.  It is written in C++, configured with cmake, and perl, and php.  It uses the vendor perl directories.  So when it installs, instead of using TARGET_DIR/usr/lib/perl5/site_<wbr>perl/... it uses  TARGET_DIR/ .  So all the perl bits end up in the top directory, which is sub optimal.  The ZoneMinder authors provide prebuilt binaries for the major distributions because it is very difficult to successfully compile from source.  Cross compiling with buildroot adds even more challenges.  Adding a vendor directory to perl like most other distributions is the easiest solution by far. <br></div><div><br></div><div>That said, if you don&#39;t want to add this change, I would understand.<br></div><div><div class="gmail-h5"><div><br></div><div><br></div></div></div></div></div></div></blockquote><div><br></div><div>OK, for configuring vendorprefix.<br><br>But a target-finalize hook is not the right place to create a directory (see <a href="https://buildroot.org/downloads/manual/manual.html#hooks">https://buildroot.org/downloads/manual/manual.html#hooks</a>).<br><br>You could create the directory usr/lib/perl5/vendor_perl in the INSTALL_TARGET_CMDS of your package ZoneMinder.<br><br>François<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5"><div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class="gmail-m_-3682809839695127731HOEnZb"><font color="#888888"><br>François<br><br></font></span></div><div><div class="gmail-m_-3682809839695127731h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a> | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a> b/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
index b0eea3eff4..19a8f95f7b 100644<br>
--- a/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
+++ b/package/perl/<a href="http://perl.mk" rel="noreferrer" target="_blank">perl.mk</a><br>
@@ -48,6 +48,7 @@ PERL_CONF_OPTS = \<br>
        --target=$(GNU_TARGET_NAME) \<br>
        --target-tools-prefix=$(TARGET<wbr>_CROSS) \<br>
        --prefix=/usr \<br>
+       --vendorprefix=/usr \<br>
        -Dld=&quot;$(TARGET_CC)&quot; \<br>
        -Dccflags=&quot;$(TARGET_CFLAGS)&quot; \<br>
        -Dldflags=&quot;$(TARGET_LDFLAGS) -lm&quot; \<br>
@@ -92,6 +93,7 @@ endef<br>
 HOST_PERL_CONF_OPTS = \<br>
        -des \<br>
        -Dprefix=&quot;$(HOST_DIR)&quot; \<br>
+       -Dvendorprefix=&quot;$(HOST_DIR)&quot; \<br>
        -Dcc=&quot;$(HOSTCC)&quot;<br>
<br>
 define HOST_PERL_CONFIGURE_CMDS<br>
@@ -111,6 +113,7 @@ $(eval $(generic-package))<br>
 $(eval $(host-generic-package))<br>
<br>
 define PERL_FINALIZE_TARGET<br>
+       mkdir -p $(TARGET_DIR)/usr/lib/perl5/ve<wbr>ndor_perl/$(PERL_VERSION)/$(PE<wbr>RL_ARCHNAME)<br>
        rm -rf $(TARGET_DIR)/usr/lib/perl5/$(<wbr>PERL_VERSION)/pod<br>
        rm -rf $(TARGET_DIR)/usr/lib/perl5/$(<wbr>PERL_VERSION)/$(PERL_ARCHNAME)<wbr>/CORE<br>
        find $(TARGET_DIR)/usr/lib/perl5/ -name &#39;extralibs.ld&#39; -print0 | xargs -0 rm -f<br>
<span class="gmail-m_-3682809839695127731m_-3668939074737042758gmail-HOEnZb"><font color="#888888">-- <br>
2.14.4<br>
<br>
</font></span></blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="gmail-m_-3682809839695127731gmail_signature">Christopher McCrory<br>To the optimist, the glass is half full.<br>To the pessimist, the glass is half empty.<br>To the engineer, the glass is twice as big as it needs to be.</div>
</font></span></div></div>
</blockquote></div><br></div></div>
diff mbox series

Patch

diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index b0eea3eff4..19a8f95f7b 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -48,6 +48,7 @@  PERL_CONF_OPTS = \
 	--target=$(GNU_TARGET_NAME) \
 	--target-tools-prefix=$(TARGET_CROSS) \
 	--prefix=/usr \
+	--vendorprefix=/usr \
 	-Dld="$(TARGET_CC)" \
 	-Dccflags="$(TARGET_CFLAGS)" \
 	-Dldflags="$(TARGET_LDFLAGS) -lm" \
@@ -92,6 +93,7 @@  endef
 HOST_PERL_CONF_OPTS = \
 	-des \
 	-Dprefix="$(HOST_DIR)" \
+	-Dvendorprefix="$(HOST_DIR)" \
 	-Dcc="$(HOSTCC)"
 
 define HOST_PERL_CONFIGURE_CMDS
@@ -111,6 +113,7 @@  $(eval $(generic-package))
 $(eval $(host-generic-package))
 
 define PERL_FINALIZE_TARGET
+	mkdir -p $(TARGET_DIR)/usr/lib/perl5/vendor_perl/$(PERL_VERSION)/$(PERL_ARCHNAME)
 	rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
 	rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
 	find $(TARGET_DIR)/usr/lib/perl5/ -name 'extralibs.ld' -print0 | xargs -0 rm -f