diff --git a/app-editors/xemacs/xemacs-21.5_hg.recipe b/app-editors/xemacs/xemacs-21.5_hg.recipe new file mode 100644 index 000000000..342f7fcd7 --- /dev/null +++ b/app-editors/xemacs/xemacs-21.5_hg.recipe @@ -0,0 +1,99 @@ +SUMMARY="XEmacs editor" +DESCRIPTION="highly customizable open source text editor and application development system" +HOMEPAGE="http://xemacs.org/" +SRC_URI="hg+https://bitbucket.org/mmu_man/xemacs#24b993054953" +REVISION="1" +LICENSE="GNU GPL v3" +COPYRIGHT="1998-2000 Hrvoje Niksic + 2000-2001 Michael Sperber + 2001 Ben Wing + 2001 Didier Verna + 2004 Stephen Turnbull + 2005-2006 Aidan Kehoe" +# TODO: FIXME: +#Bootstrapping from temacs... +#Warning: +# XEmacs was unable to determine a good value for the user's $HOME +# directory, and will be using the value: +# / +# This is probably incorrect. + + +ARCHITECTURES="x86_gcc2 x86 ?x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +#POLICY WARNING: no matching provides "cmd:b2m" for "bin/b2m" +#POLICY WARNING: no matching provides "cmd:ctags" for "bin/ctags" +#POLICY WARNING: no matching provides "cmd:ellcc" for "bin/ellcc" +#POLICY WARNING: no matching provides "cmd:etags" for "bin/etags" +#POLICY WARNING: no matching provides "cmd:gnuattach" for "bin/gnuattach" +#POLICY WARNING: no matching provides "cmd:gnuclient" for "bin/gnuclient" +#POLICY WARNING: no matching provides "cmd:gnudoit" for "bin/gnudoit" +#POLICY WARNING: no matching provides "cmd:ootags" for "bin/ootags" +#POLICY WARNING: no matching provides "cmd:xemacs_21.5_b34" for "bin/xemacs-21.5-b34" +#POLICY WARNING: no matching provides "cmd:xemacs_script" for "bin/xemacs-script +PROVIDES=" + xemacs$secondaryArchSuffix = $portVersion + app:xemacs = $portVersion + cmd:xemacs = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libncurses$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libpng$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix +# lib:libtiff$secondaryArchSuffix +# lib:libxpm$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:libiconv$secondaryArchSuffix + devel:libncurses$secondaryArchSuffix + devel:libz$secondaryArchSuffix >= 1.2.8 + devel:libpng$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix +# devel:libtiff$secondaryArchSuffix +# devel:libxpm$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:autoconf + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:tar + cmd:which + cmd:makeinfo + " + +# TODO: fix lispdir to not use $HOME +BUILD() +{ + export DISABLEASLR=1 + autoconf + export HOME=/boot/home + runConfigure ./configure \ + --with-tty=yes --with-pop --with-x11=no --with-ipv6-cname=no \ + --with-mule --with-wnn=no \ + -with-beos=yes \ + --with-toolbars=yes \ + --with-scrollbars=no \ + --with-menubars=no \ + --with-dialogs=no \ + --with-widgets=no \ + --with-dragndrop=yes \ + --with-system-malloc --disable-mc-alloc --with-mc-alloc=no \ + --with-postgresql=no \ + --disable-kkcc \ + --with-png + make clean + make +} + +INSTALL() +{ + export DISABLEASLR=1 + make install + addattr SYS:ENV DISABLEASLR=1 $binDir/xemacs-21* + addAppDeskbarSymlink $binDir/xemacs XEmacs +} diff --git a/dev-libs/libpthread_stubs/libpthread_stubs-0.3.recipe b/dev-libs/libpthread_stubs/libpthread_stubs-0.3.recipe index 5df1e235d..73951280e 100644 --- a/dev-libs/libpthread_stubs/libpthread_stubs-0.3.recipe +++ b/dev-libs/libpthread_stubs/libpthread_stubs-0.3.recipe @@ -47,4 +47,5 @@ BUILD() INSTALL() { make install + fixPkgconfig } diff --git a/games-puzzle/gemz/gemz-0.97.0.recipe b/games-puzzle/gemz/gemz-0.97.0.recipe new file mode 100644 index 000000000..012b8e9e4 --- /dev/null +++ b/games-puzzle/gemz/gemz-0.97.0.recipe @@ -0,0 +1,53 @@ +SUMMARY="Gemz is an SDL implementation of the popular puzzle game 'Bejeweled'." +DESCRIPTION="Gemz is an SDL implementation of the popular puzzle game 'Bejeweled'. +The objective of this game is to swap one gem with an adjacent gem to form a horizontal or vertical chain of three or more gems. Bonus points are given when chains of more than three identical gems are formed and when two chains are formed in one swap. Gems disappear when chains are formed and gems fall from the top to fill in gaps. Sometimes chain reactions, called cascades, are triggered, where chains are formed by the falling gems. +" +HOMEPAGE="http://sourceforge.net/projects/gemz/" +SRC_URI="http://sourceforge.net/projects/gemz/files/gemz/Source/gemz-0.97.0.tgz/download" +CHECKSUM_MD5="ea71e3cf9ee7f3b7f6d0a7f4cbe0af58" +LICENSE="GNU GPL v2" +COPYRIGHT="2003-2013 Jonathan Bilodeau" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + gemz = $portVersion + app:gemz = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libsdl_image$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:libsdl$secondaryArchSuffix + devel:libsdl_image$secondaryArchSuffix + " + +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:which + cmd:sdl_config$secondaryArchSuffix + " + +PATCHES=" + gemz-0.97.0.patch + " + +BUILD() +{ + make +} + +INSTALL() +{ + mkdir -p $appsDir/gemz + cp -r fonts gfx tilesets $appsDir/gemz + cp gemz $appsDir/gemz/gemz + + addAppDeskbarSymlink $appsDir/gemz/gemz "Gemz" +} diff --git a/games-puzzle/gemz/patches/gemz-0.97.0.patch b/games-puzzle/gemz/patches/gemz-0.97.0.patch new file mode 100644 index 000000000..6cf8f0355 --- /dev/null +++ b/games-puzzle/gemz/patches/gemz-0.97.0.patch @@ -0,0 +1,37 @@ +--- ../Makefile 2004-05-07 05:39:47.034340864 +0000 ++++ Makefile-new 2013-12-13 22:51:00.000000000 +0000 +@@ -2,7 +2,7 @@ + CFLAGS+=-O2 -Wall -W -g + #CFLAGS+=-O2 -Wall -W -g -fprofile-arcs -ftest-coverage -pg + CFLAGS+=`sdl-config --cflags` +-LFLAGS=`sdl-config --libs` -lSDL_image -L/usr/X11R6/lib -lX11 ++LFLAGS=`sdl-config --libs` -lSDL_image + SRCS= \ + SFont.c \ + board.c \ +--- ../main.c 2004-05-07 05:36:26.035389440 +0000 ++++ main-new.c 2013-12-13 23:41:06.150994944 +0000 +@@ -2,6 +2,8 @@ + #include + #include + #include ++#include ++#include + + #include "board.h" + #include "graphics.h" +@@ -27,11 +29,12 @@ + /* 3. Start the game loop */ + /* 4. Clean up before the program exits */ + /* ************************************************************************ */ +-int main() ++int main(int argc, char *argv[]) + { + game_t game; + screen_t screen; +- ++ // For tracker ++ chdir(dirname(argv[0])); + /* initialize various systems (sounds, graphics, input, etc) */ + if (init(&screen)) + { diff --git a/games-puzzle/rezerwar/patches/rezerwar-0.4.2.patch b/games-puzzle/rezerwar/patches/rezerwar-0.4.2.patch new file mode 100644 index 000000000..18254aacf --- /dev/null +++ b/games-puzzle/rezerwar/patches/rezerwar-0.4.2.patch @@ -0,0 +1,33 @@ +--- ../configure 2010-05-09 16:25:03.000524288 +0000 ++++ configure-new 2013-12-14 00:36:47.137887744 +0000 +@@ -232,7 +232,7 @@ + Haiku|BeOS) + check_sdl + check_sdl_mixer +- [ -z "$PREFIX" ] && PREFIX="/boot/apps/rezerwar" ++ [ -z "$PREFIX" ] && PREFIX="data" + [ -z "$TARGET" ] && TARGET="$PREFIX" + TARGET_BIN="$TARGET" + TARGET_DOC="$TARGET" +--- ../src/main.c 2010-05-09 16:25:03.002097152 +0000 ++++ main-new.c 2013-12-13 23:59:59.994312192 +0000 +@@ -32,7 +32,8 @@ + #endif + + #include "SDL.h" +- ++#include ++#include + #include "rezerwar.h" + #include "config.h" + +@@ -231,7 +232,8 @@ + bool loop = true; + char *path; + SDL_Joystick *js; +- ++ // For tracker ++ chdir(dirname(av[0])); + /* Version number only */ + if (has_flag(ac, av, "-v")) { + printf("%s\n", VERSION); diff --git a/games-puzzle/rezerwar/rezerwar-0.4.2.recipe b/games-puzzle/rezerwar/rezerwar-0.4.2.recipe new file mode 100644 index 000000000..8443aefe7 --- /dev/null +++ b/games-puzzle/rezerwar/rezerwar-0.4.2.recipe @@ -0,0 +1,56 @@ +SUMMARY="A puzzle game." +DESCRIPTION="Rezerwar is a puzzle game that could be described as the illegitimate child of a known tetromino game and the average pipe game. +It runs on Linux, Windows, Nintendo Wii (homebrew), FreeBSD, Amiga OS, And Now Haiku! +The whole game was created with open-source software including graphics, sounds and musics. Feel free to contribute. The goal of this game is basically to create networks of water to make them disappear, a couple tricks and techniques will help you achieve this goal faster. +" +HOMEPAGE="http://tamentis.com/projects/rezerwar/" +SRC_URI="http://tamentis.com/projects/rezerwar/files/rezerwar-0.4.2.tar.gz" +CHECKSUM_MD5="42018abe251e45ab8cc30133cde61ff8" +LICENSE="BSD (2-clause)" +COPYRIGHT="2008, 2009 Bertrand Janin" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + rezerwar = $portVersion + app:rezerwar = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libsdl_mixer$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:libsdl$secondaryArchSuffix + devel:libsdl_mixer$secondaryArchSuffix + " + +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:which + cmd:sdl_config$secondaryArchSuffix + " + +PATCHES=" + rezerwar-0.4.2.patch + " + +BUILD() +{ + configure + make +} + +INSTALL() +{ + mkdir -p $appsDir/rezerwar + cp -r data $appsDir/rezerwar + #cp -r rezerwar $appsDir/rezerwar + cp src/rezerwar $appsDir/rezerwar/rezerwar + + addAppDeskbarSymlink $appsDir/rezerwar/rezerwar "Rezerwar" +} \ No newline at end of file diff --git a/haiku-apps/beae/beae-1.2.recipe b/haiku-apps/beae/beae-1.2.recipe new file mode 100644 index 000000000..044ff2426 --- /dev/null +++ b/haiku-apps/beae/beae-1.2.recipe @@ -0,0 +1,45 @@ +DESCRIPTION="BeAE is an audio editor for Haiku, with features like silencing, fading in/out, analyzing etc." +SUMMARY="Well featured audio editor for Haiku" +HOMEPAGE="http://developer.berlios.de/projects/beae" +SRC_URI="svn://svn.berlios.de/beae/trunk#25" +REVISION="1" +COPYRIGHT="2003 Xentronix" +LICENSE="BSD (3-clause)" + +ARCHITECTURES="x86_gcc2 !x86 ?x86_64" +SECONDARY_ARCHITECTURES="!x86" + +PROVIDES=" + beae = $portVersion + app:beae = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " + +BUILD_PREREQUIRES=" + cmd:make + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + " + +BUILD() +{ + cmake . + make +} + +INSTALL() +{ + mkdir -p $appsDir/BeAE + + cd build + mv * $appsDir/BeAE + addAppDeskbarSymlink $appsDir/BeAE/BeAE +} diff --git a/haiku-apps/behappy/behappy-1.06e_git.recipe b/haiku-apps/behappy/behappy-1.06e_git.recipe index f3ea35ab7..511d9c711 100644 --- a/haiku-apps/behappy/behappy-1.06e_git.recipe +++ b/haiku-apps/behappy/behappy-1.06e_git.recipe @@ -40,5 +40,6 @@ INSTALL() { cd trunk make install BUILDHOME=/system/develop + addAppDeskbarSymlink $appsDir/BeHappy/BeHappy } diff --git a/haiku-apps/bescreencapture/bescreencapture-1.9.3.recipe b/haiku-apps/bescreencapture/bescreencapture-1.9.3.recipe new file mode 100644 index 000000000..b75375062 --- /dev/null +++ b/haiku-apps/bescreencapture/bescreencapture-1.9.3.recipe @@ -0,0 +1,51 @@ +SUMMARY="A screen recorder utility" +DESCRIPTION=" + BeScreenCapture, created by Stefano Ceccherini, is a screen + recorder utility for Haiku. It allows you to record what happens on your + screen, then save it to any media format that Haiku supports. + + BeScreenCapture can record either the entire screen, or just a + section you select. + " +HOMEPAGE="https://github.com/jackburton79/bescreencapture" +SRC_URI="https://github.com/jackburton79/bescreencapture/archive/v1.9.3.tar.gz" +LICENSE=" + BSD (3-clause) + MIT + " +COPYRIGHT="2013 Stefano Ceccherini" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86 ?x86_64" + +PROVIDES=" + bescreencapture = $portVersion + app:bescreencapture = $portVersion + " + +REQUIRES=" + haiku >= $haikuVersion + " + +BUILD_REQUIRES=" + haiku_devel >= $haikuVersion + " + +BUILD_PREREQUIRES=" + makefile_engine + cmd:make + cmd:gcc + cmd:mkdepend + " + +BUILD() +{ + make OBJ_DIR=objects \ + BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` +} + +INSTALL() +{ + mkdir -p $appsDir + cp -a objects/BeScreenCapture $appsDir + addAppDeskbarSymlink $appsDir/BeScreenCapture +} diff --git a/haiku-apps/pe/pe-2.4.3_hg615.recipe b/haiku-apps/pe/pe-2.4.3_hg615.recipe new file mode 100644 index 000000000..07ebbf5b8 --- /dev/null +++ b/haiku-apps/pe/pe-2.4.3_hg615.recipe @@ -0,0 +1,68 @@ +SUMMARY="A programmer's editor" +DESCRIPTION="Pe is a native programmer's editor for Haiku. It features syntax +highlighting and a structural view for several programming language, as well +as basic support for Makefile and Jamfile project management." +HOMEPAGE="http://pe-editor.berlios.de/" +LICENSE=" + BSD (4-clause) + MIT + " + +COPYRIGHT=" + 1996-2002 Maarteen Hekkelman + 2003-2013 Team Pe + " + +SRC_URI="hg+http://hg.berlios.de/repos/pe-editor#615" +REVISION="2" +ARCHITECTURES="x86_gcc2 x86 x86_64" + +PROVIDES=" + pe = $portVersion + app:Pe = $portVersion compat >= 2 + cmd:lpe = $portVersion compat >= 2 + " + +REQUIRES=" + haiku + lib:libpcre + lib:libpcreposix + " + +BUILD_REQUIRES=" + haiku_devel + devel:libpcre + devel:libpcreposix + " + +BUILD_PREREQUIRES=" + cmd:bison + cmd:flex + cmd:gcc + cmd:jam + cmd:ld + " + +USER_SETTINGS_FILES=" + settings/pe directory + " + +BUILD() +{ + jam -q + # multi-job builds don't work reliably +} + +INSTALL() +{ + peDir=$appsDir/Pe + + mkdir -p $appsDir + cp -a generated/distro $peDir + cp -a doc $peDir/Documentation + + mkdir $binDir + ln -sfn $peDir/lpe $binDir + + addAppDeskbarSymlink $peDir/Pe +} diff --git a/haiku-apps/yab/patches/yab-1.6.patch b/haiku-apps/yab/patches/yab-1.6.patch deleted file mode 100644 index e3b3ee9e5..000000000 --- a/haiku-apps/yab/patches/yab-1.6.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -urN yab-1.6/src/Makefile yab-1.6-haiku/src/Makefile ---- yab-1.6/src/Makefile 2009-10-23 21:02:10.031195136 +0000 -+++ yab-1.6-haiku/src/Makefile 2011-06-01 16:17:53.000000000 +0000 -@@ -45,7 +45,7 @@ - ## - ## Libraries - ## --LIBPATH = -L/boot/home/config/lib -+LIBPATH = -L/$(shell finddir B_COMMON_LIB_DIRECTORY) - #-L/boot/home/yab/CalendarControl.a - LIB = -lncurses -lbe -lroot -ltranslation -ltracker -lmedia $(ZETALIB) - -@@ -98,6 +98,7 @@ - main.o: main.c yabasic.h config.h - $(GCC) $(GCC_OPT) -c main.c -o main.o - flex.c: yabasic.flex -+ chmod 755 ./flex - ./flex $(FLEXFLAGS) -t yabasic.flex >flex.c - bison.c: yabasic.bison - bison $(BISONFLAGS) --output-file bison.c yabasic.bison diff --git a/haiku-apps/yab/patches/yab-1.7.patch b/haiku-apps/yab/patches/yab-1.7.patch deleted file mode 100644 index 47dc5d7cd..000000000 --- a/haiku-apps/yab/patches/yab-1.7.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- apps/yab-1.7/src/Makefile 2012-01-24 07:55:38.018087936 -0800 -+++ /boot/home/Makefile 2013-10-21 14:17:35.131334144 -0700 -@@ -38,14 +38,14 @@ - ## GCC Options - ## - GCC = gcc --GCC_OPT = $(DBG) $(OPT) -I. -I/boot/home/config/include/ -I/boot/home/config/include/ncurses/ -DHAVE_CONFIG -DUNIX $(HAIKUOPT) -+GCC_OPT = $(DBG) $(OPT) -I. -I/$(shell finddir B_SYSTEM_HEADERS_DIRECTORY) -DHAVE_CONFIG -DUNIX $(HAIKUOPT) - GPP = g++ - GPP_OPT = $(DBG) $(OPT) -I. -DHAVE_CONFIG -DUNIX $(HAIKUOPT) - - ## - ## Libraries - ## --LIBPATH = -L/boot/home/config/lib -+LIBPATH = -L/$(shell finddir B_SYSTEM_LIB_DIRECTORY) - LIB = -lncurses -lbe -lroot -ltranslation -ltracker -lmedia -llocale - - ## flags for flex (-d for debugging) -@@ -97,6 +97,7 @@ - main.o: main.c yabasic.h config.h - $(GCC) $(GCC_OPT) -c main.c -o main.o - flex.c: yabasic.flex -+ chmod 755 ./flex - ./flex $(FLEXFLAGS) -t yabasic.flex >flex.c - bison.c: yabasic.bison - bison $(BISONFLAGS) --output-file bison.c yabasic.bison diff --git a/haiku-apps/yab/yab-1.7.recipe b/haiku-apps/yab/yab-1.7.recipe index 30b286d03..f2a6efff2 100644 --- a/haiku-apps/yab/yab-1.7.recipe +++ b/haiku-apps/yab/yab-1.7.recipe @@ -1,17 +1,17 @@ SUMMARY="yab is an extended version of yabsic, a BASIC programming language" -DESCRIPTION="yab is an extended version of yabasic, a BASIC programming language, with special commands designed for BeOS, Haiku and Zeta." -HOMEPAGE="http://sourceforge.net/projects/yab-interpreter" -SRC_URI="http://ports-space.haiku-files.org/source/yab-1.7.zip" +DESCRIPTION="yab is an extended version of yabasic, a BASIC programming language, with special commands designed for BeOS, Haiku and Zeta." +HOMEPAGE="http://sourceforge.net/projects/yab-interpreter" +SRC_URI="git+https://github.com/HaikuArchives/Yab.git" REVISION="2" -CHECKSUM_MD5="2b465895d9eb2e8383f035dd67b88a20" +#CHECKSUM_MD5="2b465895d9eb2e8383f035dd67b88a20" LICENSE="Artistic GNU GPL v2" COPYRIGHT="1995-2006 Marc-Oliver Ihm (yabasic) 2006-2009 Jan Bungeroth (yab improvements)" - -ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -SOURCE_DIR="yab-$portVersion" +ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64" + +#SOURCE_DIR="yab-$portVersion" PROVIDES=" cmd:yab @@ -20,32 +20,30 @@ PROVIDES=" REQUIRES=" haiku >= $haikuVersion " - + BUILD_REQUIRES=" - haiku_devel + haiku_devel >= $haikuVersion " - + BUILD_PREREQUIRES=" - haiku + cmd:bison + cmd:flex cmd:gcc cmd:make + cmd:mkdepend + cmd:perl + makefile_engine " BUILD() { - ls - ls apps - ls apps/yab-${portVersion} - - cd apps/yab-${portVersion}/src - make clean - make + cd src + make $jobArgs BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` } INSTALL() { - ls -r - $YABDIR=`FINDDIR(B_APPS_DIRECTORY`/yab + $YABDIR=$appsDir/yab mkdir -p ${YABDIR} cp -a ${YABDIR}apps/yab cp -a Documentation ${YABDIR} diff --git a/haiku-libs/libsanta/libsanta-0.0.1.recipe b/haiku-libs/libsanta/libsanta-0.0.1.recipe index 347c3bea7..ad72ff1f9 100644 --- a/haiku-libs/libsanta/libsanta-0.0.1.recipe +++ b/haiku-libs/libsanta/libsanta-0.0.1.recipe @@ -1,12 +1,12 @@ SUMMARY="Custom widget library" -DESCRIPTION="libsanta has some useful custom widgets." +DESCRIPTION="libsanta has some useful custom widgets (color picker, column list view, scroll view etc.)" HOMEPAGE="https://github.com/HaikuArchives/SantasGiftBag" COPYRIGHT="briant@timelinevista.com" LICENSE="libsanta" SRC_URI="git+https://github.com/HaikuArchives/SantasGiftBag#4b62541" -REVISION="1" -ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -SECONDARY_ARCHITECTURES="x86_gcc2 ?x86" +REVISION="2" +ARCHITECTURES="x86_gcc2 x86 ?x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" PROVIDES=" libsanta$secondaryArchSuffix = $portVersion @@ -25,38 +25,63 @@ BUILD_PREREQUIRES=" cmd:gcc$secondaryArchSuffix cmd:ld$secondaryArchSuffix cmd:make + cmd:mkdepend " +PATCHES="libsanta-0.0.1.patchset" + BUILD() { make TYPE=STATIC \ - OBJ_DIR=build \ + OBJ_DIR=obj-static \ BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` make TYPE=SHARED \ - OBJ_DIR=build \ + OBJ_DIR=obj-shared \ BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` } INSTALL() { - mkdir -p $developLibDir $libDir + mkdir -p $developLibDir $developDocDir $includeDir/santa $libDir - cp -R Documentation $developLibDir + cp -R Documentation/* $developDocDir - cd build + cd obj-static cp libsanta.a $developLibDir + + cd ../obj-shared cp libsanta $libDir/libsanta.so + cd .. + + # Copy header files to $includeDir + + cp ./BetterScrollView/BetterScrollView.h \ + ./Colors.h \ + ./ColumnListView/CLVColumn.h \ + ./ColumnListView/CLVColumnLabelView.h \ + ./ColumnListView/CLVEasyItem.h \ + ./ColumnListView/CLVListItem.h \ + ./ColumnListView/ColumnListView.h \ + ./Cursors/Cursors.h \ + ./NewStrings/NewStrings.h \ + ./PrefilledBitmap/PrefilledBitmap.h \ + ./ScrollViewCorner/ScrollViewCorner.h $includeDir/santa + + symlinkRelative -s $libDir/libsanta.so $developLibDir + packageEntries devel \ - $developLibDir + $developLibDir \ + $developDocDir \ + $includeDir } # ----- devel package ------------------------------------------------------- PROVIDES_devel=" libsanta${secondaryArchSuffix}_devel = $portVersion - libsanta$secondaryArchSuffix = $portVersion + devel:libsanta$secondaryArchSuffix = $portVersion " REQUIRES_devel=" libsanta$secondaryArchSuffix == $portVersion base diff --git a/haiku-libs/libsanta/patches/libsanta-0.0.1.patchset b/haiku-libs/libsanta/patches/libsanta-0.0.1.patchset new file mode 100644 index 000000000..baaab658e --- /dev/null +++ b/haiku-libs/libsanta/patches/libsanta-0.0.1.patchset @@ -0,0 +1,22 @@ +From 459e758be3720ec93b1029eea0db2af14db38121 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Fri, 13 Dec 2013 00:03:52 -0700 +Subject: Fix stdc++ libs on gcc4 + + +diff --git a/Makefile b/Makefile +index 57c3914..2719e8d 100644 +--- a/Makefile ++++ b/Makefile +@@ -51,7 +51,7 @@ RSRCS= + # naming scheme you need to specify the path to the library + # and it's name + # library: my_lib.a entry: my_lib.a or path/my_lib.a +-LIBS= be root stdc++.r4 ++LIBS= be root $(STDCPPLIBS) + + # specify additional paths to directories following the standard + # libXXX.so or libXXX.a naming scheme. You can specify full paths +-- +1.8.3.4 + diff --git a/sys-apps/which/which-2.20.recipe b/sys-apps/which/which-2.20.recipe index acbdd52e3..8df104316 100644 --- a/sys-apps/which/which-2.20.recipe +++ b/sys-apps/which/which-2.20.recipe @@ -5,7 +5,7 @@ LICENSE="GNU GPL v2" SRC_URI="http://ftp.gnu.org/gnu/which/which-2.20.tar.gz" CHECKSUM_MD5="95be0501a466e515422cde4af46b2744" REVISION="2" -ARCHITECTURES="x86_gcc2 x86" +ARCHITECTURES="x86_gcc2 x86 x86_64" PATCHES="which-2.20.patch" diff --git a/sys-devel/binutils/binutils-2.17_2013_04_21.recipe b/sys-devel/binutils/binutils-2.17_2013_04_21.recipe index b2db590e1..384391eaa 100644 --- a/sys-devel/binutils/binutils-2.17_2013_04_21.recipe +++ b/sys-devel/binutils/binutils-2.17_2013_04_21.recipe @@ -1,6 +1,6 @@ SUMMARY="The GNU assembler, linker and binary utilities" HOMEPAGE="http://www.gnu.org/software/binutils" -SRC_URI="git+git://github.com/haiku/BuildtoolsPM.git#ab0f66e" +SRC_URI="git+git://github.com/haiku/buildtools.git#ab0f66e" REVISION="2" LICENSE=" GNU GPL v2 diff --git a/sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe b/sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe index 3db357b10..42a3d32d1 100644 --- a/sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe +++ b/sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe @@ -2,7 +2,7 @@ SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}" HOMEPAGE="http://www.gnu.org/software/binutils" SRC_URI=" - git+git://github.com/haiku/BuildtoolsPM.git#db2a6d28f6c6a92cfb1c619b0828dfbf6b87ca30" + git+git://github.com/haiku/buildtools.git#db2a6d28f6c6a92cfb1c619b0828dfbf6b87ca30" REVISION="2" LICENSE=" GNU GPL v2 diff --git a/sys-devel/gcc/gcc-2.95.3_2013_08_12.recipe b/sys-devel/gcc/gcc-2.95.3_2013_08_12.recipe index 79349b7c1..ddb717d77 100644 --- a/sys-devel/gcc/gcc-2.95.3_2013_08_12.recipe +++ b/sys-devel/gcc/gcc-2.95.3_2013_08_12.recipe @@ -7,8 +7,8 @@ LICENSE=" " COPYRIGHT="1988-2000 Free Software Foundation, Inc." SRC_URI=" - git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c - git+git://github.com/haiku/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c + git+file://$portBaseDir/../binutils/download/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c + git+git://github.com/haiku/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c " REVISION="1" ARCHITECTURES="x86_gcc2" diff --git a/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe b/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe index e8a2c5797..0e134cf65 100644 --- a/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe +++ b/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe @@ -7,8 +7,8 @@ LICENSE=" " COPYRIGHT="1988-2013 Free Software Foundation, Inc." SRC_URI=" - git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c - git+git://github.com/haiku/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c + git+file://$portBaseDir/../binutils/download/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c + git+git://github.com/haiku/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c " REVISION="4" ARCHITECTURES="x86 x86_64" diff --git a/sys-devel/jam/jam-2.5_2012_10_12.recipe b/sys-devel/jam/jam-2.5_2012_10_12.recipe index 7479d30b2..713fa098f 100644 --- a/sys-devel/jam/jam-2.5_2012_10_12.recipe +++ b/sys-devel/jam/jam-2.5_2012_10_12.recipe @@ -19,8 +19,8 @@ HOMEPAGE="http://www.perforce.com/jam/jam.html" LICENSE="Jam" COPYRIGHT="1993-2003 Christopher Seiwald" SRC_URI=" - git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#278de7bc9243876c2e08f8d6a243d510c5000462 - git+git://github.com/haiku/BuildtoolsPM.git#278de7bc9243876c2e08f8d6a243d510c5000462 + git+file://$portBaseDir/../binutils/download/buildtools.git#278de7bc9243876c2e08f8d6a243d510c5000462 + git+git://github.com/haiku/buildtools.git#278de7bc9243876c2e08f8d6a243d510c5000462 " REVISION="1" ARCHITECTURES="x86_gcc2 x86 x86_64" diff --git a/www-client/links/links-2.3pre2.recipe b/www-client/links/links-2.3pre2.recipe index c2882b221..48546dcab 100644 --- a/www-client/links/links-2.3pre2.recipe +++ b/www-client/links/links-2.3pre2.recipe @@ -1,16 +1,56 @@ +SUMMARY="links web browser" DESCRIPTION="links web browser" -HOMEPAGE="http://links.twibright.com" +HOMEPAGE="http://links.twibright.com/" SRC_URI="http://links.twibright.com/download/links-2.3pre2.tar.gz" REVISION="1" -STATUS_HAIKU="stable" -DEPEND="" CHECKSUM_MD5="bb2a4e058c88b8ec0c9f6c0e1640555c" +LICENSE="GNU GPL v2" +COPYRIGHT="1999 - 2011 Mikulas Patocka + 2000 - 2011 Petr Kulhavy, Karel Kulhavy, Martin Pergel" + +ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" + +PROVIDES=" + links$secondaryArchSuffix = $portVersion + cmd:links$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libpng$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix +# lib:libtiff$secondaryArchSuffix + lib:libz$secondaryArchSuffix + openssl >= 1.0.0 + " + +BUILD_REQUIRES=" +# devel:libGL$secondaryArchSuffix + devel:libglu$secondaryArchSuffix + devel:libpng$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix +# devel:libtiff$secondaryArchSuffix + devel:libz$secondaryArchSuffix >= 1.2.8 + openssl_devel >= 1.0.0 + " + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + cmd:libtool + cmd:aclocal + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:pkg_config$secondaryArchSuffix + " + +PATCHES="links-2.3pre2.patch" + BUILD() { - cd links-2.3pre2 autoconf - ./configure --prefix=`finddir B_COMMON_DIRECTORY` \ - --mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \ + runConfigure ./configure \ --without-x \ --enable-utf-8 \ --enable-graphics @@ -22,10 +62,6 @@ BUILD() INSTALL() { - cd links-2.3pre2 - make install DESTDIR=${DESTDIR} + make install } -LICENSE="GNU GPL v2" -COPYRIGHT="1999 - 2011 Mikulas Patocka - 2000 - 2011 Petr Kulhavy, Karel Kulhavy, Martin Pergel" diff --git a/www-client/links/links-2.8.recipe b/www-client/links/links-2.8.recipe new file mode 100644 index 000000000..d501db8ff --- /dev/null +++ b/www-client/links/links-2.8.recipe @@ -0,0 +1,69 @@ +SUMMARY="links web browser" +DESCRIPTION="links web browser" +HOMEPAGE="http://links.twibright.com/" +SRC_URI="http://links.twibright.com/download/links-2.8.tar.gz" +REVISION="1" +CHECKSUM_MD5="34c67f980105643fc6cd63a14acc626f" +LICENSE="GNU GPL v2" +COPYRIGHT="1999 - 2011 Mikulas Patocka + 2000 - 2011 Petr Kulhavy, Karel Kulhavy, Martin Pergel" + + +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + links$secondaryArchSuffix = $portVersion + cmd:links$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libpng$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix +# lib:libtiff$secondaryArchSuffix + lib:libz$secondaryArchSuffix + openssl$secondaryArchSuffix >= 1.0.0 + " + +BUILD_REQUIRES=" +# devel:libGL$secondaryArchSuffix + devel:libglu$secondaryArchSuffix + devel:libpng$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix +# devel:libtiff$secondaryArchSuffix + devel:libz$secondaryArchSuffix >= 1.2.8 + openssl${secondaryArchSuffix}_devel >= 1.0.0 + " + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + cmd:libtool + cmd:aclocal + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:pkg_config$secondaryArchSuffix + " + +PATCHES="links-2.8.patch" + +BUILD() +{ + aclocal + automake --add-missing + autoheader + automake + autoconf + runConfigure ./configure \ + --without-x \ + --enable-graphics + make +} + +INSTALL() +{ + make install + addAppDeskbarSymlink $binDir/links Links +} + diff --git a/www-client/links/patches/links-2.8.patch b/www-client/links/patches/links-2.8.patch new file mode 100644 index 000000000..c548ab300 --- /dev/null +++ b/www-client/links/patches/links-2.8.patch @@ -0,0 +1,1386 @@ +diff -urN links-2.8.org/acconfig.h links-2.8/acconfig.h +--- links-2.8.org/acconfig.h 2013-08-03 18:22:59.028311552 +0200 ++++ links-2.8/acconfig.h 2013-12-12 20:39:35.528744448 +0100 +@@ -179,6 +179,9 @@ + #undef GRDRV_ATHEOS + + /* */ ++#undef GRDRV_HAIKU ++ ++/* */ + #undef GRDRV_GRX + + /* */ +diff -urN links-2.8.org/beos.c links-2.8/beos.c +--- links-2.8.org/beos.c 2013-01-23 05:52:02.030670848 +0100 ++++ links-2.8/beos.c 2013-12-12 19:10:01.005242880 +0100 +@@ -3,7 +3,7 @@ + * This file is a part of the Links program, released under GPL + */ + +-#if defined(__BEOS__) || defined(__HAIKU__) ++#if defined(__BEOS__) + + #include "com-defs.h" + +diff -urN links-2.8.org/configure.in links-2.8/configure.in +--- links-2.8.org/configure.in 2013-09-17 02:11:46.046137344 +0200 ++++ links-2.8/configure.in 2013-12-13 00:05:02.135004160 +0100 +@@ -13,7 +13,7 @@ + AUTOHEADER="./missing autoheader" + image_formats="GIF PNG XBM" + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADER(config.h) + + dnl Checks for programs. + AC_PROG_CC +@@ -577,10 +577,10 @@ + + AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no) + if test "$cf_result" = no; then +- AC_CHECK_LIB(socket, socket) +- if test "$ac_cv_lib_socket_socket" = no; then +- AC_CHECK_LIB(network, socket) +- if test "$ac_cv_lib_network_socket" = no; then ++ AC_CHECK_LIB(network, socket) ++ if test "$ac_cv_lib_network_socket" = no; then ++ AC_CHECK_LIB(socket, socket) ++ if test "$ac_cv_lib_socket_socket" = no; then + AC_CHECK_LIB(watt, socket) + if test "$ac_cv_lib_watt_socket" = no; then + AC_ERROR([socket function not present]) +@@ -722,6 +722,7 @@ + AC_DEFINE(HAVE_BEGINTHREAD) + fi + AC_CHECK_HEADERS(atheos/threads.h) ++AC_CHECK_HEADERS(kernel/OS.h) + AC_HAVE_FUNCS(spawn_thread) + AC_HAVE_FUNCS(resume_thread) + +@@ -876,6 +877,7 @@ + + + cf_have_atheos=no ++cf_have_haiku=no + + if test "$cf_use_graphics" != no; then + AC_DEFINE(G) +@@ -888,6 +890,7 @@ + AC_ARG_WITH(pmshell, [ --without-pmshell compile without PMShell graphics driver],[if test "$withval" = no; then disable_pmshell=yes; else disable_pmshell=no; fi]) + AC_ARG_WITH(windows, [ --without-windows compile without Windows graphics driver],[if test "$withval" = no; then disable_windows=yes; else disable_windows=no; fi]) + AC_ARG_WITH(atheos, [ --without-atheos compile without Atheos graphics driver],[if test "$withval" = no; then disable_atheos=yes; else disable_atheos; fi]) ++AC_ARG_WITH(haiku, [ --without-haiku compile without Haiku/BeOS graphics driver],[if test "$withval" = no; then disable_haiku=yes; else disable_haiku=no; fi]) + AC_ARG_WITH(grx, [ --without-grx compile without DOS GRX graphics driver],[if test "$withval" = no; then disable_grx=yes; else disable_grx; fi]) + + drivers="" +@@ -1124,6 +1127,31 @@ + fi + fi + ++if test "$disable_haiku" != yes ; then ++ old_ext="$ac_ext" ++ ac_ext=cpp ++ AC_CHECK_HEADERS(interface/View.h) ++ AC_CHECK_HEADERS(interface/Window.h) ++ AC_CHECK_HEADERS(interface/Screen.h) ++ AC_CHECK_HEADERS(interface/Bitmap.h) ++ AC_CHECK_HEADERS(support/Locker.h) ++ AC_CHECK_HEADERS(app/Application.h) ++ ac_ext="$old_ext" ++ ++ if test "$ac_cv_header_kernel_OS_h" = yes && ++ test "$ac_cv_header_interface_View_h" = yes && ++ test "$ac_cv_header_interface_Window_h" = yes && ++ test "$ac_cv_header_interface_Screen_h" = yes && ++ test "$ac_cv_header_interface_Bitmap_h" = yes && ++ test "$ac_cv_header_support_Locker_h" = yes && ++ test "$ac_cv_header_app_Application_h" = yes; then ++ AC_PROG_CXX ++ AC_DEFINE(GRDRV_HAIKU) ++ drivers="$drivers HAIKU" ++ cf_have_haiku=yes ++ fi ++fi ++ + if test "$disable_grx" != yes -a "$ac_cv_have_djgpp" = yes; then + LIBS_X="$LIBS" + AC_CHECK_HEADERS(grx20.h) +@@ -1230,6 +1258,7 @@ + + + AM_CONDITIONAL(ATHEOS_GR, test "$cf_have_atheos" = yes) ++AM_CONDITIONAL(HAIKU_GR, test "$cf_have_haiku" = yes) + + test "$ac_cv_have_emx" = yes && LDFLAGS="$LDFLAGS -Zexe" + +diff -urN links-2.8.org/drivers.c links-2.8/drivers.c +--- links-2.8.org/drivers.c 2013-08-12 23:15:36.026214400 +0200 ++++ links-2.8/drivers.c 2013-12-12 20:42:12.595329024 +0100 +@@ -31,6 +31,9 @@ + #ifdef GRDRV_ATHEOS + extern struct graphics_driver atheos_driver; + #endif ++#ifdef GRDRV_HAIKU ++extern struct graphics_driver haiku_driver; ++#endif + #ifdef GRDRV_GRX + extern struct graphics_driver grx_driver; + #endif +@@ -51,6 +54,9 @@ + #ifdef GRDRV_ATHEOS + &atheos_driver, + #endif ++#ifdef GRDRV_HAIKU ++ &haiku_driver, ++#endif + #ifndef SPAD + #ifdef GRDRV_X + &x_driver, +diff -urN links-2.8.org/haiku.cpp links-2.8/haiku.cpp +--- links-2.8.org/haiku.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ links-2.8/haiku.cpp 2013-12-13 00:23:09.939786240 +0100 +@@ -0,0 +1,890 @@ ++/* haiku.cpp ++ * (c) 2007 François Revol ++ * This file is a part of the Links program, released under GPL ++ */ ++ ++#if defined __BEOS__ || defined __HAIKU__ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * GUI code ++ */ ++ ++/* ++ * TODO: ++ * - BeOS doesn't handle BView::DrawBitmap() with RGB24, and links doesn't seem to handle RGB32, ++ * so the colorspace is forced into 16bpp for now. ++ * - more paste handling ? ++ * - more DnD (maybe check if in menu or not and prepend "g" ?) ++ * - handle DnD of Net+ bookmarks ++ */ ++ ++extern "C" { ++#include "cfg.h" ++} ++ ++#ifdef GRDRV_HAIKU ++ ++extern "C" { ++#include "links.h" ++} ++#undef B_ENTER ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++//#define DBG(l...) fprintf(stderr, l); ++#define DBG(l...) {} ++ ++/* ++#ifdef debug ++#undef debug ++#endif ++#define debug(x) ++#define fprintf(x, y) ++*/ ++ ++extern "C" struct graphics_driver haiku_driver; ++ ++class LinksApplication : public BApplication { ++ public: ++ LinksApplication():BApplication("application/x-vnd.links"){} ++ virtual void RefsReceived(BMessage *message); ++ virtual bool QuitRequested(); ++}; ++ ++class LinksView; ++ ++class LinksWindow : public BWindow { ++ public: ++ LinksWindow(BRect r); ++ ~LinksWindow(); ++ virtual void FrameResized(float width, float height); ++ virtual bool QuitRequested(); ++ int resized; ++ LinksView *view; ++}; ++ ++class LinksView : public BView { ++ public: ++ LinksView(LinksWindow *w); ++ ~LinksView(); ++ virtual void Draw(BRect r); ++ virtual void MouseDown(BPoint p); ++ virtual void MouseUp(BPoint p); ++ virtual void MouseMoved(BPoint p, uint32 transit, const BMessage *dragmsg); ++ virtual void KeyDown(const char *s, int32 numBytes); ++ virtual void MessageReceived(BMessage *msg); ++ LinksWindow *win; ++ struct graphics_device *dev; ++ void d_flush(); ++ int flushing; ++ int last_x, last_y; ++}; ++ ++#define lv(dev) ((LinksView *)(dev)->driver_data) ++ ++#define lock_dev(dev) do { if (!lv(dev)->win->Lock()) return; } while (0) ++#define lock_dev0(dev) do { if (!lv(dev)->win->Lock()) return 0; } while (0) ++#define unlock_dev(dev) do { lv(dev)->win->Unlock(); } while (0) ++ ++void be_get_size(struct graphics_device *dev); ++ ++#define detach_message(dev) \ ++ BMessage *current = Looper()->DetachCurrentMessage(); \ ++ if (current) { \ ++ current->AddPointer("linksdev", dev); \ ++ } ++ ++#define pipe_message(dev) \ ++ if (current) { \ ++ write(wpipe, ¤t, sizeof(current)); \ ++ } ++ ++#define detach_and_pipe_message(dev) do { \ ++ BMessage *current = Looper()->DetachCurrentMessage(); \ ++ if (current) { \ ++ current->AddPointer("linksdev", dev); \ ++ write(wpipe, ¤t, sizeof(current)); \ ++ } \ ++} while (0) ++ ++LinksApplication *be_links_app; ++BLocker *be_lock = NULL; ++ ++int msg_pipe[2]; ++ ++thread_id be_app_thread_id; ++ ++#define rpipe (msg_pipe[0]) ++#define wpipe (msg_pipe[1]) ++ ++#define small_color (sizeof(rgb_color) <= sizeof(long)) ++#define get_color32(c, rgb) rgb_color c((rgb_color){(rgb >> 16) & 255, (rgb >> 8) & 255, rgb & 255, 255}) ++ ++color_space be_cs_desktop, be_cs_bmp; ++ ++int be_x_size, be_y_size; ++ ++int be_win_x_size, be_win_y_size; ++int be_win_x_pos, be_win_y_pos; ++ ++static BMessage *initial_refs_msg; ++ ++void LinksApplication::RefsReceived(BMessage *message) ++{ ++ entry_ref ref; ++ //if (!IsLaunching()) ++ // return; ++ BMessenger msgr(WindowAt(0)); ++ BMessage *m = new BMessage(*message); ++ m->AddSpecifier("View", (long)0); ++ //m->what = B_SIMPLE_DATA; ++ if (msgr.IsValid()) { ++ msgr.SendMessage(m); ++ } else ++ initial_refs_msg = m; ++} ++ ++bool LinksApplication::QuitRequested() ++{ ++ BApplication::QuitRequested(); ++ //printf("qc: %ld\n", CountWindows()); ++ return true; ++} ++ ++LinksWindow::LinksWindow(BRect r):BWindow(r, "Links", B_DOCUMENT_WINDOW, 0) ++{ ++ DBG("LINKSWINDOW\n"); ++ resized = 0; ++ view = NULL; ++} ++ ++LinksWindow::~LinksWindow() ++{ ++ view = NULL; ++ DBG("~LINKSWINDOW\n"); ++} ++ ++void LinksWindow::FrameResized(float width, float height) ++{ ++ resized = 1; ++} ++ ++bool LinksWindow::QuitRequested() ++{ ++ detach_and_pipe_message(view->dev); ++ return false; ++} ++ ++void do_flush(void *p_dev) ++{ ++ struct graphics_device *dev = (struct graphics_device *)p_dev; ++ LinksView *v = lv(dev); ++ v->win->Lock(); ++ v->win->Flush(); ++ v->win->Unlock(); ++ v->flushing = 0; ++} ++ ++LinksView::LinksView(LinksWindow *w):BView(w->Bounds(), "Links", B_FOLLOW_ALL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_NAVIGABLE) ++{ ++ DBG("LINKSVIEW\n"); ++ (win = w)->AddChild(this); ++ SetViewColor(B_TRANSPARENT_32_BIT); ++ MakeFocus(); ++ w->view = this; ++ flushing = 0; ++ last_x = last_y = 0; ++} ++ ++LinksView::~LinksView() ++{ ++ win->view = NULL; ++ DBG("~LINKSVIEW\n"); ++} ++ ++void LinksView::d_flush() ++{ ++ if (flushing) return; ++ register_bottom_half(do_flush, this->dev); ++ flushing = 1; ++} ++ ++#undef select ++ ++int be_loop_select(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t) ++{ ++ int v; ++ v = select(n, r, w, e, t); ++ check_bottom_halves(); ++ return v; ++} ++ ++void be_paste_string(struct graphics_device *dev, const char *str) ++{ ++ unsigned char *s = (unsigned char *)str; ++ int c, i; ++ while (s && *s) { ++ GET_UTF_8(s, c); ++ if (dev) dev->keyboard_handler(dev, c, 0); ++ } ++} ++ ++void be_get_event(void *dummy) ++{ ++ BMessage *msg; ++ LinksView *view = NULL; ++ LinksWindow *win = NULL; ++ struct graphics_device *dev; ++ read(rpipe, &msg, sizeof(msg)); ++ DBG("GETE\n"); ++ if (!msg) ++ return; ++ if (msg->FindPointer("linksdev", (void **)&dev) < B_OK) ++ return; ++ if (dev) { ++ view = lv(dev); ++ if (view) ++ win = dynamic_cast(view->Window()); ++ } ++ switch (msg->what) { ++ case B_QUIT_REQUESTED: ++ if (dev) ++ dev->keyboard_handler(dev, KBD_CTRL_C, 0); ++ break; ++ case _UPDATE_: ++ { ++ BRect r; ++ if (msg->FindRect("updateRect", &r) < B_OK) ++ return; ++ struct rect rr; ++ rr.x1 = (int)r.left; ++ rr.x2 = (int)r.right + 1; ++ rr.y1 = (int)r.top; ++ rr.y2 = (int)r.bottom + 1; ++ /*DBG("paint: %d %d %d %d\n", rr.x1, rr.x2, rr.y1, rr.y2);*/ ++ if (dev) { ++ if (!win->resized) dev->redraw_handler(dev, &rr); ++ else { ++ be_get_size(dev); ++ win->resized = 0; ++ dev->resize_handler(dev); ++ } ++ } ++ check_bottom_halves(); ++ } ++ break; ++ case B_MOUSE_DOWN: ++ { ++ BPoint where; ++ int32 buttons; ++ int btn = B_LEFT; ++ if (msg->FindInt32("buttons", &buttons) != B_OK) ++ return; ++ if (msg->FindPoint("where", &where) != B_OK) ++ return; ++ if (buttons & B_PRIMARY_MOUSE_BUTTON) ++ btn = B_LEFT; ++ else if (buttons & B_SECONDARY_MOUSE_BUTTON) ++ btn = B_RIGHT; ++ else if (buttons & B_TERTIARY_MOUSE_BUTTON) ++ btn = B_MIDDLE; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 1)) ++ btn = B_FOURTH; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 2)) ++ btn = B_FIFTH; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 3)) ++ btn = B_SIXTH; ++ if (dev) dev->mouse_handler(dev, view->last_x = (int)where.x, view->last_y = (int)where.y, B_DOWN | btn); ++ } ++ break; ++ case B_MOUSE_UP: ++ { ++ BPoint where; ++ int32 buttons; ++ int btn = B_LEFT; ++ if (msg->FindInt32("buttons", &buttons) != B_OK) ++ return; ++ if (msg->FindPoint("where", &where) != B_OK) ++ return; ++ if (buttons & ~B_PRIMARY_MOUSE_BUTTON == 0) ++ btn = B_LEFT; ++ else if (buttons & ~B_SECONDARY_MOUSE_BUTTON == 0) ++ btn = B_RIGHT; ++ else if (buttons & ~B_TERTIARY_MOUSE_BUTTON == 0) ++ btn = B_MIDDLE; ++ else if (buttons & ~(B_TERTIARY_MOUSE_BUTTON << 1) == 0) ++ btn = B_FOURTH; ++ else if (buttons & ~(B_TERTIARY_MOUSE_BUTTON << 2) == 0) ++ btn = B_FIFTH; ++ else if (buttons & ~(B_TERTIARY_MOUSE_BUTTON << 3) == 0) ++ btn = B_SIXTH; ++ if (dev) dev->mouse_handler(dev, view->last_x = (int)where.x, view->last_y = (int)where.y, B_UP | btn); ++ } ++ break; ++ case B_MOUSE_MOVED: ++ { ++ BPoint where; ++ int32 buttons; ++ int btn = B_LEFT; ++ if (msg->FindInt32("buttons", &buttons) != B_OK) ++ return; ++ if (msg->FindPoint("where", &where) != B_OK) ++ return; ++ if (buttons & B_PRIMARY_MOUSE_BUTTON) ++ btn = B_LEFT; ++ else if (buttons & B_SECONDARY_MOUSE_BUTTON) ++ btn = B_RIGHT; ++ else if (buttons & B_TERTIARY_MOUSE_BUTTON) ++ btn = B_MIDDLE; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 1)) ++ btn = B_FOURTH; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 2)) ++ btn = B_FIFTH; ++ else if (buttons & (B_TERTIARY_MOUSE_BUTTON << 3)) ++ btn = B_SIXTH; ++ if (dev) dev->mouse_handler(dev, view->last_x = (int)where.x, view->last_y = (int)where.y, !buttons ? B_MOVE : B_DRAG | btn); ++ } ++ break; ++ case B_KEY_DOWN: ++ { ++ int32 modifiers; ++ int32 numBytes; ++ const char *bytes; ++ int c; ++ int mods = 0; ++ if (msg->FindInt32("modifiers", &modifiers) != B_OK) ++ return; ++ if (msg->FindString("bytes", &bytes) != B_OK) ++ return; ++ unsigned char buf[4] = { 0, 0, 0, 0 }; ++ unsigned char *ss; ++ if (modifiers & (B_LEFT_CONTROL_KEY | B_RIGHT_CONTROL_KEY | B_LEFT_COMMAND_KEY | B_RIGHT_COMMAND_KEY)) { ++ int32 raw; ++ if (msg->FindInt32("raw_char", &raw) != B_OK) ++ return; ++ buf[0] = (unsigned char)raw; ++ ss = buf; ++ } else ++ ss = (unsigned char *)bytes; ++ ++ GET_UTF_8(ss, c); ++ switch (c) { ++ case B_BACKSPACE: c = KBD_BS; break; ++ case B_ENTER: c = KBD_ENTER; break; ++ case B_SPACE: c = ' '; break; ++ case B_TAB: c = KBD_TAB; break; ++ case B_ESCAPE: c = KBD_ESC; break; ++ case B_LEFT_ARROW: c = KBD_LEFT; break; ++ case B_RIGHT_ARROW: c = KBD_RIGHT; break; ++ case B_UP_ARROW: c = KBD_UP; break; ++ case B_DOWN_ARROW: c = KBD_DOWN; break; ++ case B_INSERT: c = KBD_INS; break; ++ case B_DELETE: c = KBD_DEL; break; ++ case B_HOME: c = KBD_HOME; break; ++ case B_END: c = KBD_END; break; ++ case B_PAGE_UP: c = KBD_PAGE_UP; break; ++ case B_PAGE_DOWN: c = KBD_PAGE_DOWN; break; ++ default: if (c < 32) c = 0; ++ else modifiers &= ~(B_LEFT_SHIFT_KEY|B_RIGHT_SHIFT_KEY); ++ break; ++ } ++ if (modifiers & (B_LEFT_SHIFT_KEY|B_RIGHT_SHIFT_KEY)) ++ mods |= KBD_SHIFT; ++ if (modifiers & (B_LEFT_CONTROL_KEY|B_RIGHT_CONTROL_KEY)) ++ mods |= KBD_CTRL; ++ if (modifiers & (B_LEFT_COMMAND_KEY|B_RIGHT_COMMAND_KEY)) ++ mods |= KBD_ALT; ++ if (c) if (dev) dev->keyboard_handler(dev, c, mods); ++ } ++ break; ++ case B_MOUSE_WHEEL_CHANGED: ++ { ++ float delta_x, delta_y; ++ if (msg->FindFloat("be:wheel_delta_x", &delta_x) != B_OK) ++ delta_x = 0; ++ if (msg->FindFloat("be:wheel_delta_y", &delta_y) != B_OK) ++ delta_y = 0; ++ if (delta_y) if (dev) dev->mouse_handler(dev, view->last_x, view->last_y, B_MOVE | (delta_y > 0 ? B_WHEELDOWN : B_WHEELUP)); ++ if (delta_x) if (dev) dev->mouse_handler(dev, view->last_x, view->last_y, B_MOVE | (delta_x < 0 ? B_WHEELLEFT : B_WHEELRIGHT)); ++ } ++ break; ++ case B_PASTE: ++ if (be_clipboard->Lock()) { ++ BMessage *data = be_clipboard->Data(); ++ if (data) { ++ const char *text_plain; ++ ssize_t len; ++ //data->PrintToStream(); ++ if (data->FindData("text/plain", B_MIME_TYPE, (const void **)&text_plain, &len) == B_OK) { ++ be_paste_string(dev, text_plain); ++ } ++ } ++ be_clipboard->Unlock(); ++ } ++ break; ++ case B_REFS_RECEIVED: ++ if (dev) ++ be_paste_string(dev, "\033\ng"); ++ /* FALLTHROUGH */ ++ case B_SIMPLE_DATA: ++ { ++ /* something got dropped */ ++ entry_ref ref; ++ const char *text_plain; ++ ssize_t len; ++ //msg->PrintToStream(); ++ /* try find a file path to paste */ ++ if (msg->FindRef("refs", &ref) == B_OK) { ++ BPath path(&ref); ++ if (path.InitCheck() == B_OK) { ++ BFile f(path.Path(), B_READ_ONLY); ++ BString url; ++ if (f.InitCheck() == B_OK && f.ReadAttrString("META:url", &url) >= B_OK) { ++ be_paste_string(dev, url.String()); ++ } else ++ be_paste_string(dev, path.Path()); ++ } ++ } else if (msg->FindData("text/plain", B_MIME_TYPE, (const void **)&text_plain, &len) == B_OK) { ++ be_paste_string(dev, text_plain); ++ } ++ } ++ break; ++ default: ++ msg->PrintToStream(); ++ break; ++ } ++ delete msg; ++} ++ ++void be_get_size(struct graphics_device *dev) ++{ ++ BRect r; ++ lock_dev(dev); ++ r = lv(dev)->Bounds(); ++ unlock_dev(dev); ++ dev->size.x1 = dev->size.y1 = 0; ++ dev->size.x2 = (int)r.Width() + 1; ++ dev->size.y2 = (int)r.Height() + 1; ++} ++ ++void LinksView::Draw(BRect r) ++{ ++ detach_message(dev); ++ current->AddRect("updateRect", r); ++ pipe_message(dev); ++} ++ ++ ++void LinksView::MouseDown(BPoint p) ++{ ++ detach_and_pipe_message(dev); ++} ++ ++void LinksView::MouseUp(BPoint p) ++{ ++ detach_and_pipe_message(dev); ++} ++ ++void LinksView::MouseMoved(BPoint p, uint32 transit, const BMessage *dragmsg) ++{ ++ detach_and_pipe_message(dev); ++} ++ ++void LinksView::MessageReceived(BMessage *msg) ++{ ++ switch (msg->what) { ++ case B_REFS_RECEIVED: ++ case B_MOUSE_WHEEL_CHANGED: ++ case B_PASTE: ++ case B_SIMPLE_DATA: ++ detach_and_pipe_message(dev); ++ break; ++ default: ++ BView::MessageReceived(msg); ++ } ++} ++ ++void LinksView::KeyDown(const char *s, int32 numBytes) ++{ ++ detach_and_pipe_message(dev); ++} ++ ++unsigned char *be_get_driver_param(void) ++{ ++ return NULL; ++} ++ ++int32 be_app_thread(void *p) ++{ ++ be_links_app->Lock(); ++ be_links_app->Run(); ++ delete be_links_app; ++ return 0; ++} ++ ++unsigned char *be_init_driver(unsigned char *param, unsigned char *display) ++{ ++ be_links_app = new LinksApplication(); ++ if (!be_links_app) { ++ return stracpy((unsigned char *)"Unable to allocate Application object.\n"); ++ } ++ if (c_pipe(msg_pipe)) { ++ delete be_links_app; ++ return stracpy((unsigned char *)"Could not create pipe.\n"); ++ } ++ fcntl(rpipe, F_SETFL, O_NONBLOCK); ++ fcntl(wpipe, F_SETFL, O_NONBLOCK); ++ set_handlers(rpipe, be_get_event, NULL, NULL, NULL); ++ be_app_thread_id = spawn_thread(be_app_thread, "links_app", B_NORMAL_PRIORITY, NULL); ++ resume_thread(be_app_thread_id); ++ be_links_app->Unlock(); ++ be_cs_desktop = B_NO_COLOR_SPACE; ++ be_x_size = 640; ++ be_y_size = 480; ++ BScreen d; ++ if (d.IsValid()) { ++ be_cs_desktop = d.ColorSpace(); ++ be_x_size = (int)d.Frame().Width() + 1; ++ be_y_size = (int)d.Frame().Height() + 1; ++ } ++ be_win_y_size = be_y_size * 9 / 10; ++ be_win_x_size = be_win_y_size; ++ /* ++ DBG("%d %d\n", be_x_size, be_y_size); ++ DBG("%d %d\n", be_win_x_size, be_win_y_size); ++ */ ++ be_win_y_pos = (be_y_size - be_win_y_size) / 2; ++ be_win_x_pos = be_x_size - be_win_x_size - be_win_y_pos; ++ if (/*be_cs_desktop == B_RGB32 ||*/ be_cs_desktop == B_RGB24 || be_cs_desktop == B_RGB16 || be_cs_desktop == B_RGB15) ++ be_cs_bmp = be_cs_desktop; ++ else if (be_cs_desktop == B_RGB32 || be_cs_desktop == B_RGBA32) be_cs_bmp = B_RGB24; ++ else be_cs_bmp = B_RGB15; ++ be_cs_bmp = B_RGB16; // XXX: DEBUG ++ switch (be_cs_bmp) { ++ case B_RGB24: ++ haiku_driver.depth = 0xc3; ++ break; ++ case B_RGB16: ++ haiku_driver.depth = 0x82; ++ break; ++ case B_RGB15: ++ haiku_driver.depth = 0x7a; ++ break; ++ default: ++ internal("unknown depth"); ++ } ++ return NULL; ++} ++ ++void be_shutdown_driver() ++{ ++ status_t ret; ++ //debug((unsigned char *)"D"); ++ close(rpipe); ++ close(wpipe); ++ set_handlers(rpipe, NULL, NULL, NULL, NULL); ++ //debug((unsigned char *)"DD"); ++ be_links_app->PostMessage(B_QUIT_REQUESTED); ++ //debug((unsigned char *)"E"); ++ wait_for_thread(be_app_thread_id, &ret); ++ //debug((unsigned char *)"F"); ++} ++ ++struct graphics_device *be_init_device() ++{ ++ LinksView *view; ++ LinksWindow *win; ++ struct graphics_device *dev = (struct graphics_device *)mem_calloc(sizeof(struct graphics_device)); ++ if (!dev) return NULL; ++ //dev->drv = &haiku_driver; ++ //debug((unsigned char *)"1"); ++ win = new LinksWindow(BRect(be_win_x_pos, be_win_y_pos, be_win_x_pos + be_win_x_size, be_win_y_pos + be_win_y_size)); ++ //debug((unsigned char *)"2"); ++ if (!win) { ++ mem_free(dev); ++ return NULL; ++ } ++ //debug((unsigned char *)"3"); ++ view = new LinksView(win); ++ if (!view) { ++ delete win; ++ mem_free(dev); ++ return NULL; ++ } ++ view->dev = dev; ++ dev->driver_data = view; ++ be_get_size(dev); ++ memcpy(&dev->clip, &dev->size, sizeof(struct rect)); ++ //debug((unsigned char *)"4"); ++ win->Show(); ++ win->Lock(); ++ view->MakeFocus(); ++ win->Unlock(); ++ //debug((unsigned char *)"5"); ++ if (initial_refs_msg) { ++ BMessenger msgr(win); ++ if (msgr.IsValid()) { ++ msgr.SendMessage(initial_refs_msg); ++ initial_refs_msg = NULL; ++ } ++ } ++ return dev; ++} ++ ++void be_shutdown_device(struct graphics_device *dev) ++{ ++ LinksWindow *win = lv(dev)->win; ++ unregister_bottom_half(do_flush, dev); ++ lv(dev)->dev = NULL; ++ win->PostMessage(B_QUIT_REQUESTED); ++ mem_free(dev); ++} ++ ++void be_set_title(struct graphics_device *dev, unsigned char *title) ++{ ++ LinksWindow *win = lv(dev)->win; ++ lock_dev(dev); ++ win->SetTitle((const char *)title); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++ ++/* ++int be_get_filled_bitmap(struct bitmap *bmp, long color) ++{ ++ internal((unsigned char *)"nedopsano"); ++ return 0; ++} ++*/ ++ ++int be_get_empty_bitmap(struct bitmap *bmp) ++{ ++ DBG("bmp\n"); ++//DBG("bmp (%d, %d) cs %08x\n", bmp->x, bmp->y, be_cs_bmp); ++ BRect r(0, 0, bmp->x - 1, bmp->y - 1); ++ BBitmap *b = new BBitmap(r, /*B_RGB32*/be_cs_bmp); ++ if (!b) { ++ bmp->data = NULL; ++DBG("%s: error 1\n", __FUNCTION__); ++ return 0; ++ } ++ if (!b->IsValid()) { ++ bmp->data = NULL; ++ delete b; ++DBG("%s: error 2\n", __FUNCTION__); ++ return 0; ++ } ++ if (b->LockBits() < B_OK) { ++ bmp->data = NULL; ++ delete b; ++DBG("%s: error 3\n", __FUNCTION__); ++ return 0; ++ } ++ bmp->data = b->Bits(); ++ bmp->skip = b->BytesPerRow(); ++ bmp->flags = b; ++//DBG("bmp: data %p, skip %d, flags %p\n", bmp->data, bmp->skip, bmp->flags); ++ return 0; ++} ++ ++void be_register_bitmap(struct bitmap *bmp) ++{ ++ BBitmap *b = (BBitmap *)bmp->flags; ++ b->UnlockBits(); ++} ++ ++void *be_prepare_strip(struct bitmap *bmp, int top, int lines) ++{ ++ DBG("preps\n"); ++ BBitmap *b = (BBitmap *)bmp->flags; ++ if (b->LockBits() < B_OK) ++ return NULL; ++ bmp->data = b->Bits(); ++ bmp->skip = b->BytesPerRow(); ++ return ((char *)bmp->data) + bmp->skip * top; ++} ++ ++void be_commit_strip(struct bitmap *bmp, int top, int lines) ++{ ++ BBitmap *b = (BBitmap *)bmp->flags; ++ b->UnlockBits(); ++} ++ ++void be_unregister_bitmap(struct bitmap *bmp) ++{ ++ DBG("unb\n"); ++ BBitmap *b = (BBitmap *)bmp->flags; ++ delete b; ++} ++ ++void be_draw_bitmap(struct graphics_device *dev, struct bitmap *bmp, int x, int y) ++{ ++ DBG("drawb\n"); ++ BBitmap *b = (BBitmap *)bmp->flags; ++ lock_dev(dev); ++ lv(dev)->DrawBitmap(b, b->Bounds(), BRect(x, y, x + bmp->x - 1, y + bmp->y - 1)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++ ++/* ++void be_draw_bitmaps(struct graphics_device *dev, struct bitmap **bmp, int n, int x, int y) ++{ ++ LinksView *lvv = lv(dev); ++ lock_dev(dev); ++ while (n--) { ++ BBitmap *b = (BBitmap *)(*bmp)->flags; ++ lvv->DrawBitmap(b, b->Bounds(), BRect(x, y, x + (*bmp)->x, y + (*bmp)->y)); ++ x += (*bmp)->x; ++ bmp++; ++ } ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++*/ ++ ++long be_get_color(int rgb) ++{ ++ if (small_color) { ++ get_color32(c, rgb); ++ return *(long *)(void *)&c; ++ } else return rgb & 0xffffff; ++} ++ ++void be_fill_area(struct graphics_device *dev, int x1, int y1, int x2, int y2, long color) ++{ ++ DBG("fill\n"); ++ if (x1 >= x2 || y1 >= y2) return; ++ lock_dev(dev); ++ if (small_color) ++ lv(dev)->SetHighColor(*(rgb_color *)(void *)&color); ++ else ++ lv(dev)->SetHighColor(get_color32(, color)); ++ lv(dev)->FillRect(BRect(x1, y1, x2 - 1, y2 - 1)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++ ++void be_draw_hline(struct graphics_device *dev, int x1, int y, int x2, long color) ++{ ++ DBG("hline\n"); ++ if (x1 >= x2) return; ++ lock_dev(dev); ++ if (small_color) ++ lv(dev)->SetHighColor(*(rgb_color *)(void *)&color); ++ else ++ lv(dev)->SetHighColor(get_color32(, color)); ++ lv(dev)->StrokeLine(BPoint(x1, y), BPoint(x2 - 1, y)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++ ++void be_draw_vline(struct graphics_device *dev, int x, int y1, int y2, long color) ++{ ++ DBG("vline\n"); ++ if (y1 >= y2) return; ++ lock_dev(dev); ++ if (small_color) ++ lv(dev)->SetHighColor(*(rgb_color *)(void *)&color); ++ else ++ lv(dev)->SetHighColor(get_color32(, color)); ++ lv(dev)->StrokeLine(BPoint(x, y1), BPoint(x, y2 - 1)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++} ++ ++int be_hscroll(struct graphics_device *dev, struct rect_set **ignore, int sc) ++{ ++ DBG("hscroll\n"); ++ if (dev->clip.x1 >= dev->clip.x2 || dev->clip.y1 >= dev->clip.y2) return 0; ++ if (sc <= dev->clip.x1 - dev->clip.x2) return 1; ++ if (sc >= dev->clip.x2 - dev->clip.x1) return 1; ++ lock_dev0(dev); ++ if (sc > 0) lv(dev)->CopyBits(BRect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - sc - 1, dev->clip.y2 - 1), BRect(dev->clip.x1 + sc, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - 1)); ++ else lv(dev)->CopyBits(BRect(dev->clip.x1 - sc, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - 1), BRect(dev->clip.x1, dev->clip.y1, dev->clip.x2 + sc - 1, dev->clip.y2 - 1)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++ return 1; ++} ++ ++int be_vscroll(struct graphics_device *dev, struct rect_set **ignore, int sc) ++{ ++ DBG("vscroll\n"); ++ if (!sc || dev->clip.x1 >= dev->clip.x2 || dev->clip.y1 >= dev->clip.y2) return 0; ++ if (sc <= dev->clip.y1 - dev->clip.y2) return 1; ++ if (sc >= dev->clip.y2 - dev->clip.y1) return 1; ++ lock_dev0(dev); ++ if (sc > 0) lv(dev)->CopyBits(BRect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - sc - 1), BRect(dev->clip.x1, dev->clip.y1 + sc, dev->clip.x2 - 1, dev->clip.y2 - 1)); ++ else lv(dev)->CopyBits(BRect(dev->clip.x1, dev->clip.y1 - sc, dev->clip.x2 - 1, dev->clip.y2 - 1), BRect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 + sc - 1)); ++ lv(dev)->d_flush(); ++ unlock_dev(dev); ++ return 1; ++} ++ ++void be_set_clip_area(struct graphics_device *dev, struct rect *r) ++{ ++ DBG("setc\n"); ++ memcpy(&dev->clip, r, sizeof(struct rect)); ++ lock_dev(dev); ++ BRegion clip(BRect(r->x1, r->y1, r->x2 - 1, r->y2 - 1)); ++ lv(dev)->ConstrainClippingRegion(&clip); ++ unlock_dev(dev); ++} ++ ++struct graphics_driver haiku_driver = { ++ (unsigned char *)"haiku", ++ be_init_driver, ++ be_init_device, ++ be_shutdown_device, ++ be_shutdown_driver, ++ dummy_emergency_shutdown, ++ be_get_driver_param, ++ be_get_empty_bitmap, ++ be_register_bitmap, ++ be_prepare_strip, ++ be_commit_strip, ++ be_unregister_bitmap, ++ be_draw_bitmap, ++ be_get_color, ++ be_fill_area, ++ be_draw_hline, ++ be_draw_vline, ++ be_hscroll, ++ be_vscroll, ++ be_set_clip_area, ++ dummy_block, ++ dummy_unblock, ++ be_set_title, ++ NULL, /* exec */ ++ NULL, /* set_clipboard_text */ ++ NULL, /* get_clipboard_text */ ++ 0, /* depth */ ++ 0, 0, /* size */ ++ 0, /* flags */ ++ 0, /* codepage */ ++ NULL, /* shell */ ++}; ++ ++#endif /* GRDRV_HAIKU */ ++ ++#endif +diff -urN links-2.8.org/links-haiku.rdef links-2.8/links-haiku.rdef +--- links-2.8.org/links-haiku.rdef 1970-01-01 01:00:00.000000000 +0100 ++++ links-2.8/links-haiku.rdef 2013-12-13 00:23:34.395313152 +0100 +@@ -0,0 +1,125 @@ ++/* ++** links-haiku.rdef ++** ++** Automatically generated by BResourceParser on ++** Thursday, December 13, 2007 at 23:46:45. ++** ++*/ ++ ++resource(1, "BEOS:APP_FLAGS") (#'APPF') $"01000000"; ++ ++resource(1, "BEOS:APP_VERSION") #'APPV' array { ++ $"02000000010000000000000000000000210000006C696E6B7320322E31707265" ++ $"3333000000000000000000000000000000000000000000000000000000000000" ++ $"00000000000000000000000000000000000000004C696E6B732062726F777365" ++ $"7220322E31707265333300000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000" ++}; ++ ++resource(101, "BEOS:L:STD_ICON") #'ICON' array { ++ $"2A2A2A2A2A2A2A2A2A2A2A2A2A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2A2A2A2A2A2A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2B2B2B2B2B2B2B2B2B2B2B2C0000363434343434343434343434343434" ++ $"2A2A2A3200000000000000000000000000363434343434343434343434343434" ++ $"2A2A2A2FF1313200000000000131310000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A30000000002B2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2A2A2A2A2A2A2A2F000000002A2A2C0000363434343434343434343434343434" ++ $"2C2C2C2C2C2C2C30000000002C2C2D0000373636363636363636363636363636" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"0000000000000000000000000000000000000000000000000000000000000000" ++ $"2222222222222226000000002222230000151A1A1A1A1A1A1A1A1A1A1A1A1A1A" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F3F3F3F3F3F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F3F1501113F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F3F0E00133F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F3F0500163F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F1A0000193F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F3F0C00001B3F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F3F190000001E3F3F3F3F" ++ $"20202020202020250000000020202200001A3F3F3F3F1A030000013F3F3F3F3F" ++ $"20202020202020270000000023202200001A3F1E170C00000000043F3F3F3F3F" ++ $"2020202628292900000000000029290000040300000000000000063F3F3F3F3F" ++ $"20202027292929292929292929292900000203030303030303030B3F3F3F3F3F" ++ $"20202020202020202020202020202200001A3F3F3F3F3F3F3F3F3F3F3F3F3F3F" ++ $"20202020202020202020202020202200001A3F3F3F3F3F3F3F3F3F3F3F3F3F3F" ++ $"20202020202020202020202020202200001A3F3F3F3F3F3F3F3F3F3F3F3F3F3F" ++}; ++ ++resource(101, "BEOS:M:STD_ICON") #'MICN' array { ++ $"2A2A2A2A2A2A2A303A34343434343434" ++ $"2A2C3030303030F73A34343434343434" ++ $"2A2B2D300000EB323A34343434343434" ++ $"2A2A2A2C00002A303A34343434343434" ++ $"2A2A2A2C00002A303A34343434343434" ++ $"2A2A2A2C00002A303A34343434343434" ++ $"2A2A2A2C00002A303A34343434343434" ++ $"303030310000F1333D3A3A3A3A3A3A3A" ++ $"2626262700002629050D0D0D0D0D0D0D" ++ $"20202022000020260D3F3F3F1D143F3F" ++ $"20202022000020260D3F3F3F140A3F3F" ++ $"20202022000020260D3F3F3F090D3F3F" ++ $"20202022000020260D3F3F16000F3F3F" ++ $"20222427000026280710090000123F3F" ++ $"202225252525252807111111111A3F3F" ++ $"20202020202020260D3F3F3F3F3F3F3F" ++}; ++ ++resource(101, "BEOS:ICON") #'VICN' array { ++ $"6E6369661305000200060237E670B8880E39469D39AE144A52234B0D2500C6D7" ++ $"F5FF6B94DD03EC6666020006023B2B47BB18653D0FA53D225148297046CA1900" ++ $"00FF00FFA9FF00020016023B2B47BB18653D0FA53D225148297046CA1900FFFF" ++ $"8A020006023B3049396B0ABA90833C646E4A101543299500FFFFFFFF52FF5202" ++ $"0016023B3049396B0ABA90833C646E4A101543299500FFFFC9020006023C71E3" ++ $"3A0C78BA15E43C7D2149055549455700E3EDFFFF9EC2FF020006023CD8653068" ++ $"26B065D13CD5A34A6E4A46E21900FFDCDCFFDA5858020006023A1DA6393F04BB" ++ $"B5BC3C6B074AEA364809110087CA05FF026802020016023C00913B1266BB9E06" ++ $"3C5B934A01F04914EC00FFFF4E03003CB00200060230B31E3A09B9BB024238A1" ++ $"2F4BAB534AFF0B00A3043CFFFFDCE603CD4D4D030D296402000602BD498B3E11" ++ $"59BF219BBE7D2F4BE71F4AB31300C13E3EFFE27A7A040174020016023F2938BB" ++ $"F60A3BA9823EEC25C40E6348C15D0099FF00020016023E8FA33A7B71BA9D783E" ++ $"B2C049F7BAC28CE500C8FF00130A06322E323E42464C3C4C2C3D260A04322E32" ++ $"3E424642350A04322E42354C2C3D260A04423542464C3C4C2C0A0338423C4D3C" ++ $"440A08335C395C41544F5C555C6051594D3E510A0422422252325A32490A0422" ++ $"4232493C402D3A0A043249325A3C503C400A043E424E495840493A0A043E524E" ++ $"5A4E493E420A1243C97243C375BF66C2A93F503C5133C4F03330342F3830382D" ++ $"2927292A2C2C2D2E2DC2F2B7B1C3BEB5E1C358B5E1C4AA0A042C252927382D3B" ++ $"2B0A04364B334D3E5241500A0442463F48434A46480A042A4727492B4B2E490A" ++ $"04382D38303B2E3B2B0A04434A4358465646480A04332F334D364B362D160A10" ++ $"01052020230A1001052022120A00010030103701178400040A0101012010370A" ++ $"0B01032010370A0E0104201D250A0101072020230A00010030101C0117840004" ++ $"0A02010A2004080A0C010320101C0A0801092004080A00010030283901178400" ++ $"040A0401012028390A0601022028390A0A01032028390A000100302A20011784" ++ $"00040A030101202A200A050102202A200A090103202A200A12040C0D0E0F000A" ++ $"0003101211000A11010B00" ++}; ++ ++resource(1, "BEOS:APP_SIG") (#'MIMS') "application/x-vnd.links"; ++ ++resource(1, "BEOS:FILE_TYPES") message { ++ "types" = "text/html", ++ "types" = "application/x-vnd.Be-bookmark", ++ "types" = "application/x-vnd.Be.URL.http" ++}; +diff -urN links-2.8.org/Makefile.am links-2.8/Makefile.am +--- links-2.8.org/Makefile.am 2013-09-20 22:37:39.031457280 +0200 ++++ links-2.8/Makefile.am 2013-12-12 23:23:13.554172416 +0100 +@@ -4,7 +4,7 @@ + + man_MANS=links.1 + +-EXTRA_DIST=$(man_MANS) atheos.cpp BRAILLE_HOWTO KEYS SITES descrip.mms *.opt PATCH-gpm-1.20.0-smooth-cursor PATCH-libpng-1.2.18 mailcap.pl rebuild Links_logo.png Unicode/*.cp Unicode/[!C]* intl/[!C]* graphics/*.c graphics/arrow.png graphics/gen graphics/system_font/*.png graphics/font/century_extensions-medium-roman-serif-vari/*.png graphics/font/century_school-bold-roman-serif-vari/*.png graphics/font/century_school-medium-roman-serif-vari/*.png graphics/font/courier-medium-roman-serif-mono/*.png graphics/font/japanese-medium-roman-sans-mono/*.png graphics/font/symbol-medium-roman-sans-vari/*.png graphics/font/century_school-bold-roman-serif-vari/aliases graphics/font/century_school-medium-roman-serif-vari/aliases graphics/font/japanese-medium-roman-sans-mono/aliases graphics/font/symbol-medium-roman-sans-vari/aliases doc/links_cal/*.png doc/links_cal/*.html graphics/Makefile graphics/Fontmap graphics/clip.c graphics/links.xpm graphics/makefont graphics/pdf2html graphics/spacer.png pkg-config.m4 *.xpm *.ico *.rc mk-release-os2 mk-release-win mk-dos links.wis *.nsi ++EXTRA_DIST=$(man_MANS) atheos.cpp haiku.cpp BRAILLE_HOWTO KEYS SITES descrip.mms *.opt PATCH-gpm-1.20.0-smooth-cursor PATCH-libpng-1.2.18 mailcap.pl rebuild Links_logo.png Unicode/*.cp Unicode/[!C]* intl/[!C]* graphics/*.c graphics/arrow.png graphics/gen graphics/system_font/*.png graphics/font/century_extensions-medium-roman-serif-vari/*.png graphics/font/century_school-bold-roman-serif-vari/*.png graphics/font/century_school-medium-roman-serif-vari/*.png graphics/font/courier-medium-roman-serif-mono/*.png graphics/font/japanese-medium-roman-sans-mono/*.png graphics/font/symbol-medium-roman-sans-vari/*.png graphics/font/century_school-bold-roman-serif-vari/aliases graphics/font/century_school-medium-roman-serif-vari/aliases graphics/font/japanese-medium-roman-sans-mono/aliases graphics/font/symbol-medium-roman-sans-vari/aliases doc/links_cal/*.png doc/links_cal/*.html graphics/Makefile graphics/Fontmap graphics/clip.c graphics/links.xpm graphics/makefont graphics/pdf2html graphics/spacer.png pkg-config.m4 *.xpm *.ico *.rc mk-release-os2 mk-release-win mk-dos links.wis *.nsi links-haiku.rdef + + bin_PROGRAMS=links + +@@ -13,6 +13,17 @@ + else + endif + ++if HAIKU_GR ++links_LDADD=haiku.o -lbe ++EXTRA_links_DEPENDENCIES=links-haiku.rsrc ++# automake will not let us touch the binary after link ++# and install will not copy the attributes anyway... so do it after install ++install-exec-hook: ++ xres -o $(DESTDIR)$(bindir)/links$(EXEEXT) links-haiku.rsrc ++ mimeset $(DESTDIR)$(bindir)/links$(EXEEXT) ++else ++endif ++ + links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c font_inc.c framebuf.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c links_ic.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c string.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc codepage.inc entity.inc fbcommon.inc language.inc uni_7b.inc upcase.inc vpipe.inc + + dist-hook: +@@ -33,6 +44,12 @@ + atheos.o: atheos.cpp + $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c atheos.cpp + ++haiku.o: haiku.cpp ++ $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -o $@ -c $< ++ ++links-haiku.rsrc: links-haiku.rdef ++ rc -o $@ $< ++ + datadir = $(prefix)/@DATADIRNAME@ + LIBS = @LIBS@ + +diff -urN links-2.8.org/os_dep.c links-2.8/os_dep.c +--- links-2.8.org/os_dep.c 2013-09-20 23:16:38.037748736 +0200 ++++ links-2.8/os_dep.c 2013-12-12 21:48:36.256638976 +0100 +@@ -307,7 +307,7 @@ + + #endif + +-#if defined(UNIX) || defined(WIN32) || defined(INTERIX) || defined(BEOS) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) || defined(OPENVMS) ++#if defined(UNIX) || defined(WIN32) || defined(INTERIX) || defined(BEOS) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) || defined(OPENVMS) || defined(HAIKU) + + #ifdef SIGWINCH + static void sigwinch(void *s) +@@ -573,7 +573,7 @@ + return xt; + } + +-#elif defined(BEOS) || defined(ATHEOS) || defined(DOS) ++#elif defined(BEOS) || defined(ATHEOS) || defined(DOS) || defined(HAIKU) + + int is_xterm(void) + { +@@ -656,6 +656,12 @@ + if (!GetConsoleCP()) + force_g = 1; + #endif ++#ifdef HAIKU ++ if (getenv("TERM") == NULL) { ++ /* probably launched from Tracker or Deskbar, force graphics mode */ ++ force_g = 1; ++ } ++#endif + } + #endif + +@@ -958,7 +964,7 @@ + #endif + + +-#if defined(UNIX) || defined(INTERIX) || defined(BEOS) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) || defined(OPENVMS) || defined(DOS) ++#if defined(UNIX) || defined(INTERIX) || defined(BEOS) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) || defined(OPENVMS) || defined(DOS) || defined(HAIKU) + + #if defined(BEOS) && defined(HAVE_SETPGID) + +@@ -1710,7 +1716,7 @@ + + #endif + +-#if defined(UNIX) || defined(OS2) || defined(WIN32) || defined(INTERIX) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) ++#if defined(UNIX) || defined(OS2) || defined(WIN32) || defined(INTERIX) || defined(RISCOS) || defined(ATHEOS) || defined(SPAD) || defined(HAIKU) + + void terminate_osdep(void) + { +@@ -1727,7 +1733,7 @@ + + #if defined(BEOS) + +-#include ++#include + + static int thr_sem_init = 0; + static sem_id thr_sem; +@@ -2466,6 +2472,13 @@ + return 0; + } + ++#elif defined(HAIKU) ++ ++int get_system_env(void) ++{ ++ return ENV_BE; ++} ++ + #elif defined(WIN32) + + int get_system_env(void) +@@ -2588,6 +2601,14 @@ + } + #endif + ++#ifdef HAIKU ++static int open_in_new_haiku(struct terminal *term, unsigned char *exe, unsigned char *param) ++{ ++ exec_new_links(term, cast_uchar "Terminal", exe, param); ++ return 0; ++} ++#endif ++ + #ifdef G + static int open_in_new_g(struct terminal *term, unsigned char *exe, unsigned char *param) + { +@@ -2637,6 +2658,9 @@ + #ifdef BEOS + {ENV_BE, open_in_new_be, TEXT_(T_BEOS_TERMINAL), TEXT_(T_HK_BEOS_TERMINAL)}, + #endif ++#ifdef HAIKU ++ {ENV_BE, open_in_new_haiku, TEXT_(T_BEOS_TERMINAL), TEXT_(T_HK_BEOS_TERMINAL)}, ++#endif + #ifdef G + {ENV_G, open_in_new_g, TEXT_(T_WINDOW), TEXT_(T_HK_WINDOW)}, + #endif +@@ -2685,6 +2709,9 @@ + #ifdef BEOS + if (!(environment & ENV_BE)) return 0; + #endif ++#ifdef HAIKU ++ if (!(environment & ENV_BE)) return 0; ++#endif + #ifdef G + if (F && drv->flags & GD_NO_OS_SHELL) return 0; + #endif +diff -urN links-2.8.org/os_dep.h links-2.8/os_dep.h +--- links-2.8.org/os_dep.h 2013-09-17 02:11:47.030932992 +0200 ++++ links-2.8/os_dep.h 2013-12-12 21:29:28.176685056 +0100 +@@ -29,7 +29,7 @@ + #define WIN32 + #elif defined(__INTERIX) + #define INTERIX +-#elif defined(__BEOS__) || defined(__HAIKU__) ++#elif defined(__BEOS__) + #define BEOS + #elif defined(__riscos__) + #define RISCOS +@@ -41,6 +41,8 @@ + #define OPENVMS + #elif defined(__DJGPP) + #define DOS ++#elif defined(__HAIKU__) ++#define HAIKU + #else + #define UNIX + #endif +@@ -158,6 +160,25 @@ + + #include "beos.h" + ++#elif defined(HAIKU) ++ ++static inline int dir_sep(unsigned char x) { return x == '/'; } ++#define NEWLINE "\n" ++#define NO_ASYNC_LOOKUP /* async lookup works on BeOS but crashes the Haiku kernel */ ++#define FS_UNIX_RIGHTS ++#define FS_UNIX_SOFTLINKS ++#define FS_UNIX_USERS ++/* TODO: allocate new SYS_* or replace SYS_BEOS */ ++#define SYSTEM_ID SYS_BEOS ++#define SYSTEM_NAME "Haiku" ++#define DEFAULT_SHELL "/bin/sh" ++#define GETSHELL getenv("SHELL") ++#define NO_CTRL_Z ++#define SET_WINDOW_TITLE_UTF_8 ++#define SHARED_CONFIG_DIR "/etc/" ++#define NO_FORK_ON_EXIT ++#define ASSOC_BLOCK ++ + #elif defined(RISCOS) + + static inline int dir_sep(unsigned char x) { return x == '/' || x == '\\'; } +diff -urN links-2.8.org/os_depx.h links-2.8/os_depx.h +--- links-2.8.org/os_depx.h 2013-08-25 13:07:50.033030144 +0200 ++++ links-2.8/os_depx.h 2013-12-12 21:35:09.725614592 +0100 +@@ -184,6 +184,10 @@ + #endif + #endif + ++#ifdef HAIKU ++/* nothing so far */ ++#endif ++ + #ifdef OPENVMS + #if defined(__INITIAL_POINTER_SIZE) + #if __INITIAL_POINTER_SIZE == 64 +@@ -340,6 +344,9 @@ + #elif defined(GRDRV_ATHEOS) + #define loop_select ath_select + int ath_select(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t); ++#elif defined(GRDRV_HAIKU) ++#define loop_select be_loop_select ++int be_loop_select(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t); + #else + #define loop_select select + #endif diff --git a/x11-libs/libxau/libxau-1.0.5.recipe b/x11-libs/libxau/libxau-1.0.5.recipe index 262bf426b..d3848bf41 100644 --- a/x11-libs/libxau/libxau-1.0.5.recipe +++ b/x11-libs/libxau/libxau-1.0.5.recipe @@ -1,22 +1,58 @@ +SUMMARY="libxau" DESCRIPTION="libxau" HOMEPAGE="http://xorg.freedesktop.org/releases/individual/lib/" SRC_URI="http://xorg.freedesktop.org/releases/individual/lib/libXau-1.0.5.tar.gz" CHECKSUM_MD5="1a421d9376f43596fe068ce209a70b84" REVISION="1" -STATUS_HAIKU="stable" -DEPEND="pkgconfig >= 0.23 - x11-misc/util-macros >= 1.7.0" +COPYRIGHT="1988, 1993, 1994, 1998 The Open Group" +LICENSE="MIT (no promotion)" + +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + libxau$secondaryArchSuffix = $portVersion + lib:libxau$secondaryArchSuffix = $portVersion + lib:libXau$secondaryArchSuffix = $portVersion + devel:libxau$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + xproto$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + devel:xproto$secondaryArchSuffix + " + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:util_macros$secondaryArchSuffix + cmd:autoconf + cmd:libtool + cmd:aclocal + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:pkg_config$secondaryArchSuffix + " + +SOURCE_DIR="libXau-$portVersion" + +PATCHES="libxau-1.0.5.patch" + BUILD() { - cd libXau-1.0.5 libtoolize --force --copy --install autoreconf -i - ./configure --prefix=`finddir B_COMMON_DIRECTORY` + runConfigure ./configure make } INSTALL() { - cd libXau-1.0.5 make install + prepareInstalledDevelLibs libXau + fixPkgconfig } diff --git a/x11-libs/libxau/patches/libxau-1.0.5.patch b/x11-libs/libxau/patches/libxau-1.0.5.patch index b131ea47e..7779a6f82 100644 --- a/x11-libs/libxau/patches/libxau-1.0.5.patch +++ b/x11-libs/libxau/patches/libxau-1.0.5.patch @@ -1,7 +1,17 @@ -diff -Naur libXau-1.0.5/configure.ac libXau-1.0.5-haiku/configure.ac ---- libXau-1.0.5/configure.ac 2009-08-28 04:34:23.023855104 +0000 -+++ libXau-1.0.5-haiku/configure.ac 2010-04-26 23:21:53.573308928 +0000 -@@ -58,6 +58,9 @@ +diff --git a/configure.ac b/configure.ac +index c63adcb..0d981c6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -28,7 +28,7 @@ AC_INIT(libXau, 1.0.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg] + AM_INIT_AUTOMAKE([dist-bzip2]) + AM_MAINTAINER_MODE + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADER(config.h) + + # Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG, XORG_WITH_LINT + m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +@@ -58,6 +58,9 @@ if test "x$xthreads" = "xyes" ; then if test "x$mtsafe" = "x" ; then AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes]) fi diff --git a/x11-proto/xcb_proto/xcb_proto-1.6.recipe b/x11-proto/xcb_proto/xcb_proto-1.6.recipe index 190bd056d..3127598b5 100644 --- a/x11-proto/xcb_proto/xcb_proto-1.6.recipe +++ b/x11-proto/xcb_proto/xcb_proto-1.6.recipe @@ -36,6 +36,10 @@ BUILD_PREREQUIRES=" SOURCE_DIR="xcb-proto-$portVersion" +GLOBAL_WRITABLE_FILES=" + non-packaged/lib/python2.6/site-packages directory keep-old + " + BUILD() { libtoolize --force --copy --install @@ -46,5 +50,6 @@ BUILD() INSTALL() { - make install + make install DESTDIR=/ + fixPkgconfig }