diff mbox series

util-linux: fix the pylibmount installation path

Message ID 20230629-pylibmount-v1-1-342da6733d5d@baylibre.com
State New
Headers show
Series util-linux: fix the pylibmount installation path | expand

Commit Message

Louis Rannou June 29, 2023, 12:37 p.m. UTC
Append the install task to move the python library from ${base_libdir}
to ${PYTHON_SITEPACKAGES_DIR}.

Signed-off-by: Louis Rannou <lrannou@baylibre.com>
---
As we install libraries of util-linux in ${base_libdir} (/lib), the
python library pylibmount is also installed there. An issue was raised
when pylibmount was added to PACKAGECONFIG.
---
 meta/recipes-core/util-linux/util-linux_2.38.1.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


---
base-commit: ed04d429f742288bdc547a6537d536c97c89831f
change-id: 20230629-pylibmount-84dab8d2ba11

Best regards,

Comments

Richard Purdie June 29, 2023, 12:59 p.m. UTC | #1
On Thu, 2023-06-29 at 12:37 +0000, Louis Rannou wrote:
> Append the install task to move the python library from ${base_libdir}
> to ${PYTHON_SITEPACKAGES_DIR}.
> 
> Signed-off-by: Louis Rannou <lrannou@baylibre.com>
> ---
> As we install libraries of util-linux in ${base_libdir} (/lib), the
> python library pylibmount is also installed there. An issue was raised
> when pylibmount was added to PACKAGECONFIG.
> ---
>  meta/recipes-core/util-linux/util-linux_2.38.1.bb | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/util-linux/util-linux_2.38.1.bb b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> index 9ea7a04e8a..f9a9fdcfaf 100644
> --- a/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> +++ b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> @@ -1,7 +1,7 @@
>  require util-linux.inc
>  
>  #gtk-doc is not enabled as it requires xmlto which requires util-linux
> -inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
> +inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir python3targetconfig bash-completion ptest
>  DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid"
>  
>  PACKAGES =+ "${PN}-swaponoff"
> @@ -320,3 +320,12 @@ do_install_ptest() {
>          rm -rf ${D}${PTEST_PATH}/tests/ts/chfn
>      fi
>  }
> +
> +do_install:append() {
> +    if [ -d ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ]
> +    then
> +        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
> +        mv ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ${D}${PYTHON_SITEPACKAGES_DIR}/
> +        rm -rf ${D}${base_libdir}/${PYTHON_DIR}
> +    fi
> +}

When it is being installed, can we not pass the right path into the
build system so it ends up in the right place?

Cheers,

Richard
Louis Rannou June 29, 2023, 1:50 p.m. UTC | #2
On 29/06/2023 14:59, Richard Purdie wrote:
> On Thu, 2023-06-29 at 12:37 +0000, Louis Rannou wrote:
>> Append the install task to move the python library from ${base_libdir}
>> to ${PYTHON_SITEPACKAGES_DIR}.
>>
>> Signed-off-by: Louis Rannou <lrannou@baylibre.com>
>> ---
>> As we install libraries of util-linux in ${base_libdir} (/lib), the
>> python library pylibmount is also installed there. An issue was raised
>> when pylibmount was added to PACKAGECONFIG.
>> ---
>>   meta/recipes-core/util-linux/util-linux_2.38.1.bb | 11 ++++++++++-
>>   1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/util-linux/util-linux_2.38.1.bb b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>> index 9ea7a04e8a..f9a9fdcfaf 100644
>> --- a/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>> +++ b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>> @@ -1,7 +1,7 @@
>>   require util-linux.inc
>>   
>>   #gtk-doc is not enabled as it requires xmlto which requires util-linux
>> -inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
>> +inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir python3targetconfig bash-completion ptest
>>   DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid"
>>   
>>   PACKAGES =+ "${PN}-swaponoff"
>> @@ -320,3 +320,12 @@ do_install_ptest() {
>>           rm -rf ${D}${PTEST_PATH}/tests/ts/chfn
>>       fi
>>   }
>> +
>> +do_install:append() {
>> +    if [ -d ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ]
>> +    then
>> +        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
>> +        mv ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ${D}${PYTHON_SITEPACKAGES_DIR}/
>> +        rm -rf ${D}${base_libdir}/${PYTHON_DIR}
>> +    fi
>> +}
> 
> When it is being installed, can we not pass the right path into the
> build system so it ends up in the right place?
I would love that. But the build system installs the libraries and the 
python package using the same prefix which we specify to ${base_libdir}. 
I have asked a quick question on IRC. I'll send a mail to the util-linux 
mailing list if I get no answer.

