more work on bundle and starting from Finder

This commit is contained in:
nhmall
2023-02-10 01:55:49 -05:00
parent 61bb25889c
commit 24461058e6
2 changed files with 18 additions and 7 deletions
+12 -6
View File
@@ -425,18 +425,16 @@ ifdef NEEDS_WAV
BUNDLEWAVS = $(addsuffix .wav, $(SNDWAVS)) BUNDLEWAVS = $(addsuffix .wav, $(SNDWAVS))
endif endif
RESOURCES_LIST = $(BUNDLEWAVS) IMAGESLIST = nethack.icns
RESOURCES_LIST = $(BUNDLEWAVS) $(IMAGESLIST)
BUNDLE_ADD_TO_RESOURCES = $(addprefix $(BUNDLE_RESOURCESDIR)/, $(RESOURCES_LIST)) BUNDLE_ADD_TO_RESOURCES = $(addprefix $(BUNDLE_RESOURCESDIR)/, $(RESOURCES_LIST))
MACOS_LIST = $(notdir $(GAMEBIN)) NetHackGuidebook.applescript \ MACOS_LIST = $(notdir $(GAMEBIN)) NetHackGuidebook.applescript NetHackRecover.applescript NetHackTerm.applescript
NetHackRecover.applescript NetHackTerm.applescript
BUNDLE_ADD_TO_MACOS = $(addprefix $(BUNDLE_MACOSDIR)/, $(MACOS_LIST)) BUNDLE_ADD_TO_MACOS = $(addprefix $(BUNDLE_MACOSDIR)/, $(MACOS_LIST))
# win/macosx/NetHackGuidebook.applescript
# win/macosx/NetHackRecover.applescript
# win/macosx/NetHackTerm.applescript
endif # WANT_BUNDLE endif # WANT_BUNDLE
# #
# We include the bundle outside of a WANT_BUNDLE block because # We include the bundle outside of a WANT_BUNDLE block because
@@ -494,6 +492,7 @@ $(BUNDLE_MACOSDIR)/%: ../win/macosx/% | $(BUNDLE_MACOSDIR)
$(BUNDLE_MACOSDIR)/%: $(dir $(GAMEBIN))/% | $(BUNDLE_MACOSDIR) $(BUNDLE_MACOSDIR)/%: $(dir $(GAMEBIN))/% | $(BUNDLE_MACOSDIR)
cp $< $@ cp $< $@
bundledir: bundledir:
mkdir -p bundle mkdir -p bundle
@@ -533,6 +532,13 @@ ifneq "$(SHELLDIR)" ""
rm -f $(GAME).tmp; \ rm -f $(GAME).tmp; \
fi; fi;
endif endif
# We can't use a general rule because the file name of the .uu does not match the
# uudecode target file name in this case (nhicns.uu to nethack.icns)
../win/share/nethack.icns: ../util/uudecode ../win/share/nhicns.uu
../util/uudecode ../win/share/nhicns.uu
mv $(notdir $@) $@
endif # MAKEFILE_SRC endif # MAKEFILE_SRC
endif # WANT_BUNDLE endif # WANT_BUNDLE
+6 -1
View File
@@ -13,6 +13,11 @@
set debug to false set debug to false
set needshutdown to false set needshutdown to false
tell application "Finder"
set bundleAppPath to POSIX path of (application file id "org.nethack.macos" as text)
end tell
tell application "Terminal" tell application "Terminal"
# see if we're going to have to shut it down at the end because we started it up # see if we're going to have to shut it down at the end because we started it up
if it is not running then if it is not running then
@@ -21,7 +26,7 @@ tell application "Terminal"
activate activate
#open new window and run NetHack in it #open new window and run NetHack in it
do script with command "clear;sleep 1;/usr/local/bin/nethack;echo '(press RETURN to exit)';awk '{exit}';exit" do script with command "clear;sleep 1;pwd;" & bundleAppPath & "/Contents/MacOS/nethack;echo '(press RETURN to exit)';awk '{exit}';exit"
set nhresult to result -- class is tab set nhresult to result -- class is tab
set nhresrec to result as record set nhresrec to result as record
set nhreslist to result as list set nhreslist to result as list