update python setuptools PKGBUILD template.

* Update sed command to blank out shebang line.
 - Restricted to *-script.py, as that convention is used by the launcher.
* Remove now unneeded install scripts
* Minor fixes.
This commit is contained in:
Jeremy Drake 2021-03-09 11:07:28 -08:00
parent 80ed8c6b6f
commit 3fc57c0c77
5 changed files with 5 additions and 76 deletions

View File

@ -16,14 +16,13 @@ validpgpkeys=('gpg_KEY')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
install=${_realname}-${CARCH}.install
options=('staticlibs' 'strip' '!debug')
#Ideally, you should download the sources from github or some other place besides
#pypi, but that ideal is not always possible.
_dtoken='aa/aa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
#Some Python packages software might use this instead
#source=("https://pypi.python.org/packages/source/[first letter of the packages]/${_realname}/${_realname}-${pkgver}.tar.gz")
@_dtoken would be the part of the URL between the /package and filename.
#_dtoken would be the part of the URL between the /package and filename.
# I did this to make it so you could just update the token to a new version instead of the complete
# download URL.
source=("https://pypi.python.org/packages/${_dtoken}/${_realname}-${pkgver}.tar.gz"
@ -59,7 +58,7 @@ prepare() {
0002-A-less-important-fix.patch
popd
rm -rf python-build-${CARCH} | true
rm -rf python-build-${CARCH} || true
cp -r "${_realname}-${pkgver}" "python-build-${CARCH}"
# Set version for setuptools_scm
@ -93,11 +92,9 @@ package() {
# This entire section should be removed if the package does NOT install
# anything in the /mingw*/bin directory.
### begin section ###
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|/usr/bin/env |${MINGW_PREFIX}|g" \
-e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
# remove shebang line
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do
sed -e '1 { s/^#!.*$// }' -i ${_f}
done
#### end section ####
}

View File

@ -1,17 +0,0 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
# "somepackage" should be replaced with the name of your .EXE w/o 2 and .exe ext
# Like this:
# For "myexe2.exe", it would be "myexe2" .
for _it in somepackage2; do
sed -e "s|/mingw32|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@ -1,17 +0,0 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
# "somepackage" should be replaced with the name of your .EXE w/o 2 and .exe ext
# Like this:
# For "myexe2.exe", it would be "myexe2" .
for _it in somepackage2; do
sed -e "s|/mingw64|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@ -1,17 +0,0 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
# "somepackage" should be replaced with the name of your .EXE w/o 2 and .exe ext
# Like this:
# For "myexe.exe", it would be "myexe" .
for _it in somepackage; do
sed -e "s|/mingw32|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@ -1,17 +0,0 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
# "somepackage" should be replaced with the name of your .EXE w/o 2 and .exe ext
# Like this:
# For "myexe.exe", it would be "myexe" .
for _it in somepackage; do
sed -e "s|/mingw64|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}