Louis
Richard Purdie June 29, 2023, 2:04 p.m. UTC | #3
On Thu, 2023-06-29 at 15:50 +0200, Louis Rannou wrote:
> On 29/06/2023 14:59, Richard Purdie wrote:
> > On Thu, 2023-06-29 at 12:37 +0000, Louis Rannou wrote:
> > > Append the install task to move the python library from ${base_libdir}
> > > to ${PYTHON_SITEPACKAGES_DIR}.
> > > 
> > > Signed-off-by: Louis Rannou <lrannou@baylibre.com>
> > > ---
> > > As we install libraries of util-linux in ${base_libdir} (/lib), the
> > > python library pylibmount is also installed there. An issue was raised
> > > when pylibmount was added to PACKAGECONFIG.
> > > ---
> > >   meta/recipes-core/util-linux/util-linux_2.38.1.bb | 11 ++++++++++-
> > >   1 file changed, 10 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/meta/recipes-core/util-linux/util-linux_2.38.1.bb b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> > > index 9ea7a04e8a..f9a9fdcfaf 100644
> > > --- a/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> > > +++ b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
> > > @@ -1,7 +1,7 @@
> > >   require util-linux.inc
> > >   
> > >   #gtk-doc is not enabled as it requires xmlto which requires util-linux
> > > -inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
> > > +inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir python3targetconfig bash-completion ptest
> > >   DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid"
> > >   
> > >   PACKAGES =+ "${PN}-swaponoff"
> > > @@ -320,3 +320,12 @@ do_install_ptest() {
> > >           rm -rf ${D}${PTEST_PATH}/tests/ts/chfn
> > >       fi
> > >   }
> > > +
> > > +do_install:append() {
> > > +    if [ -d ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ]
> > > +    then
> > > +        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
> > > +        mv ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ${D}${PYTHON_SITEPACKAGES_DIR}/
> > > +        rm -rf ${D}${base_libdir}/${PYTHON_DIR}
> > > +    fi
> > > +}
> > 
> > When it is being installed, can we not pass the right path into the
> > build system so it ends up in the right place?
> I would love that. But the build system installs the libraries and the 
> python package using the same prefix which we specify to ${base_libdir}. 
> I have asked a quick question on IRC. I'll send a mail to the util-linux 
> mailing list if I get no answer.

Perhaps we should just let util-linux install to libdir instead of
base_libdir. The reasons for using base_libdir are effectively
historical now anyway...

Cheers,

Richard
Louis Rannou June 30, 2023, 8:55 a.m. UTC | #4
On 29/06/2023 16:04, Richard Purdie wrote:
> On Thu, 2023-06-29 at 15:50 +0200, Louis Rannou wrote:
>> On 29/06/2023 14:59, Richard Purdie wrote:
>>> On Thu, 2023-06-29 at 12:37 +0000, Louis Rannou wrote:
>>>> Append the install task to move the python library from ${base_libdir}
>>>> to ${PYTHON_SITEPACKAGES_DIR}.
>>>>
>>>> Signed-off-by: Louis Rannou <lrannou@baylibre.com>
>>>> ---
>>>> As we install libraries of util-linux in ${base_libdir} (/lib), the
>>>> python library pylibmount is also installed there. An issue was raised
>>>> when pylibmount was added to PACKAGECONFIG.
>>>> ---
>>>>    meta/recipes-core/util-linux/util-linux_2.38.1.bb | 11 ++++++++++-
>>>>    1 file changed, 10 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/recipes-core/util-linux/util-linux_2.38.1.bb b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>>>> index 9ea7a04e8a..f9a9fdcfaf 100644
>>>> --- a/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>>>> +++ b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
>>>> @@ -1,7 +1,7 @@
>>>>    require util-linux.inc
>>>>    
>>>>    #gtk-doc is not enabled as it requires xmlto which requires util-linux
>>>> -inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
>>>> +inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir python3targetconfig bash-completion ptest
>>>>    DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid"
>>>>    
>>>>    PACKAGES =+ "${PN}-swaponoff"
>>>> @@ -320,3 +320,12 @@ do_install_ptest() {
>>>>            rm -rf ${D}${PTEST_PATH}/tests/ts/chfn
>>>>        fi
>>>>    }
>>>> +
>>>> +do_install:append() {
>>>> +    if [ -d ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ]
>>>> +    then
>>>> +        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
>>>> +        mv ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ${D}${PYTHON_SITEPACKAGES_DIR}/
>>>> +        rm -rf ${D}${base_libdir}/${PYTHON_DIR}
>>>> +    fi
>>>> +}
>>>
>>> When it is being installed, can we not pass the right path into the
>>> build system so it ends up in the right place?
>> I would love that. But the build system installs the libraries and the
>> python package using the same prefix which we specify to ${base_libdir}.
>> I have asked a quick question on IRC. I'll send a mail to the util-linux
>> mailing list if I get no answer.
> 
> Perhaps we should just let util-linux install to libdir instead of
> base_libdir. The reasons for using base_libdir are effectively
> historical now anyway...

I can do that, but if /lib and /usr/lib are distincts we probably 
require util-linux to be in /lib, don't we ? For example, if /usr is a 
separate partition.

Thanks,
Louis
diff mbox series

Patch

diff --git a/meta/recipes-core/util-linux/util-linux_2.38.1.bb b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
index 9ea7a04e8a..f9a9fdcfaf 100644
--- a/meta/recipes-core/util-linux/util-linux_2.38.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.38.1.bb
@@ -1,7 +1,7 @@ 
 require util-linux.inc
 
 #gtk-doc is not enabled as it requires xmlto which requires util-linux
-inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
+inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir python3targetconfig bash-completion ptest
 DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid"
 
 PACKAGES =+ "${PN}-swaponoff"
@@ -320,3 +320,12 @@  do_install_ptest() {
         rm -rf ${D}${PTEST_PATH}/tests/ts/chfn
     fi
 }
+
+do_install:append() {
+    if [ -d ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ]
+    then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+        mv ${D}${base_libdir}/${PYTHON_DIR}/site-packages/libmount ${D}${PYTHON_SITEPACKAGES_DIR}/
+        rm -rf ${D}${base_libdir}/${PYTHON_DIR}
+    fi
+}