ahmedfgad / GeneticAlgorithmPython

Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
https://pygad.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.89k stars 465 forks source link

pygad and mingw #200

Closed 3rav closed 1 year ago

3rav commented 1 year ago

I try to add pygad as a package to mingw repo with this PKGBUILD file:

_realname=pygad
_realname2=GeneticAlgorithmPython
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=3.0.1
pkgrel=1
pkgdesc="A Python 3 Library for Building the Genetic Algorithm and Training Machine Learning Algoithms (mingw64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://github.com/cjekel/similarity_measures"
depends=("${MINGW_PACKAGE_PREFIX}-python"
         "${MINGW_PACKAGE_PREFIX}-python-cloudpickle"
         "${MINGW_PACKAGE_PREFIX}-python-numpy"
         "${MINGW_PACKAGE_PREFIX}-python-matplotlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
             "${MINGW_PACKAGE_PREFIX}-python-installer"
             "${MINGW_PACKAGE_PREFIX}-python-setuptools"
             "${MINGW_PACKAGE_PREFIX}-python-wheel"
             "${MINGW_PACKAGE_PREFIX}-cc")
license=('spdx:BSD')
source=("https://github.com/ahmedfgad/GeneticAlgorithmPython/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('7E4260253A99589866DAEC8654E83EBF8DB1353F59A392199422CEABE66E2171')

prepare() {
  rm -rf python-build-${MSYSTEM} | true
  cp -r "${_realname2}-${pkgver}" "python-build-${MSYSTEM}"
}

build() {
  cd "${srcdir}/python-build-${MSYSTEM}"
  ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${srcdir}/python-build-${MSYSTEM}"

  MSYS2_ARG_CONV_EXCL="--prefix=" \
    ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
    --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}

but package contains only: LICENSE in shared folder

and in lib: LICENSE METADATA RECORD top_level WHEEL

==> Starting build()...
* Building wheel...
running bdist_wheel
running build
installing to build/bdist.mingw_x86_64/wheel
running install
running install_egg_info
running egg_info
writing pygad.egg-info/PKG-INFO
writing dependency_links to pygad.egg-info/dependency_links.txt
writing requirements to pygad.egg-info/requires.txt
writing top-level names to pygad.egg-info/top_level.txt
reading manifest file 'pygad.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'pygad.egg-info/SOURCES.txt'
Copying pygad.egg-info to build/bdist.mingw_x86_64/wheel/./pygad-3.0.0-py3.10.egg-info
running install_scripts
creating build/bdist.mingw_x86_64/wheel/pygad-3.0.0.dist-info/WHEEL
creating 'C:/msys64/usr/local/pkg_pygad/src/python-build-MINGW64/dist/.tmp-wg1yzr21/pygad-3.0.
0-py3-none-any.whl' and adding 'build/bdist.mingw_x86_64/wheel' to it
adding 'pygad-3.0.0.dist-info/LICENSE'
adding 'pygad-3.0.0.dist-info/METADATA'
adding 'pygad-3.0.0.dist-info/WHEEL'
adding 'pygad-3.0.0.dist-info/top_level.txt'
adding 'pygad-3.0.0.dist-info/RECORD'
removing build/bdist.mingw_x86_64/wheel
Successfully built pygad-3.0.0-py3-none-any.whl
3rav commented 1 year ago

https://github.com/msys2/MINGW-packages/pull/17395