Skip to content

Instantly share code, notes, and snippets.

@dllud
Created July 12, 2024 12:03
Show Gist options
  • Save dllud/d301640a88abf7d736344243c45ecfcc to your computer and use it in GitHub Desktop.
Save dllud/d301640a88abf7d736344243c45ecfcc to your computer and use it in GitHub Desktop.
python-curl-cffi PKGBUILD
# Maintainer: Matthew Sexton <mssxtn@gmail.com>
# Contributor: Nebulosa <nebulosa2007-at-yandex-dot-ru>
# Contributor: dllud <dllud riseup net>
pkgname=python-curl-cffi
_name=curl_cffi
pkgver=0.5.10
pkgrel=2
pkgdesc="Python binding for curl-impersonate via CFFI"
arch=(x86_64)
url="https://github.com/yifeikong/${_name}"
license=(MIT)
depends=(
ca-certificates
libcurl-impersonate-chrome
python-cffi
python-gevent
python-eventlet
)
makedepends=(
gcc13
python-build
python-installer
python-setuptools
python-wheel
)
options=(!debug)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
b2sums=('6b1f07304bba3509814d23deb19c582513d91df1b17f8d24c5243f87b40c2cfa8465de34635323e940577e05f1924e78c4ed9dcf1f1a7161928d7cfd34af28ba')
build() {
cd "${_name}-$pkgver"
#Fix for gcc
export CC=gcc-13
export CXX=g++-13
python -m build --wheel --no-isolation
}
package() {
cd "${_name}-$pkgver"
python -m installer --destdir="$pkgdir" dist/*.whl
install -vDm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
# Fix certificates
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
ln -s /etc/ca-certificates/extracted/tls-ca-bundle.pem "${pkgdir}/usr/lib/python${python_version}/site-packages/curl_cffi/cacert.pem"
}
@Samy879
Copy link

Samy879 commented Aug 3, 2024

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment