You are not logged in.

#1 2015-02-16 11:34:04

xanb
Member
Registered: 2012-07-24
Posts: 418

[solved] Installing python package from AUR instead of pip?

Hi,

I want to install sake. But I don't want to install as PIP. Is there any tool in archlinux as checkinstall for making packages?

Thanks,

Last edited by xanb (2015-02-25 08:07:00)


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#2 2015-02-16 11:58:53

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [solved] Installing python package from AUR instead of pip?

I assume that you want it to be installed as a package like those in the standard repositories? There's the PKGBUILD + makepkg system which does this.

Well, I see an INSTALL file in the source tarball for the release candidate with the the following command:

python setup.py install

That said, as it's a git repository, you could use PKGBUILDs with git.

I'd take the PKGBUILD for the bdflib-git package, modify it to create a package to build this python module instead and you should be done.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2015-02-16 15:50:38

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] Installing python package from AUR instead of pip?

You can take a look into any Python-package in AUR. They are basically all very similar, you probably would just have to change the package's name and the sorce (+ checksums).

And then just build your own Package with makepkg.

Offline

#4 2015-02-16 20:14:52

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: [solved] Installing python package from AUR instead of pip?

Thanks a lot, both of you.

Following your advise, I create this PKGBUILD

# Maintainer: Me

pkgname=sake-git
pkgver=1.0RC
pkgrel=1
pkgdesc="
A self-documenting build automation tool"
url="https://github.com/tonyfischetti/sake"
arch=('any')
license=('MIT')
depends=('python')
makedepends=('git')
source=('git://github.com/tonyfischetti/sake.git')
md5sums=('SKIP')

_gitname="master"

pkgver() {
  cd $_gitname
  git show -s --format="%ci" HEAD | sed -e 's/-//g' -e 's/ .*//'
}

build() {
  cd $_gitname

  msg "GIT checkout done or server timeout"
  msg "Starting setup.py..."

  find ./ -type f | xargs -n 1 sed -i 's|/usr/bin/python|/usr/bin/env python2|'
  python setup.py build
}

package() {
  cd $_gitname
  python setup.py install --prefix=/usr --root="$pkgdir"
}

Is that correct?

Thanks a lot,


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#5 2015-02-16 20:29:05

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] Installing python package from AUR instead of pip?

looks good. In case it is not, you'll notice as you have a non-functioning package installed. wink

Offline

#6 2015-02-17 08:05:42

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: [solved] Installing python package from AUR instead of pip?

In the official webpage the developers says that package has as dependencies:

    Python 2.7, or above (including 3.4!)
    The networkx python module
    the PyYAML python module
    Graphviz
 

that is

depends=('python' 'python-networkx' 'python-yaml' 'graphviz')

I have to include these in my package?


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#7 2015-02-17 12:48:25

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] Installing python package from AUR instead of pip?

Yes, if upstream depends on these, you should include them. Otherwise, you might end up with a non-functional package (except all of them happen to be already installed anyways, but they should be listed in the depends nevertheless).

Offline

#8 2015-02-17 14:33:14

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: [solved] Installing python package from AUR instead of pip?

I get error:

[xan@argonia p]$ export LANG=en_US.UTF-8
[xan@argonia p]$ makepkg
==> Making package: sake-git 20150113-1 (Tue Feb 17 15:31:55 CET 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating sake git repo...
Fetching origin
==> Validating source files with md5sums...
    sake ... Skipped
==> Extracting sources...
  -> Creating working copy of sake git repo...
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
==> GIT checkout done or server timeout
==> Starting setup.py...
Traceback (most recent call last):
  File "setup.py", line 91, in <module>
    **kw
TypeError: setup() got multiple values for keyword argument 'requires'
==> ERROR: A failure occurred in build().
    Aborting...
[xan@argonia p]$ 

with this PKGBUILD

# Maintainer: Me

pkgname=sake-git
pkgver=20150113
pkgrel=1
pkgdesc="
A self-documenting build automation tool"
url="https://github.com/tonyfischetti/sake"
arch=('any')
license=('MIT')
depends=('python' 'python-networkx' 'python-yaml' 'graphviz')
makedepends=('git')
source=('git://github.com/tonyfischetti/sake.git')
md5sums=('SKIP')

_gitname="sake"

pkgver() {
  cd $_gitname
  git show -s --format="%ci" HEAD | sed -e 's/-//g' -e 's/ .*//'
}

build() {
  cd $_gitname

  msg "GIT checkout done or server timeout"
  msg "Starting setup.py..."

  find ./ -type f | xargs -n 1 sed -i 's|/usr/bin/python|/usr/bin/env python2|'
  python setup.py build
}

package() {
  cd $_gitname
  python setup.py install --prefix=/usr --root="$pkgdir"
}

What happens?

Thanks,


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#9 2015-02-17 14:56:54

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] Installing python package from AUR instead of pip?

upstream's setup.py is broken. If you don't have python-setuptools installed, the setup-function in the setup.py will get multiple entries for 'depends', which it obviously doesn't like. Quickfix: add python-setuptools to makedepends (or install it, if you are working with Python you might want to have setuptools installed by default anyways).

real fix: report the issue upstream with your build()-code and the error thrown (the one below). Then they can fix it. You should do the second thing in any case to get the error fixed and not just work around it.

Traceback (most recent call last):
  File "setup.py", line 91, in <module>
    **kw
TypeError: setup() got multiple values for keyword argument 'requires'

Offline

#10 2015-02-18 08:32:36

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: [solved] Installing python package from AUR instead of pip?


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#11 2015-02-18 08:35:49

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: [solved] Installing python package from AUR instead of pip?

