-
Notifications
You must be signed in to change notification settings - Fork 346
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
Finalize extra packing for macOS bundle #1918
Conversation
This PR finalizes how cpack works on macOS under MacPorts. IT would be good if @seisman on brew could Temporarily set GMT_PUBLIC_RELEASE true In top gmt-dev directory, run admin/build-rehease.sh Make sure the bundle still works. Maybe he and I should exchange bundles to make sure they run on systems with a different distro.
For homebrew, all the commands are located in
|
So given my gs was copied as an existing symlink, we will need the build-macos*.sh script to replace links with the real thing. I see in bash, -L checks if a link, so then we need to do something like
Better suggestions? |
Google says use readlink. So we use readlink in that loop. |
|
Do you always get those ..? What if you run the readlink from another directory? |
Nothing changes. |
So if we do this in the loop and /usr/local/bin/gs becomes ../Cellar/..., will cpack find things? Or do we need to replace the .. with the actual directory? |
I find |
OK, I can do that too. Perhaps that is the safest? And we document somewhere in admin that macOS maintainers will need that package? |
I got this mesage:
can you use grealpath? |
One more complications. If I blindly do this on all links, I get
and no gs. So for macports, need to preserve that gs link. So your gs is the executable? |
I am modifying the script a bit and making three sets:
Do I need a check on Macports vs HomeBrew to make changes here? The EXELINKS will just let which tell us the path, but the other two will go through a greadpath step. |
Please see if just running this produces acceptable output, i.e. bash build-macos-external-list.sh |
This is what I get:
For me, both gs and gsc are executables, but gs is 13 M and gsc is only 9 Kb. |
OK, looks reasonable to me, I guess you can try to run the whole thing: Set the GMT_PUBLIC_RELEASE to true and try bash admin/build-release.sh and see if it works or not. |
Nope, |
But /opt/local/bin/gs is a symlink for me and it copes that in as a link. |
|
OK, not so good. I added $distro as a variable. Perhaps you can play with this by maybe removing the gs and adding it specially as a link to gsc in that same directory? |
If your actual gs is 13 Mb (in Cellar) while gsc is only 9kB then that seems opposite to what I have (gsc is the program, gs is a link). Very odd. |
Tried your DMG file.
|
Right. So party can be solved by setting GS_LIB to point to it, but of course there is the entirety of /opt/local/share/ghostscript. So would have to add that entire directory into our bundles share directory and have the init set GS_LIB. I also have /opt/local/share/GraphicsMagick-1.3.33. GDAL I think we already have, and there is nothing about ffmpeg. I will try this. |
Probably, but @seisman says he has built the bundle under brew and got stuff like netcdf included. I am building gs 9.50 from source now, under macports, and will try to build a bundle with everything. |
So building with port now does not include netcdf either. Apart from the 58 shared libs that build-macos-external-list.sh found, cpack only added the gmt and postscript libs, the gmt plugin dir. No netcdf, pcre, etc. Maybe an error happened. Also, would like to build gs without X11 but it adds Z11 libs now. |
Well, excluding the macos list and building the bundle as I ahve done for years now yields no siupporting shared libraries. I wonder if it gets confused with both brew and macport files and does nothing. |
So after removing brew completely, rebooting, and redoing the build-release.sh step, the bundle still has no shared libraries beyond gmt and postscriptlight. How is this possible? |
Latest version seems to find all dylibs recursively and adds teh ghostscript and gdal share dirs. This has gs 9.50 which may only take GS_LIB. Note: Not set in the shell startup yet so if gs fails please set GS_LIB to the /Application/gmt-6.0.0.app/......./share/ghostscript/9.50/lib or whatever. |
Am I the only one who thinks /opt/local/lib/proj6/share is one stupid place to place share information when there is opt/local/share for that? SO where to we place this in the bundle? We would have to use GDAL_LIB if that even works for this non-GDAL, probably need to set PROJ_LIB then. So maybe place this ih share/proj6 on the installer. |
Also add reference to licenses dir.
Last bit that remains is to place all the licenses for gs, gm, ffmpeg, gdal in a licenses folder in the bundle. |
Should we create a licsenses directory under admin and then just place that directory in the bundle? That may be the simplest. I added a one-liner in the startup script that directs users to that directory for license information. |
Will hold all licesnes for executables in the bundle
Think this PR is good to be approved now, @seisman ? |
share/Licenses on the bundle now lists
and when you double-click on the GMT logo it prints the gmt splash screen and adds
|
Hi @seisman, any reason this cannot be approved? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few typos, then it's good to merge.
Co-Authored-By: Dongdong Tian <[email protected]>
Co-Authored-By: Dongdong Tian <[email protected]>
Co-Authored-By: Dongdong Tian <[email protected]>
Could you build a bundle after merging this PR and upload it to your FTP? Then I can have more testing on the bundle. |
Will do now. |
OK, same ftp link as before. Heading home - let me know if there are any issues. |
This PR finalizes how cpack works on macOS under MacPorts; this time handling the gs link. If there is no gs -> gsc link on brew then we need to work on the script a bit more. It would be good if @seisman on brew could
Maybe we should exchange bundles to make sure they run on systems with a different distro.