diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml index b99c516016d..44379bb47a6 100644 --- a/.github/workflows/release_linux.yml +++ b/.github/workflows/release_linux.yml @@ -1,4 +1,4 @@ -name: Releases +name: Linux Releases on: push: diff --git a/.github/workflows/release_mac.yml b/.github/workflows/release_mac.yml index 9556e5e893c..6314ca6773c 100644 --- a/.github/workflows/release_mac.yml +++ b/.github/workflows/release_mac.yml @@ -1,4 +1,4 @@ -name: Releases +name: Mac Releases on: push: diff --git a/.github/workflows/release_windows.yml b/.github/workflows/release_windows.yml index 5885ca60967..33611323900 100644 --- a/.github/workflows/release_windows.yml +++ b/.github/workflows/release_windows.yml @@ -1,4 +1,4 @@ -name: Releases +name: Windows Releases on: push: diff --git a/cmake/PythonCopyStandardLib.py b/cmake/PythonCopyStandardLib.py index d55f6c3cce6..fafbcbd3b0e 100644 --- a/cmake/PythonCopyStandardLib.py +++ b/cmake/PythonCopyStandardLib.py @@ -61,7 +61,7 @@ # this script must be called with two args: # 1 - the path to the EnergyPlus executable in the install-tree, which is used to determine where to copy the library # since this is in the install-tree, you'll need to use a cmake generator expression -# 2 - name of the folder to create to store the copied in python standard library, usually python_library +# 2 - name of the folder to create to store the copied in python standard library, usually python_lib import ctypes import os import platform @@ -122,7 +122,8 @@ def find_libs(dir_path): python_root_dir = os.path.dirname(standard_lib_dir) tcl_dir = os.path.join(python_root_dir, 'tcl') shutil.copytree(tcl_dir, target_dir, dirs_exist_ok=True) - +# TODO: Need to do this on Mac as well, see the bottom of cmake/PythonFixUpOnMac.cmake for more info + # then I'm going to try to clean up any __pycache__ folders in the target dir to reduce installer size for root, dirs, _ in os.walk(target_dir): for this_dir in dirs: diff --git a/cmake/PythonFixUpOnMac.cmake b/cmake/PythonFixUpOnMac.cmake index 615d04340a3..21c2410dc69 100644 --- a/cmake/PythonFixUpOnMac.cmake +++ b/cmake/PythonFixUpOnMac.cmake @@ -71,3 +71,20 @@ foreach(PREREQ IN LISTS PREREQUISITES) execute_process(COMMAND "install_name_tool" -change "${PREREQ}" "@loader_path/${LIB_INT_FILENAME}" "${LOCAL_PYTHON_LIBRARY}") endif() endforeach() + +##############3 +# we need to look into the tkinter binary's runtime dependencies, copy over the tcl and tk dylibs, update them with install_name_tool, and make sure they all get signed, like this: + +# libtcl +# cp /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib /path/to/python_lib/lib-dynload/ +# install_name_tool -change "/opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib" "@loader_path/libtcl8.6.dylib" /path/to/python_lib/lib-dynload/_tkinter.cpython-312-darwin.so + +# Do the same for libtk +# cp /opt/homebrew/opt/tcl-tk/lib/libtk8.6.dylib /path/to/python_lib/lib-dynload/ +# install_name_tool -change "/opt/homebrew/opt/tcl-tk/lib/libtk8.6.dylib" "@loader_path/libtk8.6.dylib" /path/to/python_lib/lib-dynload/_tkinter.cpython-312-darwin.so + +# Resign _tkinter +# codesign -vvvv -s "Developer ID Application: National ..." -f --timestamp -i "org.nrel.EnergyPlus" -o runtime /path/to/python_lib/lib-dynload/_tkinter.cpython-312-darwin.so +# codesign -vvvv -s "Developer ID Application: National ..." -f --timestamp -i "org.nrel.EnergyPlus" -o runtime /path/to/python_lib/lib-dynload/libtcl8.6.dylib +# codesign -vvvv -s "Developer ID Application: National ..." -f --timestamp -i "org.nrel.EnergyPlus" -o runtime /path/to/python_lib/lib-dynload/libtk8.6.dylib +##############3 diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc index a0b1394ac74..c4d563eb07a 100644 --- a/src/EnergyPlus/CommandLineInterface.cc +++ b/src/EnergyPlus/CommandLineInterface.cc @@ -235,6 +235,10 @@ Built on Platform: {} app.add_flag("--debug-cli", debugCLI, "Print the result of the CLI assignments to the console and exit")->group(""); // Empty group to hide it #if LINK_WITH_PYTHON +#if __APPLE__ + // for now on Apple we are not providing the command line interface to EP-Launch due to packaging issues + // once that is fixed, this __APPLE__ block will be removed and we'll just have this on all platforms +#else auto *auxiliaryToolsSubcommand = app.add_subcommand("auxiliary", "Run Auxiliary Python Tools"); auxiliaryToolsSubcommand->require_subcommand(); // should default to requiring 1 or more additional args? @@ -278,10 +282,11 @@ sys.argv.append("energyplus") from eplaunch.tk_runner import main_gui main_gui() )python"; - std::cout << "Trying to execute this python snippet: " << std::endl << cmd << std::endl; + // std::cout << "Trying to execute this python snippet: " << std::endl << cmd << std::endl; engine.exec(cmd); exit(0); }); +#endif #endif app.footer("Example: energyplus -w weather.epw -r input.idf");