Created
May 1, 2020 15:21
-
-
Save Alhadis/9d8b39ebddad5d640ff6466fa17d9578 to your computer and use it in GitHub Desktop.
Installing Snack for Tcl on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEST = $(HOME)/Library/Tcl | |
TCL = /System/Library/Frameworks/Tcl.framework | |
TK = /System/Library/Frameworks/Tk.framework | |
X = /Developer/SDKs/MacOSX10.6.sdk/usr/X11/include | |
all: ../unix/Makefile | |
cd ../unix && $(MAKE) && $(MAKE) install | |
../unix/Makefile: | |
cd ../unix && ./configure --disable-stubs --with-tcl=$(TCL) --with-tk=$(TK) CPPFLAGS=-I$(X) | |
sed -i.bak \ | |
-e 's|^\(TCL_INCPATH[[:blank:]]*=\).*|\1 $(TCL)|' \ | |
-e 's|^\(TK_INCPATH[[:blank:]]*=\).*|\1 $(TK)|' \ | |
-e 's|^\(XINCLUDES[[:blank:]]*=\).*|\1 -I$(X)|' \ | |
-e 's|^\(DESTDIR[[:blank:]]*=\).*|\1 $(DEST)|' \ | |
-e 's|^\(SNACK_INSTALL_PATH[[:blank:]]*=\).*|\1|' $@ | |
rm -f $@.bak | |
clean: | |
[ ! -f ../unix/Makefile ] || { cd ../unix && $(MAKE) distclean; } | |
git checkout -- ../unix ../demos | |
git clean -fd ../unix | |
.PHONY: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# the next line restarts using tclsh \ | |
exec tclsh8.5 "$0" "$@" | |
package require sound | |
# Try to load optional file format handlers | |
catch { package require snacksphere } | |
catch { package require snackogg } | |
if {[llength $argv] == 0} { | |
puts {Usage: play.tcl file} | |
exit | |
} else { | |
set file [lindex $argv 0] | |
} | |
snack::sound s -file $file | |
s play | |
vwait forever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment