summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e203660b503d8ec8df7c4bf5c0aee4c10949e787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: envolution
# Contributor: Self Denial <selfdenial@pm.me>
# Contributor: Brian Thompson <brianrobt@pm.me>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Roberto Alsina <ralsina@kde.org>
# Contributor: Julien Duponchelle <julien@gns3.net>

pkgname=python-cx-freeze
pkgver=7.2.7
pkgrel=1
pkgdesc='Create standalone executables from Python scripts'
arch=('x86_64')
url='https://marcelotduarte.github.io/cx_Freeze'
license=('PSF-2.0')
depends=('glibc' 'patchelf' 'python' 'python-packaging' 'python-setuptools' 'python-filelock' 'python-pyqt6')
makedepends=('python-wheel' 'python-build' 'python-installer')
checkdepends=('python-pytest-mock' 'python-pytest-xdist' 'python-pytest-datafiles' 'python-pytest')
optdepends=('perl-alien-build: Alien support for rpm, dpkg, stampede slp, and slackware tgz file formats'
            'rpm-tools: RPM Package Manager RPM.org support')
replaces=('python-cx_freeze')
provides=('python-cx_freeze')
conflicts=('python-cx_freeze')
source=("https://github.com/marcelotduarte/cx_Freeze/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('0c6a1173eae6e25309491282f156aac4a9dd8163f45f7508f9c220ac5152b167ec9b32a7180886f9e545f3c549b4f2074e917dc0a3ab1ad334c5d0fcb0f0f923')

prepare() {
  sed -e 's|75|80|g' -i cx_Freeze-$pkgver/pyproject.toml # Support setuptools 75
  sed -e '/patchelf/d' -i cx_Freeze-$pkgver/pyproject.toml # don't require patchelf pip module
}

build() {
  cd cx_Freeze-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  echo "Removing the following directory for a clean install: $PWD/cx_Freeze-$pkgver/test_dir"
  rm -rf cx_Freeze-$pkgver/test_dir
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

  cd cx_Freeze-$pkgver
  python -m installer --destdir=test_dir dist/*.whl
  export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
  unset SOURCE_DATE_EPOCH # Workaround for 'FATAL ERROR:SOURCE_DATE_EPOCH' (see https://github.com/AppImage/AppImageKit/issues/1202)
  pytest -vv -k 'not pandas and not deb and not rpm' # Since deb and rpm are optional, disable testing
}

package() {
  cd cx_Freeze-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}