Success:

$ makepkg
==> S'està fent el paquet: sake-git 20150113-1 (dc feb 18 09:34:27 CET 2015)
==> Comprovant les dependències en temps d'execució ...
==> Comprovant de dependències per l'assemblatge ...
==> Recuperant codi font ...
  -> Clonant repositori sake git...
Clonant al dipòsit nu '/home/xan/p/sake'...
remote: Counting objects: 1427, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1427 (delta 0), reused 0 (delta 0), pack-reused 1421
Rebent objectes: 100% (1427/1427), 1.31 MiB | 589.00 KiB/s, fet.
Resolent les deltes: 100% (897/897), fet.
Provant connectivitat... fet.
==> S'està validant el fitxer de codi font amb md5sums...
    sake ... Omès
==> Extracció de codi font ...
  -> Creant una còpia del repositori sake git ...
Clonant a 'sake'...
fet.
==> Iniciant pkgver()...
==> Iniciant build()...
==> GIT checkout done or server timeout
==> Starting setup.py...
running build
running build_py
creating build
creating build/lib
creating build/lib/sakelib
copying sakelib/__init__.py -> build/lib/sakelib
copying sakelib/audit.py -> build/lib/sakelib
copying sakelib/constants.py -> build/lib/sakelib
copying sakelib/build.py -> build/lib/sakelib
copying sakelib/acts.py -> build/lib/sakelib
running build_scripts
creating build/scripts-3.4
copying and adjusting sake -> build/scripts-3.4
changing mode of build/scripts-3.4/sake from 644 to 755
I hope you enjoy using Sake!
==> Entrant a l'entorn fakeroot ... 
==> Iniciant package()...
running install
running build
running build_py
running build_scripts
running install_lib
creating /home/xan/p/pkg/sake-git/usr
creating /home/xan/p/pkg/sake-git/usr/lib
creating /home/xan/p/pkg/sake-git/usr/lib/python3.4
creating /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages
creating /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
copying build/lib/sakelib/__init__.py -> /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
copying build/lib/sakelib/audit.py -> /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
copying build/lib/sakelib/constants.py -> /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
copying build/lib/sakelib/build.py -> /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
copying build/lib/sakelib/acts.py -> /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib
byte-compiling /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib/__init__.py to __init__.cpython-34.pyc
byte-compiling /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib/audit.py to audit.cpython-34.pyc
byte-compiling /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib/constants.py to constants.cpython-34.pyc
byte-compiling /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib/build.py to build.cpython-34.pyc
byte-compiling /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/sakelib/acts.py to acts.cpython-34.pyc
running install_egg_info
running egg_info
writing requirements to master_sake.egg-info/requires.txt
writing master_sake.egg-info/PKG-INFO
writing dependency_links to master_sake.egg-info/dependency_links.txt
writing top-level names to master_sake.egg-info/top_level.txt
reading manifest file 'master_sake.egg-info/SOURCES.txt'
writing manifest file 'master_sake.egg-info/SOURCES.txt'
Copying master_sake.egg-info to /home/xan/p/pkg/sake-git/usr/lib/python3.4/site-packages/master_sake-0.9.6-py3.4.egg-info
running install_scripts
creating /home/xan/p/pkg/sake-git/usr/bin
copying build/scripts-3.4/sake -> /home/xan/p/pkg/sake-git/usr/bin
changing mode of /home/xan/p/pkg/sake-git/usr/bin/sake to 755
I hope you enjoy using Sake!
==> S'està netejant la instal·lació...
  -> S'estan purgant fitxers no desitjats...
  -> S'estan eliminant fitxers libtool...
  -> Removing static library files...
  -> S'està comprimint el manual i les pàgines d'informació...
  -> S'estan retirant els símbols innecessaris de depuració dels binaris i les biblioteques...
==> Creant paquet "sake-git"...
  -> Generant arxiu .PKGINFO...
  -> S'està generant el fitxer .MTREE...
  -> S'està comprimint el paquet...
==> Deixant d'entorn fakeroot.
==> S'ha acabat de fer: sake-git 20150113-1 (dc feb 18 09:34:32 CET 2015)
[xan@argonia p]$ ls
pkg  PKGBUILD  sake  sake-git-20150113-1-any.pkg.tar.xz  src
[xan@argonia p]$ 

with this PKGBUILD:

# Maintainer: Me

pkgname=sake-git
pkgver=20150113
pkgrel=1
pkgdesc="
A self-documenting build automation tool"
url="https://github.com/tonyfischetti/sake"
arch=('any')
license=('MIT')
depends=('python' 'python-networkx' 'python-yaml' 'graphviz')
makedepends=('git' 'python-setuptools')
source=('git://github.com/tonyfischetti/sake.git')
md5sums=('SKIP')

_gitname="sake"

pkgver() {
  cd $_gitname
  git show -s --format="%ci" HEAD | sed -e 's/-//g' -e 's/ .*//'
}

build() {
  cd $_gitname

  msg "GIT checkout done or server timeout"
  msg "Starting setup.py..."

  find ./ -type f | xargs -n 1 sed -i 's|/usr/bin/python|/usr/bin/env python|'
  python setup.py build
}

package() {
  cd $_gitname
  python setup.py install --prefix=/usr --root="$pkgdir"
}

Thanks a lot,

Last edited by xanb (2015-02-18 08:36:06)


Owning one OpenRC (artoo way) and other three systemd machines

Offline

Board footer

Powered by FluxBB