diff --git a/app-editors/vim/patches/vim-7.2.patch b/app-editors/vim/patches/vim-7.2.patch index a23587032..bb7b3961a 100644 --- a/app-editors/vim/patches/vim-7.2.patch +++ b/app-editors/vim/patches/vim-7.2.patch @@ -1,7 +1,7 @@ diff -Naur vim72/Makefile vim72.haiku/Makefile --- vim72/Makefile 2009-04-19 20:53:31.000000000 +0000 +++ vim72.haiku/Makefile 2009-04-18 09:14:47.000000000 +0000 -@@ -185,6 +185,13 @@ +@@ -185,6 +185,15 @@ # - Rename the executables to vimos2.exe, xxdos2.exe and teeos2.exe and copy # them to here. # - "make os2bin". @@ -9,12 +9,51 @@ diff -Naur vim72/Makefile vim72.haiku/Makefile +# BeOS/Haiku OS +# - Unpack the Unix "src", "extra" and "rt" archives. +# - Aplly Haiku patch. -+# - Go to "src" directory and use "make autoconf" to regenerate configure. -+# - Use typical Unix build and install procedures. -+# TODO: describe procedure of creating package! ++# - Go to "src" directory and use "make autoconf" to regenerate configure script. ++# - Default "make [install]" will produce GUI version. ++# - To prepare Haiku package use following command: ++# make haiku_package GCCVER_SUFFIX="-gcc2" ++# Both gui-less and full versions of vim will be packaged. VIMVER = vim-$(MAJOR).$(MINOR) VERSION = $(MAJOR)$(MINOR) +@@ -228,6 +237,7 @@ + COMMENT_HTML = comment/$(VERSION)-html + COMMENT_FARSI = comment/$(VERSION)-farsi + COMMENT_LANG = comment/$(VERSION)-lang ++COMMENT_HAIKU = comment/$(VERSION)-haiku + + dist/$(COMMENT_RT): dist/comment + echo "Vim - Vi IMproved - v$(VDOT) runtime files for MS-DOS and MS-Windows" > dist/$(COMMENT_RT) +@@ -271,6 +281,9 @@ + dist/$(COMMENT_LANG): dist/comment + echo "Vim - Vi IMproved - v$(VDOT) MS-Windows language files" > dist/$(COMMENT_LANG) + ++dist/$(COMMENT_HAIKU): dist/comment ++ echo "Vim - Vi IMproved - v$(VDOT)$(GCCVER_SUFFIX) package for Haiku OS" > dist/$(COMMENT_HAIKU) ++ + unixall: dist prepare + -rm -f dist/$(VIMVER).tar.bz2 + -rm -rf dist/$(VIMRTDIR) +@@ -600,3 +613,18 @@ + farsi: dist dist/$(COMMENT_FARSI) + -rm -f dist/farsi$(VERSION).zip + zip -9 -rD -z dist/farsi$(VERSION).zip farsi < dist/$(COMMENT_FARSI) ++ ++haiku_package: dist dist/$(COMMENT_HAIKU) ++ -rm -rf dist/boot/ ++ ./configure --prefix=/boot/common --with-features=big --with-compiledby="$(COMPILEDBY)" ++ make clean; make install DESTDIR=`pwd`/dist ++ ./configure --prefix=/boot/common --with-features=big --disable-gui --with-compiledby="$(COMPILEDBY)" ++ make clean; make install DESTDIR=`pwd`/dist ++ echo "Package: Vim" > dist/boot/.OptionalPackageDescription ++ echo "Version: $(VDOT)$(GCCVER_SUFFIX)" >> dist/boot/.OptionalPackageDescription ++ echo "Copyright: Bram Moolenaar et al." >> dist/boot/.OptionalPackageDescription ++ echo "Description: Vi IMproved. Highly configurable text editor." >> dist/boot/.OptionalPackageDescription ++ echo "License: Charityware" >> dist/boot/.OptionalPackageDescription ++ echo "URL: http://www.vim.org/" >> dist/boot/.OptionalPackageDescription ++ cd dist/boot && zip -9 -r -z -y ../vim-$(VDOT)$(GCCVER_SUFFIX)-`date +%F`.zip * .OptionalPackageDescription* < ../$(COMMENT_HAIKU) ++ diff -Naur vim72/src/Makefile vim72.haiku/src/Makefile --- vim72/src/Makefile 2009-04-19 20:53:35.000000000 +0000 +++ vim72.haiku/src/Makefile 2009-04-23 22:26:29.000000000 +0000 @@ -59,7 +98,7 @@ diff -Naur vim72/src/Makefile vim72.haiku/src/Makefile objects/os_qnx.o: os_qnx.c $(CCC) -o $@ os_qnx.c -@@ -2645,6 +2665,59 @@ +@@ -2645,6 +2665,60 @@ ############################################################################### @@ -88,30 +127,31 @@ diff -Naur vim72/src/Makefile vim72.haiku/src/Makefile + $(DEST_BIN)/$(RGVIEWTARGET) +### +### This rule: ++### - Replace gvim link with copy of vim binary. +### - Replace g*-links with shell script equivalents to solve the problem +### of calling them from Tracker, -+### - add icon resources to mentioned g*-link shell scripts. ++### - Add icon resources to mentioned g*-link shell scripts. +### +installglinks_beos: $(BEOS_GLINKS) install_beos_extra -+ @catattr -r "BEOS:L:STD_ICON" $(DEST_BIN)/$(VIMTARGET) > ~icon.attr -+ @catattr -r "BEOS:M:STD_ICON" $(DEST_BIN)/$(VIMTARGET) > ~micon.attr -+ @for i in $(BEOS_GLINKS); do \ ++ @catattr -r "BEOS:L:STD_ICON" $(DEST_BIN)/$(GVIMTARGET) > ~icon.attr ++ @catattr -r "BEOS:M:STD_ICON" $(DEST_BIN)/$(GVIMTARGET) > ~micon.attr ++ for i in $(BEOS_GLINKS); do \ + rm $$i ; \ + echo "#!/bin/sh" > $$i ; \ + case $$i in \ -+ $(DEST_BIN)/$(GVIMTARGET)) echo "$(VIMTARGET) -g" >> $$i;; \ -+ $(DEST_BIN)/$(GVIEWTARGET)) echo "$(VIMTARGET) -g -R" >> $$i;; \ -+ $(DEST_BIN)/$(GVIMDIFFTARGET)) echo "$(VIMTARGET) -g -d" >> $$i;; \ -+ $(DEST_BIN)/$(RGVIMTARGET)) echo "$(VIMTARGET) -Z -g" >> $$i;; \ -+ $(DEST_BIN)/$(RGVIEWTARGET)) echo "$(VIMTARGET) -Z -g -R" >> $$i;; \ -+ *) echo "$(VIMTARGET)" >> $$i;; \ -+ esac ; \ ++ $(DEST_BIN)/$(GVIMTARGET)) cp $(DEST_BIN)/$(VIMTARGET) $$i;; \ ++ $(DEST_BIN)/$(GVIEWTARGET)) printf "%s -R %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ ++ $(DEST_BIN)/$(GVIMDIFFTARGET)) printf "%s -d %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ ++ $(DEST_BIN)/$(RGVIMTARGET)) printf "%s -Z %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ ++ $(DEST_BIN)/$(RGVIEWTARGET)) printf "%s -Z -R %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ ++ *) printf "%s %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ ++ esac ; \ + chmod $(BINMOD) $$i ; \ + addattr -f ~icon.attr -t \'ICON\' BEOS:L:STD_ICON $$i ; \ + addattr -f ~micon.attr -t \'MICN\' BEOS:M:STD_ICON $$i ; \ + done -+ @addattr -f ~icon.attr -t \'ICON\' BEOS:L:STD_ICON $(DEST_BIN)/$(VIMNAME)tutor -+ @addattr -f ~micon.attr -t \'MICN\' BEOS:M:STD_ICON $(DEST_BIN)/$(VIMNAME)tutor ++ addattr -f ~icon.attr -t \'ICON\' BEOS:L:STD_ICON $(DEST_BIN)/$(VIMNAME)tutor ++ addattr -f ~micon.attr -t \'MICN\' BEOS:M:STD_ICON $(DEST_BIN)/$(VIMNAME)tutor + @rm ~icon.attr + @rm ~micon.attr + @@ -138,6 +178,15 @@ diff -Naur vim72/src/configure.in vim72.haiku/src/configure.in *) BEOS=no; AC_MSG_RESULT(no);; esac +@@ -1009,7 +1011,7 @@ + if test "$enable_netbeans" = "yes"; then + AC_MSG_RESULT(no) + dnl On Solaris we need the socket and nsl library. +- AC_CHECK_LIB(socket, socket) ++ AC_CHECK_LIB(network, socket) + AC_CHECK_LIB(nsl, gethostbyname) + AC_MSG_CHECKING(whether compiling netbeans integration is possible) + AC_TRY_LINK([ @@ -1196,11 +1198,11 @@ fi fi @@ -366,7 +415,7 @@ diff -Naur vim72/src/gui.h vim72.haiku/src/gui.h diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc --- vim72/src/gui_beos.cc 1970-01-01 00:00:00.000000000 +0000 +++ vim72.haiku/src/gui_beos.cc 2009-05-04 21:17:48.000000000 +0000 -@@ -0,0 +1,4186 @@ +@@ -0,0 +1,4185 @@ +/* vi:set ts=8 sts=4 sw=4: + * + * VIM - Vi IMproved by Bram Moolenaar @@ -528,8 +577,7 @@ diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc + static void SendRefs(BMessage *m, bool changedir); + + sem_id fFilePanelSem; -+ BFilePanel fSavePanel; -+ BFilePanel fOpenPanel; ++ BFilePanel* fFilePanel; + BPath fBrowsedPath; + private: +}; @@ -1013,10 +1061,7 @@ diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc +VimApp::VimApp(const char *appsig): + BApplication(appsig), + fFilePanelSem(-1), -+ fOpenPanel(B_OPEN_PANEL, NULL, NULL, 0, false, -+ new BMessage('open'), NULL, true), -+ fSavePanel(B_SAVE_PANEL, NULL, NULL, 0, false, -+ new BMessage('save'), NULL, true) ++ fFilePanel(NULL) +{ +} + @@ -1108,8 +1153,7 @@ diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc + { + BFilePanel *panel; + m->FindPointer("source", (void**)&panel); -+ if(fFilePanelSem != -1 && -+ (panel == &fSavePanel || panel == &fOpenPanel)) ++ if(fFilePanelSem != -1 && panel == fFilePanel) + { + delete_sem(fFilePanelSem); + fFilePanelSem = -1; @@ -4429,31 +4473,35 @@ diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc + char_u *initdir, + char_u *filter) +{ -+ BFilePanel& Panel = (saving == TRUE) ? -+ gui.vimApp->fSavePanel : gui.vimApp->fOpenPanel; -+ ++ gui.vimApp->fFilePanel = new BFilePanel((saving == TRUE) ? B_SAVE_PANEL : B_OPEN_PANEL, ++ NULL, NULL, 0, false, ++ new BMessage((saving == TRUE) ? 'save' : 'open'), NULL, true); ++ + gui.vimApp->fBrowsedPath.Unset(); + -+ Panel.Window()->SetTitle((char*)title); -+ //if(initdir != NULL) -+ Panel.SetPanelDirectory((const char*)initdir); ++ gui.vimApp->fFilePanel->Window()->SetTitle((char*)title); ++ gui.vimApp->fFilePanel->SetPanelDirectory((const char*)initdir); + -+ Panel.Show(); ++ gui.vimApp->fFilePanel->Show(); + + gui.vimApp->fFilePanelSem = create_sem(0, "FilePanelSem"); + + while(acquire_sem(gui.vimApp->fFilePanelSem) == B_INTERRUPTED); + ++ char_u *fileName = NULL; + status_t result = gui.vimApp->fBrowsedPath.InitCheck(); + if(result == B_OK) { -+ return vim_strsave((char_u*)gui.vimApp->fBrowsedPath.Path()); ++ fileName = vim_strsave((char_u*)gui.vimApp->fBrowsedPath.Path()); + } else + if(result != B_NO_INIT) { + fprintf(stderr, "gui_mch_browse: BPath error: %#08x (%s)\n", + result, strerror(result)); + } + -+ return NULL; ++ delete gui.vimApp->fFilePanel; ++ gui.vimApp->fFilePanel = NULL; ++ ++ return fileName; +} +#endif /* FEAT_BROWSE */ + @@ -4783,7 +4831,7 @@ diff -Naur vim72/src/os_beos.rdef vim72.haiku/src/os_beos.rdef + internal = 0, + + short_info = "VIM Editor", -+ long_info = "VI Improved Editor by Bram Moolenar et al." ++ long_info = "VI Improved Editor by Bram Moolenaar et al." +}; + +//resource app_flags B_SINGLE_LAUNCH;