Create mac-build-intel.sh#1222
Conversation
How to build App on macOS with intel chip. App does work, but DMG not.
Use: pip install ".[gui]" Not: pip install .[gui] This will issue shell errors
Typo? 19 MAY -> 29. MAY
|
This is good to have, thank you. A few suggestions:
|
|
General questions:
You can now access https://flagsoft.com/public/ptxprint directly.
mac-build.sh - is not from me. So I think this is used to build the macOS Apple silicon chip version?
How then? If someone builds from source we must clone the whole thing. HEAD-version the so called bleeding edge version / latest nightly build. and with TAGs a specific version, for example 3.0.31.
As for now, only the .app file works. Do .DMG install image. Don't know why.
No. I did not touch mac-build.sh. Instead created a new mac-intel-build.sh with instructions. |
|
My new script can now build the .app autonomous. Just put this script mac-build-intel.sh inside your main folder. So you can just download a release ZIP file, unzip it, and put this script in main folder, and run it with https://github.com/flagsoft/ptx2pdf/blob/master/mac-build-intel.sh Maybe the user still needs to do Important NOTE after downloading .app file Remove the attribute and you can launch the application. So after download: open a console and type: After that you can run the App as usual. You must Install XeTeX separately This will install XeTeX with binaries: |
|
So with this bild script I was able to compile some versions and create an App for macOS with Intel Chip. |
|
No, it is as it always was/is. Just a script which builds an .app within ./dist
NO! See existing mac-build.ch it just builds an .app within your existing ./dist sub-folder as it should exactly as with building your .dmg MY top level ./distribution folder is JUST my privat folder. |
|
Step by step Instruction - How to build PTXprint on macOS with intel chip I think best is: Just ignore or revert, cancel my push request if possible. Just create ONE new file on your repository ("mac-build-intel.sh") ist MUST be within your TOP folder as existing mac-build.sh. Just copy my script mac-build-intel.sh by creating a new file on your repository in your top folder and put the contents there, as it was and still is with your existing mac-build.ch script. That's all, your are set and ready to go!
This can be easily integrated in automated build systems. Will build down to version PTXprint Version 2.8.5. WITHOUT any change on your source code. Very little patch is within the build script ON-THE-FLY. At the end, you will have a up-and-running .app file. But user must install TeTeX locally with well known and widely used BREW (install missing packages on macOS) as described in documentation, which is easy to do. |
|
OK so we are getting there. As you say, let's go with a single top level script and if you want to add something to docs/dev to point people to your github repo, you can. In such an md can I recommend you tell them to run your script rather than giving them a script to hand execute, and then tell them how to appropriate the results. I notice that your script patches various files. Please don't do that. Instead let's fix the code so that it works for you. I have added the GtkSource version requirement. I'm unsure about the import gi; gi.require_version('Gtk', 3.0) in main. I certainly don't want it right at the top because we work very hard to allow ptxprint to run headless without pulling in anything from Gtk. How about around line 502 where the code imports stuff from gtkview, etc.? I would entertain such a change in this PR, but it will take a bit of testing from you to ensure we have the necessary changes to the code correct. If it's easier for you, feel free to start a new PR. |
Ok.
Just 2 files. The problem seems to be about Gtk Version mix. Fix: Prevent Gtk Version mix. I think BEST would be that you do the testing IF such code goes directly in the main source. I can not test Windows + Linux by myself. Required changes:For macOS (and Windows?, and Linux? I DO NOT know that.) This will prevent the CRASH: These 2 changes makes sure it loads ONLY version 3 of Gtk. I know that if we do that change to make sure it loads Gtk 3.0 and it does not mix with Gtk 4.x or whatever, then it worked. (GUI is loading) One can test this do start the app, it should load. Test TeTeX usage: Better would be: PTXprint need to have a SETUP screen for where it can find TeTeX. |
|
Please stop just copying Claude and read what I wrote. I will not accept a
patch like this to the start of main.py.
…On Fri, 12 Jun 2026, 14:03 Michael, ***@***.***> wrote:
*flagsoft* left a comment (sillsdev/ptx2pdf#1222)
<#1222 (comment)>
OK so we are getting there. As you say, let's go with a single top level
script and if you want to add something to docs/dev to point people to your
github repo, you can. In such an md can I recommend you tell them to run
your script rather than giving them a script to hand execute, and then tell
them how to appropriate the results.
Ok.
I notice that your script patches various files. Please don't do that.
Instead let's fix the code so that it works for you. I have added the
GtkSource version requirement. I'm unsure about the import gi;
gi.require_version('Gtk', 3.0) in main. I certainly don't want it right at
the top because we work very hard to allow ptxprint to run headless without
pulling in anything from Gtk. How about around line 502 where the code
imports stuff from gtkview, etc.?
I would entertain such a change in this PR, but it will take a bit of
testing from you to ensure we have the necessary changes to the code
correct.
If it's easier for you, feel free to start a new PR.
Just 2 files.
I'm very very cautions to change main source... because you never know
what happens to build with Windows + Linux...
-> I think it's best you change it and make sure it works on Windows +
Linux ? (I can't)
The problem seems to be about Gtk Version mix. Fix: Prevent Gtk Version
mix.
I think BEST would be that you do the testing IF such code goes directly
in the main source.
I can not test Windows + Linux by myself.
I do not know for sure where to put such things about Gtk to make sure it
will work on any platform.
Required changes:
For macOS (and Windows?, and Linux? I DO NOT know that.)
# main.py:
import gi
gi.require_version('Gtk', '3.0')
# gtkview.py add about on top:
gi.require_version('GtkSource', '3.0')
gi.require_version('Gtk', '3.0')
This will prevent the CRASH:
## [PYI-14051:ERROR] Failed to execute script 'ptxprint' due to unhandled exception: gtk-builder-error-quark: .:15738:56 Invalid object type 'GtkSourceBuffer' (6)
These 2 changes makes sure it loads ONLY version 3 of Gtk.
I know that if we do that change to make sure it loads Gtk 3.0 and it does
not mix with Gtk 4.x or whatever, then it worked. (GUI is loading)
One can test this do start the app, it should load.
Test TeTeX usage:
It should load the font-pannel and will be able to create PDFs.
If it does not: it will show blank white space instead of font list. if
TeTeX is not working.
Better would be: PTXprint need to have a SETUP screen for where it can
find TeTeX.
—
Reply to this email directly, view it on GitHub
<#1222?email_source=notifications&email_token=ABLMO3IWTRO7RT4PSEQCTKD47OTKTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRYHAZTAMRZGQ42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4688302949>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLMO3K3DVNLAT4W6TQBVHL47OTKTAVCNFSNUABFKJSXA33TNF2G64TZHMYTQOJVGIYDCNRQHNEXG43VMU5TINJUGEYDCMJQGY2KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ABLMO3N2NFXHBKRII7MLFYL47OTKTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRYHAZTAMRZGQ42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/ABLMO3LXOIVU53CWAGUUXFD47OTKTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRYHAZTAMRZGQ42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
|
This is getting complicated. Then try it yourself. Put it where you think it should be. I can not test it for Windows + Linux + macOS and make sure it works everywhere. Else I can not help. You have any information about how to make a up and running .app for macOS with intel chip right now. |
|
BTW: I do not use AI, Claude etc. It's best you put where ever you think the patch should go, this was also the initial idea, but I'm not familiar with your Gtk setup. One must check for side effects. I can do a test on my macOS with Intel chip - after main source has changed. |
How to build App on macOS with intel chip.
App does work, but DMG not.