Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Fix multiple python packages #3920

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 24 additions & 33 deletions packages/python-esprima/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,50 +1,41 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-esprima
pkgname=('python2-esprima' 'python-esprima')
pkgname=python-esprima
_pkgname=esprima
pkgver=4.0.1
pkgrel=5
pkgrel=6
pkgdesc='ECMAScript parsing infrastructure for multipurpose analysis in Python.'
arch=('any')
url='https://pypi.org/project/esprima/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
makedepends=('python-build' 'python-pip')
depends=('python')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/esprima-$pkgver.tar.gz")
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c7e21739ef75c5e8e75ecbe8b8f63ca26e9fbf58fc5753c86913c4ee65a8be9b07b2192c1db035bc3ed375c6f7a6b3fd9ae13a53ec38dcf542e65b40b2ec5b2c')

prepare() {
cp -a "esprima-$pkgver" "esprima2-$pkgver"
}

build() {
cd "esprima-$pkgver"

python setup.py build
cd "$_pkgname-$pkgver"

cd "$srcdir/esprima2-$pkgver"

python2 setup.py build
python -m build --wheel --outdir="$startdir/dist"
}

package_python2-esprima() {
depends=('python')

cd "esprima2-$pkgver"

python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build

mv "$pkgdir/usr/bin/esprima" "$pkgdir/usr/bin/esprima2"
}

package_python-esprima() {
depends=('python')

cd "esprima-$pkgver"

python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
package() {

cd "$_pkgname-$pkgver"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
"$_pkgname"
}

47 changes: 21 additions & 26 deletions packages/python-optparse-pretty/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-optparse-pretty
pkgname=('python2-optparse-pretty' 'python-optparse-pretty')
pkgname=python-optparse-pretty
_pkgname=optparse-pretty
pkgver=0.1.1
pkgrel=5
pkgrel=6
pkgdesc='A more compact help formatter for optparse.'
arch=('any')
url='https://pypi.org/project/optparse-pretty/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/optparse-pretty-$pkgver.tar.gz")
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2342109e9e258842803d2e6d3e8ad0a4082bd9bec9260ce4049328c0f0326cd79dc256e19765a91bf6d62cefcb3891b43682ef7fcbe928b4457bb6d7f5436cbe')

prepare() {
cp -a "optparse-pretty-$pkgver" "optparse-pretty2-$pkgver"
}

build() {
cd "optparse-pretty2-$pkgver"

python2 setup.py build

cd "$srcdir/optparse-pretty-$pkgver"
cd "$_pkgname-$pkgver"

python setup.py build
}

package_python2-optparse-pretty() {
cd "optparse-pretty2-$pkgver"

python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
python -m build --wheel --outdir="$startdir/dist"
}

package_python-optparse-pretty() {
cd "optparse-pretty-$pkgver"

python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
cd "$_pkgname-$pkgver"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
"$_pkgname"
}

38 changes: 23 additions & 15 deletions packages/python-requirements-parser/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-requirements-parser
pkgname=('python2-requirements-parser' 'python-requirements-parser')
pkgname=python-requirements-parser
_pkgname=requirements-parser
pkgver=0.5.0
pkgrel=2
pkgrel=3
pkgdesc='A Pip requirements file parser.'
arch=('any')
url='https://pypi.org/project/requirements-parser'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
makedepends=('python-build' 'python-pip')
depends=('python' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('a3bed4f26efb738cf09933770d11ccbe0c2d2b64936865979a8071b3478f26fb6f9780459d316eb5aa907eecf089b0e92fb1bb945b108b9ef71fee74b564a763')

package_python2-requirements-parser() {
depends=('python2')
build() {
cd "$_pkgname-$pkgver"

cd "requirements-parser-$pkgver"

python2 setup.py install --root="$pkgdir" --optimize=1
python -m build --wheel --outdir="$startdir/dist"
}

package_python-requirements-parser() {
depends=('python')

cd "requirements-parser-$pkgver"

python setup.py install --root="$pkgdir" --optimize=1
package() {
cd "$_pkgname-$pkgver"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
"$_pkgname"
}

35 changes: 23 additions & 12 deletions packages/python-sflock/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
# See COPYING for license details.

pkgbase=python-sflock
pkgname=('python2-sflock' 'python-sflock')
pkgname=('python-sflock' 'python2-sflock')
_pkgname=SFlock
pkgver=0.3.10
pkgrel=8
pkgrel=9
pkgdesc='Sample staging and detonation utility.'
arch=('any')
url='https://pypi.org/project/SFlock/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
makedepends=('python2-setuptools' 'python-build' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/SFlock-0.3.10.tar.gz"
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-0.3.10.tar.gz"
'setup.py.patch')
sha512sums=('055b60a23103c1662cfd62aef37a2c2bfbfc0cc2fa5982736bd58b8e4a4fb73f5450b11c3e3ef3802871e3ce11b75a1b03f309ae17191ce407b2fd6c89e24111'
'1901f8c691b0634a459effb21b899d6eb9499afdf972daac2056fc6ec784e4f1849d2218f41bac2d235a09521d2871e0ce32c1365502a31fcbafe855b24ab687')

prepare() {
patch -p1 < setup.py.patch

cp -a "SFlock-$pkgver" "SFlock2-$pkgver"
cp -a "$_pkgname-$pkgver" "${_pkgname}2-$pkgver"
}

build() {
cd "SFlock-$pkgver"
cd "$_pkgname-$pkgver"

python setup.py build
python -m build --wheel --outdir="$startdir/dist"

cd "$srcdir/SFlock2-$pkgver"
cd "$srcdir/${_pkgname}2-$pkgver"

python2 setup.py build
}
Expand All @@ -36,7 +37,7 @@ package_python2-sflock() {
depends=('python2' 'python2-click' 'python2-olefile' 'python2-python-magic'
'python2-cryptography' 'peepdf')

cd "SFlock2-$pkgver"
cd "${_pkgname}2-$pkgver"

python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
Expand All @@ -48,9 +49,19 @@ package_python-sflock() {
depends=('python' 'python-click' 'python-olefile' 'python-python-magic'
'python-cryptography' 'peepdf')

cd "SFlock-$pkgver"
cd "$_pkgname-$pkgver"

python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
"$_pkgname"
}

52 changes: 23 additions & 29 deletions packages/python-user-agent/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,47 +1,41 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-user-agent
pkgname=('python2-user-agent' 'python-user-agent')
pkgname=python-user-agent
_pkgname=user_agent
pkgver=0.1.10
pkgrel=2
pkgrel=3
pkgdesc='User-Agent generator.'
arch=('any')
url='https://pypi.org/project/user_agent/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
makedepends=('python-build' 'python-pip')
depends=('python-six')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/user_agent-$pkgver.tar.gz")
sha512sums=('44331d2cbec7779c9370032c91027c634ab86cb886fdf631708d0a7457d23410910b51a6466b535dc5a14e4b55ddf15246b0e0d6cf3cc824b5162906bdad17a4')

prepare() {
cp -a "user_agent-$pkgver" "user_agent2-$pkgver"
}

build() {
cd "user_agent2-$pkgver"

python2 setup.py build

cd "$srcdir/user_agent-$pkgver"
cd "$_pkgname-$pkgver"

python setup.py build
python -m build --wheel --outdir="$startdir/dist"
}

package_python2-user-agent() {
depends=('python2-six')

cd "user_agent2-$pkgver"

python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
}

package_python-user-agent() {
depends=('python-six')

cd "user_agent-$pkgver"

python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
--skip-build
package() {

cd "$_pkgname-$pkgver"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
"$_pkgname"
}