mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-19 19:59:43 +00:00
- Fix building with python3*
- Use checksum file under lang/python${PYTHON_SUFFIX}/, for removal lang/python/distinfo PR: ports/136198 Submitted by: lwhsu Approved by: perky
This commit is contained in:
parent
c240b6cc9f
commit
b50a93688f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=237414
@ -25,9 +25,15 @@ PYDISTUTILS_PKGNAME= Tkinter
|
||||
PYDISTUTILS_PKGVERSION= 0.0.0
|
||||
USE_TK= 82+
|
||||
WRKSRC= ${PYTHON_WRKSRC}/Modules
|
||||
MD5_FILE= ${PORTSDIR}/lang/python/distinfo
|
||||
MD5_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
post-extract:
|
||||
.if ${PYTHON_REL} < 300
|
||||
@${SED} -e "s|%%TK_VER%%|${TK_VER}|" ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
|
||||
.else
|
||||
@${SED} -e "s|%%TK_VER%%|${TK_VER}|" ${FILESDIR}/setup3.py > ${WRKSRC}/setup.py
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
.include <bsd.port.post.mk>
|
||||
|
40
x11-toolkits/py-tkinter/files/setup3.py
Normal file
40
x11-toolkits/py-tkinter/files/setup3.py
Normal file
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python
|
||||
# To use:
|
||||
# python setup.py install
|
||||
#
|
||||
|
||||
__version__ = "$FreeBSD$"
|
||||
|
||||
import os, string
|
||||
|
||||
try:
|
||||
import distutils
|
||||
from distutils import sysconfig
|
||||
from distutils.command.install import install
|
||||
from distutils.core import setup, Extension
|
||||
except:
|
||||
raise SystemExit("Distutils problem")
|
||||
|
||||
tkversion = "%%TK_VER%%"
|
||||
prefix = sysconfig.PREFIX
|
||||
# Python 1.5 doesn't have os.getenv()?
|
||||
x11base = os.environ['LOCALBASE'] or '/usr/X11R6'
|
||||
inc_dirs = [prefix + "/include",
|
||||
prefix + "/include/tcl" + tkversion,
|
||||
prefix + "/include/tk" + tkversion,
|
||||
x11base + "/include"]
|
||||
lib_dirs = [prefix + "/lib", x11base + "/lib"]
|
||||
# use string.replace() for the benefit of Python 1.5 users
|
||||
libs = ["tcl" + tkversion.replace(".", ""),
|
||||
"tk" + tkversion.replace(".", ""),
|
||||
"X11"]
|
||||
|
||||
setup(name = "Tkinter",
|
||||
description = "Tk Extension to Python",
|
||||
|
||||
ext_modules = [Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||
define_macros=[('WITH_APPINIT', 1)],
|
||||
include_dirs = inc_dirs,
|
||||
libraries = libs,
|
||||
library_dirs = lib_dirs)]
|
||||
)
|
Loading…
Reference in New Issue
Block a user