6 |
MAGE_PYTHON_EXEC="python" |
MAGE_PYTHON_EXEC="python" |
7 |
|
|
8 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
9 |
>= dev-lang/python-2.7" |
>= dev-lang/python-3" |
10 |
fi |
fi |
11 |
|
|
12 |
# call meson include in the smage2, to prevent unnecessary dependencies |
# call meson include in the smage2, to prevent unnecessary dependencies |
27 |
mget-python-libdir() |
mget-python-libdir() |
28 |
{ |
{ |
29 |
local pylib |
local pylib |
30 |
pylib=$(${MAGE_PYTHON_EXEC} -c 'from distutils import sysconfig; print (sysconfig.get_python_lib())') |
pylib=$(${MAGE_PYTHON_EXEC} -c 'import sysconfig; print (sysconfig.get_path("platlib"))') |
31 |
[[ -z ${pylib} ]] && return 1 |
[[ -z ${pylib} ]] && return 1 |
32 |
echo "${pylib}" |
echo "${pylib}" |
33 |
return 0 |
return 0 |
36 |
mget-python-includedir() |
mget-python-includedir() |
37 |
{ |
{ |
38 |
local pyinc |
local pyinc |
39 |
pyinc=$(${MAGE_PYTHON_EXEC} -c 'from distutils import sysconfig; print (sysconfig.get_python_inc())') |
pyinc=$(${MAGE_PYTHON_EXEC} -c 'import sysconfig; print (sysconfig.get_path("platinclude"))') |
40 |
[[ -z ${pyinc} ]] && return 1 |
[[ -z ${pyinc} ]] && return 1 |
41 |
echo "${pyinc}" |
echo "${pyinc}" |
42 |
return 0 |
return 0 |
66 |
|
|
67 |
python_docompile() |
python_docompile() |
68 |
{ |
{ |
69 |
if [[ -e setup.py ]] |
if [[ -e pyproject.toml ]] |
70 |
|
then |
71 |
|
TMPDIR=${BUILDDIR} ${MAGE_PYTHON_EXEC} \ |
72 |
|
-m pip wheel --wheel-dir dist --no-build-isolation --no-deps --disable-pip-version-check \ |
73 |
|
--no-cache-dir --use-pep517 --no-clean ${PWD} || die |
74 |
|
elif [[ -e setup.py ]] |
75 |
then |
then |
76 |
${MAGE_PYTHON_EXEC} setup.py build $@ || die |
${MAGE_PYTHON_EXEC} setup.py build $@ || die |
77 |
elif [[ -e waf ]] |
elif [[ -e waf ]] |
104 |
|
|
105 |
python_doinstall() |
python_doinstall() |
106 |
{ |
{ |
107 |
if [[ -e setup.py ]] |
if [[ -e pyproject.toml ]] |
108 |
|
then |
109 |
|
TMPDIR=${BUILDDIR} ${MAGE_PYTHON_EXEC} \ |
110 |
|
-m pip install --root ${BINDIR} --no-index --no-deps --disable-pip-version-check \ |
111 |
|
--no-cache-dir --use-pep517 --ignore-installed --no-warn-script-location $(find dist -name \*.whl) || die |
112 |
|
elif [[ -e setup.py ]] |
113 |
then |
then |
114 |
${MAGE_PYTHON_EXEC} setup.py install --no-compile --root ${BINDIR} $@ || die |
${MAGE_PYTHON_EXEC} setup.py install --no-compile --root ${BINDIR} $@ || die |
115 |
elif [[ -e waf ]] |
elif [[ -e waf ]] |
165 |
|
|
166 |
local i |
local i |
167 |
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
168 |
FAQ LICENSE NEWS README TODO |
FAQ LICENSE NEWS README* TODO PKG-INFO |
169 |
do |
do |
170 |
if [ -f ${SRCDIR}/${i} ] |
if [ -f ${SRCDIR}/${i} ] |
171 |
then |
then |
187 |
|
|
188 |
local i |
local i |
189 |
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
190 |
FAQ LICENSE NEWS README TODO |
FAQ LICENSE NEWS README* TODO PKG-INFO |
191 |
do |
do |
192 |
if [ -f ${SRCDIR}/${i} ] |
if [ -f ${SRCDIR}/${i} ] |
193 |
then |
then |