Skip to content

Commit

Permalink
fixes for mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bryan committed Aug 20, 2024
1 parent c60a7e3 commit ea7f999
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
25 changes: 15 additions & 10 deletions package/force_launcher.scpt
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
set options to {"HERON", "RAVEN", "TEAL", "Quit"}

set resourceName to "heron"
set filePathName to quoted form of POSIX path of (path to resource resourceName) as text

set selectedOption to choose from list options with title "FORCE Launcher" with prompt "Which FORCE application woudl you like to use?" default items {"HERON"}
set selectedOption to choose from list options with title "FORCE Launcher" with prompt "Which FORCE application would you like to use?" default items {"HERON"}

if selectedOption is false then
display dialog "No option selected. Exiting..." buttons {"OK"} default button "OK"
else
set selectedOption to item 1 of selectedOption
if selectedOption is "HERON" then
set resourceName to "heron"
set filePathName to quoted form of "/Applications/FORCE.app/Contents/Resources/heron"
else if selectedOption is "RAVEN" then
set resourceName to "raven_framework"
set filePathName to quoted form of "/Applications/FORCE.app/Contents/Resources/raven_framework"
else if selectedOption is "TEAL" then
set resourceName to "teal"
set filePathName to quoted form of "/Applications/FORCE.app/Contents/Resources/teal"
else if selectedOption is "Quit" then
display dialog "Exiting..." buttons {"OK"} default button "OK"
return
end if
set filePathName to quoted form of POSIX path of (path to resource resourceName) as text
do shell script filePathName
end if
-- do shell script filePathName
try
do shell script "test -e " & filePathName
-- If the test passes, the file exists and we proceed with the script
do shell script filePathName
on error
-- If the file doesn't exist, display an error message
display dialog "The file at " & filePathName & " does not exist." buttons {"OK"} default button "OK"
end try
end if
3 changes: 2 additions & 1 deletion package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
else:
ipopt_path = os.path.join(os.path.dirname(sys.executable), "ipopt")
build_exe_options["include_files"] += [
(ipopt_path, "local/bin/ipopt")
# (ipopt_path, "local/bin/ipopt")
(ipopt_path, "ipopt") # put it in main directory
]

setup(
Expand Down
12 changes: 6 additions & 6 deletions package/ui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ def get_workbench_dir_from_exe_path(workbench_exe_path: pathlib.Path) -> pathlib
@ In, workbench_exe_path, pathlib.Path, the path to the Workbench executable
@ Out, workbench_dir, pathlib.Path, the path to the Workbench installation directory
"""
if platform.system() == "Darwin":
workbench_dir = workbench_exe_path.parent.parent.parent
else:
workbench_dir = workbench_exe_path.parent.parent
# NOTE: for macOS, this returns the path to the "Contents" directory in the app bundle, not the
# app bundle's root directory. However, this keeps pathing more consistent with other platforms.
workbench_dir = workbench_exe_path.parent.parent
return workbench_dir


Expand Down Expand Up @@ -251,7 +250,7 @@ def create_workbench_heron_default(workbench_dir: pathlib.Path):
" default {\n"
" options {\n"
" shared {\n"
f" \"Executable\"=\"{heron_path}\"\n"
f" Executable=\"{heron_path}\"\n"
" }\n"
" }\n"
" }\n"
Expand All @@ -271,7 +270,8 @@ def convert_xml_to_heron(xml_file: pathlib.Path, workbench_path: pathlib.Path) -
# Find the xml2eddi.py script in the Workbench installation directory
xml2eddi_script = workbench_path / "rte" / "util" / "xml2eddi.py"
if not xml2eddi_script.exists():
print("ERROR: Could not find the xml2eddi.py script in the Workbench installation directory.")
print(f"ERROR: Could not find the xml2eddi.py script in the Workbench installation directory ({str(workbench_path)}). "
f"Checked {str(xml2eddi_script)}.")
return None

# Convert the .xml file to a .heron file by running the xml2eddi.py script with the .xml file as
Expand Down

0 comments on commit ea7f999

Please sign in to comment.