[arch-commits] Commit in python-virtualenv/trunk (PKGBUILD)

Levente Polyak anthraxx at archlinux.org
Thu Nov 23 20:26:15 UTC 2017


    Date: Thursday, November 23, 2017 @ 20:26:14
  Author: anthraxx
Revision: 310766

upgpkg: python-virtualenv 15.1.0-2 cleanup for reproducible builds

- avoid sed or build in packages
- adding tests
- adding docs (txt and man)

Modified:
  python-virtualenv/trunk/PKGBUILD

----------+
 PKGBUILD |   57 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 42 insertions(+), 15 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-11-23 19:35:20 UTC (rev 310765)
+++ PKGBUILD	2017-11-23 20:26:14 UTC (rev 310766)
@@ -4,24 +4,54 @@
 
 pkgname=('python-virtualenv' 'python2-virtualenv')
 pkgver=15.1.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Virtual Python Environment builder"
 url="https://virtualenv.pypa.io/"
 arch=('any')
 license=('MIT')
-makedepends=('python' 'python2')
+makedepends=('python' 'python-sphinx' 'python2' 'python2-sphinx')
+checkdepends=('python-pytest' 'python-mock' 'python2-pytest' 'python2-mock')
 replaces=('virtualenv')
 conflicts=('virtualenv')
-source=("https://pypi.io/packages/source/v/virtualenv/virtualenv-$pkgver.tar.gz")
-md5sums=('44e19f4134906fe2d75124427dc9b716')
-sha256sums=('02f8102c2436bb03b3ee6dede1919d1dac8a427541652e5ec95171ec8adbc93a')
+options=('!makeflags')
+source=(${pkgname}-${pkgver}.tar.gz::https://github.com/pypa/virtualenv/archive/${pkgver}.tar.gz)
+md5sums=('30222e271963a437e240aee4853728d2')
+sha256sums=('aea627d114a3863d6374c5a3fc3cdd08907e0ac951cf93b458e5ba5998c516de')
 
+prepare() {
+  cp -a virtualenv-${pkgver}{,-py2}
+  cd virtualenv-${pkgver}-py2
+  sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|" virtualenv.py
+}
+
+build() {
+  (cd virtualenv-${pkgver}
+    python setup.py build
+    make -C docs text man
+  )
+  (cd virtualenv-${pkgver}-py2
+    python2 setup.py build
+    make -C docs text man
+  )
+}
+
+check() {
+  (cd virtualenv-${pkgver}
+    py.test
+  )
+  (cd virtualenv-${pkgver}-py2
+    py.test2
+  )
+}
+
 package_python-virtualenv() {
   depends=('python')
 
-  cd "$srcdir/virtualenv-$pkgver"
-  LANG='en_US.UTF-8' python3 setup.py build
-  LANG='en_US.UTF-8' python3 setup.py install --prefix=/usr --root="$pkgdir"
+  cd virtualenv-$pkgver
+  python setup.py install --prefix=/usr --root="$pkgdir" --skip-build
+  install -Dm 644 docs/_build/text/* -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/man/virtualenv.1 "${pkgdir}/usr/share/man/man1/virtualenv.1"
+  ln -s virtualenv.1.gz "${pkgdir}/usr/share/man/man1/virtualenv3.1.gz"
 
   # link to a version with 3 suffix as well
   ln "$pkgdir/usr/bin/virtualenv" "$pkgdir/usr/bin/virtualenv3"
@@ -33,14 +63,11 @@
 package_python2-virtualenv() {
   depends=('python2')
 
-  cd "$srcdir/virtualenv-$pkgver"
+  cd virtualenv-$pkgver-py2
+  python2 setup.py install --prefix=/usr --root="$pkgdir" --skip-build
+  install -Dm 644 docs/_build/text/* -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/_build/man/virtualenv.1 "${pkgdir}/usr/share/man/man1/virtualenv2.1"
 
-  # should report this upstream as still not fixed...
-  sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|" virtualenv.py
-
-  python2 setup.py build
-  python2 setup.py install --prefix=/usr --root="$pkgdir"
-
   # move this "old" version out of the way
   mv "$pkgdir/usr/bin/virtualenv" "$pkgdir/usr/bin/virtualenv2"
 


More information about the arch-commits mailing list