Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X: building with X11 Tkinter #45925

Closed
ceball mannequin opened this issue Dec 11, 2007 · 16 comments
Closed

Mac OS X: building with X11 Tkinter #45925

ceball mannequin opened this issue Dec 11, 2007 · 16 comments
Assignees
Labels
build The build process and cross-build topic-tkinter type-feature A feature request or enhancement

Comments

@ceball
Copy link
Mannequin

ceball mannequin commented Dec 11, 2007

BPO 1584
Nosy @birkenfeld, @ronaldoussoren, @tiran, @ned-deily, @asvetlov
Files
  • issue1584_rev0.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ned-deily'
    closed_at = <Date 2013-10-25.07:59:53.080>
    created_at = <Date 2007-12-11.04:04:58.507>
    labels = ['type-feature', 'expert-tkinter', 'build']
    title = 'Mac OS X: building with X11 Tkinter'
    updated_at = <Date 2013-10-25.07:59:53.078>
    user = 'https://bugs.python.org/ceball'

    bugs.python.org fields:

    activity = <Date 2013-10-25.07:59:53.078>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2013-10-25.07:59:53.080>
    closer = 'ned.deily'
    components = ['Build', 'Tkinter']
    creation = <Date 2007-12-11.04:04:58.507>
    creator = 'ceball'
    dependencies = []
    files = ['31600']
    hgrepos = []
    issue_num = 1584
    keywords = ['patch']
    message_count = 16.0
    messages = ['58413', '58421', '58439', '58479', '84476', '84562', '116800', '116922', '157438', '157441', '157442', '178933', '196987', '197054', '201221', '201222']
    nosy_count = 8.0
    nosy_names = ['georg.brandl', 'ronaldoussoren', 'christian.heimes', 'ceball', 'ned.deily', 'asvetlov', 'samueljohn', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1584'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @ceball
    Copy link
    Mannequin Author

    ceball mannequin commented Dec 11, 2007

    On OS X, I wanted to build my own copy of Python that used my own copy
    of Tkinter (built for X11).

    To do this, I passed "LDFLAGS=-rpath,/path/to/lib" to configure so that
    Python could find my specific lib files, but I also had to edit Python's
    setup.py so that detect_tkinter() would not do anything special for Darwin:

    $ diff setup.py original_setup.py 
    1199c1199
    <         if 0 and (platform == 'darwin' and

        if (platform == 'darwin' and
    

    I did this based on a post by Ronald Oussoren to the Python-SIG Mac
    mailing list [http://article.gmane.org/gmane.comp.python.apple/14008].
    He also suggested that I file a bug report, asking for an argument to be
    added to python's configure script to avoid having to edit setup.py.

    Thanks

    @ceball ceball mannequin added type-bug An unexpected behavior, bug, or error OS-mac build The build process and cross-build topic-tkinter labels Dec 11, 2007
    @tiran
    Copy link
    Member

    tiran commented Dec 11, 2007

    The problem is already fixed in svn. Can you download a svn checkout and
    verify it that the code is working?

    41848 skip.montanaro if (platform == 'darwin' and

    @birkenfeld
    Copy link
    Member

    Crys: look closely at the diff, the "0 and " is in the modified file.

    @ceball
    Copy link
    Mannequin Author

    ceball mannequin commented Dec 12, 2007

    I apologize for the confusion: I put the modified file first and the
    original second.

    Sorry about that!

    An option to do nothing special to find Tk and Tcl on darwin is what
    would be useful.

    @bitdancer
    Copy link
    Member

    Reopening since additional feedback was provided clarifying the request.

    How does this request interact with the business about building the Mac
    installer with a local tk installed? Does the fact that that does
    something useful mean that this request is in fact out of date? Looking
    at the setup.py comments, I suspect not.

    @bitdancer bitdancer added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Mar 30, 2009
    @ronaldoussoren
    Copy link
    Contributor

    Adding support for building an X11 version of Tkinter would require an
    explicit flag to configure, defaulting to a build that uses AquaTk (which
    most people would like to use).

    I'm not interested in creating a patch for this, but am willing to review
    patches for this.

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Sep 18, 2010

    This will go nowhere unless someone supplies a patch.

    @ceball
    Copy link
    Mannequin Author

    ceball mannequin commented Sep 20, 2010

    Sorry, I don't have a Mac, and I don't have access to one that I could use to make a patch.

    At the time, I was trying to support OS X users of a piece of Python/Tkinter software. Please do not keep this issue open on my account.

    Thanks,
    Chris

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Apr 3, 2012

    Is there actual?

    @ned-deily
    Copy link
    Member

    It certainly is still possible to patch current Pythons to build with the X11 Tk 8.5 on OS X. For example, the current MacPorts Python ports use an X11 Tk 8.5. Considering all the issues that have arisen with the other Tcl/Tk implementations on OS X (i.e. Cocoa Tk and Carbon Tk), I think it would be useful to provide better support for choosing which to build with. I'll take a look at this as a possible feature.

    @ned-deily ned-deily self-assigned this Apr 3, 2012
    @asvetlov
    Copy link
    Contributor

    asvetlov commented Apr 3, 2012

    Thank you, Ned.

    @samueljohn
    Copy link
    Mannequin

    samueljohn mannequin commented Jan 3, 2013

    Hello from Homebrew (Mac)!

    Indeed we also patch setup.py (but right now only for python2.7) and uncommented the "detect_tkinter_darwin" related lines to support linking against a Tkinter build with homebrew (optionally with X11 support).

    (Our patch: https://github.com/mxcl/homebrew/pull/16626/files#L0R270)

    I agree that an option to tell setup.py to use another Tk would be much appreciated.

    @ned-deily
    Copy link
    Member

    Here's a patch. It is simple-minded but I think it should be powerful enough for advanced users to build with non-default Tcl and Tk libraries without having to modify the source. It adds two new options to configure; if used, both must be specified:

    ./configure \
    --with-tcltk-includes="-I/opt/local/include" \
    --with-tcltk-libs="-L/opt/local/lib -ltcl8.5 -ltk8.5"

    The values are passed into the top-level setup.py and override the default searches and values for include_dirs and libraries when building _tkinter.so.

    In addition, the options can be overridden with make. This can be useful when testing tkinter with different versions of Tcl/Tk:

    ./configure
    make
    make test # test with platform default Tcl/Tk
    ( cd ./build/lib.xx && mv _tkinter.so _tkinter.so.default )
    make \
    TCLTK_INCLUDES="-I/opt/local/include" \
    TCLTK_LIBS="-L/opt/local/lib -ltcl8.6 -ltk8.6"
    make test # test with another version of Tcl/Tk

    I have some more testing to do on other platforms but, unless there are major objections, I intend to commit this soon for use with bpo-15663.

    @ned-deily ned-deily removed the OS-mac label Sep 5, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 6, 2013

    New changeset 0986e4f5750d by Ned Deily in branch 'default':
    Issue bpo-1584: Provide options to override default search paths for Tcl and Tk
    http://hg.python.org/cpython/rev/0986e4f5750d

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 25, 2013

    New changeset e7474d4d85ca by Ned Deily in branch '2.7':
    Issue bpo-1584: Provide options to override default search paths for Tcl and Tk
    http://hg.python.org/cpython/rev/e7474d4d85ca

    New changeset d7662958b27a by Ned Deily in branch '3.3':
    Issue bpo-1584: Provide options to override default search paths for Tcl and Tk
    http://hg.python.org/cpython/rev/d7662958b27a

    @ned-deily
    Copy link
    Member

    Committed to default for release in 3.4.0. With the consent of the release managers, this change has been backported to 2.7 (for release in 2.7.6) and 3.3 (for 3.3.3) in support of bpo-15663.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build topic-tkinter type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants