Skip to content

Instantly share code, notes, and snippets.

@bvaudour
Created June 11, 2014 15:44
Show Gist options
  • Save bvaudour/76893aabc9bc3fe4865e to your computer and use it in GitHub Desktop.
Save bvaudour/76893aabc9bc3fe4865e to your computer and use it in GitHub Desktop.
Example of PKGBUILD with pip
pkgname=frescobaldi
pkgver=2.0.16
pkgrel=1
pkgdesc="A LilyPond sheet music editor for KDE4. It aims to be powerful, yet lightweight and easy to use."
arch=('x86_64')
url="http://www.frescobaldi.org/"
license=("GPL")
depends=('lilypond' 'python2-pip' 'pyqt' 'poppler-qt')
_pythondep='python-poppler-qt4'
optdepends=('lilypond-doc')
makedepends=('automoc4' 'cmake' 'docbook-xsl')
install=$pkgname.install
source=(https://github.com/wbsoft/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
md5sums=('5ff5573fbc817561724a598953449265')
build() {
pip2 show ${_pythondep} 2>/dev/null || sudo pip2 install ${_pythondep}
cd "$srcdir/$pkgname-$pkgver"
python2 setup.py build
}
package() {
cd "$srcdir/$pkgname-$pkgver"
python2 setup.py install --root="$pkgdir/" --optimize=1
find "$pkgdir" -name '*.py' -exec sed -i -e 's/^#!\/usr\/bin\/env python$/#!\/usr\/bin\/env python2/' -e 's/^#!\/usr\/bin\/python$/#!\/usr\/bin\/python2/' {} \;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment