-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
PKGBUILD
58 lines (52 loc) · 2.12 KB
/
PKGBUILD
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
56
57
58
# Maintainer: Sebastian Ehlert <awvwgk@disroot.org>
_pyname=fprettify
_realname=${_pyname}
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=0.3.7
pkgrel=4
pkgdesc="An auto-formatter for modern Fortran code that imposes strict whitespace formatting, written in Python (mingw-w64)"
url="https://github.com/pseewald/fprettify"
license=('spdx:GPL-3.0-or-later')
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
'pypi: fprettify'
'aur: fprettify'
)
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-configargparse")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
"unzip")
source=("${_realname}-${pkgver}.zip::https://github.com/pseewald/${_realname}/archive/v${pkgver}.zip")
sha256sums=('1dcd817ecb2cdb13ef10403810f861c79694b29d1ecab142642341c55226c076')
noextract=("${_realname}-${pkgver}.zip")
#sha256sums=('052da19a9080a6641d3202e10572cf3d978e6bcc0e7db29c1eb8ba724e89adc7')
#noextract=("${_realname}-${pkgver}.tar.gz")
prepare() {
cd ${srcdir}
# # Symlinks require manual intervention
# tar zxf "${srcdir}/${_realname}-${pkgver}.tar.gz" || true
# MSYS=winsymlinks:lnk tar zxf "${srcdir}/${_realname}-${pkgver}.tar.gz"
# for i in examples/example_before.f90 examples/example_after.f90 hook.yaml; do
# test -f "${_realname}-${pkgver}/$i" && rm "${_realname}-${pkgver}/$i"
# done
unzip "${srcdir}/${_realname}-${pkgver}.zip"
rm -rf python-build-${CARCH} | true
cp -r "${_realname}-${pkgver}" "python-build-${CARCH}"
}
build() {
msg "Python build for ${CARCH}"
cd "${srcdir}/python-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py build
}
package() {
cd "${srcdir}/python-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 --skip-build
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do
# Remove shebang line
sed -e '1 { s/^#!.*$// }' -i "${_f}"
done
}