[pacman-dev] Fix/enforce PATH with makepkg (required for Python packages)
Usually Python packages use `python` in their PKGBUILD, which results in any activated virtualenv to be used, e.g. from `pep257`: ``` package() { cd "${srcdir}/${pkgname}-${pkgver}" python setup.py install --root="${pkgdir}" --optimize=1 install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE-MIT } ``` Activating a virtualenv will add the "python" binary in front of $PATH. I've reported this initially for pacaur at https://github.com/rmarquis/pacaur/issues/400, but it's a problem with makepkg after all. I am using this workaround in /etc/xdg/pacaur/config currently: PATH=/usr/bin:$PATH Cheers, Daniel.
On 20/01/16 07:01, Daniel Hahler wrote:
Usually Python packages use `python` in their PKGBUILD, which results in any activated virtualenv to be used, e.g. from `pep257`:
``` package() { cd "${srcdir}/${pkgname}-${pkgver}" python setup.py install --root="${pkgdir}" --optimize=1
install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE-MIT } ```
Activating a virtualenv will add the "python" binary in front of $PATH.
I've reported this initially for pacaur at https://github.com/rmarquis/pacaur/issues/400, but it's a problem with makepkg after all.
makepkg is working as specified.
I am using this workaround in /etc/xdg/pacaur/config currently: PATH=/usr/bin:$PATH
Cheers, Daniel.
On 19.01.2016 22:48, Allan McRae wrote:
On 20/01/16 07:01, Daniel Hahler wrote:
Usually Python packages use `python` in their PKGBUILD, which results in any activated virtualenv to be used, e.g. from `pep257`:
``` package() { cd "${srcdir}/${pkgname}-${pkgver}" python setup.py install --root="${pkgdir}" --optimize=1
install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE-MIT } ```
Activating a virtualenv will add the "python" binary in front of $PATH.
I've reported this initially for pacaur at https://github.com/rmarquis/pacaur/issues/400, but it's a problem with makepkg after all.
makepkg is working as specified.
Does this mean that pacaur (and other consumers) should handle fixing the PATH themselves? (In the case of pacaur, a package is meant to be installed system-wide and therefore the system's "python" should be used also.)
I am using this workaround in /etc/xdg/pacaur/config currently: PATH=/usr/bin:$PATH
Cheers, Daniel.
On 21/01/16 03:56, Daniel Hahler wrote:
On 19.01.2016 22:48, Allan McRae wrote:
On 20/01/16 07:01, Daniel Hahler wrote:
Usually Python packages use `python` in their PKGBUILD, which results in any activated virtualenv to be used, e.g. from `pep257`:
``` package() { cd "${srcdir}/${pkgname}-${pkgver}" python setup.py install --root="${pkgdir}" --optimize=1
install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE-MIT } ```
Activating a virtualenv will add the "python" binary in front of $PATH.
I've reported this initially for pacaur at https://github.com/rmarquis/pacaur/issues/400, but it's a problem with makepkg after all.
makepkg is working as specified.
Does this mean that pacaur (and other consumers) should handle fixing the PATH themselves?
(In the case of pacaur, a package is meant to be installed system-wide and therefore the system's "python" should be used also.)
Neither makepkg or any wrapper should touch the system path. How can they distinguish needed additions to the PATH from unneeded ones? Allan
On 25.01.2016 03:39, Allan McRae wrote:
(In the case of pacaur, a package is meant to be installed system-wide and therefore the system's "python" should be used also.)
Neither makepkg or any wrapper should touch the system path. How can they distinguish needed additions to the PATH from unneeded ones?
I can see the point, but then it's also a matter/responsibility of the package manager (or packages) to use the package manager's version of the build tools - especially with Python or other tools, where it's common to use isolated environments by changing PATH. And I can also see that it would get into your way if you would like to use some special PATH by yourself. Would it be a good practice to use /usr/bin/python in the PKGBUILD then explicitly? Thanks, Daniel.
participants (2)
-
Allan McRae
-
Daniel Hahler