From c67180156bb011ebe9a0524757052a28a6c62692 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 21 Nov 2005 04:39:02 +0000 Subject: Lots of changes, got the first complete(-ish) build with the new extended build system. I left as much of the old functionality in place as possible, definitely were it was being used. But there are some changes that break backwards compatibility, thought they should be noticed by few, and be easy to fix going forward. Some highlights: - centralized patch system (packages/patches with targets patch_pd and unpatch_pd) - easily redirected builds, using INSTALL_PREFIX and all of the *_DEST variables. This makes building packages like Pd.app, .deb, .rpm, etc. much easier. - libdir format: basically a libdir is a directory that has both the objects and the help files together in one folder. It can be added using -lib or the StartUp preferences, or you can access them via geiger namespaces, i.e. [mylibrary/myobject]. - special characters allow in setup function/file names for objects. This makes objects like [||~] possible without having to be in a library. Now they can be either .pd files or individual .pd_darwin files (thanks IOhannes for the patch). svn path=/trunk/; revision=3993 --- packages/patches/build_vars_4_makefile.in.patch | 98 ++++++++++ .../patches/darwin/darwin_display_tweaks.patch | 33 ++++ .../patches/darwin/darwin_jack_weak_linking.patch | 22 +++ packages/patches/darwin/darwin_linking_fixes.patch | 149 +++++++++++++++ packages/patches/extended-help-menu.patch | 174 +++++++++++++++++ packages/patches/libdir-0.38-4.patch | 14 +- packages/patches/loaderHEX-0.39-1.patch | 208 +++++++++++++++++++++ packages/patches/win/NT2_MSC_VER.patch | 59 ++++++ 8 files changed, 751 insertions(+), 6 deletions(-) create mode 100644 packages/patches/build_vars_4_makefile.in.patch create mode 100644 packages/patches/darwin/darwin_display_tweaks.patch create mode 100644 packages/patches/darwin/darwin_jack_weak_linking.patch create mode 100644 packages/patches/darwin/darwin_linking_fixes.patch create mode 100644 packages/patches/extended-help-menu.patch create mode 100644 packages/patches/loaderHEX-0.39-1.patch create mode 100644 packages/patches/win/NT2_MSC_VER.patch (limited to 'packages/patches') diff --git a/packages/patches/build_vars_4_makefile.in.patch b/packages/patches/build_vars_4_makefile.in.patch new file mode 100644 index 00000000..d398ae4e --- /dev/null +++ b/packages/patches/build_vars_4_makefile.in.patch @@ -0,0 +1,98 @@ +Index: makefile.in +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/makefile.in,v +retrieving revision 1.5 +diff -u -w -r1.5 makefile.in +--- makefile.in 6 Nov 2004 16:07:33 -0000 1.5 ++++ makefile.in 21 Nov 2005 04:32:51 -0000 +@@ -113,29 +113,48 @@ + cd ../extra/pique;make @EXTERNTARGET@ + + INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX) +-MANINSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)/$(MANDIR) + BINARYMODE=@binarymode@ + ++# varibles to match packages/Makefile.buildlayout so that they can be easily ++# overridden when building extended builds. ++BIN_DEST = $(INSTDIR)/bin ++DOCS_DEST = $(INSTDIR)/doc ++INCLUDE_DEST = $(INSTDIR)/include ++LIBPD_DEST = $(INSTDIR)/lib/pd ++LIBBIN_DEST = $(LIBPD_DEST)/bin ++MAN_DEST = $(INSTDIR)/$(MANDIR) ++ + install: all +- install -d $(INSTDIR)/lib/pd/bin +- install $(BIN_DIR)/$(GUINAME) $(INSTDIR)/lib/pd/bin/$(GUINAME) +- install $(BIN_DIR)/pd-watchdog $(INSTDIR)/lib/pd/bin/pd-watchdog +- install -m644 $(BIN_DIR)/pd.tk $(INSTDIR)/lib/pd/bin/pd.tk +- install -d $(INSTDIR)/bin +- install $(BINARYMODE) $(PDEXEC) $(INSTDIR)/bin/pd +- install -m755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend +- install -m755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive +- cp -pr ../doc ../extra $(INSTDIR)/lib/pd/ ++ install -d $(LIBBIN_DEST) ++ install $(BIN_DIR)/$(GUINAME) $(LIBBIN_DEST)/$(GUINAME) ++ install $(BIN_DIR)/pd-watchdog $(LIBBIN_DEST)/pd-watchdog ++ install -m644 $(BIN_DIR)/pd.tk $(LIBBIN_DEST)/pd.tk ++ install -d $(BIN_DEST) ++ install $(BINARYMODE) $(PDEXEC) $(BIN_DEST)/pd ++ install -m755 $(BIN_DIR)/pdsend $(BIN_DEST)/pdsend ++ install -m755 $(BIN_DIR)/pdreceive $(BIN_DEST)/pdreceive ++ for dir in $(shell ls -1 ../doc | grep -v CVS); do \ ++ echo "installing $$dir"; \ ++ install -d $(DOCS_DEST)/$$dir ; \ ++ install -p ../doc/$$dir/*.* $(DOCS_DEST)/$$dir ; \ ++ done ++ for dir in $(shell ls -1 ../doc/7.stuff | grep -v CVS); do \ ++ echo "installing 7.stuff/$$dir"; \ ++ install -d $(DOCS_DEST)/7.stuff/$$dir ; \ ++ install -p ../doc/7.stuff/$$dir/*.* $(DOCS_DEST)/7.stuff/$$dir ; \ ++ done ++ cp -pr ../extra $(LIBPD_DEST)/ + rm -f $(INSTDIR)/extra/*/*.o +- install -d $(INSTDIR)/include +- install -m644 m_pd.h $(INSTDIR)/include/m_pd.h +- install -d $(MANINSTDIR)/man1 +- gzip < ../man/pd.1 > $(MANINSTDIR)/man1/pd.1.gz +- chmod 644 $(MANINSTDIR)/man1/pd.1.gz +- gzip < ../man/pdsend.1 > $(MANINSTDIR)/man1/pdsend.1.gz +- chmod 644 $(MANINSTDIR)/man1/pdsend.1.gz +- gzip < ../man/pdreceive.1 > $(MANINSTDIR)/man1/pdreceive.1.gz +- chmod 644 $(MANINSTDIR)/man1/pdreceive.1.gz ++ install -d $(INCLUDE_DEST) ++ install -m644 m_pd.h $(INCLUDE_DEST)/m_pd.h ++ install -d $(MAN_DEST)/man1 ++ gzip < ../man/pd.1 > $(MAN_DEST)/man1/pd.1.gz ++ chmod 644 $(MAN_DEST)/man1/pd.1.gz ++ gzip < ../man/pdsend.1 > $(MAN_DEST)/man1/pdsend.1.gz ++ chmod 644 $(MAN_DEST)/man1/pdsend.1.gz ++ gzip < ../man/pdreceive.1 > $(MAN_DEST)/man1/pdreceive.1.gz ++ chmod 644 $(MAN_DEST)/man1/pdreceive.1.gz ++ @echo "Pd install succeeded." + + local-clean: + -rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \ +@@ -166,14 +185,14 @@ + $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies + + uninstall: +- rm -f -r $(INSTDIR)/lib/pd +- rm -f $(INSTDIR)/bin/pd +- rm -f $(INSTDIR)/bin/pdsend +- rm -f $(INSTDIR)/bin/pdreceive +- rm -f $(INSTDIR)/include/m_pd.h +- rm -f $(MANINSTDIR)/man1/pd.1.gz +- rm -f $(MANINSTDIR)/man1/pdsend.1.gz +- rm -f $(MANINSTDIR)/man1/pdreceive.1.gz ++ rm -f -r $(LIBPD_DEST) ++ rm -f $(BIN_DEST)/pd ++ rm -f $(BIN_DEST)/pdsend ++ rm -f $(BIN_DEST)/pdreceive ++ rm -f $(INCLUDE_DEST)/m_pd.h ++ rm -f $(MAN_DEST)/man1/pd.1.gz ++ rm -f $(MAN_DEST)/man1/pdsend.1.gz ++ rm -f $(MAN_DEST)/man1/pdreceive.1.gz + + include makefile.dependencies + diff --git a/packages/patches/darwin/darwin_display_tweaks.patch b/packages/patches/darwin/darwin_display_tweaks.patch new file mode 100644 index 00000000..59771854 --- /dev/null +++ b/packages/patches/darwin/darwin_display_tweaks.patch @@ -0,0 +1,33 @@ +--- ../../pd/src/u_main.tk Thu Jun 9 11:54:59 2005 ++++ build/Pd.app/Contents/Resources/bin/pd.tk Thu Jun 9 16:17:58 2005 +@@ -37,6 +37,12 @@ + if {$pd_nt == 2} { + # turn on James Tittle II's fast drawing (wait until I can test this...): + # set tk::mac::useCGDrawing 1 ++ # set minimun line size for anti-aliasing. If set to 1 or 0, then every ++ # line will be anti-aliased. While this makes connections and circles in ++ # [bng] and such look really good, it makes boxes and messages look out of ++ # focus. Setting this to 2 makes it so the thick audio rate connections ++ # are anti-aliased. 2005-06-09 ++ set tk::mac::CGAntialiasLimit 2 + global pd_guidir + global pd_tearoff + set pd_gui2 [string range $argv0 0 [expr [string last / $argv0 ] - 1]] +@@ -158,7 +164,7 @@ + + + frame .printout +-text .printout.text -relief raised -bd 2 -font -*-courier-bold--normal--12-* \ ++text .printout.text -relief raised -bd 2 -font { courier 12 } \ + -yscrollcommand ".printout.scroll set" -width 80 + # .printout.text insert end "\n\n\n\n\n\n\n\n\n\n" + scrollbar .printout.scroll -command ".printout.text yview" +@@ -337,7 +343,7 @@ + global pd_myversion + set name [format ".help%d" $doc_number] + toplevel $name +- text $name.text -relief raised -bd 2 -font -*-courier-bold--normal--12-* \ ++ text $name.text -relief raised -bd 2 -font { helvetica 14 } \ + -yscrollcommand "$name.scroll set" -background white + scrollbar $name.scroll -command "$name.text yview" + pack $name.scroll -side right -fill y diff --git a/packages/patches/darwin/darwin_jack_weak_linking.patch b/packages/patches/darwin/darwin_jack_weak_linking.patch new file mode 100644 index 00000000..fa0f6601 --- /dev/null +++ b/packages/patches/darwin/darwin_jack_weak_linking.patch @@ -0,0 +1,22 @@ +Index: makefile.in +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/makefile.in,v +retrieving revision 1.8 +diff -u -w -r1.8 makefile.in +--- makefile.in 24 Jul 2005 19:41:14 -0000 1.8 ++++ makefile.in 25 Jul 2005 01:59:05 -0000 +@@ -85,9 +85,12 @@ + $(BIN_DIR)/pdreceive: u_pdreceive.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c + ++# MACOSX_DEPLOYMENT_TARGET=10.2 is necessary on Mac OS X to support weak ++# linking of frameworks. Since its just a environment variable, it should be ++# safely ignored on other platforms. + $(PDEXEC): $(OBJ) +- cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ +- $(LIB) ++ cd ../obj; MACOSX_DEPLOYMENT_TARGET=10.2 $(CC) $(LDFLAGS) $(DBG_CFLAGS) \ ++ -o $(PDEXEC) $(OBJ) $(LIB) + + $(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC) + cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ diff --git a/packages/patches/darwin/darwin_linking_fixes.patch b/packages/patches/darwin/darwin_linking_fixes.patch new file mode 100644 index 00000000..dd1c2db3 --- /dev/null +++ b/packages/patches/darwin/darwin_linking_fixes.patch @@ -0,0 +1,149 @@ +Index: configure.in +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/configure.in,v +retrieving revision 1.10 +diff -u -w -r1.10 configure.in +--- configure.in 30 May 2005 04:37:25 -0000 1.10 ++++ configure.in 7 Jun 2005 00:14:52 -0000 +@@ -13,6 +13,7 @@ + AC_SUBST(USE_DEBUG_CFLAGS, no) + AC_SUBST(SYSSRC) + AC_SUBST(STRIPFLAG) ++AC_SUBST(TCLTK_FRAMEWORKS_PATH) + AC_SUBST(GUINAME) + AC_SUBST(GUIFLAGS) + AC_SUBST(OSNUMBER) +@@ -207,6 +208,24 @@ + OPT_CFLAGS="-g" + else + OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer" ++ ++ if test x$jack == "xyes"; ++ then ++ LDFLAGS=$LDFLAGS" -lrt -ljack" ++ fi ++ if test x$jack == "xrun"; ++ then ++ LDFLAGS=$LDFLAGS" -lrt -ljack" ++ fi ++ fi ++ ++ if test x$jack == "xyes"; ++ then ++ LDFLAGS=$LDFLAGS" -lrt -ljack" ++ fi ++ if test x$jack == "xrun"; ++ then ++ LDFLAGS=$LDFLAGS" -lrt -ljack" + fi + echo OPT_CFLAGS --------------- $OPT_CFLAGS + OSNUMBER=0 +@@ -245,11 +264,25 @@ + ../portmidi/pm_common/portmidi.c \ + ../portmidi/porttime/ptmacosx_cf.c " + STRIPFLAG="" +- GUINAME="pdtcl" +- GUIFLAGS="-F../../Frameworks -framework Tcl -framework Tk \ +- -I../../Frameworks/Tk.framework/Versions/Current/Headers \ +- -I../../Frameworks/Tcl.framework/Versions/Current/Headers \ +- -I../../Frameworks/Tcl.framework/Versions/8.4/PrivateHeaders" ++ GUINAME="libPdTcl.dylib" ++ ++# find the Tcl/Tk Frameworks ++ if test -d "../../Frameworks"; ++ then ++ # Miller's location ++ TCLTK_FRAMEWORKS_PATH="../../Frameworks" ++ elif test -d "/Library/Frameworks"; ++ then ++ # get it from the default install location ++ TCLTK_FRAMEWORKS_PATH="/Library/Frameworks" ++ else ++ # Panther has Tcl here; Tiger has Tcl and Tk here ++ TCLTK_FRAMEWORKS_PATH="/System/Library/Frameworks" ++ fi ++ GUIFLAGS="-F$TCLTK_FRAMEWORKS_PATH -framework Tcl -framework Tk \ ++ -I$TCLTK_FRAMEWORKS_PATH/Tk.framework/Versions/Current/Headers \ ++ -I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/Current/Headers \ ++ -I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/8.4/PrivateHeaders" + if test x$USE_DEBUG_CFLAGS == "xyes"; + then + OPT_CFLAGS="-g" +@@ -258,11 +291,14 @@ + fi + OSNUMBER=2 + EXTERNTARGET=pd_darwin ++ + if test x$jack == "xyes"; + then +- LDFLAGS=$LDFLAGS" -framework Jack" +- MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK" +- SYSSRC=$SYSSRC" s_audio_jack.c" ++ LDFLAGS=$LDFLAGS" -weak_framework Jack" ++ fi ++ if test x$jack == "xrun"; ++ then ++ LDFLAGS=$LDFLAGS" -weak_framework Jack" + fi + fi + +@@ -272,13 +308,11 @@ + then + MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK" + SYSSRC=$SYSSRC" s_audio_jack.c" +- LDFLAGS=$LDFLAGS" -lrt -ljack" + fi + if test x$jack == "xrun"; + then + MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK -DJACK_XRUN" + SYSSRC=$SYSSRC" s_audio_jack.c" +- LDFLAGS=$LDFLAGS" -lrt -ljack" + fi + + # extra flags for alpha machines +Index: makefile.in +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/makefile.in,v +retrieving revision 1.6 +diff -u -w -r1.6 makefile.in +--- makefile.in 18 May 2005 04:28:51 -0000 1.6 ++++ makefile.in 7 Jun 2005 00:14:52 -0000 +@@ -97,11 +97,17 @@ + cp u_main.tk $(BIN_DIR)/pd.tk + + #this is for Max OSX only... +-$(BIN_DIR)/pdtcl: $(GOBJ) $(GSRC) +- cd ../obj; libtool -dynamic -o $(BIN_DIR)/pdtcl $(GOBJ) \ +- ../../Frameworks/Tk.framework/Versions/Current/Tk \ +- ../../Frameworks/Tcl.framework/Versions/Current/Tcl \ +- /usr/lib/libSystem.B.dylib ++$(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC) ++ cd ../obj && $(CC) -dynamiclib -read_only_relocs warning \ ++ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ ++ -F@TCLTK_FRAMEWORKS_PATH@ \ ++ -framework Tcl -framework Tk -framework System \ ++ -Wl,-install_name,@executable_path/../Resources/bin/libPdTcl.dylib ++ install_name_tool -change @TCLTK_FRAMEWORKS_PATH@/Tcl.framework/Versions/8.4/Tcl\ ++ @executable_path/../Frameworks/Tcl.framework/Versions/8.4/Tcl \ ++ -change @TCLTK_FRAMEWORKS_PATH@/Tk.framework/Versions/8.4/Tk \ ++ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ++ ../bin/libPdTcl.dylib + + externs: + cd ../extra/bonk~;make @EXTERNTARGET@ +Index: u_main.tk +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v +retrieving revision 1.9 +diff -u -w -r1.9 u_main.tk +--- u_main.tk 18 May 2005 04:28:51 -0000 1.9 ++++ u_main.tk 7 Jun 2005 00:14:52 -0000 +@@ -48,7 +48,7 @@ + global pd_tearoff + set pd_gui2 [string range $argv0 0 [expr [string last / $argv0 ] - 1]] + set pd_guidir $pd_gui2/.. +- load $pd_guidir/bin/pdtcl ++ load $pd_guidir/bin/libPdTcl.dylib + set pd_tearoff 0 + + # tk::mac::OpenDocument is called with the filenames put into the diff --git a/packages/patches/extended-help-menu.patch b/packages/patches/extended-help-menu.patch new file mode 100644 index 00000000..0cabfeaa --- /dev/null +++ b/packages/patches/extended-help-menu.patch @@ -0,0 +1,174 @@ +Index: u_main.tk +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v +--- pd-0.38-4/src/u_main.tk Sun Feb 20 20:03:36 2005 ++++ u_main.tk Wed Nov 16 00:33:02 2005 +@@ -374,22 +374,41 @@ + set help_directory $pd_guidir/doc + set help_top_directory $pd_guidir/doc + ++################## generate_menu_doc_link ######################### ++# This procedure generates a temporary mirror of the documentation directory ++# in /tmp so that it can be opened from the Help->Pure Documentation... menu ++# under Mac OS X. It is meant to be run at startup. ++# Damn you Apple and your "hide stuff from the user" "features". ++# ++proc generate_menu_doc_link {} { ++ global help_directory ++ ++ regsub -all "/" $help_directory "." help_directory_alias ++ set help_directory_alias /tmp/$help_directory_alias ++ set help_directory_tmpdir $help_directory_alias/doc ++ # if something other than a directory exists, delete it ++ if [file exists $help_directory_alias] { ++ file delete -force -- $help_directory_alias ++ } ++ if { ! [ file isdirectory $help_directory_tmpdir ] } { ++ file mkdir $help_directory_tmpdir ++ } ++ foreach file [ lsort [ glob -dir $help_directory * ] ] { ++ regsub -all ".*/" $file "" link_file_name ++ file link -symbolic [file join $help_directory_tmpdir $link_file_name ] $file ++ } ++ set help_directory $help_directory_tmpdir ++} ++ ++################## menu_documentation ######################### + proc menu_documentation {} { + global help_directory + global pd_nt + global pd_guidir + +- if {$pd_nt == 2} { +- exec rm -rf /tmp/pd-documentation +- exec cp -pr $pd_guidir/doc /tmp/pd-documentation +- set filename [tk_getOpenFile -defaultextension .pd \ +- -filetypes { {{documentation} {.pd .txt .htm}} } \ +- -initialdir /tmp/pd-documentation] +- } else { + set filename [tk_getOpenFile -defaultextension .pd \ + -filetypes { {{documentation} {.pd .txt .htm}} } \ + -initialdir $help_directory] +- } + if {$filename != ""} { + if {[string first .txt $filename] >= 0} { + menu_opentext $filename +@@ -411,35 +430,57 @@ + + set dirname $pd_guidir/$subdir + ++ set file_type [file type $dirname/$basename] ++ if { $file_type == "directory" } { ++ pd [concat pd open [pdtk_enquote $basename] \ ++ [pdtk_enquote $dirname] \;] ++ } else { + if {[regexp ".*\.(txt|c)$" $basename]} { + menu_opentext $dirname/$basename ++ } elseif {[regexp ".*\.(pd|max)$" $basename]} { ++ pd [concat pd open [pdtk_enquote $basename] \ ++ [pdtk_enquote $dirname] \;] + } elseif {[regexp ".*\.html?$" $basename]} { + menu_openhtml $dirname/$basename + } else { +- pd [concat pd open [pdtk_enquote $basename] \ +- [pdtk_enquote $dirname] \;] ++ menu_openhtml $dirname/$basename ++ } + } + } + +-proc doc_submenu {helpmenu subdir} { +- global help_top_directory pd_tearoff +- +- set menudir $help_top_directory/$subdir + +- regsub -all "\\\." $subdir "" submenu ++################## menu_doc_submenu ######################### + ++# this is a recursive function to generation a nested menu in the help menu ++# which shows the complete contents of the doc directory ++proc menu_doc_submenu {helpmenu base_dir sub_dir} { ++ global pd_tearoff ++ global help_top_directory ++ ++ set menu_dir $help_top_directory/$base_dir/$sub_dir ++ ++ foreach file [ lsort [ glob -nocomplain -dir $menu_dir * ] ] { ++ set file_type [file type $file] ++ regsub {.*/(.*$)} $file {\1} file_name ++ # If links are going to be used then there needs to be a check to see if each ++ # link might cause this function to recurse forever ++ # if { $file_type == "link"} { ++ # puts stderr "LINK: $file" ++ # } ++ if { $file_type == "file" } { ++ # only put certain file types on the menu ++ if {[regexp ".*\.(htm|html|c|pd|txt|tk|pdf|wav|aif|aiff)$" $file]} { ++ $helpmenu add command -label $file_name \ ++ -command "menu_doc_open doc/$base_dir/$sub_dir $file_name" ++ } ++ } elseif { $file_type == "directory" } { ++ regsub -all "\\\." [string tolower $file_name] "" submenu + menu $helpmenu.$submenu -tearoff $pd_tearoff +- regsub -all "\\\." $subdir " " submenuname ++ regsub -all "\\\." $file_name " " submenuname + $helpmenu add cascade -label $submenuname \ + -menu $helpmenu.$submenu +- +-# use this glob pattern to exclude the supporting files +-# foreach file [ lsort [ glob -dir $menudir {*[0-9][0-9]*} ] ] +- foreach file [ lsort [ glob -dir $menudir * ] ] { +- set filename "" +- regsub {.*/(.*\..+$)} $file {\1} filename +- $helpmenu.$submenu add command -label $filename \ +- -command "menu_doc_open doc/$subdir $filename" ++ menu_doc_submenu $helpmenu.$submenu $base_dir/$sub_dir [file tail $file] ++ } + } + } + +@@ -494,7 +535,18 @@ + + + # the "Help" menu +- if {$pd_nt != 2} { ++ if {$pd_nt == 2} { ++# Apple doesn't allow cascading menus in their Help so I had to call this ++# one "docs" ++ generate_menu_doc_link ++ $mbar.docs add command -label {Browse Documentation...} \ ++ -command {menu_documentation} ++ # the help menu only really works well on Mac OS X ++ $mbar.docs add command -label {Pd HTML Manual...} \ ++ -command {menu_doc_open doc/1.manual index.htm} ++ $mbar.docs add separator ++ menu_doc_submenu $mbar.docs "." "." ++ } else { + # a menu on the main menubar named "$whatever.help" while be treated + # as a special menu with specific behaviors on different platforms. + # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm +@@ -502,22 +554,9 @@ + -command {menu_doc_open doc/1.manual 1.introduction.txt} + $mbar.help add command -label {Pure Documentation...} \ + -command {menu_documentation} +- # add menu items for each section instead of using Pd patches +- $mbar.help add separator +- set helpmenuname help +- } else { +-# Apple doesn't allow cascading menus in their Help so I had to call this +-# one "docs" +- set helpmenuname docs +- } +- +- $mbar.$helpmenuname add command -label {1 manual...} \ ++ $mbar.help add command -label {1 manual...} \ + -command {menu_doc_open doc/1.manual index.htm} +- doc_submenu $mbar.$helpmenuname 2.control.examples +- doc_submenu $mbar.$helpmenuname 3.audio.examples +- doc_submenu $mbar.$helpmenuname 4.fft.examples +- doc_submenu $mbar.$helpmenuname 5.reference +- doc_submenu $mbar.$helpmenuname 6.externs ++ } + } + + #################### the "File" menu for the Pd window ############## diff --git a/packages/patches/libdir-0.38-4.patch b/packages/patches/libdir-0.38-4.patch index c2148c11..3ac2a790 100644 --- a/packages/patches/libdir-0.38-4.patch +++ b/packages/patches/libdir-0.38-4.patch @@ -1,10 +1,11 @@ +? configure Index: s_loader.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v retrieving revision 1.4 diff -u -w -r1.4 s_loader.c --- s_loader.c 6 Sep 2004 20:20:35 -0000 1.4 -+++ s_loader.c 20 Nov 2005 01:52:20 -0000 ++++ s_loader.c 20 Nov 2005 03:47:04 -0000 @@ -163,3 +163,82 @@ @@ -94,7 +95,7 @@ RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.9.2.5 diff -u -w -r1.9.2.5 s_main.c --- s_main.c 24 Feb 2005 01:37:20 -0000 1.9.2.5 -+++ s_main.c 20 Nov 2005 01:52:20 -0000 ++++ s_main.c 20 Nov 2005 03:47:04 -0000 @@ -233,6 +233,7 @@ /* load dynamic libraries specified with "-lib" args */ for (nl = sys_externlist; nl; nl = nl->nl_next) @@ -109,12 +110,13 @@ RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v retrieving revision 1.5 diff -u -w -r1.5 s_stuff.h --- s_stuff.h 6 Sep 2004 20:20:36 -0000 1.5 -+++ s_stuff.h 20 Nov 2005 01:52:20 -0000 -@@ -47,6 +47,7 @@ - ++++ s_stuff.h 20 Nov 2005 03:47:04 -0000 +@@ -48,6 +48,8 @@ /* s_loader.c */ int sys_load_lib(char *dirname, char *filename); -+int sys_load_lib_dir(char *dirname, char *filename); ++int sys_load_lib_dir(char *dirname, char *filename); ++ /* s_audio.c */ + #define SENDDACS_NO 0 /* return values for sys_send_dacs() */ diff --git a/packages/patches/loaderHEX-0.39-1.patch b/packages/patches/loaderHEX-0.39-1.patch new file mode 100644 index 00000000..d3656662 --- /dev/null +++ b/packages/patches/loaderHEX-0.39-1.patch @@ -0,0 +1,208 @@ +Index: m_class.c +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/m_class.c,v +retrieving revision 1.4 +diff -u -w -r1.4 m_class.c +--- m_class.c 28 Nov 2004 21:20:42 -0000 1.4 ++++ m_class.c 17 Nov 2005 23:33:06 -0000 +@@ -16,6 +16,7 @@ + + #include + #include ++#include + + static t_symbol *class_loadsym; /* name under which an extern is invoked */ + static void pd_defaultfloat(t_pd *x, t_float f); +@@ -513,6 +514,42 @@ + t_symbol* pathsearch(t_symbol *s,char* ext); + int pd_setloadingabstraction(t_symbol *sym); + ++ ++/* replace everything but [a-zA-Z0-9_] by "0x%x" */ ++static char*alternative_classname(char*classname) ++{ ++ char *altname=(char*)getbytes(sizeof(char)*MAXPDSTRING); ++ int count=0; ++ int i=0; ++ for(i=0; i=48 && c<=57)|| /* [0-9] */ ++ (c>=65 && c<=90)|| /* [A-Z] */ ++ (c>=97 && c<=122)||/* [a-z] */ ++ (c==95)) /* [_] */ ++ { ++ altname[i]=c; ++ i++; ++ } ++ else /* a "bad" character */ ++ { ++ sprintf(altname+i, "0x%02x", c); ++ i+=4; ++ count++; ++ } ++ classname++; ++ } ++ if(count>0)return altname; ++ /* seems like the given classname is fine as can be */ ++ freebytes(altname, sizeof(char)*MAXPDSTRING); ++ return 0; ++} ++ ++ + /* this routine is called when a new "object" is requested whose class Pd + doesn't know. Pd tries to load it as an extern, then as an abstraction. */ + void new_anything(void *dummy, t_symbol *s, int argc, t_atom *argv) +@@ -521,10 +558,11 @@ + t_symbol *dir = canvas_getcurrentdir(); + int fd; + char dirbuf[MAXPDSTRING], *nameptr; ++ char *altname=alternative_classname(s->s_name); + if (tryingalready) return; + newest = 0; + class_loadsym = s; +- if (sys_load_lib(dir->s_name, s->s_name)) ++ if (sys_load_lib_alt(dir->s_name, s->s_name,altname)) + { + tryingalready = 1; + typedmess(dummy, s, argc, argv); +@@ -535,6 +573,8 @@ + current = s__X.s_thing; + if ((fd = open_via_path(dir->s_name, s->s_name, ".pd", + dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 || ++ (altname && (fd = open_via_path(dir->s_name, altname, ".pd", ++ dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) || + (fd = open_via_path(dir->s_name, s->s_name, ".pat", + dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) + { +Index: s_loader.c +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v +retrieving revision 1.6 +diff -u -w -r1.6 s_loader.c +--- s_loader.c 30 May 2005 03:04:19 -0000 1.6 ++++ s_loader.c 17 Nov 2005 23:33:07 -0000 +@@ -46,10 +46,11 @@ + + void class_set_extern_dir(t_symbol *s); + +-int sys_load_lib(char *dirname, char *classname) ++int sys_load_lib_alt(char *dirname, char *classname, char*altname) + { + char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING], +- classname2[MAXPDSTRING], *nameptr, *lastdot; ++ classname2[MAXPDSTRING], *nameptr, *lastdot, ++ altsymname[MAXPDSTRING]; + void *dlobj; + t_xxx makeout = NULL; + int fd; +@@ -72,6 +73,25 @@ + if ((fd = open_via_path(dirname, classname2, sys_dllextent, + dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) + { ++ /* next try (alternative_classname).(sys_dllextent) */ ++ if(altname) ++ { ++ if ((fd = open_via_path(dirname, altname, sys_dllextent, ++ dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) ++ ++ /* next try (alternative_classname)/(alternative_classname).(sys_dllextent) ... */ ++ strncpy(classname2, altname, MAXPDSTRING); ++ filename[MAXPDSTRING-2] = 0; ++ strcat(classname2, "/"); ++ strncat(classname2, altname, MAXPDSTRING-strlen(classname2)); ++ filename[MAXPDSTRING-1] = 0; ++ if ((fd = open_via_path(dirname, classname2, sys_dllextent, ++ dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) ++ { ++ return 0; ++ } ++ } ++ else + return (0); + } + } +@@ -93,9 +113,20 @@ + #ifdef MACOSX + strcpy(symname, "_"); + strcat(symname, nameptr); ++ if(altname) ++ { ++ strcpy(altsymname, "_setup_"); ++ strcat(symname, altname); ++ } + #else + strcpy(symname, nameptr); ++ if(altname) ++ { ++ strcpy(altsymname, "setup_"); ++ strcat(altsymname, altname); ++ } + #endif ++ + /* if the last character is a tilde, replace with "_tilde" */ + if (symname[strlen(symname) - 1] == '~') + strcpy(symname + (strlen(symname) - 1), "_tilde"); +@@ -110,6 +141,7 @@ + return (0); + } + makeout = (t_xxx)dlsym(dlobj, symname); ++ if(!makeout)makeout = (t_xxx)dlsym(dlobj, altsymname); + #endif + #ifdef MSW + sys_bashfilename(filename, filename); +@@ -121,6 +153,7 @@ + return (0); + } + makeout = (t_xxx)GetProcAddress(ntdll, symname); ++ if(!makeout)makeout = (t_xxx)GetProcAddress(ntdll, altsymname); + #endif + #ifdef MACOSX + { +@@ -147,6 +180,8 @@ + } + s = NSLookupSymbolInModule(ret, symname); + ++ if(!s)s=NSLookupSymbolInModule(ret, altsymname); ++ + if (s) + makeout = (t_xxx)NSAddressOfSymbol( s); + else makeout = 0; +@@ -156,6 +191,8 @@ + if (!makeout) + { + post("load_object: Symbol \"%s\" not found", symname); ++ if(altname) ++ post("load_object: Symbol \"%s\" not found", altsymname); + class_set_extern_dir(&s_); + return 0; + } +@@ -164,6 +201,10 @@ + return (1); + } + ++int sys_load_lib(char *dirname, char *filename) ++{ ++ return sys_load_lib_alt(dirname, filename, 0); ++} + + + +Index: s_stuff.h +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v +retrieving revision 1.7 +diff -u -w -r1.7 s_stuff.h +--- s_stuff.h 16 Jul 2005 01:43:18 -0000 1.7 ++++ s_stuff.h 17 Nov 2005 23:33:07 -0000 +@@ -47,6 +47,7 @@ + + /* s_loader.c */ + int sys_load_lib(char *dirname, char *filename); ++int sys_load_lib_alt(char *dirname, char *filename, char* altname); + + /* s_audio.c */ + diff --git a/packages/patches/win/NT2_MSC_VER.patch b/packages/patches/win/NT2_MSC_VER.patch new file mode 100644 index 00000000..7c5f3d25 --- /dev/null +++ b/packages/patches/win/NT2_MSC_VER.patch @@ -0,0 +1,59 @@ +? configure +Index: d_mayer_fft.c +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/d_mayer_fft.c,v +retrieving revision 1.3 +diff -u -w -r1.3 d_mayer_fft.c +--- d_mayer_fft.c 18 May 2005 04:28:50 -0000 1.3 ++++ d_mayer_fft.c 17 Nov 2005 23:29:25 -0000 +@@ -48,7 +48,8 @@ + * of work. -msp + */ + +-#ifdef MSW ++/* These pragmas are only used for MSVC, not MinGW or Cygwin */ ++#ifdef _MSC_VER + #pragma warning( disable : 4305 ) /* uncast const double to float */ + #pragma warning( disable : 4244 ) /* uncast double to float */ + #pragma warning( disable : 4101 ) /* unused local variables */ +Index: m_pd.h +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v +retrieving revision 1.8 +diff -u -w -r1.8 m_pd.h +--- m_pd.h 19 Aug 2005 23:28:03 -0000 1.8 ++++ m_pd.h 17 Nov 2005 23:29:25 -0000 +@@ -17,12 +17,13 @@ + #define MSW + #endif + +-#ifdef MSW ++/* These pragmas are only used for MSVC, not MinGW or Cygwin */ ++#ifdef _MSC_VER + /* #pragma warning( disable : 4091 ) */ + #pragma warning( disable : 4305 ) /* uncast const double to float */ + #pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */ + #pragma warning( disable : 4101 ) /* unused automatic variables */ +-#endif /* MSW */ ++#endif /* _MSC_VER */ + + /* the external storage class is "extern" in UNIX; in MSW it's ugly. */ + #ifdef MSW +Index: t_tkcmd.c +=================================================================== +RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v +retrieving revision 1.6 +diff -u -w -r1.6 t_tkcmd.c +--- t_tkcmd.c 15 Oct 2005 23:14:28 -0000 1.6 ++++ t_tkcmd.c 17 Nov 2005 23:29:25 -0000 +@@ -30,7 +30,9 @@ + #include + #include + #endif +-#ifdef MSW ++ ++/* These pragmas are only used for MSVC, not MinGW or Cygwin */ ++#ifdef _MSC_VER + #pragma warning( disable : 4305 ) /* uncast const double to float */ + #pragma warning( disable : 4244 ) /* uncast double to float */ + #pragma warning( disable : 4101 ) /* unused local variables */ -- cgit v1.2.1