Enzhen Huang | 21b3503 | 2021-07-08 09:03:37 -0700 | [diff] [blame] | 1 | # Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website> |
| 2 | |
| 3 | _realname=manim |
| 4 | pkgbase=mingw-w64-${_realname} |
| 5 | pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") |
| 6 | pkgver=0.7.0 |
| 7 | pkgrel=1 |
| 8 | pkgdesc="Animation engine for explanatory math videos (community edition) (mingw-w64)" |
| 9 | arch=('any') |
| 10 | mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') |
| 11 | url='https://www.manim.community' |
| 12 | license=('MIT' 'custom') |
| 13 | depends=( |
| 14 | "${MINGW_PACKAGE_PREFIX}-python" |
| 15 | "${MINGW_PACKAGE_PREFIX}-ffmpeg" |
| 16 | "${MINGW_PACKAGE_PREFIX}-python-click" |
| 17 | "${MINGW_PACKAGE_PREFIX}-python-click-default-group" |
| 18 | "${MINGW_PACKAGE_PREFIX}-python-colour" |
| 19 | "${MINGW_PACKAGE_PREFIX}-python-numpy" |
| 20 | "${MINGW_PACKAGE_PREFIX}-python-pillow" |
| 21 | "${MINGW_PACKAGE_PREFIX}-python-scipy" |
| 22 | "${MINGW_PACKAGE_PREFIX}-python-tqdm" |
| 23 | "${MINGW_PACKAGE_PREFIX}-python-pydub" |
| 24 | "${MINGW_PACKAGE_PREFIX}-python-pygments" |
| 25 | "${MINGW_PACKAGE_PREFIX}-python-rich" |
| 26 | "${MINGW_PACKAGE_PREFIX}-python-cairo" |
| 27 | "${MINGW_PACKAGE_PREFIX}-python-manimpango" |
| 28 | "${MINGW_PACKAGE_PREFIX}-python-networkx" |
| 29 | "${MINGW_PACKAGE_PREFIX}-python-decorator" |
| 30 | "${MINGW_PACKAGE_PREFIX}-python-setuptools" |
| 31 | "${MINGW_PACKAGE_PREFIX}-python-watchdog" |
| 32 | "${MINGW_PACKAGE_PREFIX}-python-moderngl" |
| 33 | "${MINGW_PACKAGE_PREFIX}-python-moderngl-window" |
| 34 | "${MINGW_PACKAGE_PREFIX}-mapbox-earcut" |
| 35 | "${MINGW_PACKAGE_PREFIX}-python-cloup" |
| 36 | "${MINGW_PACKAGE_PREFIX}-python-requests" |
| 37 | ) |
| 38 | optdepends=("${MINGW_PACKAGE_PREFIX}-texlive-scheme-medium: For LaTeX support") |
| 39 | makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools") |
| 40 | source=( |
| 41 | "${_realname}-${pkgver}.tar.gz"::"https://github.com/ManimCommunity/${_realname}/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz") # from https://github.com/ManimCommunity/manim/pull/1567 |
| 42 | sha512sums=('2c9c939c8771b3f48583295d63e230f7db89f8a4f6b5d97d3afec8eb295df7e9b5035be6b2e0c1bf0db9f9a14257f0ad86d48c25ab3d24e6600437f708c4641f') |
| 43 | |
| 44 | prepare() { |
| 45 | rm -rf python-build-${CARCH} | true |
| 46 | cp -r "${_realname}-${pkgver}" "python-build-${CARCH}" |
| 47 | cd "python-build-${CARCH}" |
| 48 | sed -i 's/rich>=6.0,<7.0/rich/' setup.py |
| 49 | sed -i 's/decorator<5.0.0/decorator/' setup.py |
| 50 | sed -i 's/click>=7.1,<8.0/click/' setup.py |
| 51 | sed -i 's/manimpango>=0.2.4,<0.3.0/manimpango/' setup.py |
| 52 | } |
| 53 | |
| 54 | build() { |
| 55 | msg "Python build for ${CARCH}" |
| 56 | cd "${srcdir}/python-build-${CARCH}" |
| 57 | ${MINGW_PREFIX}/bin/python setup.py build |
| 58 | } |
| 59 | |
| 60 | package() { |
| 61 | cd "${srcdir}/python-build-${CARCH}" |
| 62 | MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ |
| 63 | ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \ |
| 64 | --root="${pkgdir}" --optimize=1 --skip-build |
| 65 | |
| 66 | local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) |
| 67 | # fix python command in files |
| 68 | for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do |
| 69 | sed -i 's/\#\!.*//' $_f |
| 70 | done |
| 71 | |
| 72 | install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" |
| 73 | install -Dm644 LICENSE.community "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.community" |
| 74 | } |