diff --git a/app-misc/mc/mc-4.8.11.recipe b/app-misc/mc/mc-4.8.11.recipe new file mode 100644 index 000000000..58d11712e --- /dev/null +++ b/app-misc/mc/mc-4.8.11.recipe @@ -0,0 +1,66 @@ +SUMMARY="Midnight Commander — a powerful file manager." +DESCRIPTION=" +GNU Midnight Commander is a text-mode full-screen file manager. It uses a two panel interface and a subshell for command execution. It includes an internal editor with syntax highlighting and an internal viewer with support for binary files. Also included is Virtual Filesystem (VFS), that allows files on remote systems (e.g. FTP, SSH servers) and files inside archives to be manipulated like real files." +HOMEPAGE="http://www.midnight-commander.org/" +SRC_URI="git+https://github.com/MidnightCommander/mc#d26b7dd6ee49211f4d18fdfbe193023a3e480389" +REVISION="1" +LICENSE="GNU GPL v2" +COPYRIGHT="2007 MC Team" +ARCHITECTURES="x86 x86_gcc2" +PATCHES="mc.patch" +SOURCE_DIR="mc-4.8.11" +COOK="Maxim Sokhatsky " + +GLOBAL_WRITABLE_FILES=" + settings/mc directory keep-old + " + +PROVIDES=" + mc = $portVersion + cmd:mc = $portVersion + cmd:mcedit = $portVersion + cmd:mcdiff = $portVersion + cmd:mcview = $portVersion + " + +REQUIRES=" + haiku >= $haikuVersion + lib:libncurses + lib:libintl + lib:libiconv + lib:libglib_2.0 + " + +BUILD_REQUIRES=" + devel:libncurses + devel:libintl + devel:libiconv + devel:libglib_2.0 + " + +BUILD_PREREQUIRES=" + cmd:pkg_config + haiku_devel >= $haikuVersion + cmd:gettext + cmd:make + cmd:tar + cmd:libtoolize + cmd:aclocal + cmd:autom4te + cmd:autoconf + cmd:automake + cmd:autoheader + cmd:gcc + " + +BUILD() +{ + autogen.sh + runConfigure configure --prefix="$prefix" --datarootdir="$dataRootDir" --with-screen=ncurses + make +} + +INSTALL() +{ + make install +} diff --git a/app-misc/mc/patches/mc.patch b/app-misc/mc/patches/mc.patch new file mode 100644 index 000000000..acbb58cfa --- /dev/null +++ b/app-misc/mc/patches/mc.patch @@ -0,0 +1,12 @@ +diff --git mc-4.8.11/lib/tty/tty-ncurses.c mc-4.8.11-haiku/lib/tty/tty-ncurses.c +--- mc-4.8.11/lib/tty/tty-ncurses.c ++++ mc-4.8.11-haiku/lib/tty/tty-ncurses.c +@@ -66,7 +66,7 @@ + + /*** file scope macro definitions ****************************************************************/ + +-#if defined(_AIX) && !defined(CTRL) ++#if !defined(CTRL) + #define CTRL(x) ((x) & 0x1f) + #endif + diff --git a/app-misc/srm/srm-1.2.12.recipe b/app-misc/srm/srm-1.2.12.recipe new file mode 100644 index 000000000..3b734d06f --- /dev/null +++ b/app-misc/srm/srm-1.2.12.recipe @@ -0,0 +1,53 @@ +SUMMARY="srm - secure file deletion for posix systems" +DESCRIPTION=" +A command-line compatible rm which destroys file contents before unlinking. +" +HOMEPAGE="http://srm.sourceforge.net/" +SRC_URI="http://sourceforge.net/projects/srm/files/1.2.12/srm-1.2.12.tar.bz2" +CHECKSUM_MD5="5c89c96f53ea1a3d671678bec52959a1" +REVISION="1" +LICENSE="MIT (no promotion)" +COPYRIGHT="2000 Matthew D. Gauthier" + +ARCHITECTURES="x86_gcc2 x86 ?x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + srm$secondaryArchSuffix = $portVersion + cmd:srm = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:automake + cmd:make + cmd:gcc$secondaryArchSuffix + " + +BUILD() +{ + #./autogen.sh ... + #aclocal + #autoheader + #automake --add-missing + #autoconf + runConfigure ./configure + make +} + +INSTALL() +{ + make install +} + +# Beware, needs at least 5GB of free disk space. +TEST() +{ + make test +} diff --git a/app-misc/srm/srm-1.2.12_cvs.recipe b/app-misc/srm/srm-1.2.13_svn.recipe similarity index 83% rename from app-misc/srm/srm-1.2.12_cvs.recipe rename to app-misc/srm/srm-1.2.13_svn.recipe index db1fa7fb1..7dade809b 100644 --- a/app-misc/srm/srm-1.2.12_cvs.recipe +++ b/app-misc/srm/srm-1.2.13_svn.recipe @@ -3,13 +3,13 @@ DESCRIPTION=" A command-line compatible rm which destroys file contents before unlinking. " HOMEPAGE="http://srm.sourceforge.net/" -SRC_URI="cvs://:pserver:anonymous@srm.cvs.sourceforge.net:/cvsroot/srm/srm" +SRC_URI="svn://svn.code.sf.net/p/srm/srm/trunk" REVISION="1" LICENSE="MIT (no promotion)" COPYRIGHT="2000 Matthew D. Gauthier" -ARCHITECTURES="x86_gcc2 x86 ?x86_64" -SECONDARY_ARCHITECTURES="x86_gcc2 x86" +ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" PROVIDES=" srm$secondaryArchSuffix = $portVersion diff --git a/dev-embedded/avrdude/avrdude-6.0.1.recipe b/dev-embedded/avrdude/avrdude-6.0.1.recipe index 28493ec1f..acc6890ca 100644 --- a/dev-embedded/avrdude/avrdude-6.0.1.recipe +++ b/dev-embedded/avrdude/avrdude-6.0.1.recipe @@ -20,6 +20,7 @@ if [ $effectiveTargetArchitecture != x86_gcc2 ]; then ARCHITECTURES="$ARCHITECTURES x86_gcc2" fi SECONDARY_ARCHITECTURES="x86" +PATCHES="avrdude-6.0.1.patch" GLOBAL_WRITABLE_FILES=" settings/avrdude.conf keep-old @@ -33,9 +34,13 @@ PROVIDES=" REQUIRES=" haiku$secondaryArchSuffix >= $haikuVersion lib:libusb_1.0$secondaryArchSuffix + lib:libftdi1$secondaryArchSuffix + lib:libelf$secondaryArchSuffix " BUILD_REQUIRES=" devel:libusb_1.0$secondaryArchSuffix + devel:libftdi1$secondaryArchSuffix + devel:libelf$secondaryArchSuffix " BUILD_PREREQUIRES=" haiku${secondaryArchSuffix}_devel >= $haikuVersion @@ -46,12 +51,14 @@ BUILD_PREREQUIRES=" cmd:make cmd:yacc cmd:flex - cmd:pkg_config$secondaryArchSuffix + cmd:pkg_config " BUILD() { + export PKG_CONFIG_LIBDIR=/system/develop/lib/x86/pkgconfig/ aclocal + autoconf automake runConfigure ./configure make $jobArgs diff --git a/dev-embedded/avrdude/patches/avrdude-6.0.1.patch b/dev-embedded/avrdude/patches/avrdude-6.0.1.patch new file mode 100644 index 000000000..6549b0239 --- /dev/null +++ b/dev-embedded/avrdude/patches/avrdude-6.0.1.patch @@ -0,0 +1,37 @@ +diff -Naur avrdude-6.0.1/configure.ac avrdude-6.0.1-haiku/configure.ac +--- avrdude-6.0.1/configure.ac 2013-09-18 06:19:42.038010880 +0000 ++++ avrdude-6.0.1-haiku/configure.ac 2014-01-13 23:01:38.477102080 +0000 +@@ -96,6 +96,7 @@ + + AC_SEARCH_LIBS([gethostent], [nsl]) + AC_SEARCH_LIBS([setsockopt], [socket]) ++AC_SEARCH_LIBS(socket, socket network) + AH_TEMPLATE([HAVE_LIBUSB], + [Define if USB support is enabled via libusb]) + AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes]) +@@ -176,11 +177,8 @@ + fi + AC_CHECK_HEADERS([pthread.h]) + # as there exits header file only pthread implementations for Windows, check if we have a library +-AC_CHECK_LIB([pthread], [pthread_create], [have_pthread=yes]) +-if test x$have_pthread = xyes; then +- LIBPTHREAD="-lpthread" +-fi +-AC_SUBST(LIBPTHREAD, $LIBPTHREAD) ++AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthread=yes]) ++ + # Checks for header files. + AC_CHECK_HEADERS([limits.h stdlib.h string.h]) + AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h]) +diff -Naur avrdude-6.0.1/Makefile.am avrdude-6.0.1-haiku/Makefile.am +--- avrdude-6.0.1/Makefile.am 2013-09-18 05:59:07.037224448 +0000 ++++ avrdude-6.0.1-haiku/Makefile.am 2014-01-13 21:50:05.837550080 +0000 +@@ -63,7 +63,7 @@ + + libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ + +-avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm ++avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ + + bin_PROGRAMS = avrdude + diff --git a/dev-lang/erlang/erlang-16.03.recipe b/dev-lang/erlang/erlang-16.03.recipe new file mode 100644 index 000000000..9678bc53e --- /dev/null +++ b/dev-lang/erlang/erlang-16.03.recipe @@ -0,0 +1,67 @@ +SUMMARY="Erlang/OTP" +DESCRIPTION=" +Erlang is a programming language used to +build massively scalable soft real-time systems with +requirements on high availability. Some of its uses +are in telecoms, banking, e-commerce, computer +telephony and instant messaging. Erlang's runtime +system has built-in support for concurrency, distribution and fault tolerance." +HOMEPAGE="http://www.erlang.org" +SRC_URI="http://www.erlang.org/download/otp_src_R16B03.tar.gz" +CHECKSUM_MD5="c330150913556a0fe73e57a441cb6375" +ARCHITECTURES="x86_gcc2 x86" +LICENSE="EPL" +REVISION="1" +COPYRIGHT="1997-2013 Ericsson AB" +SOURCE_DIR="otp_src_R16B03" +PATCHES="erlang_R16B03_haiku.patch" + +PROVIDES=" + erl = $portVersion + cmd:erl = $portVersion + cmd:ct_run = $portVersion + cmd:dialyzer = $portVersion + cmd:epmd = $portVersion + cmd:erlc = $portVersion + cmd:escript = $portVersion + cmd:run_erl = $portVersion + cmd:to_erl = $portVersion + cmd:typer = $portVersion + " + +REQUIRES=" + haiku >= $haikuVersion + cmd:libtool + cmd:perl + cmd:gcc + " + +BUILD_PREREQUIRES=" + haiku_devel >= $haikuVersion + cmd:perl + cmd:make + cmd:gcc + cmd:tar + cmd:uname + devel:libncurses + devel:libssl + devel:libcrypto + " +ERLANG_CFLAGS="-DETHR_X86_OUT_OF_ORDER -DHAVE_NET_IF_DL_H -DETHR_HAVE_ETHREAD_DEFINES -DETHR_PTHREADS -DETHR_SIZEOF_PTR=4 -DHAVE_CONFIG_H -I../i586-pc-haiku -I../../i586-pc-haiku -I../include/internal -I../../include/internal -I../../emulator/sys/unix -I../../include/i586-pc-haiku -I../../emulator/beam -I../../../erts/include/internal/i586-pc-haiku -I../../../erts/i586-pc-haiku -Imisc -I../include -Iepmd -Iconnect -I../../../erts/emulator/beam -I../../../erts/include/i586-pc-haiku -I../../../../erts/emulator/beam -I../../../../erts/include/i586-pc-haiku -I../../../../erts/i586-pc-haiku" + +BUILD() +{ + rm -rf `finddir B_SYSTEM_SETTINGS_DIRECTORY`/network + mkdir -p `finddir B_SYSTEM_SETTINGS_DIRECTORY`/network + touch `finddir B_SYSTEM_SETTINGS_DIRECTORY`/network/hostname + runConfigure --omit-dirs "docDir dataRootDir" configure --prefix="$prefix" --disable-ipv6 --disable-hipe LDFLAGS="-lnetwork" + echo "#undef ERTS_SMP" >> erts/i586-pc-haiku/config.h + echo "#undef USE_THREADS" >> erts/i586-pc-haiku/config.h + echo "Skip" > lib/megaco/SKIP + HOME=/boot/home make CFLAGS="$ERLANG_CFLAGS" +} + +INSTALL() +{ + HOME=/boot/home make CFLAGS="$ERLANG_CFLAGS" install +} \ No newline at end of file diff --git a/dev-lang/erlang/erlang-R14B.recipe b/dev-lang/erlang/erlang-R14B.recipe deleted file mode 100644 index 0865f3e9c..000000000 --- a/dev-lang/erlang/erlang-R14B.recipe +++ /dev/null @@ -1,61 +0,0 @@ -DESCRIPTION="erlang" -HOMEPAGE="http://www.erlang.org" -SRC_URI="http://www.erlang.org/download/otp_src_R14B.tar.gz" -REVISION="1" -STATUS_HAIKU="broken" -DEPEND="" -CHECKSUM_MD5="5292a04556d17ad528d570e02357dfbb" -BUILD() -{ - cd otp_src_R14B - mkdir -p m4 - echo "AC_CONFIG_MACRO_DIR([m4]) >> configure.in" - echo "AC_CHECK_LIBM" >> configure.in - rm -f erts/autoconf/config.guess - rm -f erts/autoconf/config.sub - rm -f erts/autoconf/install-sh - rm -f erts/autoconf/ltmain.sh - cp -v /boot/common/share/libtool/config/config.guess erts/autoconf - cp -v /boot/common/share/libtool/config/config.sub erts/autoconf - cp -v /boot/common/share/libtool/config/install-sh erts/autoconf - cp -v /boot/common/share/libtool/config/ltmain.sh erts/autoconf - cp -v /boot/common/share/libtool/config/config.guess lib/common_test/priv/auxdir - cp -v /boot/common/share/libtool/config/config.sub lib/common_test/priv/auxdir - cp -v /boot/common/share/libtool/config/install-sh lib/common_test/priv/auxdir - cp -v /boot/common/share/libtool/config/ltmain.sh lib/common_test/priv/auxdir - cp -v /boot/common/share/libtool/config/config.guess lib/erl_interface/src/auxdir - cp -v /boot/common/share/libtool/config/config.sub lib/erl_interface/src/auxdir - cp -v /boot/common/share/libtool/config/install-sh lib/erl_interface/src/auxdir - cp -v /boot/common/share/libtool/config/ltmain.sh lib/erl_interface/src/auxdir - cp -v /boot/common/share/libtool/config/config.guess lib/test_server/src - cp -v /boot/common/share/libtool/config/config.sub lib/test_server/src - cp -v /boot/common/share/libtool/config/install-sh lib/test_server/src - cp -v /boot/common/share/libtool/config/ltmain.sh lib/test_server/src - cp -v /boot/common/share/aclocal/libtool.m4 m4 - cp -v /boot/common/share/aclocal/ltoptions.m4 m4 - cp -v /boot/common/share/aclocal/ltversion.m4 m4 - cp -v /boot/common/share/aclocal/ltsugar.m4 m4 - cp -v /boot/common/share/aclocal/lt~obsolete.m4 m4 - rm -f aclocal.m4 -# libtoolize --copy --force --install # this fails?! so have to delete and copy files in instead - cd lib/test_server/src - autoconf - cd ../../.. - aclocal -I m4 - autoconf - ./configure --prefix=`finddir B_COMMON_DIRECTORY` \ - --with-ssl=`finddir B_COMMON_DIRECTORY` \ - --disable-ipv6 \ - --disable-hipe \ - LDFLAGS="-lnetwork" - make -s -} - -INSTALL() -{ - cd otp_src_R14B - make -s install -} - -LICENSE="EPL v1.1" -COPYRIGHT="1997-2010 Ericsson AB" diff --git a/dev-lang/erlang/licenses/EPL v1.1 b/dev-lang/erlang/licenses/EPL similarity index 100% rename from dev-lang/erlang/licenses/EPL v1.1 rename to dev-lang/erlang/licenses/EPL diff --git a/dev-lang/erlang/patches/erlang-R14B.patch b/dev-lang/erlang/patches/erlang-R14B.patch deleted file mode 100644 index 6659da218..000000000 --- a/dev-lang/erlang/patches/erlang-R14B.patch +++ /dev/null @@ -1,287 +0,0 @@ -diff -urN otp_src_R14B/lib/test_server/src/configure.in otp_src_R14B-haiku/lib/test_server/src/configure.in ---- otp_src_R14B/lib/test_server/src/configure.in 2010-09-13 17:00:22.037748736 +0000 -+++ otp_src_R14B-haiku/lib/test_server/src/configure.in 2010-10-04 13:15:31.969932800 +0000 -@@ -279,6 +279,10 @@ - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, erl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi -+ -+# Haiku uses -lnetwork instead of -lsocket -+AC_CHECK_LIB(network, socket, LIBS="$LIBS -lnetwork", LIBS="$LIBS") -+ - AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) - - dnl Checks for library functions. -diff -urN otp_src_R14B/erts/emulator/drivers/common/inet_drv.c otp_src_R14B-haiku/erts/emulator/drivers/common/inet_drv.c ---- otp_src_R14B/erts/emulator/drivers/common/inet_drv.c 2010-02-19 13:03:42.000000000 -0500 -+++ otp_src_R14B-haiku/erts/emulator/drivers/common/inet_drv.c 2010-10-08 15:13:14.000000000 -0400 -@@ -621,6 +621,7 @@ - #define INET_IFF_NPOINTTOPOINT 0x0800 - /* #define INET_IFF_NRUNNING 0x1000 */ - /* #define INET_IFF_NMULTICAST 0x2000 */ -+#define IFF_RUNNING 0x0001 - - /* Flags for "sctp_sndrcvinfo". Used in a bitmask -- must be powers of 2: - ** INET_REQ_SETOPTS:SCTP_OPT_DEFAULT_SEND_PARAM -diff -urN otp_src_R14B/erts/emulator/sys/unix/sys.c otp_src_R14B-haiku/erts/emulator/sys/unix/sys.c ---- otp_src_R14B/erts/emulator/sys/unix/sys.c 2010-02-19 13:03:16.000000000 -0500 -+++ otp_src_R14B-haiku/erts/emulator/sys/unix/sys.c 2010-10-08 15:13:14.000000000 -0400 -@@ -709,7 +709,7 @@ - if (nice_val > 39) { - nice_val = 39; - } -- erts_silence_warn_unused_result(nice(nice_val)); -+ erts_silence_warn_unused_result(nice_val); - } - - envsz = sizeof(env); -diff -urN otp_src_R14B/lib/appmon/SKIP otp_src_R14B-haiku/lib/appmon/SKIP ---- otp_src_R14B/lib/appmon/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/appmon/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/asn1/SKIP otp_src_R14B-haiku/lib/asn1/SKIP ---- otp_src_R14B/lib/asn1/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/asn1/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/common_test/SKIP otp_src_R14B-haiku/lib/common_test/SKIP ---- otp_src_R14B/lib/common_test/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/common_test/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosEvent/SKIP otp_src_R14B-haiku/lib/cosEvent/SKIP ---- otp_src_R14B/lib/cosEvent/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosEvent/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosEventDomain/SKIP otp_src_R14B-haiku/lib/cosEventDomain/SKIP ---- otp_src_R14B/lib/cosEventDomain/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosEventDomain/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosFileTransfer/SKIP otp_src_R14B-haiku/lib/cosFileTransfer/SKIP ---- otp_src_R14B/lib/cosFileTransfer/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosFileTransfer/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosNotification/SKIP otp_src_R14B-haiku/lib/cosNotification/SKIP ---- otp_src_R14B/lib/cosNotification/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosNotification/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosProperty/SKIP otp_src_R14B-haiku/lib/cosProperty/SKIP ---- otp_src_R14B/lib/cosProperty/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosProperty/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosTime/SKIP otp_src_R14B-haiku/lib/cosTime/SKIP ---- otp_src_R14B/lib/cosTime/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosTime/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/cosTransactions/SKIP otp_src_R14B-haiku/lib/cosTransactions/SKIP ---- otp_src_R14B/lib/cosTransactions/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/cosTransactions/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/crypto/SKIP otp_src_R14B-haiku/lib/crypto/SKIP ---- otp_src_R14B/lib/crypto/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/crypto/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/debugger/SKIP otp_src_R14B-haiku/lib/debugger/SKIP ---- otp_src_R14B/lib/debugger/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/debugger/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/dialyzer/SKIP otp_src_R14B-haiku/lib/dialyzer/SKIP ---- otp_src_R14B/lib/dialyzer/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/dialyzer/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/docbuilder/SKIP otp_src_R14B-haiku/lib/docbuilder/SKIP ---- otp_src_R14B/lib/docbuilder/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/docbuilder/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/edoc/SKIP otp_src_R14B-haiku/lib/edoc/SKIP ---- otp_src_R14B/lib/edoc/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/edoc/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/erl_docgen/SKIP otp_src_R14B-haiku/lib/erl_docgen/SKIP ---- otp_src_R14B/lib/erl_docgen/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/erl_docgen/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/erl_interface/SKIP otp_src_R14B-haiku/lib/erl_interface/SKIP ---- otp_src_R14B/lib/erl_interface/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/erl_interface/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/et/SKIP otp_src_R14B-haiku/lib/et/SKIP ---- otp_src_R14B/lib/et/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/et/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/eunit/SKIP otp_src_R14B-haiku/lib/eunit/SKIP ---- otp_src_R14B/lib/eunit/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/eunit/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/gs/SKIP otp_src_R14B-haiku/lib/gs/SKIP ---- otp_src_R14B/lib/gs/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/gs/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/hipe/SKIP otp_src_R14B-haiku/lib/hipe/SKIP ---- otp_src_R14B/lib/hipe/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/hipe/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/ic/SKIP otp_src_R14B-haiku/lib/ic/SKIP ---- otp_src_R14B/lib/ic/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/ic/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/inets/SKIP otp_src_R14B-haiku/lib/inets/SKIP ---- otp_src_R14B/lib/inets/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/inets/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/inviso/SKIP otp_src_R14B-haiku/lib/inviso/SKIP ---- otp_src_R14B/lib/inviso/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/inviso/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/jinterface/SKIP otp_src_R14B-haiku/lib/jinterface/SKIP ---- otp_src_R14B/lib/jinterface/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/jinterface/SKIP 2010-10-08 15:13:14.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/megaco/SKIP otp_src_R14B-haiku/lib/megaco/SKIP ---- otp_src_R14B/lib/megaco/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/megaco/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/mnesia/SKIP otp_src_R14B-haiku/lib/mnesia/SKIP ---- otp_src_R14B/lib/mnesia/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/mnesia/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/observer/SKIP otp_src_R14B-haiku/lib/observer/SKIP ---- otp_src_R14B/lib/observer/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/observer/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/odbc/SKIP otp_src_R14B-haiku/lib/odbc/SKIP ---- otp_src_R14B/lib/odbc/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/odbc/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/orber/SKIP otp_src_R14B-haiku/lib/orber/SKIP ---- otp_src_R14B/lib/orber/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/orber/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/os_mon/SKIP otp_src_R14B-haiku/lib/os_mon/SKIP ---- otp_src_R14B/lib/os_mon/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/os_mon/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/otp_mibs/SKIP otp_src_R14B-haiku/lib/otp_mibs/SKIP ---- otp_src_R14B/lib/otp_mibs/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/otp_mibs/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/parsetools/SKIP otp_src_R14B-haiku/lib/parsetools/SKIP ---- otp_src_R14B/lib/parsetools/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/parsetools/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/percept/SKIP otp_src_R14B-haiku/lib/percept/SKIP ---- otp_src_R14B/lib/percept/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/percept/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/pman/SKIP otp_src_R14B-haiku/lib/pman/SKIP ---- otp_src_R14B/lib/pman/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/pman/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/public_key/SKIP otp_src_R14B-haiku/lib/public_key/SKIP ---- otp_src_R14B/lib/public_key/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/public_key/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/reltool/SKIP otp_src_R14B-haiku/lib/reltool/SKIP ---- otp_src_R14B/lib/reltool/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/reltool/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/runtime_tools/SKIP otp_src_R14B-haiku/lib/runtime_tools/SKIP ---- otp_src_R14B/lib/runtime_tools/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/runtime_tools/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/sasl/SKIP otp_src_R14B-haiku/lib/sasl/SKIP ---- otp_src_R14B/lib/sasl/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/sasl/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/snmp/SKIP otp_src_R14B-haiku/lib/snmp/SKIP ---- otp_src_R14B/lib/snmp/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/snmp/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/ssh/SKIP otp_src_R14B-haiku/lib/ssh/SKIP ---- otp_src_R14B/lib/ssh/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/ssh/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/ssl/SKIP otp_src_R14B-haiku/lib/ssl/SKIP ---- otp_src_R14B/lib/ssl/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/ssl/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/syntax_tools/SKIP otp_src_R14B-haiku/lib/syntax_tools/SKIP ---- otp_src_R14B/lib/syntax_tools/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/syntax_tools/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/test_server/SKIP otp_src_R14B-haiku/lib/test_server/SKIP ---- otp_src_R14B/lib/test_server/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/test_server/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/toolbar/SKIP otp_src_R14B-haiku/lib/toolbar/SKIP ---- otp_src_R14B/lib/toolbar/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/toolbar/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/tools/SKIP otp_src_R14B-haiku/lib/tools/SKIP ---- otp_src_R14B/lib/tools/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/tools/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/tv/SKIP otp_src_R14B-haiku/lib/tv/SKIP ---- otp_src_R14B/lib/tv/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/tv/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/typer/SKIP otp_src_R14B-haiku/lib/typer/SKIP ---- otp_src_R14B/lib/typer/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/typer/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/webtool/SKIP otp_src_R14B-haiku/lib/webtool/SKIP ---- otp_src_R14B/lib/webtool/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/webtool/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation -diff -urN otp_src_R14B/lib/wx/SKIP otp_src_R14B-haiku/lib/wx/SKIP ---- otp_src_R14B/lib/wx/SKIP 1969-12-31 19:00:00.000000000 -0500 -+++ otp_src_R14B-haiku/lib/wx/SKIP 2010-10-08 15:13:16.000000000 -0400 -@@ -0,0 +1 @@ -+Minimal installation diff --git a/dev-lang/erlang/patches/erlang_R16B03_haiku.patch b/dev-lang/erlang/patches/erlang_R16B03_haiku.patch new file mode 100644 index 000000000..9e59e87ac --- /dev/null +++ b/dev-lang/erlang/patches/erlang_R16B03_haiku.patch @@ -0,0 +1,146 @@ +diff --git otp_src_R16B03/erts/configure otp_src_R16B03-haiku/erts/configure +--- otp_src_R16B03/erts/configure ++++ otp_src_R16B03-haiku/erts/configure +@@ -6648,7 +6648,7 @@ if test "${ac_cv_lib_m_sin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS=" $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -6711,7 +6711,7 @@ if test $ac_cv_lib_m_sin = yes; then + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS=" $LIBS" + + fi + +@@ -17872,7 +17872,9 @@ echo "${ECHO_T}$gcc_dw_cmpxchg_asm" >&6 + if test "$gcc_dw_cmpxchg_asm" = "yes"; then + + cat >>confdefs.h <<\_ACEOF +-#define ETHR_GCC_HAVE_DW_CMPXCHG_ASM_SUPPORT 1 ++#undef ETHR_GCC_HAVE_DW_CMPXCHG_ASM_SUPPORT ++#undef ERTS_SMP ++#undef USE_THREADS + _ACEOF + + fi;; +diff --git otp_src_R16B03/erts/emulator/sys/unix/sys.c otp_src_R16B03-haiku/erts/emulator/sys/unix/sys.c +--- otp_src_R16B03/erts/emulator/sys/unix/sys.c ++++ otp_src_R16B03-haiku/erts/emulator/sys/unix/sys.c +@@ -767,7 +767,7 @@ prepare_crash_dump(int secs) + if (nice_val > 39) { + nice_val = 39; + } +- erts_silence_warn_unused_result(nice(nice_val)); ++ erts_silence_warn_unused_result(nice_val); + } + + UnUseTmpHeapNoproc(NUFBUF); +diff --git otp_src_R16B03/erts/epmd/src/Makefile.in otp_src_R16B03-haiku/erts/epmd/src/Makefile.in +--- otp_src_R16B03/erts/epmd/src/Makefile.in ++++ otp_src_R16B03-haiku/erts/epmd/src/Makefile.in +@@ -64,7 +64,7 @@ else + ifeq ($(findstring vxworks,$(TARGET)),vxworks) + ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ + else +-ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ -lm ++ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ + endif + endif + +diff --git otp_src_R16B03/erts/etc/common/Makefile.in otp_src_R16B03-haiku/erts/etc/common/Makefile.in +--- otp_src_R16B03/erts/etc/common/Makefile.in ++++ otp_src_R16B03-haiku/erts/etc/common/Makefile.in +@@ -91,7 +91,7 @@ endif + ifeq ($(TARGET),win32) + ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal_r$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ + else +-ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ -lm ++ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ + endif + + ERTS_LIB = $(ERL_TOP)/erts/lib_src/obj/$(TARGET)/$(TYPE)/MADE +diff --git otp_src_R16B03/erts/etc/common/erlexec.c otp_src_R16B03-haiku/erts/etc/common/erlexec.c +--- otp_src_R16B03/erts/etc/common/erlexec.c ++++ otp_src_R16B03-haiku/erts/etc/common/erlexec.c +@@ -1989,7 +1989,7 @@ initial_argv_massage(int *argc, char ***argv) + + vix = 0; + +- av = build_args_from_env("ERL_" OTP_SYSTEM_VERSION "_FLAGS"); ++ av = build_args_from_env("ERL_HAIKU_FLAGS"); + if (av) + avv[vix++].argv = av; + +diff --git otp_src_R16B03/erts/include/internal/ethread.h otp_src_R16B03-haiku/erts/include/internal/ethread.h +--- otp_src_R16B03/erts/include/internal/ethread.h ++++ otp_src_R16B03-haiku/erts/include/internal/ethread.h +@@ -26,9 +26,7 @@ + #ifndef ETHREAD_H__ + #define ETHREAD_H__ + +-#ifndef ETHR_HAVE_ETHREAD_DEFINES +-# include "ethread_header_config.h" +-#endif ++#include "ethread_header_config.h" + + #include + #include "erl_errno.h" +diff --git otp_src_R16B03/erts/include/internal/i386/ethr_dw_atomic.h otp_src_R16B03-haiku/erts/include/internal/i386/ethr_dw_atomic.h +--- otp_src_R16B03/erts/include/internal/i386/ethr_dw_atomic.h ++++ otp_src_R16B03-haiku/erts/include/internal/i386/ethr_dw_atomic.h +@@ -25,6 +25,8 @@ + #ifndef ETHR_X86_DW_ATOMIC_H__ + #define ETHR_X86_DW_ATOMIC_H__ + ++#include "ethread_header_config.h" ++ + #ifdef ETHR_GCC_HAVE_DW_CMPXCHG_ASM_SUPPORT + + #define ETHR_HAVE_NATIVE_DW_ATOMIC +diff --git otp_src_R16B03/lib/asn1/c_src/Makefile otp_src_R16B03-haiku/lib/asn1/c_src/Makefile +--- otp_src_R16B03/lib/asn1/c_src/Makefile ++++ otp_src_R16B03-haiku/lib/asn1/c_src/Makefile +@@ -67,7 +67,7 @@ CLIB_FLAGS = + LN=cp + else + NIF_SHARED_OBJ_FILE = $(LIBDIR)/asn1_erl_nif.so +-CLIB_FLAGS = -lc ++CLIB_FLAGS = + LN= ln -s + endif + +diff --git otp_src_R16B03/lib/runtime_tools/c_src/Makefile.in otp_src_R16B03-haiku/lib/runtime_tools/c_src/Makefile.in +--- otp_src_R16B03/lib/runtime_tools/c_src/Makefile.in ++++ otp_src_R16B03-haiku/lib/runtime_tools/c_src/Makefile.in +@@ -149,10 +149,10 @@ $(OBJDIR)/%.o: %.c + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< + + $(LIBDIR)/trace_ip_drv.so: $(TRACE_IP_DRV_OBJS) +- $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) ++ $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS) + + $(LIBDIR)/trace_file_drv.so: $(TRACE_FILE_DRV_OBJS) +- $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) ++ $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS) + + $(LIBDIR)/trace_ip_drv.dll: $(TRACE_IP_DRV_OBJS) + $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS) +diff --git otp_src_R16B03/lib/erl_interface/src/connect/ei_connect.c otp_src_R16B03-haiku/lib/erl_interface/src/connect/ei_connect.c +--- otp_src_R16B03/lib/erl_interface/src/connect/ei_connect.c ++++ otp_src_R16B03-haiku/lib/erl_interface/src/connect/ei_connect.c +@@ -1149,6 +1149,8 @@ static unsigned int gen_challenge(void) + + #else /* some unix */ + ++int gethostid() { return 108; } ++ + static unsigned int gen_challenge(void) + { + struct { diff --git a/dev-lang/lua/lua-5.1.4.recipe b/dev-lang/lua/lua-5.1.4.recipe index 853e92677..f41a11c35 100644 --- a/dev-lang/lua/lua-5.1.4.recipe +++ b/dev-lang/lua/lua-5.1.4.recipe @@ -2,27 +2,27 @@ SUMMARY="Lua is a powerful, fast, light-weight, embeddable scripting language." HOMEPAGE="http://www.lua.org" SRC_URI="http://www.lua.org/ftp/lua-5.1.4.tar.gz" CHECKSUM_MD5="d0870f2de55d59c1c8419f36e8fac150" -REVISION="3" +REVISION="5" ARCHITECTURES="x86 x86_gcc2" +SECONDARY_ARCHITECTURES="x86 x86_gcc2" PROVIDES=" - lua = $portVersion compat = 5.1 - cmd:lua = $portVersion compat = 5.1 - cmd:luac = $portVersion - lib:liblua = $portVersion compat = 5.2 - devel:liblua = $portVersion compat = 5.2 + lua${secondaryArchSuffix} = $portVersion compat >= 5.1 + cmd:lua${secondaryArchSuffix} = $portVersion compat >= 5.1 + cmd:luac${secondaryArchSuffix} = $portVersion compat >= 5.1 + lib:liblua${secondaryArchSuffix} = $portVersion compat >= 5.1 " - REQUIRES=" - haiku >= $haikuVersion + haiku${secondaryArchSuffix} >= $haikuVersion " BUILD_PREREQUIRES=" - haiku_devel >= $haikuVersion + haiku${secondaryArchSuffix}_devel >= $haikuVersion cmd:make - cmd:gcc + cmd:gcc${secondaryArchSuffix} " PATCHES="lua-5.1.4.patchset" + BUILD() { make haiku @@ -30,14 +30,30 @@ BUILD() INSTALL() { - make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir" \ - INSTALL_INC="$includeDir" INSTALL_LMOD="$dataDir/lua/$V" + make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \ + INSTALL_INC="$includeDir" INSTALL_LMOD="$dataDir/lua/5.1" \ + INSTALL_LIB="$libDir" INSTALL_BIN="$binDir" + mkdir -p $libDir/pkgconfig cp etc/lua.pc $libDir/pkgconfig/lua.pc + ln -s $libDir/liblua.so $libDir/liblua.so.5.1 + prepareInstalledDevelLib liblua fixPkgconfig + + packageEntries devel $developDir } + +PROVIDES_devel=" + lua${secondaryArchSuffix}_devel = $portVersion compat >= 5.1 + devel:liblua$secondaryArchSuffix = $portVersion compat >= 5.1 + " + +REQUIRES_devel=" + lua$secondaryArchSuffix == $portVersion + " + LICENSE="MIT" COPYRIGHT="1994-2009, Lua.org, PUC-Rio" DESCRIPTION=" diff --git a/dev-lang/lua/patches/lua-5.1.4.patchset b/dev-lang/lua/patches/lua-5.1.4.patchset index c5bf0f4f4..74dc0d828 100644 --- a/dev-lang/lua/patches/lua-5.1.4.patchset +++ b/dev-lang/lua/patches/lua-5.1.4.patchset @@ -1,27 +1,20 @@ -From 5944289e129f60d26f71646bc4e3404f93de138f Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sat, 5 Oct 2013 22:01:42 +0200 -Subject: Import existing haikuport patch. +From 0ba6279d1bee18e580206f0f86e3410f65db73c5 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 15 Jan 2014 15:33:52 -0600 +Subject: [PATCH] lua: fix 5.1 runtime issues +* Thanks to the work of Chris Roberts and + Adrien Destugues +--- + Makefile | 6 +++--- + src/Makefile | 13 ++++++++++--- + src/luaconf.h | 11 +++++++++++ + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile -index 6e78f66..8b8fbfc 100644 +index 6e78f66..b2e3868 100644 --- a/Makefile +++ b/Makefile -@@ -13,11 +13,11 @@ INSTALL_TOP= /usr/local - INSTALL_BIN= $(INSTALL_TOP)/bin - INSTALL_INC= $(INSTALL_TOP)/include - INSTALL_LIB= $(INSTALL_TOP)/lib --INSTALL_MAN= $(INSTALL_TOP)/man/man1 -+INSTALL_MAN= `finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man1 - # - # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with - # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc). --INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V -+INSTALL_LMOD= `finddir B_COMMON_DATA_DIRECTORY`/lua/$V - INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V - - # How to install. If your install program does not support "-p", then you @@ -38,12 +38,12 @@ RANLIB= ranlib # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE ========= @@ -37,8 +30,17 @@ index 6e78f66..8b8fbfc 100644 TO_MAN= lua.1 luac.1 # Lua version and release. +@@ -53,7 +53,7 @@ R= 5.1.4 + all: $(PLAT) + + $(PLATS) clean: +- cd src && $(MAKE) $@ ++ cd src && $(MAKE) V=$(V) $@ + + test: dummy + src/lua test/hello.lua diff --git a/src/Makefile b/src/Makefile -index e4a3cd6..86bd1ce 100644 +index e4a3cd6..9df0326 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,9 +20,10 @@ MYLIBS= @@ -49,7 +51,7 @@ index e4a3cd6..86bd1ce 100644 +PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris LUA_A= liblua.a -+LUA_SO= liblua.so ++LUA_SO= liblua.so CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \ lundump.o lvm.o lzio.o @@ -62,175 +64,31 @@ index e4a3cd6..86bd1ce 100644 ALL_A= $(LUA_A) default: $(PLAT) -@@ -57,6 +58,9 @@ $(LUA_T): $(LUA_O) $(LUA_A) +@@ -57,8 +58,11 @@ $(LUA_T): $(LUA_O) $(LUA_A) $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) +$(LUA_SO): $(CORE_O) $(LIB_O) -+ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$V $(MYLDFLAGS) $? $(LIBS) ++ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS) + clean: - $(RM) $(ALL_T) $(ALL_O) +- $(RM) $(ALL_T) $(ALL_O) ++ $(RM) $(ALL_T) $(ALL_O) $(ALL_SO) + depend: + @$(CC) $(CFLAGS) -MM l*.c print.c @@ -95,6 +99,9 @@ freebsd: generic: $(MAKE) all MYCFLAGS= +haiku: -+ $(MAKE) all MYCFLAGS=-DLUA_USE_HAIKU LIBS= ++ $(MAKE) all SYSCFLAGS="-DLUA_USE_HAIKU" LIBS= + linux: $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" -diff --git a/src/lcode.c b/src/lcode.c -index cff626b..679cb9c 100644 ---- a/src/lcode.c -+++ b/src/lcode.c -@@ -1,5 +1,5 @@ - /* --** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ -+** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $ - ** Code generator for Lua - ** See Copyright Notice in lua.h - */ -@@ -544,10 +544,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) { - pc = NO_JUMP; /* always true; do nothing */ - break; - } -- case VFALSE: { -- pc = luaK_jump(fs); /* always jump */ -- break; -- } - case VJMP: { - invertjump(fs, e); - pc = e->u.s.info; -@@ -572,10 +568,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) { - pc = NO_JUMP; /* always false; do nothing */ - break; - } -- case VTRUE: { -- pc = luaK_jump(fs); /* always jump */ -- break; -- } - case VJMP: { - pc = e->u.s.info; - break; -diff --git a/src/ldblib.c b/src/ldblib.c -index 67de122..2027eda 100644 ---- a/src/ldblib.c -+++ b/src/ldblib.c -@@ -1,5 +1,5 @@ - /* --** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $ -+** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $ - ** Interface from Lua to its debug API - ** See Copyright Notice in lua.h - */ -@@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) { - - - static int db_getfenv (lua_State *L) { -+ luaL_checkany(L, 1); - lua_getfenv(L, 1); - return 1; - } -diff --git a/src/liolib.c b/src/liolib.c -index e79ed1c..649f9a5 100644 ---- a/src/liolib.c -+++ b/src/liolib.c -@@ -1,5 +1,5 @@ - /* --** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ -+** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $ - ** Standard I/O (and system) library - ** See Copyright Notice in lua.h - */ -@@ -276,7 +276,10 @@ static int read_number (lua_State *L, FILE *f) { - lua_pushnumber(L, d); - return 1; - } -- else return 0; /* read fails */ -+ else { -+ lua_pushnil(L); /* "result" to be removed */ -+ return 0; /* read fails */ -+ } - } - - -diff --git a/src/llex.c b/src/llex.c -index 6dc3193..88c6790 100644 ---- a/src/llex.c -+++ b/src/llex.c -@@ -1,5 +1,5 @@ - /* --** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ -+** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $ - ** Lexical Analyzer - ** See Copyright Notice in lua.h - */ -@@ -118,8 +118,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { - lua_State *L = ls->L; - TString *ts = luaS_newlstr(L, str, l); - TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ -- if (ttisnil(o)) -+ if (ttisnil(o)) { - setbvalue(o, 1); /* make sure `str' will not be collected */ -+ luaC_checkGC(L); -+ } - return ts; - } - -diff --git a/src/loadlib.c b/src/loadlib.c -index 0d401eb..6158c53 100644 ---- a/src/loadlib.c -+++ b/src/loadlib.c -@@ -1,5 +1,5 @@ - /* --** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ -+** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $ - ** Dynamic library loader for Lua - ** See Copyright Notice in lua.h - ** -@@ -639,7 +639,7 @@ LUALIB_API int luaopen_package (lua_State *L) { - lua_pushvalue(L, -1); - lua_replace(L, LUA_ENVIRONINDEX); - /* create `loaders' table */ -- lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); -+ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0); - /* fill it with pre-defined loaders */ - for (i=0; loaders[i] != NULL; i++) { - lua_pushcfunction(L, loaders[i]); -diff --git a/src/lstrlib.c b/src/lstrlib.c -index 1b4763d..7a03489 100644 ---- a/src/lstrlib.c -+++ b/src/lstrlib.c -@@ -1,5 +1,5 @@ - /* --** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ -+** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $ - ** Standard library for string operations and pattern-matching - ** See Copyright Notice in lua.h - */ -@@ -754,6 +754,7 @@ static void addintlen (char *form) { - - - static int str_format (lua_State *L) { -+ int top = lua_gettop(L); - int arg = 1; - size_t sfl; - const char *strfrmt = luaL_checklstring(L, arg, &sfl); -@@ -768,7 +769,8 @@ static int str_format (lua_State *L) { - else { /* format item */ - char form[MAX_FORMAT]; /* to store the format (`%...') */ - char buff[MAX_ITEM]; /* to store the formatted item */ -- arg++; -+ if (++arg > top) -+ luaL_argerror(L, arg, "no value"); - strfrmt = scanformat(L, strfrmt, form); - switch (*strfrmt++) { - case 'c': { diff --git a/src/luaconf.h b/src/luaconf.h -index e2cb261..9f28f41 100644 +index e2cb261..96c4d45 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -33,6 +33,13 @@ @@ -247,49 +105,19 @@ index e2cb261..9f28f41 100644 #if defined(LUA_USE_LINUX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -@@ -94,7 +101,11 @@ +@@ -94,8 +101,12 @@ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" #else --#define LUA_ROOT "/usr/local/" -+# if defined(LUA_USE_HAIKU) -+# define LUA_ROOT "/boot/common/" -+# else -+# define LUA_ROOT "/usr/local/" -+# endif ++#ifndef LUA_ROOT + #define LUA_ROOT "/usr/local/" ++#endif ++#ifndef LUA_LDIR #define LUA_LDIR LUA_ROOT "share/lua/5.1/" ++#endif #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" #define LUA_PATH_DEFAULT \ -diff --git a/src/lvm.c b/src/lvm.c -index ee3256a..8aeafda 100644 ---- a/src/lvm.c -+++ b/src/lvm.c -@@ -1,5 +1,5 @@ - /* --** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ -+** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $ - ** Lua virtual machine - ** See Copyright Notice in lua.h - */ -@@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { - - void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; -+ TValue temp; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ -@@ -152,7 +153,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { - callTM(L, tm, t, key, val); - return; - } -- t = tm; /* else repeat with `tm' */ -+ /* else repeat with `tm' */ -+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */ -+ t = &temp; - } - luaG_runerror(L, "loop in settable"); - } + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ -- 1.8.3.4 diff --git a/dev-lang/luajit/luajit-2.0.2.recipe b/dev-lang/luajit/luajit-2.0.2.recipe index 410c85c92..a5c5a1028 100644 --- a/dev-lang/luajit/luajit-2.0.2.recipe +++ b/dev-lang/luajit/luajit-2.0.2.recipe @@ -2,7 +2,7 @@ SUMMARY="LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming languag HOMEPAGE="http://luajit.org/luajit.html" SRC_URI="http://luajit.org/download/LuaJIT-$portVersion.tar.gz" CHECKSUM_MD5="112dfb82548b03377fbefbba2e0e3a5b" -REVISION="1" +REVISION="2" ARCHITECTURES="x86 x86_gcc2" SECONDARY_ARCHITECTURES="x86" PROVIDES=" @@ -46,7 +46,14 @@ INSTALL() INSTALL_MAN="$manDir/man1" INSTALL_LMOD="$dataDir/lua/5.1" ln -s $libDir/libluajit-5.1.so.2.0.2 $libDir/libluajit-5.1.so.2 + + # the pkg-config is for 5.1 comapt + mkdir -p $libDir/pkgconfig + cp etc/luajit.pc $libDir/pkgconfig/luajit.pc + prepareInstalledDevelLib libluajit-5.1 + fixPkgconfig + packageEntries devel $developDir } LICENSE="MIT" diff --git a/dev-lang/python/patches/python-2.6.9.patchset b/dev-lang/python/patches/python-2.6.9.patchset new file mode 100644 index 000000000..284cf52cb --- /dev/null +++ b/dev-lang/python/patches/python-2.6.9.patchset @@ -0,0 +1,877 @@ +From 5ccf5800d437d3abbfd13b4f2ccf86b1606deb8c Mon Sep 17 00:00:00 2001 +From: Oliver Tappe +Date: Sat, 12 Oct 2013 17:37:25 +0200 +Subject: applying patch python-2.6.8.patch + + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index aeb6b74..2edcc48 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -234,9 +234,13 @@ class build_ext (Command): + + # for extensions under Linux or Solaris with a shared Python library, + # Python's library directory must be appended to library_dirs ++ # For Haiku the situation is similar, though more correctly the ++ # develop/lib path should be used. Due to the naming scheme used for the ++ # python library it works nonetheless. + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') +- or sys.platform.startswith('sunos')) ++ or sys.platform.startswith('sunos') ++ or sys.platform.startswith('haiku')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): + if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + # building third party extensions +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 46d23ec..5354cf1 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -85,7 +85,8 @@ def get_python_inc(plat_specific=0, prefix=None): + # Include is located in the srcdir + inc_dir = os.path.join(srcdir, "Include") + return inc_dir +- return os.path.join(prefix, "include", "python" + get_python_version()) ++ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers" ++ return os.path.join(prefix, inc_dir, "python" + get_python_version()) + elif os.name == "nt": + return os.path.join(prefix, "include") + elif os.name == "mac": +diff --git a/Lib/plat-haiku1/IN.py b/Lib/plat-haiku1/IN.py +new file mode 100644 +index 0000000..362cb41 +--- /dev/null ++++ b/Lib/plat-haiku1/IN.py +@@ -0,0 +1,327 @@ ++# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h ++ ++# Included from socket.h ++ ++# Included from BeBuild.h ++B_BEOS_VERSION_4 = 0x0400 ++B_BEOS_VERSION_4_5 = 0x0450 ++B_BEOS_VERSION_5 = 0x0500 ++B_BEOS_VERSION = B_BEOS_VERSION_5 ++B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5 ++_PR2_COMPATIBLE_ = 1 ++_PR3_COMPATIBLE_ = 1 ++_R4_COMPATIBLE_ = 1 ++_R4_5_COMPATIBLE_ = 1 ++_PR2_COMPATIBLE_ = 0 ++_PR3_COMPATIBLE_ = 0 ++_R4_COMPATIBLE_ = 1 ++_R4_5_COMPATIBLE_ = 1 ++def _UNUSED(x): return x ++ ++ ++# Included from sys/types.h ++ ++# Included from time.h ++ ++# Included from be_setup.h ++def __std(ref): return ref ++ ++__be_os = 2 ++__dest_os = __be_os ++__MSL__ = 0x4011 ++__GLIBC__ = -2 ++__GLIBC_MINOR__ = 1 ++ ++# Included from null.h ++NULL = (0) ++NULL = 0L ++ ++# Included from size_t.h ++ ++# Included from stddef.h ++ ++# Included from wchar_t.h ++CLOCKS_PER_SEC = 1000 ++CLK_TCK = CLOCKS_PER_SEC ++MAX_TIMESTR = 70 ++ ++# Included from sys/time.h ++ ++# Included from ByteOrder.h ++ ++# Included from endian.h ++__LITTLE_ENDIAN = 1234 ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++__BYTE_ORDER = __LITTLE_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++__BIG_ENDIAN = 0 ++BIG_ENDIAN = 0 ++__BIG_ENDIAN = 4321 ++BIG_ENDIAN = __BIG_ENDIAN ++__BYTE_ORDER = __BIG_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++__LITTLE_ENDIAN = 0 ++LITTLE_ENDIAN = 0 ++__PDP_ENDIAN = 3412 ++PDP_ENDIAN = __PDP_ENDIAN ++ ++# Included from SupportDefs.h ++ ++# Included from Errors.h ++ ++# Included from limits.h ++ ++# Included from float.h ++FLT_ROUNDS = 1 ++FLT_RADIX = 2 ++FLT_MANT_DIG = 24 ++FLT_DIG = 6 ++FLT_MIN_EXP = (-125) ++FLT_MIN_10_EXP = (-37) ++FLT_MAX_EXP = 128 ++FLT_MAX_10_EXP = 38 ++DBL_MANT_DIG = 53 ++DBL_DIG = 15 ++DBL_MIN_EXP = (-1021) ++DBL_MIN_10_EXP = (-308) ++DBL_MAX_EXP = 1024 ++DBL_MAX_10_EXP = 308 ++LDBL_MANT_DIG = DBL_MANT_DIG ++LDBL_DIG = DBL_DIG ++LDBL_MIN_EXP = DBL_MIN_EXP ++LDBL_MIN_10_EXP = DBL_MIN_10_EXP ++LDBL_MAX_EXP = DBL_MAX_EXP ++LDBL_MAX_10_EXP = DBL_MAX_10_EXP ++CHAR_BIT = (8) ++SCHAR_MIN = (-127-1) ++SCHAR_MAX = (127) ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++MB_LEN_MAX = (1) ++SHRT_MIN = (-32767-1) ++SHRT_MAX = (32767) ++LONG_MIN = (-2147483647L-1) ++LONG_MAX = (2147483647L) ++INT_MIN = LONG_MIN ++INT_MAX = LONG_MAX ++ARG_MAX = (32768) ++ATEXIT_MAX = (32) ++CHILD_MAX = (1024) ++IOV_MAX = (256) ++FILESIZEBITS = (64) ++LINK_MAX = (1) ++LOGIN_NAME_MAX = (32) ++MAX_CANON = (255) ++MAX_INPUT = (255) ++NAME_MAX = (256) ++NGROUPS_MAX = (32) ++OPEN_MAX = (128) ++PATH_MAX = (1024) ++PIPE_MAX = (512) ++SSIZE_MAX = (2147483647L) ++TTY_NAME_MAX = (256) ++TZNAME_MAX = (32) ++SYMLINKS_MAX = (16) ++_POSIX_ARG_MAX = (32768) ++_POSIX_CHILD_MAX = (1024) ++_POSIX_LINK_MAX = (1) ++_POSIX_LOGIN_NAME_MAX = (9) ++_POSIX_MAX_CANON = (255) ++_POSIX_MAX_INPUT = (255) ++_POSIX_NAME_MAX = (255) ++_POSIX_NGROUPS_MAX = (0) ++_POSIX_OPEN_MAX = (128) ++_POSIX_PATH_MAX = (1024) ++_POSIX_PIPE_BUF = (512) ++_POSIX_SSIZE_MAX = (2147483647L) ++_POSIX_STREAM_MAX = (8) ++_POSIX_TTY_NAME_MAX = (256) ++_POSIX_TZNAME_MAX = (3) ++B_GENERAL_ERROR_BASE = LONG_MIN ++B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000 ++B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000 ++B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000 ++B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000 ++B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800 ++B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000 ++B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000 ++B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000 ++B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000 ++B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000 ++B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000 ++B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff) ++E2BIG = (B_POSIX_ERROR_BASE + 1) ++ECHILD = (B_POSIX_ERROR_BASE + 2) ++EDEADLK = (B_POSIX_ERROR_BASE + 3) ++EFBIG = (B_POSIX_ERROR_BASE + 4) ++EMLINK = (B_POSIX_ERROR_BASE + 5) ++ENFILE = (B_POSIX_ERROR_BASE + 6) ++ENODEV = (B_POSIX_ERROR_BASE + 7) ++ENOLCK = (B_POSIX_ERROR_BASE + 8) ++ENOSYS = (B_POSIX_ERROR_BASE + 9) ++ENOTTY = (B_POSIX_ERROR_BASE + 10) ++ENXIO = (B_POSIX_ERROR_BASE + 11) ++ESPIPE = (B_POSIX_ERROR_BASE + 12) ++ESRCH = (B_POSIX_ERROR_BASE + 13) ++EFPOS = (B_POSIX_ERROR_BASE + 14) ++ESIGPARM = (B_POSIX_ERROR_BASE + 15) ++EDOM = (B_POSIX_ERROR_BASE + 16) ++ERANGE = (B_POSIX_ERROR_BASE + 17) ++EPROTOTYPE = (B_POSIX_ERROR_BASE + 18) ++EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19) ++EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20) ++EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21) ++EADDRINUSE = (B_POSIX_ERROR_BASE + 22) ++EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23) ++ENETDOWN = (B_POSIX_ERROR_BASE + 24) ++ENETUNREACH = (B_POSIX_ERROR_BASE + 25) ++ENETRESET = (B_POSIX_ERROR_BASE + 26) ++ECONNABORTED = (B_POSIX_ERROR_BASE + 27) ++ECONNRESET = (B_POSIX_ERROR_BASE + 28) ++EISCONN = (B_POSIX_ERROR_BASE + 29) ++ENOTCONN = (B_POSIX_ERROR_BASE + 30) ++ESHUTDOWN = (B_POSIX_ERROR_BASE + 31) ++ECONNREFUSED = (B_POSIX_ERROR_BASE + 32) ++EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33) ++ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34) ++ENOBUFS = (B_POSIX_ERROR_BASE + 35) ++EINPROGRESS = (B_POSIX_ERROR_BASE + 36) ++EALREADY = (B_POSIX_ERROR_BASE + 37) ++EILSEQ = (B_POSIX_ERROR_BASE + 38) ++ENOMSG = (B_POSIX_ERROR_BASE + 39) ++ESTALE = (B_POSIX_ERROR_BASE + 40) ++EOVERFLOW = (B_POSIX_ERROR_BASE + 41) ++EMSGSIZE = (B_POSIX_ERROR_BASE + 42) ++EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43) ++ENOTSOCK = (B_POSIX_ERROR_BASE + 44) ++false = 0 ++true = 1 ++NULL = (0) ++FALSE = 0 ++TRUE = 1 ++ ++# Included from TypeConstants.h ++B_HOST_IS_LENDIAN = 1 ++B_HOST_IS_BENDIAN = 0 ++def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg) ++ ++def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg) ++ ++def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg) ++ ++def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg) ++ ++def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg) ++ ++def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg) ++ ++def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg) ++ ++def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg) ++ ++def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg) ++ ++def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg) ++ ++def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) ++ ++def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) ++ ++def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) ++ ++def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) ++ ++def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) ++ ++def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) ++ ++def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) ++ ++def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) ++ ++def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) ++ ++def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) ++ ++B_HOST_IS_LENDIAN = 0 ++B_HOST_IS_BENDIAN = 1 ++def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg) ++ ++def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg) ++ ++def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg) ++ ++def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg) ++ ++def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg) ++ ++def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg) ++ ++def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg) ++ ++def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg) ++ ++def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg) ++ ++def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg) ++ ++def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) ++ ++def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) ++ ++def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) ++ ++def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) ++ ++def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) ++ ++def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) ++ ++def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) ++ ++def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) ++ ++def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) ++ ++def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) ++ ++def B_SWAP_DOUBLE(arg): return __swap_double(arg) ++ ++def B_SWAP_FLOAT(arg): return __swap_float(arg) ++ ++def B_SWAP_INT64(arg): return __swap_int64(arg) ++ ++def B_SWAP_INT32(arg): return __swap_int32(arg) ++ ++def B_SWAP_INT16(arg): return __swap_int16(arg) ++ ++def htonl(x): return B_HOST_TO_BENDIAN_INT32(x) ++ ++def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x) ++ ++def htons(x): return B_HOST_TO_BENDIAN_INT16(x) ++ ++def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x) ++ ++AF_INET = 1 ++INADDR_ANY = 0x00000000 ++INADDR_BROADCAST = 0xffffffff ++INADDR_LOOPBACK = 0x7f000001 ++SOL_SOCKET = 1 ++SO_DEBUG = 1 ++SO_REUSEADDR = 2 ++SO_NONBLOCK = 3 ++SO_REUSEPORT = 4 ++MSG_OOB = 0x1 ++SOCK_DGRAM = 1 ++SOCK_STREAM = 2 ++IPPROTO_UDP = 1 ++IPPROTO_TCP = 2 ++IPPROTO_ICMP = 3 ++B_UDP_MAX_SIZE = (65536 - 1024) ++FD_SETSIZE = 256 ++FDSETSIZE = FD_SETSIZE ++NFDBITS = 32 ++def _FDMSKNO(fd): return ((fd) / NFDBITS) ++ ++def _FDBITNO(fd): return ((fd) % NFDBITS) +diff --git a/Lib/plat-haiku1/regen b/Lib/plat-haiku1/regen +new file mode 100644 +index 0000000..d9da80c +--- /dev/null ++++ b/Lib/plat-haiku1/regen +@@ -0,0 +1,7 @@ ++#! /bin/sh ++ ++H2PY=../../Tools/scripts/h2py.py ++HEADERS=/boot/develop/headers ++ ++set -v ++python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h +diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py +index 7eeef7b..b1938fd 100644 +--- a/Lib/test/test_fileio.py ++++ b/Lib/test/test_fileio.py +@@ -152,6 +152,7 @@ class OtherFileTests(unittest.TestCase): + self.assertEquals(f.writable(), True) + if sys.platform != "darwin" and \ + 'bsd' not in sys.platform and \ ++ 'haiku' not in sys.platform and \ + not sys.platform.startswith('sunos'): + # Somehow /dev/tty appears seekable on some BSDs + self.assertEquals(f.seekable(), False) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index ce4fbdc..aba9464 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -90,7 +90,7 @@ BINDIR= @bindir@ + LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ +-CONFINCLUDEDIR= $(exec_prefix)/include ++CONFINCLUDEDIR= $(INCLUDEDIR) + SCRIPTDIR= $(prefix)/lib + + # Detailed destination directories +diff --git a/Modules/resource.c b/Modules/resource.c +index 9993b93..f8befde 100644 +--- a/Modules/resource.c ++++ b/Modules/resource.c +@@ -86,6 +86,7 @@ resource_getrusage(PyObject *self, PyObject *args) + PyFloat_FromDouble(doubletime(ru.ru_utime))); + PyStructSequence_SET_ITEM(result, 1, + PyFloat_FromDouble(doubletime(ru.ru_stime))); ++#ifndef __HAIKU__ + PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss)); + PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss)); + PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss)); +@@ -100,7 +101,7 @@ resource_getrusage(PyObject *self, PyObject *args) + PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals)); + PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw)); + PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw)); +- ++#endif + if (PyErr_Occurred()) { + Py_DECREF(result); + return NULL; +diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c +index a28116c..62c5813 100644 +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -4661,7 +4661,9 @@ init_socket(void) + #ifndef __BEOS__ + /* We have incomplete socket support. */ + PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); +- PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); ++#ifndef __HAIKU__ ++ PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); ++#endif + #if defined(SOCK_RDM) + PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); + #endif +diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h +index 9b85773..8e35a64 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -47,6 +47,10 @@ typedef int socklen_t; + # undef AF_NETLINK + #endif + ++#if defined(__HAIKU__) ++#undef HAVE_BLUETOOTH_BLUETOOTH_H ++#endif ++ + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + #include + #include +diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c +index 957de58..69be5bb 100644 +--- a/Modules/spwdmodule.c ++++ b/Modules/spwdmodule.c +@@ -79,7 +79,9 @@ static PyObject *mkspent(struct spwd *p) + + SETS(setIndex++, p->sp_namp); + SETS(setIndex++, p->sp_pwdp); ++#ifndef __HAIKU__ + SETI(setIndex++, p->sp_lstchg); ++#endif + SETI(setIndex++, p->sp_min); + SETI(setIndex++, p->sp_max); + SETI(setIndex++, p->sp_warn); +diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c +index 57d9df8..83c9a2e 100644 +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c +@@ -18,7 +18,7 @@ + */ + #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) + const char *Py_FileSystemDefaultEncoding = "mbcs"; +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__HAIKU__) + const char *Py_FileSystemDefaultEncoding = "utf-8"; + #else + const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ +diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py +index 63e7336..65cd21f 100755 +--- a/Tools/scripts/h2py.py ++++ b/Tools/scripts/h2py.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /bin/env python + + # Read #define's and translate to Python code. + # Handle #include statements. +@@ -50,7 +50,7 @@ except KeyError: + searchdirs=os.environ['INCLUDE'].split(';') + except KeyError: + try: +- if sys.platform.find("beos") == 0: ++ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0: + searchdirs=os.environ['BEINCLUDES'].split(';') + elif sys.platform.startswith("atheos"): + searchdirs=os.environ['C_INCLUDE_PATH'].split(':') +diff --git a/configure.in b/configure.in +index f3d34f2..aedd433 100644 +--- a/configure.in ++++ b/configure.in +@@ -745,7 +745,7 @@ if test $enable_shared = "yes"; then + RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + INSTSONAME="$LDLIBRARY".$SOVERSION + ;; +- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*) ++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*) + LDLIBRARY='libpython$(VERSION).so' + BLDLIBRARY='-L. -lpython$(VERSION)' + RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} +@@ -753,6 +753,9 @@ if test $enable_shared = "yes"; then + FreeBSD*) + SOVERSION=`echo $SOVERSION|cut -d "." -f 1` + ;; ++ Haiku*) ++ RUNSHARED=LIBRARY_PATH=`pwd`:${LIBRARY_PATH} ++ ;; + esac + INSTSONAME="$LDLIBRARY".$SOVERSION + ;; +@@ -823,7 +826,7 @@ AC_PROG_INSTALL + AC_SUBST(LN) + if test -z "$LN" ; then + case $ac_sys_system in +- BeOS*) LN="ln -s";; ++ BeOS*|Haiku*) LN="ln -s";; + CYGWIN*) LN="ln -s";; + atheos*) LN="ln -s";; + *) LN=ln;; +@@ -1829,7 +1832,7 @@ then + fi + fi + ;; +- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';; ++ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';; + BSD/OS*/4*) LDSHARED="gcc -shared";; + FreeBSD*) + if [[ "`$CC -dM -E - +Date: Sun, 13 Oct 2013 17:01:30 +0200 +Subject: Adjust package folders for Python modules. + +* move standard site-packaged into non-packaged hierarchy, as it has to + be writable +* rename directory for packaged python modules to 'vendor-packages' +* add support for automatically switching to 'vendor-packages' directory + when environment variable 'HAIKU_USE_VENDOR_DIRECTORIES' is set + +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index 44c7692..ff8c01e 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -97,6 +97,34 @@ INSTALL_SCHEMES = { + 'scripts': '$userbase/bin', + 'data' : '$userbase', + }, ++ 'haiku': { ++ 'purelib': '$base/non-packaged/lib/python$py_version_short/site-packages', ++ 'platlib': '$platbase/non-packaged/lib/python$py_version_short/site-packages', ++ 'headers': '$base/non-packaged/develop/headers/python$py_version_short/$dist_name', ++ 'scripts': '$base/non-packaged/bin', ++ 'data' : '$base/non-packaged', ++ }, ++ 'haiku_vendor': { ++ 'purelib': '$base/lib/python$py_version_short/vendor-packages', ++ 'platlib': '$platbase/lib/python$py_version_short/vendor-packages', ++ 'headers': '$base/develop/headers/python$py_version_short/$dist_name', ++ 'scripts': '$base/bin', ++ 'data' : '$base', ++ }, ++ 'haiku_home': { ++ 'purelib': '$base/lib/python', ++ 'platlib': '$base/lib/python', ++ 'headers': '$base/develop/headers/python/$dist_name', ++ 'scripts': '$base/bin', ++ 'data' : '$base', ++ }, ++ 'haiku_user': { ++ 'purelib': '$usersite', ++ 'platlib': '$usersite', ++ 'headers': '$userbase/develop/headers/python$py_version_short/$dist_name', ++ 'scripts': '$userbase/bin', ++ 'data' : '$userbase', ++ }, + } + + # The keys to an installation scheme; if any new types of files are to be +@@ -430,10 +458,16 @@ class install (Command): + raise DistutilsPlatformError( + "User base directory is not specified") + self.install_base = self.install_platbase = self.install_userbase +- self.select_scheme("unix_user") ++ if sys.platform.startswith('haiku'): ++ self.select_scheme("haiku_user") ++ else: ++ self.select_scheme("unix_user") + elif self.home is not None: + self.install_base = self.install_platbase = self.home +- self.select_scheme("unix_home") ++ if sys.platform.startswith('haiku'): ++ self.select_scheme("haiku_home") ++ else: ++ self.select_scheme("unix_home") + else: + if self.prefix is None: + if self.exec_prefix is not None: +@@ -449,7 +483,13 @@ class install (Command): + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix +- self.select_scheme("unix_prefix") ++ if sys.platform.startswith('haiku'): ++ if os.environ.get('HAIKU_USE_VENDOR_DIRECTORIES') == '1': ++ self.select_scheme("haiku_vendor") ++ else: ++ self.select_scheme("haiku") ++ else: ++ self.select_scheme("unix_prefix") + + # finalize_unix () + +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 5354cf1..017a94c 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -120,12 +120,20 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": +- libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) +- if standard_lib: +- return libpython ++ if sys.platform.startswith('haiku'): ++ if standard_lib: ++ return os.path.join(prefix, ++ "lib", "python" + get_python_version()) ++ return os.path.join(prefix, "non-packaged", ++ "lib", "python" + get_python_version(), ++ "site-packages") + else: +- return os.path.join(libpython, "site-packages") ++ libpython = os.path.join(prefix, ++ "lib", "python" + get_python_version()) ++ if standard_lib: ++ return libpython ++ else: ++ return os.path.join(libpython, "site-packages") + + elif os.name == "nt": + if standard_lib: +diff --git a/Lib/site.py b/Lib/site.py +index 66c56c2..304f994 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -241,6 +241,11 @@ def addusersitepackages(known_paths): + USER_SITE = os.path.join(USER_BASE, + "Python" + sys.version[0] + sys.version[2], + "site-packages") ++ elif sys.platform.startswith('haiku'): ++ USER_BASE = env_base if env_base else joinuser("~", "non-packaged") ++ USER_SITE = os.path.join(USER_BASE, "lib", ++ "python" + sys.version[:3], ++ "site-packages") + else: + USER_BASE = env_base if env_base else joinuser("~", ".local") + USER_SITE = os.path.join(USER_BASE, "lib", +@@ -264,6 +269,13 @@ def addsitepackages(known_paths): + + if sys.platform in ('os2emx', 'riscos'): + sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) ++ elif sys.platform.startswith('haiku'): ++ sitedirs.append(os.path.join(prefix, "non-packaged", "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitedirs.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "vendor-packages")) + elif os.sep == '/': + sitedirs.append(os.path.join(prefix, "lib", + "python" + sys.version[:3], +-- +1.8.3.4 + + +From 17c8d2590189838ef19b08fb0ce7976d03b1cabc Mon Sep 17 00:00:00 2001 +From: Oliver Tappe +Date: Sun, 13 Oct 2013 17:06:48 +0200 +Subject: Drop references to common hierarchy. + + +diff --git a/setup.py b/setup.py +index 930a368..41a16a2 100644 +--- a/setup.py ++++ b/setup.py +@@ -429,13 +429,9 @@ class PyBuildExt(build_ext): + inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) + + if platform == 'haiku1': +- inc_dirs += ['/boot/common/non-packaged/develop/headers', +- '/boot/common/develop/headers', +- '/boot/system/develop/headers/posix', ++ inc_dirs += ['/boot/system/develop/headers/posix', + '/boot/system/develop/headers'] +- lib_dirs += ['/boot/common/non-packaged/develop/lib', +- '/boot/common/develop/lib', +- '/boot/system/develop/lib'] ++ lib_dirs += ['/boot/system/develop/lib'] + + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if platform in ['osf1', 'unixware7', 'openunix8']: +-- +1.8.3.4 + +From 65db0c5cdfce63260e3b0f7f171a51273e18a40d Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 22 Jan 2014 00:08:14 +0000 +Subject: [PATCH] haiku: Fix home non-packaged dir + +--- + Lib/site.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/site.py b/Lib/site.py +index 304f994..74b0785 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -242,7 +242,7 @@ def addusersitepackages(known_paths): + "Python" + sys.version[0] + sys.version[2], + "site-packages") + elif sys.platform.startswith('haiku'): +- USER_BASE = env_base if env_base else joinuser("~", "non-packaged") ++ USER_BASE = env_base if env_base else joinuser("~", "config", "non-packaged") + USER_SITE = os.path.join(USER_BASE, "lib", + "python" + sys.version[:3], + "site-packages") +-- +1.8.3.4 + diff --git a/dev-lang/python/python-2.6.9.recipe b/dev-lang/python/python-2.6.9.recipe new file mode 100644 index 000000000..a97f285e6 --- /dev/null +++ b/dev-lang/python/python-2.6.9.recipe @@ -0,0 +1,116 @@ +SUMMARY="An interpreted, interactive, object-oriented programming language" +DESCRIPTION=" +Python is a programming language that lets you work more quickly and integrate \ +your systems more effectively. You can learn to use Python and see almost \ +immediate gains in productivity and lower maintenance costs. +Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java \ +and .NET virtual machines. +Python is free to use, even for commercial products, because of its \ +OSI-approved open source license. +" +HOMEPAGE="http://www.python.org" +LICENSE="Python" +COPYRIGHT="1990-2012, Python Software Foundation" +SRC_URI="http://www.python.org/ftp/python/2.6.9/Python-2.6.9.tar.xz" +CHECKSUM_MD5="933a811f11e3db3d73ae492f6c3a7a76" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86 x86_64" + +PATCHES="python-2.6.9.patchset" + +PROVIDES=" + python = $portVersion compat >= 2.6 + cmd:2to3 = $portVersion compat >= 2.6 + cmd:idle = $portVersion compat >= 2.6 + cmd:pydoc = $portVersion compat >= 2.6 + cmd:python = $portVersion compat >= 2.6 + cmd:python2.6 = $portVersion compat >= 2.6 + cmd:python2.6_config = $portVersion compat >= 2.6 + cmd:python_config = $portVersion compat >= 2.6 + cmd:smtpd.py = $portVersion compat >= 2.6 + devel:libpython2.6 = 1.0 + lib:libpython2.6 = 1.0 + " +REQUIRES=" + haiku >= $haikuVersion + cmd:nano + lib:libbz2 + lib:libncurses + lib:libssl + lib:libreadline + lib:libsqlite3 + lib:libz + " +BUILD_REQUIRES=" + devel:libbz2 + devel:libncurses + devel:libssl + devel:libreadline + devel:libsqlite3 + devel:libz + " +BUILD_PREREQUIRES=" + haiku_devel >= $haikuVersion + cmd:aclocal + cmd:autoconf + cmd:find + cmd:gcc + cmd:ld + cmd:libtoolize + cmd:make + cmd:nano + " + +SOURCE_DIR="Python-2.6.9" + +GLOBAL_WRITABLE_FILES=" + non-packaged/lib/python2.6/site-packages directory keep-old + " + +PATCH() +{ + echo "AC_CONFIG_MACRO_DIR([m4])" >> configure.in + find . -name '*.py' -exec sed -i -e 's|/usr/bin/env|/bin/env|g' {} \; +} + +BUILD() +{ + cd Modules/_ctypes/libffi + libtoolize --force --copy --install + cd ../../.. + + libtoolize --force --copy --install + aclocal + autoconf + runConfigure ./configure \ + --enable-shared \ + --enable-unicode=ucs4 + + # prevent make from rebuilding stuff that requires python + touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h + + make $jobArgs +} + +INSTALL() +{ + make install + + prepareInstalledDevelLibs libpython2.6 + + mkdir -p $prefix/lib/python2.6/vendor-packages + echo 'This directory contains packaged python modules.' \ + >$prefix/lib/python2.6/vendor-packages/README + + mkdir -p $prefix/non-packaged/lib/python2.6 + mv $prefix/lib/python2.6/site-packages $prefix/non-packaged/lib/python2.6/ +} + +TEST() +{ + cd Lib/test + rm test_asynchat.py # this one stalls, so skip it for now + rm test_multiprocessing.py # this one stalls, so skip it for now + + python regrtest.py +} diff --git a/dev-libs/boost/boost-1.55.0.recipe b/dev-libs/boost/boost-1.55.0.recipe index 24170220b..c2cdb68d8 100644 --- a/dev-libs/boost/boost-1.55.0.recipe +++ b/dev-libs/boost/boost-1.55.0.recipe @@ -141,6 +141,11 @@ INSTALL() packageEntries wave $libDir/libboost_wave* } +TEST() { + cd status + ../bjam $jobArgs +} + PROVIDES_devel=" boost_devel$secondaryArchSuffix = $portVersion devel:libboost_atomic$secondaryArchSuffix = $portVersion diff --git a/dev-libs/libxml2/libxml2-2.9.1.recipe b/dev-libs/libxml2/libxml2-2.9.1.recipe index e81bad670..9c374179c 100644 --- a/dev-libs/libxml2/libxml2-2.9.1.recipe +++ b/dev-libs/libxml2/libxml2-2.9.1.recipe @@ -5,8 +5,8 @@ COPYRIGHT="1998-2013 Daniel Veillard. All Rights Reserved." SRC_URI="ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz" CHECKSUM_MD5="9c0cfef285d5c4a5c80d00904ddab380" REVISION="1" -ARCHITECTURES="x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86_gcc2 x86" +ARCHITECTURES="!x86_gcc2 !x86 !x86_64" +SECONDARY_ARCHITECTURES="!x86_gcc2 !x86" PATCHES="libxml2-2.9.1.patchset" @@ -36,7 +36,7 @@ BUILD_REQUIRES=" " if $pythonModuleEnabled; then BUILD_REQUIRES="$BUILD_REQUIRES - python + python >= 2.7 " # Note: We don't use "cmd:python" here to avoid issues with the # python search path. diff --git a/games-action/quake3/quake3-0.6.1.recipe b/games-action/quake3/quake3-0.6.1.recipe index c4c316d83..c05b539e4 100644 --- a/games-action/quake3/quake3-0.6.1.recipe +++ b/games-action/quake3/quake3-0.6.1.recipe @@ -10,9 +10,9 @@ you have). HOMEPAGE="http://www.idsoftware.com" COPYRIGHT="Copyright (C) 1999-2005 Id Software, Inc." LICENSE="GNU GPL v2" -SRC_URI="http://github.com/kallisti5/quake3/archive/$portVersion.tar.gz" +SRC_URI="https://github.com/kallisti5/quake3/archive/$portVersion.tar.gz" CHECKSUM_MD5="d7f6106605ccd06ec94a3715f8aa34c5" -REVISION="1" +REVISION="2" ARCHITECTURES="x86_gcc2 x86" SECONDARY_ARCHITECTURES="x86" @@ -21,6 +21,7 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix >= $haikuVersion + lib:libGL$secondaryArchSuffix " BUILD_REQUIRES=" " @@ -30,8 +31,8 @@ BUILD_PREREQUIRES=" cmd:ld$secondaryArchSuffix cmd:make cmd:nasm + devel:libGL$secondaryArchSuffix " - #lib:libGL SOURCE_DIR="quake3-$portVersion" BUILD() diff --git a/games-arcade/f1spirit/f1spirit-0.rc9.1615.recipe b/games-arcade/f1spirit/f1spirit-0.rc9.1615.recipe new file mode 100644 index 000000000..9172d3076 --- /dev/null +++ b/games-arcade/f1spirit/f1spirit-0.rc9.1615.recipe @@ -0,0 +1,66 @@ +SUMMARY="a top down Formula One Racing game" +HOMEPAGE="http://www2.braingames.getput.com/f1spirit/" +LICENSE="GNU GPL v2" +COPYRIGHT="2002-2008 Brain Games" +SRC_URI="http://braingames.jorito.net/f1spirit/f1spirit.src_0.rc9-1615.tgz" +CHECKSUM_MD5="304935124a1bf48a4de9b39077655fe9" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + $portName = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libcurl$secondaryArchSuffix + lib:libglu$secondaryArchSuffix + lib:libsdl$secondaryArchSuffix + lib:libSDL_image$secondaryArchSuffix + lib:libSDL_mixer$secondaryArchSuffix + lib:libSDL_net_1.2$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libcurl$secondaryArchSuffix + devel:libglu$secondaryArchSuffix + devel:libsdl$secondaryArchSuffix + devel:libSDL_image$secondaryArchSuffix + devel:libSDL_mixer$secondaryArchSuffix + devel:libSDL_net_1.2$secondaryArchSuffix + lib:libSDL_net_1.2$secondaryArchSuffix +# Why is that required? + devel:libssl$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + haiku_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +PATCHES="$portName-$portVersion.patchset" +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + installDir=$appsDir/"F-1 Spirit" + mkdir -p "$installDir" + make install PREFIX="$installDir" GAMEDIR="$installDir" + + cd "$installDir" + echo -e "#!/bin/sh\ncd \"$installDir\"/share/games/f1spirit && ./f1spirit" > f1spirit + + addAppDeskbarSymlink "$installDir/$portName" "F-1 Spirit" +} + +DESCRIPTION=" +Race against your opponents on 21 tracks. Features online high scores, realtime +rain effect, split-screen multiplayer, and more! +" diff --git a/games-arcade/f1spirit/patches/f1spirit-0.rc9.1615.patchset b/games-arcade/f1spirit/patches/f1spirit-0.rc9.1615.patchset new file mode 100644 index 000000000..dc4dce04b --- /dev/null +++ b/games-arcade/f1spirit/patches/f1spirit-0.rc9.1615.patchset @@ -0,0 +1,21 @@ +From 1ddc81cdd051fabb1e56e861f5fd5a9da429029c Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 21 Jan 2014 22:40:24 +0100 +Subject: Remove outdated include. + + +diff --git a/sources/F1Shttp.cpp b/sources/F1Shttp.cpp +index 59a213c..9cb48cc 100644 +--- a/sources/F1Shttp.cpp ++++ b/sources/F1Shttp.cpp +@@ -3,7 +3,6 @@ + #include "string.h" + + #include +-#include + #include + + #include "F1Shttp.h" +-- +1.8.3.4 + diff --git a/games-arcade/mog/mog-0.63.1548.recipe b/games-arcade/mog/mog-0.63.1548.recipe new file mode 100644 index 000000000..235e7d813 --- /dev/null +++ b/games-arcade/mog/mog-0.63.1548.recipe @@ -0,0 +1,67 @@ +SUMMARY="The Maze of Galious." +HOMEPAGE="http://www2.braingames.getput.com/mog/" +LICENSE="GNU GPL v2" +COPYRIGHT="2002-2009 Brain Games" +SRC_URI="http://braingames.jorito.net/mog/downloads/mog.src_0.63-1548.tgz" +CHECKSUM_MD5="68604c258ce7347662777d853d895769" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + mog = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libSDL_image$secondaryArchSuffix + lib:libSDL_mixer$secondaryArchSuffix + lib:libSDL_sound$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libsdl$secondaryArchSuffix + devel:libSDL_image$secondaryArchSuffix + devel:libSDL_mixer$secondaryArchSuffix + devel:libSDL_sound$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + haiku_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + installDir=$appsDir/"Maze of Galious" + mkdir -p "$installDir" + make install PREFIX="$installDir" GAMEDIR="$installDir" + addAppDeskbarSymlink "$installDir/mog" "Maze of Galious" +} + +DESCRIPTION=" +The Maze of Galious (MoG in short) was originally a Konami game for the MSX +computer system. Its real name is Knightmare II: The Maze of Galious and is the +sequel of another Konami game called Knightmare. + +MoG is a very addictive game where you have to kill thousands of enemies, +collect items in order to obtain new powers and defeat some really great demons +at the end of each level. The gameplay of MoG is not the boring linear one. In +MoG you are free to go everywhere you want from the beginning of the game. You +have to be very careful of the order in which you visit all the rooms in the +HUGE map if you want to keep your character alive. The map is structured in a +main map (called the castle) and 10 submaps (called the worlds). Initially you +are in the castle and you have to find the keys that open the doors to go to +each of the worlds. To complete the game you have to defeat the boss at the end +of each one of the 10 worlds. You are free to revisit each world as often as +you want in order to see if you have missed something. To defeat all 10 demons +you control two characters: Popolon and Aphrodite. Each one has special +abilities, i.e. Popolon has a greater ability to jump and Aphrodite is able to +dive. +" diff --git a/games-arcade/roadfighter/roadfighter-1.0.1269.recipe b/games-arcade/roadfighter/roadfighter-1.0.1269.recipe new file mode 100644 index 000000000..2d0a61bf8 --- /dev/null +++ b/games-arcade/roadfighter/roadfighter-1.0.1269.recipe @@ -0,0 +1,58 @@ +SUMMARY="A 2d racing game. Can you finish the race in time?" +HOMEPAGE="http://www2.braingames.getput.com/roadf/" +LICENSE="GNU GPL v2" +COPYRIGHT="2003-2009 Brain Games" +SRC_URI="http://braingames.jorito.net/roadfighter/downloads/roadfighter.src_1.0.1269.tgz" +CHECKSUM_MD5="a1626dda4d17ae30bbdd9c1ede2cd555" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + roadfighter = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libSDL_image$secondaryArchSuffix + lib:libSDL_mixer$secondaryArchSuffix + lib:libSDL_sound$secondaryArchSuffix + lib:libSDL_ttf$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libsdl$secondaryArchSuffix + devel:libSDL_image$secondaryArchSuffix + devel:libSDL_mixer$secondaryArchSuffix + devel:libSDL_sound$secondaryArchSuffix + devel:libSDL_ttf$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + haiku_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + installDir=$appsDir/"Road Fighter" + mkdir -p "$installDir" + make install PREFIX="$installDir" GAMEDIR="$installDir" + + cd "$installDir" + echo -e "#!/bin/sh\n`cat roadfighter`" > roadfighter + + addAppDeskbarSymlink "$installDir/roadfighter" "Road Fighter" +} + +DESCRIPTION=" +The goal is to reach the finish line within the stages without running out of +time, hitting other cars or running out of fuel (fuel is refilled by hitting a +special type of car). +" diff --git a/games-arcade/super_transball/patches/super_transball-2.1.5.patchset b/games-arcade/super_transball/patches/super_transball-2.1.5.patchset new file mode 100644 index 000000000..e82dda843 --- /dev/null +++ b/games-arcade/super_transball/patches/super_transball-2.1.5.patchset @@ -0,0 +1,671 @@ +From d5e22939a27c71bc0e55a56623b7ea83dceca155 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 19 Jan 2014 17:50:47 +0100 +Subject: Split writable files to writable directory + +* Patch adapted from the Debian package. +* Rename "pause" to "paused" to avoid conflict with unistd.h pause(). + +diff --git a/sources/Makefile b/sources/Makefile +index 08a898f..779f7bd 100644 +--- a/sources/Makefile ++++ b/sources/Makefile +@@ -12,11 +12,11 @@ OBJS := \ + all: stransball2 + + %.o: %.cpp +- c++ -c -g3 -O3 $< -o $@ `sdl-config --cflags` -I/usr/local/include/SDL ++ c++ -c -g3 -O3 $< -o $@ `sdl-config --cflags` + + # dynamically linked binary: + stransball2: $(OBJS) +- c++ $^ -o $@ `sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_sound -lSDL_sound -lSGE -I/usr/local/include/SDL ++ c++ $^ -o $@ `sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_sound -lSDL_sound -lSGE -lbe + mv ./stransball2 .. + + clean: +diff --git a/sources/configuration.cpp b/sources/configuration.cpp +index b39fdc2..8ef89f9 100644 +--- a/sources/configuration.cpp ++++ b/sources/configuration.cpp +@@ -1,4 +1,5 @@ + #include "stdio.h" ++#include + + #include "SDL.h" + +@@ -9,13 +10,17 @@ extern SDLKey PAUSE_KEY; + extern bool fullscreen; + extern int PIXEL_SIZE; + ++extern char *datadir; ++extern char *confdir; + + bool load_configuration(void) + { + int a,b,c,d,e,f,g; + FILE *fp; + ++ chdir(confdir); + fp=fopen("transball.cfg","r"); ++ chdir(datadir); + + if (fp==0) return false; + +@@ -46,7 +51,9 @@ void save_configuration(void) + { + FILE *fp; + ++ chdir(confdir); + fp=fopen("transball.cfg","w"); ++ chdir(datadir); + + if (fp==0) return; + +diff --git a/sources/encoder.cpp b/sources/encoder.cpp +index f2d4945..9780520 100644 +--- a/sources/encoder.cpp ++++ b/sources/encoder.cpp +@@ -1,4 +1,8 @@ + #include "stdio.h" ++#include "unistd.h" ++ ++extern char *confdir; ++extern char *datadir; + + void encode(char *in,char *out) + { +@@ -9,8 +13,11 @@ void encode(char *in,char *out) + FILE *fpin; + FILE *fpout; + ++ chdir(datadir); + fpin=fopen(in,"rb"); ++ chdir(confdir); + fpout=fopen(out,"wb"); ++ chdir(datadir); + if (fpin==0 || fpout==0) return; + + do{ +@@ -40,8 +47,11 @@ void decode(char *in,char *out) + FILE *fpin; + FILE *fpout; + ++ chdir(datadir); + fpin=fopen(in,"rb"); ++ chdir(confdir); + fpout=fopen(out,"wb"); ++ chdir(datadir); + if (fpin==0 || fpout==0) return; + + do{ +diff --git a/sources/game.cpp b/sources/game.cpp +index 6429e2d..901e3ee 100644 +--- a/sources/game.cpp ++++ b/sources/game.cpp +@@ -8,6 +8,7 @@ + #endif + + #include ++#include + #include + #include + #include "SDL/SDL.h" +@@ -84,6 +85,9 @@ extern TRANSBALL *game; + /* Frames per second counter: */ + extern int frames_per_sec; + ++extern char *datadir; ++extern char *confdir; ++ + FILE *replayfile; + int replaynum; + int replay_source=0; +@@ -92,7 +96,7 @@ int replay_source=0; + SDLKey THRUST_KEY=SDLK_q,ANTITHRUST_KEY=SDLK_a,LEFT_KEY=SDLK_o,RIGHT_KEY=SDLK_p; + SDLKey FIRE_KEY=SDLK_SPACE,ATRACTOR_KEY=SDLK_RETURN; + SDLKey PAUSE_KEY=SDLK_F1; +-bool pause=false; ++bool paused=false; + + unsigned char old_keyboard[SDLK_LAST]; + SDL_Surface *image=0,*image2=0; /* For the tittle screen, etc. */ +@@ -133,8 +137,10 @@ bool gamecycle(SDL_Surface *screen,int sx,int sy) + strcpy(tmp,"maps/"); + strcat(tmp,levelpack); + ++ chdir(datadir); + decode(tmp,"decoding.tmp"); + ++ chdir(confdir); + fp=fopen("decoding.tmp","r+"); + if (fp!=0) { + fscanf(fp,"%i",&NLEVELS); +@@ -167,6 +173,8 @@ bool gamecycle(SDL_Surface *screen,int sx,int sy) + + if (NLEVELS==-1) return false; + ++ chdir(datadir); ++ + switch(STATE) { + case 0: if (!state_logo_cycle(screen,sx,sy,keyboard)) return false; + break; +diff --git a/sources/main.cpp b/sources/main.cpp +index 285740a..b633601 100644 +--- a/sources/main.cpp ++++ b/sources/main.cpp +@@ -12,6 +12,14 @@ + #include "SDL_mixer.h" + #include "sge.h" + ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ + #include "fonts.h" + #include "list.h" + +@@ -42,6 +50,8 @@ int frames_per_sec=0; + int frames_per_sec_tmp=0; + int init_time=0; + ++char *datadir; ++char *confdir; + + /* Surfaces: */ + SDL_Surface *screen_sfc=0,*buffer_screen_sfc=0; +@@ -126,6 +136,33 @@ int main(int argc, char** argv) + setupTickCount(); + #endif + ++ mode_t mode; ++ FILE *cfg; ++ ++ datadir=dirname(argv[0]); ++ BPath confPath; ++ find_directory(B_USER_SETTINGS_DIRECTORY, &confPath, true); ++ confdir = (char*) malloc(strlen(confPath.Path()) + 17); ++ strcpy(confdir, confPath.Path()); ++ strcat(confdir,"/supertransball2"); ++ ++ mode=S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP; ++ mkdir(confdir,mode); ++ chdir(confdir); ++ mkdir("replays",mode); ++ mkdir("high",mode); ++ ++ cfg=fopen("transball.cfg", "r"); ++ if (!cfg) ++ { ++ cfg=fopen("transball.cfg", "w"); ++ fprintf(cfg,"%s","113 97 111 112 32 13 282"); ++ } ++ ++ fclose(cfg); ++ ++ chdir(datadir); ++ + int time,act_time; + SDL_Event event; + bool quit = false; +diff --git a/sources/maps.cpp b/sources/maps.cpp +index 56df6f7..f1506c7 100644 +--- a/sources/maps.cpp ++++ b/sources/maps.cpp +@@ -1,4 +1,5 @@ + #include ++#include + #include + #include "SDL/SDL.h" + #include "SDL_mixer.h" +@@ -13,6 +14,8 @@ + #define EMPTY_ROWS 8 + #define FACTOR 512 + ++extern char *datadir; ++extern char *confdir; + + TRANSBALL_MAP::TRANSBALL_MAP(char *file) + { +@@ -25,6 +28,7 @@ TRANSBALL_MAP::TRANSBALL_MAP(char *file) + S_enemyhit=0; + S_switch=0; + ++ chdir(datadir); + fp=fopen(file,"r"); + if (fp==0) { + sx=0; +diff --git a/sources/replays.cpp b/sources/replays.cpp +index 1d4e885..5d95fc5 100644 +--- a/sources/replays.cpp ++++ b/sources/replays.cpp +@@ -1,5 +1,8 @@ + #include "stdio.h" ++#include "unistd.h" + ++extern char* datadir; ++extern char* confdir; + + int replay_parameters(char *file, int *ship, int *length, char *levelname) + { +@@ -8,7 +11,9 @@ int replay_parameters(char *file, int *ship, int *length, char *levelname) + int l,end; + int v1,v2,fuel; + ++ chdir(confdir); + fp=fopen(file,"rb"); ++ chdir(datadir); + if (fp==0) return -1; + v1=fgetc(fp); + v2=fgetc(fp); +@@ -35,8 +40,11 @@ void replay_copy(char *f1,char *f2) + + FILE *fp1,*fp2; + ++ chdir(confdir); + fp1=fopen(f1,"rb"); ++ /* chdir(confdir); */ + fp2=fopen(f2,"wb"); ++ chdir(datadir); + + do{ + fputc(fgetc(fp1),fp2); +diff --git a/sources/state_changepack.cpp b/sources/state_changepack.cpp +index 41c28da..0b56928 100644 +--- a/sources/state_changepack.cpp ++++ b/sources/state_changepack.cpp +@@ -8,6 +8,7 @@ + #endif + + #include ++#include "unistd.h" + #include + #include + #include "SDL/SDL.h" +@@ -43,7 +44,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -63,6 +64,8 @@ extern char *leveltext[MAXLEVELS]; + extern char *levelcode[MAXLEVELS]; + extern int initialfuel[MAXLEVELS]; + ++extern char *confdir; ++extern char *datadir; + + bool state_changepack_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + { +@@ -97,7 +100,8 @@ bool state_changepack_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *key + #else + DIR *dp; + struct dirent *ep; +- ++ ++ chdir(datadir); + dp = opendir ("maps"); + if (dp != NULL) + { +diff --git a/sources/state_chooseship.cpp b/sources/state_chooseship.cpp +index 6de61e2..7262269 100644 +--- a/sources/state_chooseship.cpp ++++ b/sources/state_chooseship.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_endsequence.cpp b/sources/state_endsequence.cpp +index 963a9f7..ed3d3ad 100644 +--- a/sources/state_endsequence.cpp ++++ b/sources/state_endsequence.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_game.cpp b/sources/state_game.cpp +index 10f515f..43856a2 100644 +--- a/sources/state_game.cpp ++++ b/sources/state_game.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -69,11 +69,11 @@ bool state_game_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + int retval=0; + + if (keyboard[PAUSE_KEY] && !old_keyboard[PAUSE_KEY]) { +- if (pause) pause=false; +- else pause=true; ++ if (paused) paused=false; ++ else paused=true; + } /* if */ + +- if (!pause) { ++ if (!paused) { + retval=game->cycle(keyboard); + if (replayfile!=0) { + fputc(keyboard[THRUST_KEY],replayfile); +@@ -88,7 +88,7 @@ bool state_game_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + + game->render(screen,sx,sy); + +- if (pause) { ++ if (paused) { + surface_fader(screen,0.5F,0.5F,0.5F,-1,0); + font_print(sx/2,sy/2-16,"PAUSE",screen); + } else { +diff --git a/sources/state_gameover.cpp b/sources/state_gameover.cpp +index 7c02012..4b280b5 100644 +--- a/sources/state_gameover.cpp ++++ b/sources/state_gameover.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_instructions.cpp b/sources/state_instructions.cpp +index acd6e03..882db1c 100644 +--- a/sources/state_instructions.cpp ++++ b/sources/state_instructions.cpp +@@ -41,7 +41,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_interphase.cpp b/sources/state_interphase.cpp +index 41a7810..24a0ecf 100644 +--- a/sources/state_interphase.cpp ++++ b/sources/state_interphase.cpp +@@ -8,6 +8,7 @@ + #endif + + #include ++#include + #include + #include + #include "SDL/SDL.h" +@@ -43,7 +44,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -63,6 +64,8 @@ extern char *leveltext[MAXLEVELS]; + extern char *levelcode[MAXLEVELS]; + extern int initialfuel[MAXLEVELS]; + ++extern char *datadir; ++extern char *confdir; + + bool state_interphase_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + { +@@ -92,7 +95,9 @@ bool state_interphase_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *key + if (game=0) delete game; + game=new TRANSBALL("graphics/","sound/","maps/",initialfuel[level],levelnames[level],ship_type); + sprintf(tmp,"replays/replay%.3i.rpl",replaynum++); ++ chdir(confdir); + replayfile=fopen(tmp,"wb+"); ++ chdir(datadir); + fputc(32,replayfile); + fputc(0,replayfile); + /* level name: */ +diff --git a/sources/state_keyredefinition.cpp b/sources/state_keyredefinition.cpp +index b062e62..11355b6 100644 +--- a/sources/state_keyredefinition.cpp ++++ b/sources/state_keyredefinition.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_levelfinished.cpp b/sources/state_levelfinished.cpp +index 31ccd8a..16993ec 100644 +--- a/sources/state_levelfinished.cpp ++++ b/sources/state_levelfinished.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_logo.cpp b/sources/state_logo.cpp +index 1487e8b..4518429 100644 +--- a/sources/state_logo.cpp ++++ b/sources/state_logo.cpp +@@ -41,7 +41,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +diff --git a/sources/state_mainmenu.cpp b/sources/state_mainmenu.cpp +index e689caf..9d6f86b 100644 +--- a/sources/state_mainmenu.cpp ++++ b/sources/state_mainmenu.cpp +@@ -8,6 +8,7 @@ + #endif + + #include ++#include + #include + #include + #include "SDL/SDL.h" +@@ -41,7 +42,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -57,6 +58,8 @@ extern List levelpacks; + extern int act_levelpack; + extern char levelpack[256]; + ++extern char *datadir; ++extern char *confdir; + + bool state_mainmenu_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + { +@@ -157,6 +160,7 @@ bool state_mainmenu_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keybo + tittle_alpha=255; + + sprintf(tmp,"demos/demo%i.rpl",((rand()%40)/10)+1); ++ chdir(datadir); + replayfile=fopen(tmp,"rb"); + v1=fgetc(replayfile); + v2=fgetc(replayfile); // To maintain compatibility with a previous version +diff --git a/sources/state_replay.cpp b/sources/state_replay.cpp +index a38ac37..f8d2ba8 100644 +--- a/sources/state_replay.cpp ++++ b/sources/state_replay.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -71,11 +71,11 @@ bool state_replay_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboar + SUBSTATE++; + + if (keyboard[PAUSE_KEY] && !old_keyboard[PAUSE_KEY]) { +- if (pause) pause=false; +- else pause=true; ++ if (paused) paused=false; ++ else paused=true; + } /* if */ + +- if (!pause) { ++ if (!paused) { + int i; + unsigned char tmp[SDLK_LAST]; + for(i=0;irender(screen,sx,sy); + +- if (pause) { ++ if (paused) { + surface_fader(screen,0.5F,0.5F,0.5F,-1,0); + font_print(sx/2,sy/2-16,"PAUSE",screen); + } else { +diff --git a/sources/state_replaymanager.cpp b/sources/state_replaymanager.cpp +index e767de2..7eb324c 100644 +--- a/sources/state_replaymanager.cpp ++++ b/sources/state_replaymanager.cpp +@@ -8,6 +8,7 @@ + #endif + + #include ++#include + #include + #include + #include "SDL/SDL.h" +@@ -43,7 +44,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +@@ -63,6 +64,8 @@ extern char *leveltext[MAXLEVELS]; + extern char *levelcode[MAXLEVELS]; + extern int initialfuel[MAXLEVELS]; + ++extern char *datadir; ++extern char *confdir; + + bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char *keyboard) + { +@@ -103,6 +106,7 @@ bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char * + DIR *dp; + struct dirent *ep; + ++ chdir(confdir); + if (replay_source==0) dp = opendir ("replays"); + else dp = opendir ("high"); + if (dp != NULL) +@@ -124,6 +128,7 @@ bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char * + } + (void) closedir (dp); + } ++ chdir(datadir); + #endif + first_file=0; + act_file=0; +@@ -210,7 +215,9 @@ bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char * + + if (replay_source==0) sprintf(tmp,"replays/%s",files[act_file]); + else sprintf(tmp,"high/%s",files[act_file]); ++ chdir(confdir); + replayfile=fopen(tmp,"rb"); ++ chdir(datadir); + v1=fgetc(replayfile); + v2=fgetc(replayfile); // To maintain compatibility with a previous version + +@@ -309,6 +316,7 @@ bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char * + DIR *dp; + struct dirent *ep; + ++ chdir(confdir); + dp = opendir ("replays"); + if (dp != NULL) + { +@@ -329,6 +337,7 @@ bool state_replaymanager_cycle(SDL_Surface *screen,int sx,int sy,unsigned char * + } + (void) closedir (dp); + } ++ chdir(datadir); + #endif + + /* Check if this replay is a highscore: */ +diff --git a/sources/state_typetext.cpp b/sources/state_typetext.cpp +index da45793..20c5017 100644 +--- a/sources/state_typetext.cpp ++++ b/sources/state_typetext.cpp +@@ -43,7 +43,7 @@ extern int replay_source; + extern SDLKey THRUST_KEY,ANTITHRUST_KEY,LEFT_KEY,RIGHT_KEY; + extern SDLKey FIRE_KEY,ATRACTOR_KEY; + extern SDLKey PAUSE_KEY; +-extern bool pause; ++extern bool paused; + extern unsigned char old_keyboard[SDLK_LAST]; + extern SDL_Surface *image,*image2; + extern char edit_text[80]; +-- +1.8.3.4 + + +From b382be38bd296d72071c135e9fddd6872040c532 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 19 Jan 2014 18:56:20 +0100 +Subject: Avoid waste of CPU. + +We can sleep longer than 1ms without slowing down the game. + +diff --git a/sources/main.cpp b/sources/main.cpp +index b633601..5445993 100644 +--- a/sources/main.cpp ++++ b/sources/main.cpp +@@ -284,7 +284,7 @@ int main(int argc, char** argv) + } /* if */ + SDL_Flip(screen_sfc); + } +- SDL_Delay(1); ++ SDL_Delay(REDRAWING_PERIOD); + } + + fonts_termination(); +-- +1.8.3.4 + diff --git a/games-arcade/super_transball/super_transball-2.1.5.recipe b/games-arcade/super_transball/super_transball-2.1.5.recipe new file mode 100644 index 000000000..ee51e2c62 --- /dev/null +++ b/games-arcade/super_transball/super_transball-2.1.5.recipe @@ -0,0 +1,60 @@ +SUMMARY="find and capture the SPHERE, and carry it to the sky." +HOMEPAGE="http://www2.braingames.getput.com/stransball2/default.asp" +LICENSE="GNU GPL v2" +COPYRIGHT="2003-2005 Brain Games" +SRC_URI="http://www2.braingames.getput.com/stransball2/downloads/stransball2-v15-windows.zip" +CHECKSUM_MD5="71214c96369fb78280b75725a51c1989" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + super_transball = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libSDL_image$secondaryArchSuffix + lib:libSDL_mixer$secondaryArchSuffix + lib:libSDL_sound$secondaryArchSuffix + lib:libSGE$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libsdl$secondaryArchSuffix + devel:libSDL_image$secondaryArchSuffix + devel:libSDL_mixer$secondaryArchSuffix + devel:libSDL_sound$secondaryArchSuffix + devel:libSGE$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + haiku_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +SOURCE_DIR="stransball2" +PATCHES="super_transball-$portVersion.patchset" +BUILD() +{ + cd sources + make $jobArgs +} + +INSTALL() +{ + installDir=$appsDir/"Super Transball 2" + mkdir -p "$installDir" + cp -r stransball2 demos graphics maps sound "$installDir" + addAppDeskbarSymlink "$installDir/stransball2" "Super Transball 2" +} + +DESCRIPTION=" +\"Super Transbal 2\" is the sequel of \"Transball\" and \"Transball 2\", +Inspired in THRUST type of games (and concretely in ZARA THRUSTA for the Amiga +500). In each level of Transball, the goal is to find the SPHERE, capture it +and carry it to the upper part of the level. The main obstacle is the gravity, +that impulses you towards the ground. But many other obstacles, canons, tanks, +doors, etc. will try to make difficult your journey... +" diff --git a/games-engines/solarus/patches/solarus-luajit-1.1.1.patch b/games-engines/solarus/patches/solarus-luajit-1.1.1.patch new file mode 100644 index 000000000..4020dcc88 --- /dev/null +++ b/games-engines/solarus/patches/solarus-luajit-1.1.1.patch @@ -0,0 +1,75 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 782799a..c17a479 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,7 @@ find_package(OpenAL REQUIRED) + find_package(VorbisFile REQUIRED) + find_package(Ogg REQUIRED) + find_package(ModPlug REQUIRED) +-find_package(Lua51 REQUIRED) ++find_package(LuaJIT REQUIRED) + find_package(PhysFS REQUIRED) + + # Explicit link to libdl is needed for Lua on some systems. +diff --git a/cmake/modules/FindLuaJIT.cmake b/cmake/modules/FindLuaJIT.cmake +new file mode 100644 +index 0000000..6b45ed6 +--- /dev/null ++++ b/cmake/modules/FindLuaJIT.cmake +@@ -0,0 +1,56 @@ ++# Locate LuaJIT library ++# This module defines ++# LUAJIT_FOUND, if false, do not try to link to Lua ++# LUA_LIBRARIES ++# LUA_INCLUDE_DIR, where to find lua.h ++# LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8) ++ ++## Copied from default CMake FindLua51.cmake ++ ++find_path(LUA_INCLUDE_DIR luajit.h ++ HINTS ++ ENV LUA_DIR ++ PATH_SUFFIXES include/luajit-2.0 include ++ PATHS ++ ~/Library/Frameworks ++ /Library/Frameworks ++ /sw # Fink ++ /opt/local # DarwinPorts ++ /opt/csw # Blastwave ++ /opt ++) ++ ++find_library(LUA_LIBRARY ++ NAMES luajit-5.1 ++ HINTS ++ ENV LUA_DIR ++ PATH_SUFFIXES lib ++ PATHS ++ ~/Library/Frameworks ++ /Library/Frameworks ++ /sw ++ /opt/local ++ /opt/csw ++ /opt ++) ++ ++if(LUA_LIBRARY) ++ set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") ++endif() ++ ++if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/luajit.h") ++ file(STRINGS "${LUA_INCLUDE_DIR}/luajit.h" luajit_version_str REGEX "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT .+\"") ++ ++ string(REGEX REPLACE "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${luajit_version_str}") ++ unset(luajit_version_str) ++endif() ++ ++include(FindPackageHandleStandardArgs) ++# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if ++# all listed variables are TRUE ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT ++ REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR ++ VERSION_VAR LUAJIT_VERSION_STRING) ++ ++mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) ++ diff --git a/games-engines/solarus/solarus-1.1.1.recipe b/games-engines/solarus/solarus-1.1.1.recipe index 84e660388..7fbb49db8 100644 --- a/games-engines/solarus/solarus-1.1.1.recipe +++ b/games-engines/solarus/solarus-1.1.1.recipe @@ -5,38 +5,40 @@ Solarus is an open-source Zelda-like 2D game engine. HOMEPAGE="http://solarus-games.org" SRC_URI="http://www.solarus-games.org/downloads/solarus/solarus-1.1.1-src.tar.gz" CHECKSUM_MD5="168894091ce4b728889069c767a1532d" -REVISION="1" +REVISION="2" LICENSE="GNU GPL v3" COPYRIGHT="2006-2013 Christopho, Solarus" -ARCHITECTURES="!x86_gcc2 !x86 !x86_64" -SECONDARY_ARCHITECTURES="!x86 !x86_64" +ARCHITECTURES="x86_gcc2 !x86 !x86_64" +SECONDARY_ARCHITECTURES="x86 !x86_64" PROVIDES=" - solarus = $portVersion - app:solarus = $portVersion + solarus$secondaryArchSuffix = $portVersion + cmd:solarus = $portVersion " REQUIRES=" haiku$secondaryArchSuffix >= $haikuVersion lib:libSDL$secondaryArchSuffix - lib:sdl_ttf$secondaryArchSuffix - lib:sdl_image$secondaryArchSuffix + lib:libsdl_ttf$secondaryArchSuffix + lib:libsdl_image$secondaryArchSuffix lib:libvorbis$secondaryArchSuffix lib:libmodplug$secondaryArchSuffix >= 0.8.0 lib:libphysfs$secondaryArchSuffix - lib:liblua$secondaryArchSuffix + lib:liblua$secondaryArchSuffix == 5.1.4 lib:libopenal$secondaryArchSuffix + lib:libogg$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel >= $haikuVersion devel:libSDL$secondaryArchSuffix - devel:sdl_ttf$secondaryArchSuffix - devel:sdl_image$secondaryArchSuffix + devel:libsdl_ttf$secondaryArchSuffix + devel:libsdl_image$secondaryArchSuffix devel:libvorbis$secondaryArchSuffix devel:libmodplug$secondaryArchSuffix >= 0.8.0 devel:libphysfs$secondaryArchSuffix - devel:liblua$secondaryArchSuffix + devel:liblua$secondaryArchSuffix == 5.1.4 devel:libopenal$secondaryArchSuffix + devel:libogg$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake @@ -48,12 +50,12 @@ BUILD_PREREQUIRES=" BUILD() { - cmake -DCMAKE_BUILD_TYPE=Release . + cmake -DCMAKE_INSTALL_PREFIX="$prefix" \ + -DCMAKE_BUILD_TYPE=Release . make $jobArgs } INSTALL() { make install - #addAppDeskbarSymlink $binDir/solarus } diff --git a/games-puzzle/mirrormagic/mirrormagic-2.0.2.recipe b/games-puzzle/mirrormagic/mirrormagic-2.0.2.recipe new file mode 100644 index 000000000..0eeddcc0e --- /dev/null +++ b/games-puzzle/mirrormagic/mirrormagic-2.0.2.recipe @@ -0,0 +1,54 @@ +SUMMARY="a game like Deflektor (C64) or Mindbender (Amiga) " +HOMEPAGE="http://www.artsoft.org/mirrormagic/" +LICENSE="GNU GPL v2" +COPYRIGHT="1989-2003 Artsoft Entertainment" +SRC_URI="http://www.artsoft.org/RELEASES/unix/mirrormagic/mirrormagic-2.0.2.tar.gz" +#CHECKSUM_MD5="10c03c69d2df6bcae9d835d18215978f" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + mirrormagic = $portVersion + app:mirrormagic = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libsdl_image$secondaryArchSuffix + lib:libsdl_mixer$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libsdl$secondaryArchSuffix + devel:libsdl_image$secondaryArchSuffix + devel:libsdl_mixer$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + haiku_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +PATCHES="mirrormagic-2.0.2.patchset" +BUILD() +{ + # parallel build not available. + make sdl +} + +INSTALL() +{ + destDir="$appsDir/Mirror Magic" + mkdir -p "$destDir" + cp -r mirrormagic graphics levels music sounds "$destDir" + addAppDeskbarSymlink "$destDir/mirrormagic" "Mirror Magic" +} + +# ----- DESCRIPTION ----------------------------------------------------------- + +DESCRIPTION=" +Make the Laser reach the target by rotating mirrors, but take care of not +overheating. +" diff --git a/games-puzzle/mirrormagic/patches/mirrormagic-2.0.2.patchset b/games-puzzle/mirrormagic/patches/mirrormagic-2.0.2.patchset new file mode 100644 index 000000000..e66c04ec2 --- /dev/null +++ b/games-puzzle/mirrormagic/patches/mirrormagic-2.0.2.patchset @@ -0,0 +1,106 @@ +From 5e9e47e0aa86949c07c14a0012180614695ba74b Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Mon, 20 Jan 2014 20:59:52 +0100 +Subject: Remove hardcoded -lm + + +diff --git a/src/Makefile b/src/Makefile +index 6ab93a5..6944437 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -113,7 +113,7 @@ OPTIONS = -O3 -Wall + endif + + CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(CONFIG) +-LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm ++LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) + + + SRCS = main.c \ +-- +1.8.3.4 + + +From 587046f039a7a29ed96383d9d73b1d605a398701 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Mon, 20 Jan 2014 21:07:38 +0100 +Subject: Have MirrorMagic looks for files in its own dir. + + +diff --git a/src/main.c b/src/main.c +index 0e3f90e..7a2cfaa 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -620,6 +620,8 @@ int num_element_info = sizeof(element_info)/sizeof(char *); + + int main(int argc, char *argv[]) + { ++ chdir(dirname(argv[0])); ++ + InitCommandName(argv[0]); + InitExitFunction(CloseAllAndExit); + InitPlatformDependantStuff(); +-- +1.8.3.4 + + +From 78ab3228259485da50b6a78fa66d47ea08ae6f4f Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Mon, 20 Jan 2014 21:29:11 +0100 +Subject: Fix settings dir. + + +diff --git a/src/init.c b/src/init.c +index 923da8c..e287635 100644 +--- a/src/init.c ++++ b/src/init.c +@@ -23,6 +23,10 @@ + #include "tools.h" + #include "files.h" + ++#if __HAIKU__ ++#include ++#endif ++ + static void InitPlayerInfo(void); + static void InitLevelInfo(void); + static void InitSound(void); +@@ -33,10 +37,20 @@ static void InitElementProperties(void); + + void OpenAll(void) + { ++#if __HAIKU__ ++ char dir[256]; ++ find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, dir, sizeof(dir)); ++ strcat(dir, "/mirrormagic"); ++ InitProgramInfo(dir, ++ PROGRAM_TITLE_STRING, WINDOW_TITLE_STRING, ++ ICON_TITLE_STRING, X11_ICON_FILENAME, X11_ICONMASK_FILENAME, ++ MSDOS_POINTER_FILENAME); ++#else + InitProgramInfo(UNIX_USERDATA_DIRECTORY, + PROGRAM_TITLE_STRING, WINDOW_TITLE_STRING, + ICON_TITLE_STRING, X11_ICON_FILENAME, X11_ICONMASK_FILENAME, + MSDOS_POINTER_FILENAME); ++#endif + + InitPlayerInfo(); + +diff --git a/src/libgame/misc.c b/src/libgame/misc.c +index 7a55d94..a46a298 100644 +--- a/src/libgame/misc.c ++++ b/src/libgame/misc.c +@@ -348,7 +348,9 @@ char *getRealName() + + char *getHomeDir() + { +-#if defined(PLATFORM_UNIX) ++#if __HAIKU__ ++ return ""; ++#elif defined(PLATFORM_UNIX) + static char *home_dir = NULL; + + if (!home_dir) +-- +1.8.3.4 + diff --git a/games-strategy/uqm/patches/uqm-0.7.0.patchset b/games-strategy/uqm/patches/uqm-0.7.0.patchset new file mode 100644 index 000000000..54042ce8d --- /dev/null +++ b/games-strategy/uqm/patches/uqm-0.7.0.patchset @@ -0,0 +1,100 @@ +From 45ee17169b5ca4ebb52661725d3e0bb9f1377a4c Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Wed, 15 Jan 2014 23:08:17 +0100 +Subject: Add pre-configured config.state file. + +This avoids the build script asking questions using an interactive menu. + +diff --git a/config.state b/config.state +new file mode 100644 +index 0000000..01b69f6 +--- /dev/null ++++ b/config.state +@@ -0,0 +1,14 @@ ++CHOICE_debug_VALUE='nodebug' ++CHOICE_graphics_VALUE='opengl' ++CHOICE_sound_VALUE='mixsdl' ++CHOICE_mikmod_VALUE='external' ++CHOICE_ovcodec_VALUE='standard' ++CHOICE_netplay_VALUE='ipv4' ++CHOICE_joystick_VALUE='enabled' ++CHOICE_ioformat_VALUE='stdio_zip' ++CHOICE_accel_VALUE='asm' ++CHOICE_threadlib_VALUE='pthread' ++INPUT_install_prefix_VALUE='PREFIX_HERE' ++INPUT_install_bindir_VALUE='$prefix/bin' ++INPUT_install_libdir_VALUE='$prefix/lib' ++INPUT_install_sharedir_VALUE='$prefix/share' +-- +1.8.3.4 + + +From 3833a4d67d17c88f0ca5d042134a2f77e97475cb Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Wed, 15 Jan 2014 23:08:55 +0100 +Subject: Make buildsystem aware of Haiku. + + +diff --git a/build/unix/config_functions b/build/unix/config_functions +index 4f017f1..7c4aa5a 100644 +--- a/build/unix/config_functions ++++ b/build/unix/config_functions +@@ -1060,6 +1060,8 @@ set_host_system() { + HOST_SYSTEM="ARMV5" ;; + [Gg][Cc][Cc][Ee]) + HOST_SYSTEM="GCCE" ;; ++ [Hh][Aa][Ii][Kk][Uu]) ++ HOST_SYSTEM="Haiku" ;; + *) + build_message "Warning: host type '$BUILD_HOST' unknown. Using defaults." + ;; +diff --git a/build/unix/config_proginfo_host b/build/unix/config_proginfo_host +index 6e0466c..d95c6c9 100644 +--- a/build/unix/config_proginfo_host ++++ b/build/unix/config_proginfo_host +@@ -299,7 +299,7 @@ case "$HOST_SYSTEM" in + LIB_pthread_LDFLAGS="$(pthread-config --ldflags)" + LIB_pthread_VERSION="$(pthread-config --version)" + ;; +- WINSCW|ARMV5|GCCE) ++ WINSCW|ARMV5|GCCE|Haiku) + LIB_pthread_DETECT="true" + ;; + *) +@@ -321,6 +321,11 @@ case "$HOST_SYSTEM" in + ARMV5|WINSCW|GCCE) + LIB_netlibs_DETECT="false" + ;; ++ Haiku) ++ LIB_netlibs_CFLAGS="" ++ LIB_netlibs_LDFLAGS="-lnetwork" ++ LIB_netlibs_VERSION="" ++ ;; + esac + + +-- +1.8.3.4 + + +From 0cf24463ad192a871fc103821b477cf49bc91306 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Wed, 15 Jan 2014 23:09:08 +0100 +Subject: Add missing include for use of select(). + + +diff --git a/src/libs/network/netmanager/netmanager_bsd.c b/src/libs/network/netmanager/netmanager_bsd.c +index 29159f8..4390eb8 100644 +--- a/src/libs/network/netmanager/netmanager_bsd.c ++++ b/src/libs/network/netmanager/netmanager_bsd.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "netmanager_common.ci" + #include "ndindex.ci" +-- +1.8.3.4 + diff --git a/games-strategy/uqm/uqm-0.7.0.recipe b/games-strategy/uqm/uqm-0.7.0.recipe new file mode 100644 index 000000000..fa7e6f637 --- /dev/null +++ b/games-strategy/uqm/uqm-0.7.0.recipe @@ -0,0 +1,74 @@ +SUMMARY="a port of Star Control II for modern personal computers and operating systems" +DESCRIPTION=" +The project started in August 2002, when Toys For Bob released the partially +ported sources of Star Control 2 3DO version to the fan community. Our goal is +to port this wonderful game to current personal computers and operating systems. +It is and will remain 100% free of charge, and anyone can contribute to the +project and thus help make it even better. For more information, look at our +info page. +" +HOMEPAGE="http://sc2.sourceforge.net/" +SRC_URI="http://prdownloads.sourceforge.net/sc2/uqm-0.7.0-source.tgz" +CHECKSUM_MD5="f9018ea0493d7dac6a9e1006b00af7df" +REVISION="1" +ARCHITECTURES="!x86 ?x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +#PATCHES="vcmi-0.94.patchset" +PROVIDES=" + uqm$secondaryArchSuffix = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libSDL_1.2$secondaryArchSuffix + lib:libsdl_image$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libpng$secondaryArchSuffix + lib:libvorbisfile$secondaryArchSuffix + lib:libogg$secondaryArchSuffix + lib:libmikmod$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:libSDL$secondaryArchSuffix + devel:libsdl_image$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libpng$secondaryArchSuffix + devel:libvorbisfile$secondaryArchSuffix + devel:libogg$secondaryArchSuffix + devel:libmikmod$secondaryArchSuffix + devel:libglu$secondaryArchSuffix +" + +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:as$secondaryArchSuffix + cmd:sed + cmd:make + cmd:tr + cmd:pkg_config$secondaryArchSuffix +" + +PATCHES="uqm-$portVersion.patchset" +BUILD() +{ + sed -i -e"s!PREFIX_HERE!$prefix!" config.state + ./build.sh uqm reprocess_config + ./build.sh uqm +} + +INSTALL() +{ + ./build.sh uqm install +} + +COPYRIGHT="2005-2013 VCMI Team" +LICENSE="GNU GPL v2" diff --git a/haiku-apps/chat/chat-20100903.recipe b/haiku-apps/chat/chat-20100903.recipe index 43ae6edd2..848452832 100644 --- a/haiku-apps/chat/chat-20100903.recipe +++ b/haiku-apps/chat/chat-20100903.recipe @@ -9,13 +9,13 @@ DESCRIPTION=" HOMEPAGE="http://synrc.com/client/chat/haiku/" SRC_URI="git+https://github.com/devaspot/chat.git" LICENSE="MIT" -COPYRIGHT="2012 Maxim Sokhatsky" -REVISION="1" +COPYRIGHT="2010-2014 Maxim Sokhatsky" +REVISION="2" ARCHITECTURES="x86_gcc2 x86" PROVIDES=" - chat = $portVersion - app:chat = $portVersion + Chat = $portVersion + app:Chat = $portVersion " REQUIRES=" @@ -35,18 +35,18 @@ BUILD_PREREQUIRES=" cmd:gcc$secondaryArchSuffix cmd:make cmd:which + cmd:mkdepend " BUILD() -{ +{ cd src - make -f Makefile.gcc2 BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` - chmod 755 Chat + BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` make } INSTALL() { mkdir -p $appsDir - cp src/Chat $appsDir/Chat + cp src/objects.*-release/Chat $appsDir/Chat addAppDeskbarSymlink $appsDir/Chat "Chat" } diff --git a/haiku-apps/vision/vision-0.9.7.r947.recipe b/haiku-apps/vision/vision-0.9.7.r949.recipe similarity index 91% rename from haiku-apps/vision/vision-0.9.7.r947.recipe rename to haiku-apps/vision/vision-0.9.7.r949.recipe index 9fcdd7f18..2b0dabe2a 100644 --- a/haiku-apps/vision/vision-0.9.7.r947.recipe +++ b/haiku-apps/vision/vision-0.9.7.r949.recipe @@ -3,10 +3,10 @@ DESCRIPTION=" Vision is an IRC client for Haiku. " HOMEPAGE="http://vision.sourceforge.net/" -SRC_URI="svn://svn.code.sf.net/p/vision/code/branches/0.9.7#947" +SRC_URI="svn://svn.code.sf.net/p/vision/code/branches/0.9.7#949" LICENSE="MPL v1.1" COPYRIGHT="1999-2010 The Vision Team" -REVISION="3" +REVISION="2" ARCHITECTURES="x86_gcc2 x86 x86_64" if [ $targetArchitecture != x86_gcc2 ]; then diff --git a/media-libs/libsdl2/libsdl2-2.0.1.recipe b/media-libs/libsdl2/libsdl2-2.0.1.recipe index abbaff6d7..0c0c62e83 100644 --- a/media-libs/libsdl2/libsdl2-2.0.1.recipe +++ b/media-libs/libsdl2/libsdl2-2.0.1.recipe @@ -8,7 +8,7 @@ emulators, and popular games. HOMEPAGE="http://www.libsdl.org/" SRC_URI="http://www.libsdl.org/release/SDL2-2.0.1.tar.gz" CHECKSUM_MD5="0eb97039488bf463e775295f7b18b227" -REVISION="2" +REVISION="3" LICENSE="Zlib" COPYRIGHT="1997-2013 Sam Lantinga" @@ -52,6 +52,8 @@ BUILD_PREREQUIRES=" SOURCE_DIR="SDL2-$portVersion" +PATCHES="libsdl2-2.0.1.patchset" + BUILD() { runConfigure ./configure @@ -70,10 +72,10 @@ INSTALL() libSDL2-2.0 fixPkgconfig - fixDevelopLibDirReferences $binDir/sdl2-config$secondaryArchSuffix + fixDevelopLibDirReferences $binDir/sdl2-config packageEntries devel \ - $developDir $binDir/sdl2-config$secondaryArchSuffix $dataDir + $developDir $binDir/sdl2-config $dataDir } # ----- devel package ------------------------------------- diff --git a/media-libs/libsdl2/patches/libsdl2-2.0.1.patchset b/media-libs/libsdl2/patches/libsdl2-2.0.1.patchset new file mode 100644 index 000000000..69c04b413 --- /dev/null +++ b/media-libs/libsdl2/patches/libsdl2-2.0.1.patchset @@ -0,0 +1,115 @@ +From 5491ee3ebfd9ddb58dad8e46a0b9afd30e12f000 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 15 Jan 2014 00:55:06 -0600 +Subject: [PATCH] Haiku: Clean up includes + +* Remove random references to be/os/ +--- + src/joystick/beos/SDL_bejoystick.cc | 4 ++-- + src/loadso/beos/SDL_sysloadso.c | 2 +- + src/thread/beos/SDL_syssem.c | 2 +- + src/thread/beos/SDL_systhread.c | 2 +- + src/thread/beos/SDL_systhread_c.h | 2 +- + src/timer/beos/SDL_systimer.c | 2 +- + src/video/bwindow/SDL_BWin.h | 4 ++-- + 7 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/joystick/beos/SDL_bejoystick.cc b/src/joystick/beos/SDL_bejoystick.cc +index c324581..2b93d09 100644 +--- a/src/joystick/beos/SDL_bejoystick.cc ++++ b/src/joystick/beos/SDL_bejoystick.cc +@@ -24,8 +24,8 @@ + + /* This is the system specific header for the SDL joystick API */ + +-#include +-#include ++#include ++#include + + extern "C" + { +diff --git a/src/loadso/beos/SDL_sysloadso.c b/src/loadso/beos/SDL_sysloadso.c +index 524cd71..0679bcb 100644 +--- a/src/loadso/beos/SDL_sysloadso.c ++++ b/src/loadso/beos/SDL_sysloadso.c +@@ -26,7 +26,7 @@ + /* System dependent library loading routines */ + + #include +-#include ++#include + + #include "SDL_loadso.h" + +diff --git a/src/thread/beos/SDL_syssem.c b/src/thread/beos/SDL_syssem.c +index 9661f90..269557e 100644 +--- a/src/thread/beos/SDL_syssem.c ++++ b/src/thread/beos/SDL_syssem.c +@@ -24,7 +24,7 @@ + + /* Semaphores in the BeOS environment */ + +-#include ++#include + + #include "SDL_thread.h" + +diff --git a/src/thread/beos/SDL_systhread.c b/src/thread/beos/SDL_systhread.c +index 11646f9..7371f0a 100644 +--- a/src/thread/beos/SDL_systhread.c ++++ b/src/thread/beos/SDL_systhread.c +@@ -26,7 +26,7 @@ + + #include + #include +-#include ++#include + + #include "SDL_mutex.h" + #include "SDL_thread.h" +diff --git a/src/thread/beos/SDL_systhread_c.h b/src/thread/beos/SDL_systhread_c.h +index a350ab5..65ef60d 100644 +--- a/src/thread/beos/SDL_systhread_c.h ++++ b/src/thread/beos/SDL_systhread_c.h +@@ -21,7 +21,7 @@ + #include "SDL_config.h" + + #include +-#include ++#include + + typedef thread_id SYS_ThreadHandle; + +diff --git a/src/timer/beos/SDL_systimer.c b/src/timer/beos/SDL_systimer.c +index fd22e44..370e2d9 100644 +--- a/src/timer/beos/SDL_systimer.c ++++ b/src/timer/beos/SDL_systimer.c +@@ -22,7 +22,7 @@ + + #ifdef SDL_TIMER_BEOS + +-#include ++#include + + #include "SDL_timer.h" + +diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h +index 6b6a71e..fc034ed 100644 +--- a/src/video/bwindow/SDL_BWin.h ++++ b/src/video/bwindow/SDL_BWin.h +@@ -38,9 +38,9 @@ extern "C" { + #include + #include + #include +-#include ++#include + #if SDL_VIDEO_OPENGL +-#include ++#include + #endif + #include "SDL_events.h" + #include "../../main/beos/SDL_BApp.h" +-- +1.8.3.4 + diff --git a/media-libs/sdl2_mixer/sdl2_mixer-2.0.0.recipe b/media-libs/sdl2_mixer/sdl2_mixer-2.0.0.recipe index 3e7b9f9fa..3d4a50699 100644 --- a/media-libs/sdl2_mixer/sdl2_mixer-2.0.0.recipe +++ b/media-libs/sdl2_mixer/sdl2_mixer-2.0.0.recipe @@ -27,6 +27,7 @@ PROVIDES=" REQUIRES=" haiku$secondaryArchSuffix >= $haikuVersion + lib:libGL$secondaryArchSuffix # No clue, it wants it lib:libSDL2$secondaryArchSuffix lib:libogg$secondaryArchSuffix lib:libflac$secondaryArchSuffix @@ -38,6 +39,7 @@ REQUIRES=" " BUILD_REQUIRES=" + devel:libGL$secondaryArchSuffix devel:libSDL2$secondaryArchSuffix devel:libogg$secondaryArchSuffix devel:libflac$secondaryArchSuffix diff --git a/media-libs/sdl_net/sdl_net-1.2.8.recipe b/media-libs/sdl_net/sdl_net-1.2.8.recipe index 4eb98598b..274a831ca 100644 --- a/media-libs/sdl_net/sdl_net-1.2.8.recipe +++ b/media-libs/sdl_net/sdl_net-1.2.8.recipe @@ -7,7 +7,7 @@ SRC_URI="http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8.tar.gz" CHECKSUM_MD5="20e64e61d65662db66c379034f11f718" LICENSE="Zlib" COPYRIGHT="1997-2012 Sam Lantinga" -REVISION="2" +REVISION="3" ARCHITECTURES="x86 x86_gcc2" SECONDARY_ARCHITECTURES="x86_gcc2 x86 x86_64" @@ -57,6 +57,7 @@ INSTALL() make install prepareInstalledDevelLib libSDL_net + prepareInstalledDevelLib libSDL_net-1.2 fixPkgconfig packageEntries devel \ diff --git a/media-libs/sdl_sound/sdl_sound-1.0.3.recipe b/media-libs/sdl_sound/sdl_sound-1.0.3.recipe index 2db412f45..c5bda8025 100644 --- a/media-libs/sdl_sound/sdl_sound-1.0.3.recipe +++ b/media-libs/sdl_sound/sdl_sound-1.0.3.recipe @@ -8,7 +8,7 @@ HOMEPAGE="http://www.icculus.org/SDL_sound" SRC_URI="hg+http://hg.icculus.org/icculus/SDL_sound#release-1.0.3" LICENSE="GNU LGPL v2.1" COPYRIGHT="2001-2009 Ryan C. Gordon" -REVISION="1" +REVISION="2" ARCHITECTURES="x86_gcc2 x86 x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 x86" @@ -33,6 +33,8 @@ REQUIRES=" lib:libmodplug$secondaryArchSuffix # lib:smpeg$secondaryArchSuffix # lib:physfs$secondaryArchSuffix + + lib:libGL$secondaryArchSuffix " BUILD_REQUIRES=" diff --git a/media-libs/sge/sge-030809.recipe b/media-libs/sge/sge-030809.recipe index 02367c2ce..29897775a 100644 --- a/media-libs/sge/sge-030809.recipe +++ b/media-libs/sge/sge-030809.recipe @@ -8,7 +8,7 @@ CHECKSUM_MD5="a76975665b6a2bf189130fa2c8821caf" LICENSE="GNU LGPL v2.1" COPYRIGHT="1999-2003 Anders Lindstrom" -REVISION="1" +REVISION="2" ARCHITECTURES="x86_gcc2 x86 ?x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 x86" @@ -60,10 +60,10 @@ INSTALL() } PROVIDES_devel=" - libSGE${secondaryArchSuffix}_devel = $portVersion compat >= 030809 + sge${secondaryArchSuffix}_devel = $portVersion compat >= 030809 devel:libSGE$secondaryArchSuffix = $portVersion compat >= 030809 " REQUIRES_devel=" - libSGE$secondaryArchSuffix == $portVersion base + sge$secondaryArchSuffix == $portVersion base " diff --git a/media-libs/smpeg/smpeg-0.4.5.recipe b/media-libs/smpeg/smpeg-0.4.5.recipe index 8ffe90683..3ad3c54f6 100644 --- a/media-libs/smpeg/smpeg-0.4.5.recipe +++ b/media-libs/smpeg/smpeg-0.4.5.recipe @@ -9,7 +9,7 @@ HOMEPAGE="http://www.icculus.org/smpeg" SRC_URI="svn://svn.icculus.org/smpeg/tags/release_0_4_5" LICENSE="GNU LGPL v2" COPYRIGHT="1999-2004 Sam Lantinga, Joe Tennies." -REVISION="1" +REVISION="2" ARCHITECTURES="x86 x86_gcc2" SECONDARY_ARCHITECTURES="x86_gcc2 x86 ?x86_64" @@ -26,7 +26,7 @@ PROVIDES=" REQUIRES=" haiku$secondaryArchSuffix lib:libglu$secondaryArchSuffix - lib:libSDL$secondaryArchSuffix + lib:libSDL_1.2$secondaryArchSuffix lib:libGL$secondaryArchSuffix " diff --git a/sys-apps/fxload/fxload-20120810.recipe b/sys-apps/fxload/fxload-20120810.recipe new file mode 100644 index 000000000..c448bc656 --- /dev/null +++ b/sys-apps/fxload/fxload-20120810.recipe @@ -0,0 +1,61 @@ +SUMMARY="fxload - utility for EZ-USB firmware installation" +DESCRIPTION=" +This program is conveniently able to download firmware into FX, FX2, and FX2LP \ +EZ-USB devices, as well as the original AnchorChips EZ-USB. +Primarily as an aid for developers, this can also be used to update firmware on \ +devices which boot from I2C serial EEPROMs. For that use, as well as \ +downloading firmware to all other off-chip memory, a second stage loader must \ +first be downloaded. +The distribution includes a3load.hex, which is a simple second stage loader \ +that works with all the EZ-USB products listed above. If you want to write to \ +an EEPROM, you can use the appropriate version of the Vend_Ax code provided \ +with the Cypress developer kit. +This program was modified from the original version available from \ +http://linux-hotplug.sourceforge.net to use libusbx [http://libusbx.org]. The \ +aim is to integrate this program into the libusbx samples directory. +Besides Linux, use of libusbx as the USB backend allows fxload to be used on \ +Windows, OS-X as well as any other platform supported by libusbx. +You are invited to post any bug reports or patches to the libusbx-devel mailing \ +list. +" +LICENSE="GNU GPL v2" +COPYRIGHT=" + 2001 Stephen Williams + 2001-2002 David Brownell + 2008 Roger Williams + 2012 Pete Batard + " +HOMEPAGE="https://github.com/pbatard/fxload" +SRC_URI="git+git://github.com/pbatard/fxload#cd1c1a062579b921d7694a3244cdefc60fd3325f" +REVISION="1" +ARCHITECTURES="x86_gcc2" +SECONDARY_ARCHITECTURES="x86" +PROVIDES=" + cmd:fxload$secondaryArchSuffix + " +REQUIRES=" + lib:libusb_1.0$secondaryArchSuffix + haiku$secondaryArchSuffix >= $haikuVersion + " +BUILD_REQUIRES=" + devel:libusb_1.0${secondaryArchSuffix} + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " +BUILD_PREREQUIRES=" + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:pkg_config + cmd:install + " + +BUILD() +{ + export PKG_CONFIG_LIBDIR=/system/develop/lib/x86/pkgconfig/ + make +} + +INSTALL() +{ + make install sbindir=$binDir mandir=$manDir INSTALL_PROGRAM="install -cD" +} diff --git a/sys-devel/clang/clang-3.4.recipe b/sys-devel/clang/clang-3.4.recipe new file mode 100644 index 000000000..79477fe79 --- /dev/null +++ b/sys-devel/clang/clang-3.4.recipe @@ -0,0 +1,120 @@ +SUMMARY="A llvm front end compiler for C and C++" +DESCRIPTION=" +Clang is an 'LLVM native' C/C++/Objective-C compiler, which aims to deliver \ +amazingly fast compiles (e.g. about 3x faster than GCC when compiling \ +Objective-C code in a debug configuration), extremely useful error and warning \ +messages and to provide a platform for building great source level tools. +" + +HOMEPAGE="http://www.llvm.org/" +LICENSE="UIUC" +COPYRIGHT="2003-2012 University of Illinois at Urbana-Champaign" + +SRC_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.gz" +CHECKSUM_MD5="46ed668a1ce38985120dbf6344cf6116" +SRC_URI_2="http://llvm.org/releases/${portVersion}/clang-${portVersion}.src.tar.gz" +CHECKSUM_MD5_2="b378f1e2c424e03289effc75268d3d2c" +REVISION="2" + +ARCHITECTURES="x86 x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + clang$secondaryArchSuffix = $portVersion + cmd:clang = $portVersion + cmd:clang++ = $portVersion + cmd:c_index_test = $portVersion + lib:libLTO = $portVersion + lib:libclang = $portVersion + lib:libprofile_rt = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " + +BUILD_REQUIRES=" + " + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:aclocal + cmd:autoconf + cmd:automake + cmd:gcc$secondaryArchSuffix + cmd:groff + cmd:ld$secondaryArchSuffix + cmd:libtoolize + cmd:make + cmd:python + cmd:sed + " + +SOURCE_DIR="llvm-${portVersion}" + +PATCHES="llvm-${portVersion}.patchset" +PATCHES_2="clang-${portVersion}.patchset" + +BUILD() +{ + mkdir -p tools/clang + cp -rd $sourceDir2/clang-${portVersion}/* tools/clang/ + #cp -r /boot/system/data/libtool/config/. autoconf/ + #cp -r /boot/system/data/libtool/config/. projects/sample/autoconf/ + + # Fix improper env paths + find . -type f -exec sed -i 's/\/usr\/bin\/env/\/bin\/env/g' "{}" \; + + # Haiku C++ requires rtti in a lot of central system components + # such as Mesa + export REQUIRES_RTTI=1 + + # TODO: clang's build system seems to ignore doc / man / shared dirs? + runConfigure ./configure --enable-optimized + make $jobArgs +} + +INSTALL() +{ + mkdir -p $developDir + mkdir -p $docDir + + make install-clang + + # Install static analysis tools + mkdir -p $developDir/tools/clang$secondaryArchSuffix + cp -Ra tools/clang/tools/scan-build $developDir/tools/clang$secondaryArchSuffix/ + cp -Ra tools/clang/tools/scan-view $developDir/tools/clang$secondaryArchSuffix/ + + ln -s $developDir/tools/clang$secondaryArchSuffix/scan-build/scan-build $binDir/scan-build + ln -s $developDir/tools/clang$secondaryArchSuffix/scan-view/scan-view $binDir/scan-view + ln -s $binDir/clang $developDir/tools/clang$secondaryArchSuffix/scan-build/clang + + # analysis package + packageEntries analysis \ + $binDir/scan-build \ + $binDir/scan-view \ + $developDir/tools/clang$secondaryArchSuffix +} + +TEST() +{ + make check +} + + +# ----- analysis package ------------------------------------------------------- + +SUMMARY_analysis="Static analysis tools using the clang compiler" +PROVIDES_analysis=" + clang${secondaryArchSuffix}_analysis = $portVersion + cmd:scan_build = $portVersion + cmd:scan_view = $portVersion + " + +REQUIRES_analysis=" + clang$secondaryArchSuffix == $portVersion base + " diff --git a/sys-devel/clang/patches/clang-3.4.patchset b/sys-devel/clang/patches/clang-3.4.patchset new file mode 100644 index 000000000..64545c08a --- /dev/null +++ b/sys-devel/clang/patches/clang-3.4.patchset @@ -0,0 +1,97 @@ +From 33c9dfc71ce4a7cc0a0e5967b9110bcbc3d0a7d7 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Fri, 24 Jan 2014 02:22:17 +0000 +Subject: [PATCH] haiku: Fix header search paths + +* /boot/develop no longer exists +* /boot/common no longer exists +* We still need to figure something out + for secondary architecture builds. +--- + lib/Frontend/InitHeaderSearch.cpp | 70 +++++++++++++++++++++------------------ + 1 file changed, 38 insertions(+), 32 deletions(-) + +diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp +index d144cbb..e96e329 100644 +--- a/lib/Frontend/InitHeaderSearch.cpp ++++ b/lib/Frontend/InitHeaderSearch.cpp +@@ -272,38 +272,44 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, + llvm_unreachable("Include management is handled in the driver."); + + case llvm::Triple::Haiku: +- AddPath("/boot/common/include", System, false); +- AddPath("/boot/develop/headers/os", System, false); +- AddPath("/boot/develop/headers/os/app", System, false); +- AddPath("/boot/develop/headers/os/arch", System, false); +- AddPath("/boot/develop/headers/os/device", System, false); +- AddPath("/boot/develop/headers/os/drivers", System, false); +- AddPath("/boot/develop/headers/os/game", System, false); +- AddPath("/boot/develop/headers/os/interface", System, false); +- AddPath("/boot/develop/headers/os/kernel", System, false); +- AddPath("/boot/develop/headers/os/locale", System, false); +- AddPath("/boot/develop/headers/os/mail", System, false); +- AddPath("/boot/develop/headers/os/media", System, false); +- AddPath("/boot/develop/headers/os/midi", System, false); +- AddPath("/boot/develop/headers/os/midi2", System, false); +- AddPath("/boot/develop/headers/os/net", System, false); +- AddPath("/boot/develop/headers/os/storage", System, false); +- AddPath("/boot/develop/headers/os/support", System, false); +- AddPath("/boot/develop/headers/os/translation", System, false); +- AddPath("/boot/develop/headers/os/add-ons/graphics", System, false); +- AddPath("/boot/develop/headers/os/add-ons/input_server", System, false); +- AddPath("/boot/develop/headers/os/add-ons/screen_saver", System, false); +- AddPath("/boot/develop/headers/os/add-ons/tracker", System, false); +- AddPath("/boot/develop/headers/os/be_apps/Deskbar", System, false); +- AddPath("/boot/develop/headers/os/be_apps/NetPositive", System, false); +- AddPath("/boot/develop/headers/os/be_apps/Tracker", System, false); +- AddPath("/boot/develop/headers/cpp", System, false); +- AddPath("/boot/develop/headers/cpp/i586-pc-haiku", System, false); +- AddPath("/boot/develop/headers/3rdparty", System, false); +- AddPath("/boot/develop/headers/bsd", System, false); +- AddPath("/boot/develop/headers/glibc", System, false); +- AddPath("/boot/develop/headers/posix", System, false); +- AddPath("/boot/develop/headers", System, false); ++ // TODO: We need to handle hybrid secondary architecture paths ++ // (see buildtools/tree/gcc/gcc/config/haiku.h) ++ AddPath("/boot/system/non-packaged/develop/headers", System, false); ++ AddPath("/boot/system/develop/headers/os", System, false); ++ AddPath("/boot/system/develop/headers/os/app", System, false); ++ AddPath("/boot/system/develop/headers/os/arch", System, false); ++ AddPath("/boot/system/develop/headers/os/device", System, false); ++ AddPath("/boot/system/develop/headers/os/drivers", System, false); ++ AddPath("/boot/system/develop/headers/os/game", System, false); ++ AddPath("/boot/system/develop/headers/os/interface", System, false); ++ AddPath("/boot/system/develop/headers/os/kernel", System, false); ++ AddPath("/boot/system/develop/headers/os/locale", System, false); ++ AddPath("/boot/system/develop/headers/os/mail", System, false); ++ AddPath("/boot/system/develop/headers/os/media", System, false); ++ AddPath("/boot/system/develop/headers/os/midi", System, false); ++ AddPath("/boot/system/develop/headers/os/midi2", System, false); ++ AddPath("/boot/system/develop/headers/os/net", System, false); ++ AddPath("/boot/system/develop/headers/os/opengl", System, false); ++ AddPath("/boot/system/develop/headers/os/storage", System, false); ++ AddPath("/boot/system/develop/headers/os/support", System, false); ++ AddPath("/boot/system/develop/headers/os/translation", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/graphics", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/input_server", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/mail_daemon", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/registrar", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/screen_saver", System, false); ++ AddPath("/boot/system/develop/headers/os/add-ons/tracker", System, false); ++ AddPath("/boot/system/develop/headers/os/be_apps/Deskbar", System, false); ++ AddPath("/boot/system/develop/headers/os/be_apps/NetPositive", System, false); ++ AddPath("/boot/system/develop/headers/os/be_apps/Tracker", System, false); ++ AddPath("/boot/system/develop/headers/cpp", System, false); ++ AddPath("/boot/system/develop/headers/cpp/i586-pc-haiku", System, false); ++ AddPath("/boot/system/develop/headers/3rdparty", System, false); ++ AddPath("/boot/system/develop/headers/bsd", System, false); ++ AddPath("/boot/system/develop/headers/glibc", System, false); ++ AddPath("/boot/system/develop/headers/gnu", System, false); ++ AddPath("/boot/system/develop/headers/posix", System, false); ++ AddPath("/boot/system/develop/headers", System, false); + break; + case llvm::Triple::RTEMS: + break; +-- +1.8.3.4 + diff --git a/sys-devel/clang/patches/llvm-3.4.patchset b/sys-devel/clang/patches/llvm-3.4.patchset new file mode 100644 index 000000000..9f14d94d8 --- /dev/null +++ b/sys-devel/clang/patches/llvm-3.4.patchset @@ -0,0 +1,25 @@ +From 744634aa845c403f5a39b8257bbacd36dc1dd351 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 22 Jan 2014 05:04:31 +0000 +Subject: [PATCH] haiku: fix Host.h for endian.h + +--- + include/llvm/Support/Host.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h +index 28c4cc7..ab985a4 100644 +--- a/include/llvm/Support/Host.h ++++ b/include/llvm/Support/Host.h +@@ -16,7 +16,7 @@ + + #include "llvm/ADT/StringMap.h" + +-#if defined(__linux__) || defined(__GNU__) ++#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) + #include + #else + #if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) +-- +1.8.3.4 + diff --git a/sys-devel/gcc/gcc-2.95.3_2013_08_15.recipe b/sys-devel/gcc/gcc-2.95.3_2013_08_15.recipe index a8a586880..da2417640 100644 --- a/sys-devel/gcc/gcc-2.95.3_2013_08_15.recipe +++ b/sys-devel/gcc/gcc-2.95.3_2013_08_15.recipe @@ -9,10 +9,10 @@ LICENSE=" " COPYRIGHT="1988-2000 Free Software Foundation, Inc." SRC_URI=" - git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#6ff546f23b0259bcd27550aa6ad8aaef89fd1bf6 - git+git://github.com/haiku/BuildtoolsPM.git#6ff546f23b0259bcd27550aa6ad8aaef89fd1bf6 + git+file://$portBaseDir/../binutils/download/buildtools.git#9bfca2f40f0857932e8bc66b6d1fdae94acf8d9c + git+git://github.com/haiku/buildtools.git#9bfca2f40f0857932e8bc66b6d1fdae94acf8d9c " -REVISION="2" +REVISION="4" ARCHITECTURES="x86_gcc2" if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ] then 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 a9994f2ff..a143a821c 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 @@ -9,10 +9,10 @@ LICENSE=" " COPYRIGHT="1988-2013 Free Software Foundation, Inc." SRC_URI=" - git+file://$portBaseDir/../binutils/download/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c - git+git://github.com/haiku/buildtools.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c + git+file://$portBaseDir/../binutils/download/buildtools.git#fd576c8d8a83e3fe9a6443f9c0431bd11125314e + git+git://github.com/haiku/buildtools.git#fd576c8d8a83e3fe9a6443f9c0431bd11125314e " -REVISION="4" +REVISION="5" ARCHITECTURES="x86 x86_64" if [ $effectiveTargetArchitecture != x86_gcc2 ]; then # x86_gcc2 is fine as primary target architecture as long as we're building diff --git a/sys-devel/llvm/llvm-3.4.recipe b/sys-devel/llvm/llvm-3.4.recipe new file mode 100644 index 000000000..f93569b77 --- /dev/null +++ b/sys-devel/llvm/llvm-3.4.recipe @@ -0,0 +1,61 @@ +SUMMARY="Modular and reuseable compiler and toolchain technologies." +DESCRIPTION=" +LLVM is a collection of modular and reuseable compiler and and toolchain \ +technologies. +" +HOMEPAGE="http://www.llvm.org/" +LICENSE="UIUC" +COPYRIGHT="2003-2012 University of Illinois at Urbana-Champaign" +SRC_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.gz" +REVISION="1" +CHECKSUM_MD5="46ed668a1ce38985120dbf6344cf6116" +ARCHITECTURES="x86 x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + llvm$secondaryArchSuffix = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " + +BUILD_REQUIRES=" + " + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:aclocal + cmd:autoconf + cmd:automake + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize + cmd:make + cmd:python + cmd:sed + " + +PATCHES="llvm-${portVersion}.patchset" + +PATCH() +{ + find . -type f -exec sed -i 's/\/usr\/bin\/env/\/bin\/env/g' "{}" \; +} + +BUILD() +{ + # Haiku C++ requires rtti in a lot of central system components + # such as Mesa + export REQUIRES_RTTI=1 + runConfigure ./configure --enable-optimized + make $jobArgs +} + +INSTALL() +{ + make install +} diff --git a/sys-devel/llvm/patches/llvm-3.4.patchset b/sys-devel/llvm/patches/llvm-3.4.patchset new file mode 100644 index 000000000..9f14d94d8 --- /dev/null +++ b/sys-devel/llvm/patches/llvm-3.4.patchset @@ -0,0 +1,25 @@ +From 744634aa845c403f5a39b8257bbacd36dc1dd351 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 22 Jan 2014 05:04:31 +0000 +Subject: [PATCH] haiku: fix Host.h for endian.h + +--- + include/llvm/Support/Host.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h +index 28c4cc7..ab985a4 100644 +--- a/include/llvm/Support/Host.h ++++ b/include/llvm/Support/Host.h +@@ -16,7 +16,7 @@ + + #include "llvm/ADT/StringMap.h" + +-#if defined(__linux__) || defined(__GNU__) ++#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) + #include + #else + #if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) +-- +1.8.3.4 + diff --git a/sys-libs/mesa/mesa-10.0.2.recipe b/sys-libs/mesa/mesa-10.0.2.recipe new file mode 100644 index 000000000..1fe2bf151 --- /dev/null +++ b/sys-libs/mesa/mesa-10.0.2.recipe @@ -0,0 +1,156 @@ +SUMMARY="Multi-platform GL implementation" +DESCRIPTION=" +Mesa is an open-source implementation of the OpenGL specification. The OpenGL \ +specification documents a system for rendering interactive 3D graphics. +Mesa fills the role of the Haiku OpenGL kit providing 3D rendering to Haiku \ +applications. +" +HOMEPAGE="http://www.mesa3d.org/" +COPYRIGHT="1999-2013 Brian Paul All Rights Reserved." +LICENSE="MIT" +SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/10.0.2/MesaLib-10.0.2.tar.bz2" +CHECKSUM_MD5="8544c0ab3e438a08b5103421ea15b6d2" +REVISION="2" +ARCHITECTURES="x86 x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + mesa$secondaryArchSuffix = $portVersion compat >= 10.0 + lib:libGL$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " + +PATCHES="mesa-10.0.2.patchset" + +BUILD_PREREQUIRES=" + libxml2_python + llvm${secondaryArchSuffix} + cmd:bison + cmd:find + cmd:flex + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:scons + cmd:sed + " + +SOURCE_DIR="Mesa-$portVersion" + +BUILD() +{ + if [ -n "$secondaryArchSuffix" ]; then + export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" + fi + scons $jobArgs build=release + #scons $jobArgs build=debug +} + +INSTALL() +{ + mesaBuildDir=build/haiku-$effectiveTargetArchitecture + + # libGL.so makes up the core of our OpenGL kit + mkdir -p $libDir + cp $(find $mesaBuildDir -name 'libGL.so') $libDir + mkdir -p $developLibDir + symlinkRelative -s $libDir/libGL.so $developLibDir + + # Our rendering add-ons + mkdir -p $addOnsDir/opengl + cp $(find $mesaBuildDir -name 'libswrast.so') \ + "$addOnsDir/opengl/Software Rasterizer" + cp $(find $mesaBuildDir -name 'libswpipe.so') \ + "$addOnsDir/opengl/Software Pipe" + + # Set some nice version info + setversion "$libDir/libGL.so" -app 10 0 2 -long "Haiku OpenGL kit" + setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 0 2 -long "Mesa software rasterization renderer" + setversion "$addOnsDir/opengl/Software Pipe" -app 10 0 2 -long "Gallium LLVM software pipe renderer" + + # OpenGL Kit + mkdir -p $includeDir/os/opengl + cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ + cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ + cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ + + # Standard GL headers + mkdir -p $includeDir/GL + cp ./include/GL/gl.h $includeDir/GL/ + cp ./include/GL/gl_mangle.h $includeDir/GL/ + cp ./include/GL/glext.h $includeDir/GL/ + + # Create GL symlink in opengl kit + symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL + + # devel package + packageEntries devel \ + $developDir + + # swpipe renderer package + packageEntries swpipe \ + "$addOnsDir/opengl/Software Pipe" + + # swrast renderer package + packageEntries swrast \ + "$addOnsDir/opengl/Software Rasterizer" +} + +# ----- devel package ------------------------------------------------------- + +PROVIDES_devel=" + mesa${secondaryArchSuffix}_devel = $portVersion + devel:libGL$secondaryArchSuffix = $portVersion + " + +REQUIRES_devel=" + mesa$secondaryArchSuffix == $portVersion base + " + +# ===== Mesa OpenGL Add-ons ================================================== +# ----- swrast package ------------------------------------------------------- + +SUMMARY_swrast="Mesa software rasterization renderer" +DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software + rasterization on Haiku systems. Software rasterization performs all + 3D rendering on the systems CPU and doesn't require any specialized + hardware. Software rasterization is generally considered a fallback + 3D rendering method as performance is limited. + " +PROVIDES_swrast=" + mesa${secondaryArchSuffix}_swrast = $portVersion + " +REQUIRED_swrast=" + mesa$secondaryArchSuffix == $portVersion base + " + +# ===== Gallium OpenGL Add-ons =============================================== +# ----- swpipe package ------------------------------------------------------- + +SUMMARY_swpipe="Mesa LLVM enhanced Gallium software pipe renderer" +DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM + enhanced software rendering. Software pipe rendering performs all + 3D rendering on the systems CPU and doesn't require any specialized + hardware. The usage of LLVM over traditional rasterization gives this + renderer a boost in performance. + + Gallium software pipe rendering is in an extremely early state as of + this version of Mesa, and may not function as expected. + " +PROVIDES_swpipe=" + mesa${secondaryArchSuffix}_swpipe = $portVersion + " + +REQUIRED_swpipe=" + mesa$secondaryArchSuffix == $portVersion base + " + diff --git a/sys-libs/mesa/patches/mesa-10.0.2.patchset b/sys-libs/mesa/patches/mesa-10.0.2.patchset new file mode 100644 index 000000000..6c35f8c6e --- /dev/null +++ b/sys-libs/mesa/patches/mesa-10.0.2.patchset @@ -0,0 +1,2746 @@ +From cc285772ce222f3672aa725dea18b52d9f94d2c2 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Mon, 30 Dec 2013 23:49:06 -0600 +Subject: [PATCH] haiku: Fix missing HaikuGL header paths + +--- + src/gallium/targets/haiku-softpipe/SConscript | 1 + + src/gallium/targets/libgl-haiku/SConscript | 1 + + src/mesa/drivers/haiku/swrast/SConscript | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript +index 40bf03c..16ce7cd 100644 +--- a/src/gallium/targets/haiku-softpipe/SConscript ++++ b/src/gallium/targets/haiku-softpipe/SConscript +@@ -21,6 +21,7 @@ env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', ++ '#/include/HaikuGL', + '#/src/gallium/winsys/sw/hgl', + '/boot/system/develop/headers/private', + ]) +diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript +index 2e6b628..43d15c5 100644 +--- a/src/gallium/targets/libgl-haiku/SConscript ++++ b/src/gallium/targets/libgl-haiku/SConscript +@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', ++ '#/include/HaikuGL', + '/boot/system/develop/headers/private', + Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers + ]) +diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript +index 71ce88e..ca0423e 100644 +--- a/src/mesa/drivers/haiku/swrast/SConscript ++++ b/src/mesa/drivers/haiku/swrast/SConscript +@@ -6,6 +6,7 @@ env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', ++ '#/include/HaikuGL', + '/boot/system/develop/headers/private', + Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers + ]) +-- +1.8.3.4 + +From 72e0f3de1f2df3407dbf257183c78bd3f81c1a12 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Tue, 31 Dec 2013 15:39:49 -0600 +Subject: [PATCH] haiku libGL: Move from gallium target to src/hgl + +* The Haiku renderers need to link to libGL to function properly + in all usage contexts. As mesa drivers build before gallium + targets, we couldn't properly link the mesa swrast driver to + the gallium libGL target for Haiku. +* This is likely better as it mimics how glx is laid out ensuring + the Haiku libGL is better understood. +* All renderers properly link in libGL now. +--- + src/SConscript | 5 + + src/gallium/SConscript | 1 - + src/gallium/targets/haiku-softpipe/SConscript | 2 + + src/gallium/targets/libgl-haiku/GLDispatcher.cpp | 72 --- + src/gallium/targets/libgl-haiku/GLDispatcher.h | 109 ---- + src/gallium/targets/libgl-haiku/GLRenderer.cpp | 106 ---- + .../targets/libgl-haiku/GLRendererRoster.cpp | 224 ------- + src/gallium/targets/libgl-haiku/GLRendererRoster.h | 51 -- + src/gallium/targets/libgl-haiku/GLView.cpp | 643 --------------------- + src/gallium/targets/libgl-haiku/SConscript | 35 -- + src/hgl/GLDispatcher.cpp | 72 +++ + src/hgl/GLDispatcher.h | 109 ++++ + src/hgl/GLRenderer.cpp | 106 ++++ + src/hgl/GLRendererRoster.cpp | 224 +++++++ + src/hgl/GLRendererRoster.h | 51 ++ + src/hgl/GLView.cpp | 643 +++++++++++++++++++++ + src/hgl/SConscript | 36 ++ + src/mesa/drivers/haiku/swrast/SConscript | 2 + + 18 files changed, 1250 insertions(+), 1241 deletions(-) + delete mode 100644 src/gallium/targets/libgl-haiku/GLDispatcher.cpp + delete mode 100644 src/gallium/targets/libgl-haiku/GLDispatcher.h + delete mode 100644 src/gallium/targets/libgl-haiku/GLRenderer.cpp + delete mode 100644 src/gallium/targets/libgl-haiku/GLRendererRoster.cpp + delete mode 100644 src/gallium/targets/libgl-haiku/GLRendererRoster.h + delete mode 100644 src/gallium/targets/libgl-haiku/GLView.cpp + delete mode 100644 src/gallium/targets/libgl-haiku/SConscript + create mode 100644 src/hgl/GLDispatcher.cpp + create mode 100644 src/hgl/GLDispatcher.h + create mode 100644 src/hgl/GLRenderer.cpp + create mode 100644 src/hgl/GLRendererRoster.cpp + create mode 100644 src/hgl/GLRendererRoster.h + create mode 100644 src/hgl/GLView.cpp + create mode 100644 src/hgl/SConscript + +diff --git a/src/SConscript b/src/SConscript +index 1465918..a24acea 100644 +--- a/src/SConscript ++++ b/src/SConscript +@@ -18,6 +18,11 @@ if env['hostonly']: + # enable OpenGL ES support. + SConscript('mapi/glapi/gen/SConscript') + SConscript('mapi/glapi/SConscript') ++ ++# Haiku C++ libGL dispatch (renderers depend on libgl) ++if env['platform'] in ['haiku']: ++ SConscript('hgl/SConscript') ++ + SConscript('mesa/SConscript') + + SConscript('mapi/vgapi/SConscript') +diff --git a/src/gallium/SConscript b/src/gallium/SConscript +index 6e27be2..32bbdbe 100644 +--- a/src/gallium/SConscript ++++ b/src/gallium/SConscript +@@ -119,7 +119,6 @@ if not env['embedded']: + if env['platform'] == 'haiku': + SConscript([ + 'targets/haiku-softpipe/SConscript', +- 'targets/libgl-haiku/SConscript', + ]) + + if env['dri']: +diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript +index 16ce7cd..0381d05 100644 +--- a/src/gallium/targets/haiku-softpipe/SConscript ++++ b/src/gallium/targets/haiku-softpipe/SConscript +@@ -17,6 +17,8 @@ if True: + ]) + env.Prepend(LIBS = [softpipe]) + ++env.Prepend(LIBS = [libgl]) ++ + env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', +diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp b/src/gallium/targets/libgl-haiku/GLDispatcher.cpp +deleted file mode 100644 +index 46b91d5..0000000 +--- a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp ++++ /dev/null +@@ -1,72 +0,0 @@ +-/* +- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. +- * Distributed under the terms of the MIT License. +- * +- * Authors: +- * Brian Paul +- * Philippe Houdoin +- * Alexander von Gluck IV +- */ +- +- +-extern "C" { +-#include "glapi/glapi.h" +-#include "glapi/glapi_priv.h" +- +-/* +- * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints +- * (glAccum, glBegin, etc). +- * This code IS NOT USED if we're compiling on an x86 system and using +- * the glapi_x86.S assembly code. +- */ +-#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) +- +-#define KEYWORD1 PUBLIC +-#define KEYWORD2 +-#define NAME(func) gl##func +- +-#define DISPATCH(func, args, msg) \ +- const struct _glapi_table* dispatch; \ +- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ +- (dispatch->func) args +- +-#define RETURN_DISPATCH(func, args, msg) \ +- const struct _glapi_table* dispatch; \ +- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ +- return (dispatch->func) args +- +-#endif +-} +- +- +-/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching +- C++ wrapper class +- */ +- +-#include "GLDispatcher.h" +- +-BGLDispatcher::BGLDispatcher() +-{ +-} +- +- +-BGLDispatcher::~BGLDispatcher() +-{ +-} +- +- +-status_t +-BGLDispatcher::CheckTable(const struct _glapi_table* table) +-{ +- _glapi_check_table(table ? table : _glapi_get_dispatch()); +- return B_OK; +-} +- +- +-status_t +-BGLDispatcher::SetTable(struct _glapi_table* table) +-{ +- _glapi_set_dispatch(table); +- return B_OK; +-} +diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.h b/src/gallium/targets/libgl-haiku/GLDispatcher.h +deleted file mode 100644 +index 44bca8c..0000000 +--- a/src/gallium/targets/libgl-haiku/GLDispatcher.h ++++ /dev/null +@@ -1,109 +0,0 @@ +-/* +- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. +- * Distributed under the terms of the MIT License. +- * +- * Authors: +- * Brian Paul +- * Philippe Houdoin +- */ +-#ifndef GLDISPATCHER_H +-#define GLDISPATCHER_H +- +- +-#include +-#include +-#include +- +-#include "glheader.h" +- +-extern "C" { +-#include "glapi/glapi.h" +-} +- +- +-class BGLDispatcher +-{ +- // Private unimplemented copy constructors +- BGLDispatcher(const BGLDispatcher &); +- BGLDispatcher & operator=(const BGLDispatcher &); +- +- public: +- BGLDispatcher(); +- ~BGLDispatcher(); +- +- void SetCurrentContext(void* context); +- void* CurrentContext(); +- +- struct _glapi_table* Table(); +- status_t CheckTable( +- const struct _glapi_table* dispatch = NULL); +- status_t SetTable(struct _glapi_table* dispatch); +- uint32 TableSize(); +- +- const _glapi_proc operator[](const char* functionName); +- const char* operator[](uint32 offset); +- +- const _glapi_proc AddressOf(const char* functionName); +- uint32 OffsetOf(const char* functionName); +-}; +- +- +-// Inlines methods +-inline void +-BGLDispatcher::SetCurrentContext(void* context) +-{ +- _glapi_set_context(context); +-} +- +- +-inline void* +-BGLDispatcher::CurrentContext() +-{ +- return _glapi_get_context(); +-} +- +- +-inline struct _glapi_table* +-BGLDispatcher::Table() +-{ +- return _glapi_get_dispatch(); +-} +- +- +-inline uint32 +-BGLDispatcher::TableSize() +-{ +- return _glapi_get_dispatch_table_size(); +-} +- +- +-inline const _glapi_proc +-BGLDispatcher::operator[](const char* functionName) +-{ +- return _glapi_get_proc_address(functionName); +-} +- +- +-inline const char* +-BGLDispatcher::operator[](uint32 offset) +-{ +- return _glapi_get_proc_name((GLuint) offset); +-} +- +- +-inline const _glapi_proc +-BGLDispatcher::AddressOf(const char* functionName) +-{ +- return _glapi_get_proc_address(functionName); +-} +- +- +-inline uint32 +-BGLDispatcher::OffsetOf(const char* functionName) +-{ +- return (uint32) _glapi_get_proc_offset(functionName); +-} +- +- +-#endif // GLDISPATCHER_H +diff --git a/src/gallium/targets/libgl-haiku/GLRenderer.cpp b/src/gallium/targets/libgl-haiku/GLRenderer.cpp +deleted file mode 100644 +index 4573a64..0000000 +--- a/src/gallium/targets/libgl-haiku/GLRenderer.cpp ++++ /dev/null +@@ -1,106 +0,0 @@ +-/* +- * Copyright 2006-2008, Philippe Houdoin. All rights reserved. +- * Distributed under the terms of the MIT License. +- */ +- +- +-#include +- +-#include "GLRenderer.h" +- +-#include "GLDispatcher.h" +- +- +-BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, +- BGLDispatcher* dispatcher) +- : +- fRefCount(1), +- fView(view), +- fOptions(glOptions), +- fDispatcher(dispatcher) +-{ +-} +- +- +-BGLRenderer::~BGLRenderer() +-{ +- delete fDispatcher; +-} +- +- +-void +-BGLRenderer::Acquire() +-{ +- atomic_add(&fRefCount, 1); +-} +- +- +-void +-BGLRenderer::Release() +-{ +- if (atomic_add(&fRefCount, -1) < 1) +- delete this; +-} +- +- +-void +-BGLRenderer::LockGL() +-{ +-} +- +- +-void +-BGLRenderer::UnlockGL() +-{ +-} +- +- +-void +-BGLRenderer::SwapBuffers(bool VSync) +-{ +-} +- +- +-void +-BGLRenderer::Draw(BRect updateRect) +-{ +-} +- +- +-status_t +-BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) +-{ +- return B_ERROR; +-} +- +- +-status_t +-BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) +-{ +- return B_ERROR; +-} +- +- +-void +-BGLRenderer::FrameResized(float width, float height) +-{ +-} +- +- +-void +-BGLRenderer::DirectConnected(direct_buffer_info* info) +-{ +-} +- +- +-void +-BGLRenderer::EnableDirectMode(bool enabled) +-{ +-} +- +- +-status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } +-status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } +-status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } +-status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } +-status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } +diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp b/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp +deleted file mode 100644 +index 1712a87..0000000 +--- a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp ++++ /dev/null +@@ -1,224 +0,0 @@ +-/* +- * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. +- * Distributed under the terms of the MIT License. +- * +- * Authors: +- * Philippe Houdoin +- * Alexander von Gluck IV +- */ +- +- +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include "GLDispatcher.h" +-#include "GLRendererRoster.h" +- +-#include +-#include +- +- +-extern "C" status_t _kern_get_safemode_option(const char* parameter, +- char* buffer, size_t* _bufferSize); +- +- +-GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) +- : +- fNextID(0), +- fView(view), +- fOptions(options), +- fSafeMode(false), +- fABISubDirectory(NULL) +-{ +- char parameter[32]; +- size_t parameterLength = sizeof(parameter); +- +- if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, +- parameter, ¶meterLength) == B_OK) { +- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") +- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") +- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) +- fSafeMode = true; +- } +- +- if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, +- parameter, ¶meterLength) == B_OK) { +- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") +- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") +- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) +- fSafeMode = true; +- } +- +- // We might run in compatibility mode on a system with a different ABI. The +- // renderers matching our ABI can usually be found in respective +- // subdirectories of the opengl add-ons directories. +- system_info info; +- if (get_system_info(&info) == B_OK +- && (info.abi & B_HAIKU_ABI_MAJOR) +- != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { +- switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { +- case B_HAIKU_ABI_GCC_2: +- fABISubDirectory = "gcc2"; +- break; +- case B_HAIKU_ABI_GCC_4: +- fABISubDirectory = "gcc4"; +- break; +- } +- } +- +- AddDefaultPaths(); +-} +- +- +-GLRendererRoster::~GLRendererRoster() +-{ +- +-} +- +- +-BGLRenderer* +-GLRendererRoster::GetRenderer(int32 id) +-{ +- RendererMap::const_iterator iterator = fRenderers.find(id); +- if (iterator == fRenderers.end()) +- return NULL; +- +- struct renderer_item item = iterator->second; +- return item.renderer; +-} +- +- +-void +-GLRendererRoster::AddDefaultPaths() +-{ +- // add user directories first, so that they can override system renderers +- const directory_which paths[] = { +- B_USER_NONPACKAGED_ADDONS_DIRECTORY, +- B_USER_ADDONS_DIRECTORY, +- B_SYSTEM_ADDONS_DIRECTORY, +- }; +- +- for (uint32 i = fSafeMode ? 4 : 0; +- i < sizeof(paths) / sizeof(paths[0]); i++) { +- BPath path; +- status_t status = find_directory(paths[i], &path, true); +- if (status == B_OK && path.Append("opengl") == B_OK) +- AddPath(path.Path()); +- } +-} +- +- +-status_t +-GLRendererRoster::AddPath(const char* path) +-{ +- BDirectory directory(path); +- status_t status = directory.InitCheck(); +- if (status < B_OK) +- return status; +- +- // if a subdirectory for our ABI exists, use that instead +- if (fABISubDirectory != NULL) { +- BEntry entry(&directory, fABISubDirectory); +- if (entry.IsDirectory()) { +- status = directory.SetTo(&entry); +- if (status != B_OK) +- return status; +- } +- } +- +- node_ref nodeRef; +- status = directory.GetNodeRef(&nodeRef); +- if (status < B_OK) +- return status; +- +- int32 count = 0; +- int32 files = 0; +- +- entry_ref ref; +- BEntry entry; +- while (directory.GetNextRef(&ref) == B_OK) { +- entry.SetTo(&ref); +- if (entry.InitCheck() == B_OK && !entry.IsFile()) +- continue; +- +- if (CreateRenderer(ref) == B_OK) +- count++; +- +- files++; +- } +- +- if (files != 0 && count == 0) +- return B_BAD_VALUE; +- +- return B_OK; +-} +- +- +-status_t +-GLRendererRoster::AddRenderer(BGLRenderer* renderer, +- image_id image, const entry_ref* ref, ino_t node) +-{ +- renderer_item item; +- item.renderer = renderer; +- item.image = image; +- item.node = node; +- if (ref != NULL) +- item.ref = *ref; +- +- try { +- fRenderers[fNextID] = item; +- } catch (...) { +- return B_NO_MEMORY; +- } +- +- renderer->fOwningRoster = this; +- renderer->fID = fNextID++; +- return B_OK; +-} +- +- +-status_t +-GLRendererRoster::CreateRenderer(const entry_ref& ref) +-{ +- BEntry entry(&ref); +- node_ref nodeRef; +- status_t status = entry.GetNodeRef(&nodeRef); +- if (status < B_OK) +- return status; +- +- BPath path(&ref); +- image_id image = load_add_on(path.Path()); +- if (image < B_OK) +- return image; +- +- BGLRenderer* (*instantiate_renderer) +- (BGLView* view, ulong options, BGLDispatcher* dispatcher); +- +- status = get_image_symbol(image, "instantiate_gl_renderer", +- B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); +- if (status == B_OK) { +- BGLRenderer* renderer +- = instantiate_renderer(fView, fOptions, new BGLDispatcher()); +- if (!renderer) { +- unload_add_on(image); +- return B_UNSUPPORTED; +- } +- +- if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { +- renderer->Release(); +- // this will delete the renderer +- unload_add_on(image); +- } +- return B_OK; +- } +- unload_add_on(image); +- +- return status; +-} +diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.h b/src/gallium/targets/libgl-haiku/GLRendererRoster.h +deleted file mode 100644 +index 5c8da27..0000000 +--- a/src/gallium/targets/libgl-haiku/GLRendererRoster.h ++++ /dev/null +@@ -1,51 +0,0 @@ +-/* +- * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. +- * Distributed under the terms of the MIT License. +- * +- * Authors: +- * Philippe Houdoin +- */ +-#ifndef _GLRENDERER_ROSTER_H +-#define _GLRENDERER_ROSTER_H +- +- +-#include +- +-#include +- +- +-struct renderer_item { +- BGLRenderer* renderer; +- entry_ref ref; +- ino_t node; +- image_id image; +-}; +- +-typedef std::map RendererMap; +- +- +-class GLRendererRoster { +- public: +- GLRendererRoster(BGLView* view, ulong options); +- virtual ~GLRendererRoster(); +- +- BGLRenderer* GetRenderer(int32 id = 0); +- +- private: +- void AddDefaultPaths(); +- status_t AddPath(const char* path); +- status_t AddRenderer(BGLRenderer* renderer, +- image_id image, const entry_ref* ref, ino_t node); +- status_t CreateRenderer(const entry_ref& ref); +- +- RendererMap fRenderers; +- int32 fNextID; +- BGLView* fView; +- ulong fOptions; +- bool fSafeMode; +- const char* fABISubDirectory; +- +-}; +- +- +-#endif /* _GLRENDERER_ROSTER_H */ +diff --git a/src/gallium/targets/libgl-haiku/GLView.cpp b/src/gallium/targets/libgl-haiku/GLView.cpp +deleted file mode 100644 +index 9ae5b5c..0000000 +--- a/src/gallium/targets/libgl-haiku/GLView.cpp ++++ /dev/null +@@ -1,643 +0,0 @@ +-/* +- * Copyright 2006-2012, Haiku. All rights reserved. +- * Distributed under the terms of the MIT License. +- * +- * Authors: +- * Jérôme Duval, korli@users.berlios.de +- * Philippe Houdoin, philippe.houdoin@free.fr +- * Stefano Ceccherini, burton666@libero.it +- */ +- +-#include +- +-#include +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include "interface/DirectWindowPrivate.h" +-#include "GLDispatcher.h" +-#include "GLRendererRoster.h" +- +- +-struct glview_direct_info { +- direct_buffer_info* direct_info; +- bool direct_connected; +- bool enable_direct_mode; +- +- glview_direct_info(); +- ~glview_direct_info(); +-}; +- +- +-BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, +- ulong options) +- : +- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), +- // | B_FULL_UPDATE_ON_RESIZE) +- fGc(NULL), +- fOptions(options), +- fDitherCount(0), +- fDrawLock("BGLView draw lock"), +- fDisplayLock("BGLView display lock"), +- fClipInfo(NULL), +- fRenderer(NULL), +- fRoster(NULL), +- fDitherMap(NULL) +-{ +- fRoster = new GLRendererRoster(this, options); +-} +- +- +-BGLView::~BGLView() +-{ +- delete fClipInfo; +- if (fRenderer) +- fRenderer->Release(); +-} +- +- +-void +-BGLView::LockGL() +-{ +- // TODO: acquire the OpenGL API lock it on this glview +- +- fDisplayLock.Lock(); +- if (fRenderer) +- fRenderer->LockGL(); +-} +- +- +-void +-BGLView::UnlockGL() +-{ +- if (fRenderer) +- fRenderer->UnlockGL(); +- fDisplayLock.Unlock(); +- +- // TODO: release the GL API lock to others glviews +-} +- +- +-void +-BGLView::SwapBuffers() +-{ +- SwapBuffers(false); +-} +- +- +-void +-BGLView::SwapBuffers(bool vSync) +-{ +- if (fRenderer) { +- _LockDraw(); +- fRenderer->SwapBuffers(vSync); +- _UnlockDraw(); +- } +-} +- +- +-BView* +-BGLView::EmbeddedView() +-{ +- return NULL; +-} +- +- +-void* +-BGLView::GetGLProcAddress(const char* procName) +-{ +- BGLDispatcher* glDispatcher = NULL; +- +- if (fRenderer) +- glDispatcher = fRenderer->GLDispatcher(); +- +- if (glDispatcher) +- return (void*)glDispatcher->AddressOf(procName); +- +- return NULL; +-} +- +- +-status_t +-BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) +-{ +- if (!fRenderer) +- return B_ERROR; +- +- if (!dest || !dest->Bounds().IsValid()) +- return B_BAD_VALUE; +- +- return fRenderer->CopyPixelsOut(source, dest); +-} +- +- +-status_t +-BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) +-{ +- if (!fRenderer) +- return B_ERROR; +- +- if (!source || !source->Bounds().IsValid()) +- return B_BAD_VALUE; +- +- return fRenderer->CopyPixelsIn(source, dest); +-} +- +- +-/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum +- without breaking this method signature. +- Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: +- unsigned long. +- */ +-void +-BGLView::ErrorCallback(unsigned long errorCode) +-{ +- char msg[32]; +- sprintf(msg, "GL: Error code $%04lx.", errorCode); +- // TODO: under BeOS R5, it call debugger(msg); +- fprintf(stderr, "%s\n", msg); +-} +- +- +-void +-BGLView::Draw(BRect updateRect) +-{ +- if (fRenderer) { +- _LockDraw(); +- fRenderer->Draw(updateRect); +- _UnlockDraw(); +- return; +- } +- // TODO: auto-size and center the string +- MovePenTo(8, 32); +- DrawString("No OpenGL renderer available!"); +-} +- +- +-void +-BGLView::AttachedToWindow() +-{ +- BView::AttachedToWindow(); +- +- fBounds = Bounds(); +- for (BView* view = this; view != NULL; view = view->Parent()) +- view->ConvertToParent(&fBounds); +- +- fRenderer = fRoster->GetRenderer(); +- if (fRenderer != NULL) { +- // Jackburton: The following code was commented because it doesn't look +- // good in "direct" mode: +- // when the window is moved, the app_server doesn't paint the view's +- // background, and the stuff behind the window itself shows up. +- // Setting the view color to black, instead, looks a bit more elegant. +-#if 0 +- // Don't paint white window background when resized +- SetViewColor(B_TRANSPARENT_32_BIT); +-#else +- SetViewColor(0, 0, 0); +-#endif +- +- // Set default OpenGL viewport: +- LockGL(); +- glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); +- UnlockGL(); +- fRenderer->FrameResized(Bounds().IntegerWidth(), +- Bounds().IntegerHeight()); +- +- if (fClipInfo) { +- fRenderer->DirectConnected(fClipInfo->direct_info); +- fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); +- } +- +- return; +- } +- +- fprintf(stderr, "no renderer found! \n"); +- +- // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing +- // context +- SetFont(be_bold_font); +- // SetFontSize(16); +-} +- +- +-void +-BGLView::AllAttached() +-{ +- BView::AllAttached(); +-} +- +- +-void +-BGLView::DetachedFromWindow() +-{ +- if (fRenderer) +- fRenderer->Release(); +- fRenderer = NULL; +- +- BView::DetachedFromWindow(); +-} +- +- +-void +-BGLView::AllDetached() +-{ +- BView::AllDetached(); +-} +- +- +-void +-BGLView::FrameResized(float width, float height) +-{ +- fBounds = Bounds(); +- for (BView* v = this; v; v = v->Parent()) +- v->ConvertToParent(&fBounds); +- +- if (fRenderer) { +- LockGL(); +- _LockDraw(); +- _CallDirectConnected(); +- fRenderer->FrameResized(width, height); +- _UnlockDraw(); +- UnlockGL(); +- } +- +- BView::FrameResized(width, height); +-} +- +- +-status_t +-BGLView::Perform(perform_code d, void* arg) +-{ +- return BView::Perform(d, arg); +-} +- +- +-status_t +-BGLView::Archive(BMessage* data, bool deep) const +-{ +- return BView::Archive(data, deep); +-} +- +- +-void +-BGLView::MessageReceived(BMessage* msg) +-{ +- BView::MessageReceived(msg); +-} +- +- +-void +-BGLView::SetResizingMode(uint32 mode) +-{ +- BView::SetResizingMode(mode); +-} +- +- +-void +-BGLView::GetPreferredSize(float* _width, float* _height) +-{ +- if (_width) +- *_width = 0; +- if (_height) +- *_height = 0; +-} +- +- +-void +-BGLView::Show() +-{ +- BView::Show(); +-} +- +- +-void +-BGLView::Hide() +-{ +- BView::Hide(); +-} +- +- +-BHandler* +-BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, +- int32 form, const char* property) +-{ +- return BView::ResolveSpecifier(msg, index, specifier, form, property); +-} +- +- +-status_t +-BGLView::GetSupportedSuites(BMessage* data) +-{ +- return BView::GetSupportedSuites(data); +-} +- +- +-void +-BGLView::DirectConnected(direct_buffer_info* info) +-{ +- if (fClipInfo == NULL) { +- fClipInfo = new (std::nothrow) glview_direct_info(); +- if (fClipInfo == NULL) +- return; +- } +- +- direct_buffer_info* localInfo = fClipInfo->direct_info; +- +- switch (info->buffer_state & B_DIRECT_MODE_MASK) { +- case B_DIRECT_START: +- fClipInfo->direct_connected = true; +- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); +- _UnlockDraw(); +- break; +- +- case B_DIRECT_MODIFY: +- _LockDraw(); +- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); +- _UnlockDraw(); +- break; +- +- case B_DIRECT_STOP: +- fClipInfo->direct_connected = false; +- _LockDraw(); +- break; +- } +- +- if (fRenderer) +- _CallDirectConnected(); +-} +- +- +-void +-BGLView::EnableDirectMode(bool enabled) +-{ +- if (fRenderer) +- fRenderer->EnableDirectMode(enabled); +- if (fClipInfo == NULL) { +- fClipInfo = new (std::nothrow) glview_direct_info(); +- if (fClipInfo == NULL) +- return; +- } +- +- fClipInfo->enable_direct_mode = enabled; +-} +- +- +-void +-BGLView::_LockDraw() +-{ +- if (!fClipInfo || !fClipInfo->enable_direct_mode) +- return; +- +- fDrawLock.Lock(); +-} +- +- +-void +-BGLView::_UnlockDraw() +-{ +- if (!fClipInfo || !fClipInfo->enable_direct_mode) +- return; +- +- fDrawLock.Unlock(); +-} +- +- +-void +-BGLView::_CallDirectConnected() +-{ +- if (!fClipInfo) +- return; +- +- direct_buffer_info* localInfo = fClipInfo->direct_info; +- direct_buffer_info* info = (direct_buffer_info*)malloc( +- DIRECT_BUFFER_INFO_AREA_SIZE); +- if (info == NULL) +- return; +- +- memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); +- +- // Collect the rects into a BRegion, then clip to the view's bounds +- BRegion region; +- for (uint32 c = 0; c < localInfo->clip_list_count; c++) +- region.Include(localInfo->clip_list[c]); +- BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, +- localInfo->window_bounds.top); +- info->window_bounds = boundsRegion.RectAtInt(0); +- // window_bounds are now view bounds +- region.IntersectWith(&boundsRegion); +- +- info->clip_list_count = region.CountRects(); +- info->clip_bounds = region.FrameInt(); +- +- for (uint32 c = 0; c < info->clip_list_count; c++) +- info->clip_list[c] = region.RectAtInt(c); +- fRenderer->DirectConnected(info); +- free(info); +-} +- +- +-//---- virtual reserved methods ---------- +- +- +-void BGLView::_ReservedGLView1() {} +-void BGLView::_ReservedGLView2() {} +-void BGLView::_ReservedGLView3() {} +-void BGLView::_ReservedGLView4() {} +-void BGLView::_ReservedGLView5() {} +-void BGLView::_ReservedGLView6() {} +-void BGLView::_ReservedGLView7() {} +-void BGLView::_ReservedGLView8() {} +- +- +-// #pragma mark - +- +- +-// BeOS compatibility: contrary to others BView's contructors, +-// BGLView one wants a non-const name argument. +-BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, +- ulong options) +- : +- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), +- fGc(NULL), +- fOptions(options), +- fDitherCount(0), +- fDrawLock("BGLView draw lock"), +- fDisplayLock("BGLView display lock"), +- fClipInfo(NULL), +- fRenderer(NULL), +- fRoster(NULL), +- fDitherMap(NULL) +-{ +- fRoster = new GLRendererRoster(this, options); +-} +- +- +-#if 0 +-// TODO: implement BGLScreen class... +- +- +-BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, +- status_t* error, bool debug) +- : +- BWindowScreen(name, screenMode, error, debug) +-{ +-} +- +- +-BGLScreen::~BGLScreen() +-{ +-} +- +- +-void +-BGLScreen::LockGL() +-{ +-} +- +- +-void +-BGLScreen::UnlockGL() +-{ +-} +- +- +-void +-BGLScreen::SwapBuffers() +-{ +-} +- +- +-void +-BGLScreen::ErrorCallback(unsigned long errorCode) +-{ +- // Mesa's GLenum is not ulong but uint! +- char msg[32]; +- sprintf(msg, "GL: Error code $%04lx.", errorCode); +- // debugger(msg); +- fprintf(stderr, "%s\n", msg); +- return; +-} +- +- +-void +-BGLScreen::ScreenConnected(bool enabled) +-{ +-} +- +- +-void +-BGLScreen::FrameResized(float width, float height) +-{ +- return BWindowScreen::FrameResized(width, height); +-} +- +- +-status_t +-BGLScreen::Perform(perform_code d, void* arg) +-{ +- return BWindowScreen::Perform(d, arg); +-} +- +- +-status_t +-BGLScreen::Archive(BMessage* data, bool deep) const +-{ +- return BWindowScreen::Archive(data, deep); +-} +- +- +-void +-BGLScreen::MessageReceived(BMessage* msg) +-{ +- BWindowScreen::MessageReceived(msg); +-} +- +- +-void +-BGLScreen::Show() +-{ +- BWindowScreen::Show(); +-} +- +- +-void +-BGLScreen::Hide() +-{ +- BWindowScreen::Hide(); +-} +- +- +-BHandler* +-BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, +- int32 form, const char* property) +-{ +- return BWindowScreen::ResolveSpecifier(msg, index, specifier, +- form, property); +-} +- +- +-status_t +-BGLScreen::GetSupportedSuites(BMessage* data) +-{ +- return BWindowScreen::GetSupportedSuites(data); +-} +- +- +-//---- virtual reserved methods ---------- +- +-void BGLScreen::_ReservedGLScreen1() {} +-void BGLScreen::_ReservedGLScreen2() {} +-void BGLScreen::_ReservedGLScreen3() {} +-void BGLScreen::_ReservedGLScreen4() {} +-void BGLScreen::_ReservedGLScreen5() {} +-void BGLScreen::_ReservedGLScreen6() {} +-void BGLScreen::_ReservedGLScreen7() {} +-void BGLScreen::_ReservedGLScreen8() {} +-#endif +- +- +-const char* color_space_name(color_space space) +-{ +-#define C2N(a) case a: return #a +- +- switch (space) { +- C2N(B_RGB24); +- C2N(B_RGB32); +- C2N(B_RGBA32); +- C2N(B_RGB32_BIG); +- C2N(B_RGBA32_BIG); +- C2N(B_GRAY8); +- C2N(B_GRAY1); +- C2N(B_RGB16); +- C2N(B_RGB15); +- C2N(B_RGBA15); +- C2N(B_CMAP8); +- default: +- return "Unknown!"; +- }; +- +-#undef C2N +-}; +- +- +-glview_direct_info::glview_direct_info() +-{ +- // TODO: See direct_window_data() in app_server's ServerWindow.cpp +- direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); +- direct_connected = false; +- enable_direct_mode = false; +-} +- +- +-glview_direct_info::~glview_direct_info() +-{ +- free(direct_info); +-} +- +diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript +deleted file mode 100644 +index 43d15c5..0000000 +--- a/src/gallium/targets/libgl-haiku/SConscript ++++ /dev/null +@@ -1,35 +0,0 @@ +-####################################################################### +-# SConscript for Haiku OpenGL kit +- +-Import('*') +- +-env = env.Clone() +- +-env.Append(CPPPATH = [ +- '#/src/mapi', +- '#/src/mesa', +- '#/src/mesa/main', +- '#/include/HaikuGL', +- '/boot/system/develop/headers/private', +- Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers +-]) +- +-env.Prepend(LIBS = [ +- glapi +-]) +- +-sources = [ +- 'GLView.cpp', +- 'GLRenderer.cpp', +- 'GLRendererRoster.cpp', +- 'GLDispatcher.cpp', +-] +- +-# libGL.so +-libgl = env.SharedLibrary( +- target ='GL', +- source = sources, +- SHLIBSUFFIX = env['SHLIBSUFFIX'], +-) +- +-env.Alias('libgl-haiku', libgl) +diff --git a/src/hgl/GLDispatcher.cpp b/src/hgl/GLDispatcher.cpp +new file mode 100644 +index 0000000..46b91d5 +--- /dev/null ++++ b/src/hgl/GLDispatcher.cpp +@@ -0,0 +1,72 @@ ++/* ++ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * Authors: ++ * Brian Paul ++ * Philippe Houdoin ++ * Alexander von Gluck IV ++ */ ++ ++ ++extern "C" { ++#include "glapi/glapi.h" ++#include "glapi/glapi_priv.h" ++ ++/* ++ * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints ++ * (glAccum, glBegin, etc). ++ * This code IS NOT USED if we're compiling on an x86 system and using ++ * the glapi_x86.S assembly code. ++ */ ++#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) ++ ++#define KEYWORD1 PUBLIC ++#define KEYWORD2 ++#define NAME(func) gl##func ++ ++#define DISPATCH(func, args, msg) \ ++ const struct _glapi_table* dispatch; \ ++ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ ++ (dispatch->func) args ++ ++#define RETURN_DISPATCH(func, args, msg) \ ++ const struct _glapi_table* dispatch; \ ++ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ ++ return (dispatch->func) args ++ ++#endif ++} ++ ++ ++/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching ++ C++ wrapper class ++ */ ++ ++#include "GLDispatcher.h" ++ ++BGLDispatcher::BGLDispatcher() ++{ ++} ++ ++ ++BGLDispatcher::~BGLDispatcher() ++{ ++} ++ ++ ++status_t ++BGLDispatcher::CheckTable(const struct _glapi_table* table) ++{ ++ _glapi_check_table(table ? table : _glapi_get_dispatch()); ++ return B_OK; ++} ++ ++ ++status_t ++BGLDispatcher::SetTable(struct _glapi_table* table) ++{ ++ _glapi_set_dispatch(table); ++ return B_OK; ++} +diff --git a/src/hgl/GLDispatcher.h b/src/hgl/GLDispatcher.h +new file mode 100644 +index 0000000..44bca8c +--- /dev/null ++++ b/src/hgl/GLDispatcher.h +@@ -0,0 +1,109 @@ ++/* ++ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * Authors: ++ * Brian Paul ++ * Philippe Houdoin ++ */ ++#ifndef GLDISPATCHER_H ++#define GLDISPATCHER_H ++ ++ ++#include ++#include ++#include ++ ++#include "glheader.h" ++ ++extern "C" { ++#include "glapi/glapi.h" ++} ++ ++ ++class BGLDispatcher ++{ ++ // Private unimplemented copy constructors ++ BGLDispatcher(const BGLDispatcher &); ++ BGLDispatcher & operator=(const BGLDispatcher &); ++ ++ public: ++ BGLDispatcher(); ++ ~BGLDispatcher(); ++ ++ void SetCurrentContext(void* context); ++ void* CurrentContext(); ++ ++ struct _glapi_table* Table(); ++ status_t CheckTable( ++ const struct _glapi_table* dispatch = NULL); ++ status_t SetTable(struct _glapi_table* dispatch); ++ uint32 TableSize(); ++ ++ const _glapi_proc operator[](const char* functionName); ++ const char* operator[](uint32 offset); ++ ++ const _glapi_proc AddressOf(const char* functionName); ++ uint32 OffsetOf(const char* functionName); ++}; ++ ++ ++// Inlines methods ++inline void ++BGLDispatcher::SetCurrentContext(void* context) ++{ ++ _glapi_set_context(context); ++} ++ ++ ++inline void* ++BGLDispatcher::CurrentContext() ++{ ++ return _glapi_get_context(); ++} ++ ++ ++inline struct _glapi_table* ++BGLDispatcher::Table() ++{ ++ return _glapi_get_dispatch(); ++} ++ ++ ++inline uint32 ++BGLDispatcher::TableSize() ++{ ++ return _glapi_get_dispatch_table_size(); ++} ++ ++ ++inline const _glapi_proc ++BGLDispatcher::operator[](const char* functionName) ++{ ++ return _glapi_get_proc_address(functionName); ++} ++ ++ ++inline const char* ++BGLDispatcher::operator[](uint32 offset) ++{ ++ return _glapi_get_proc_name((GLuint) offset); ++} ++ ++ ++inline const _glapi_proc ++BGLDispatcher::AddressOf(const char* functionName) ++{ ++ return _glapi_get_proc_address(functionName); ++} ++ ++ ++inline uint32 ++BGLDispatcher::OffsetOf(const char* functionName) ++{ ++ return (uint32) _glapi_get_proc_offset(functionName); ++} ++ ++ ++#endif // GLDISPATCHER_H +diff --git a/src/hgl/GLRenderer.cpp b/src/hgl/GLRenderer.cpp +new file mode 100644 +index 0000000..4573a64 +--- /dev/null ++++ b/src/hgl/GLRenderer.cpp +@@ -0,0 +1,106 @@ ++/* ++ * Copyright 2006-2008, Philippe Houdoin. All rights reserved. ++ * Distributed under the terms of the MIT License. ++ */ ++ ++ ++#include ++ ++#include "GLRenderer.h" ++ ++#include "GLDispatcher.h" ++ ++ ++BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, ++ BGLDispatcher* dispatcher) ++ : ++ fRefCount(1), ++ fView(view), ++ fOptions(glOptions), ++ fDispatcher(dispatcher) ++{ ++} ++ ++ ++BGLRenderer::~BGLRenderer() ++{ ++ delete fDispatcher; ++} ++ ++ ++void ++BGLRenderer::Acquire() ++{ ++ atomic_add(&fRefCount, 1); ++} ++ ++ ++void ++BGLRenderer::Release() ++{ ++ if (atomic_add(&fRefCount, -1) < 1) ++ delete this; ++} ++ ++ ++void ++BGLRenderer::LockGL() ++{ ++} ++ ++ ++void ++BGLRenderer::UnlockGL() ++{ ++} ++ ++ ++void ++BGLRenderer::SwapBuffers(bool VSync) ++{ ++} ++ ++ ++void ++BGLRenderer::Draw(BRect updateRect) ++{ ++} ++ ++ ++status_t ++BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) ++{ ++ return B_ERROR; ++} ++ ++ ++status_t ++BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) ++{ ++ return B_ERROR; ++} ++ ++ ++void ++BGLRenderer::FrameResized(float width, float height) ++{ ++} ++ ++ ++void ++BGLRenderer::DirectConnected(direct_buffer_info* info) ++{ ++} ++ ++ ++void ++BGLRenderer::EnableDirectMode(bool enabled) ++{ ++} ++ ++ ++status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } ++status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } ++status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } ++status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } ++status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } +diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp +new file mode 100644 +index 0000000..1712a87 +--- /dev/null ++++ b/src/hgl/GLRendererRoster.cpp +@@ -0,0 +1,224 @@ ++/* ++ * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * Authors: ++ * Philippe Houdoin ++ * Alexander von Gluck IV ++ */ ++ ++ ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include "GLDispatcher.h" ++#include "GLRendererRoster.h" ++ ++#include ++#include ++ ++ ++extern "C" status_t _kern_get_safemode_option(const char* parameter, ++ char* buffer, size_t* _bufferSize); ++ ++ ++GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) ++ : ++ fNextID(0), ++ fView(view), ++ fOptions(options), ++ fSafeMode(false), ++ fABISubDirectory(NULL) ++{ ++ char parameter[32]; ++ size_t parameterLength = sizeof(parameter); ++ ++ if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, ++ parameter, ¶meterLength) == B_OK) { ++ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") ++ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") ++ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) ++ fSafeMode = true; ++ } ++ ++ if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, ++ parameter, ¶meterLength) == B_OK) { ++ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") ++ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") ++ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) ++ fSafeMode = true; ++ } ++ ++ // We might run in compatibility mode on a system with a different ABI. The ++ // renderers matching our ABI can usually be found in respective ++ // subdirectories of the opengl add-ons directories. ++ system_info info; ++ if (get_system_info(&info) == B_OK ++ && (info.abi & B_HAIKU_ABI_MAJOR) ++ != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { ++ switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { ++ case B_HAIKU_ABI_GCC_2: ++ fABISubDirectory = "gcc2"; ++ break; ++ case B_HAIKU_ABI_GCC_4: ++ fABISubDirectory = "gcc4"; ++ break; ++ } ++ } ++ ++ AddDefaultPaths(); ++} ++ ++ ++GLRendererRoster::~GLRendererRoster() ++{ ++ ++} ++ ++ ++BGLRenderer* ++GLRendererRoster::GetRenderer(int32 id) ++{ ++ RendererMap::const_iterator iterator = fRenderers.find(id); ++ if (iterator == fRenderers.end()) ++ return NULL; ++ ++ struct renderer_item item = iterator->second; ++ return item.renderer; ++} ++ ++ ++void ++GLRendererRoster::AddDefaultPaths() ++{ ++ // add user directories first, so that they can override system renderers ++ const directory_which paths[] = { ++ B_USER_NONPACKAGED_ADDONS_DIRECTORY, ++ B_USER_ADDONS_DIRECTORY, ++ B_SYSTEM_ADDONS_DIRECTORY, ++ }; ++ ++ for (uint32 i = fSafeMode ? 4 : 0; ++ i < sizeof(paths) / sizeof(paths[0]); i++) { ++ BPath path; ++ status_t status = find_directory(paths[i], &path, true); ++ if (status == B_OK && path.Append("opengl") == B_OK) ++ AddPath(path.Path()); ++ } ++} ++ ++ ++status_t ++GLRendererRoster::AddPath(const char* path) ++{ ++ BDirectory directory(path); ++ status_t status = directory.InitCheck(); ++ if (status < B_OK) ++ return status; ++ ++ // if a subdirectory for our ABI exists, use that instead ++ if (fABISubDirectory != NULL) { ++ BEntry entry(&directory, fABISubDirectory); ++ if (entry.IsDirectory()) { ++ status = directory.SetTo(&entry); ++ if (status != B_OK) ++ return status; ++ } ++ } ++ ++ node_ref nodeRef; ++ status = directory.GetNodeRef(&nodeRef); ++ if (status < B_OK) ++ return status; ++ ++ int32 count = 0; ++ int32 files = 0; ++ ++ entry_ref ref; ++ BEntry entry; ++ while (directory.GetNextRef(&ref) == B_OK) { ++ entry.SetTo(&ref); ++ if (entry.InitCheck() == B_OK && !entry.IsFile()) ++ continue; ++ ++ if (CreateRenderer(ref) == B_OK) ++ count++; ++ ++ files++; ++ } ++ ++ if (files != 0 && count == 0) ++ return B_BAD_VALUE; ++ ++ return B_OK; ++} ++ ++ ++status_t ++GLRendererRoster::AddRenderer(BGLRenderer* renderer, ++ image_id image, const entry_ref* ref, ino_t node) ++{ ++ renderer_item item; ++ item.renderer = renderer; ++ item.image = image; ++ item.node = node; ++ if (ref != NULL) ++ item.ref = *ref; ++ ++ try { ++ fRenderers[fNextID] = item; ++ } catch (...) { ++ return B_NO_MEMORY; ++ } ++ ++ renderer->fOwningRoster = this; ++ renderer->fID = fNextID++; ++ return B_OK; ++} ++ ++ ++status_t ++GLRendererRoster::CreateRenderer(const entry_ref& ref) ++{ ++ BEntry entry(&ref); ++ node_ref nodeRef; ++ status_t status = entry.GetNodeRef(&nodeRef); ++ if (status < B_OK) ++ return status; ++ ++ BPath path(&ref); ++ image_id image = load_add_on(path.Path()); ++ if (image < B_OK) ++ return image; ++ ++ BGLRenderer* (*instantiate_renderer) ++ (BGLView* view, ulong options, BGLDispatcher* dispatcher); ++ ++ status = get_image_symbol(image, "instantiate_gl_renderer", ++ B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); ++ if (status == B_OK) { ++ BGLRenderer* renderer ++ = instantiate_renderer(fView, fOptions, new BGLDispatcher()); ++ if (!renderer) { ++ unload_add_on(image); ++ return B_UNSUPPORTED; ++ } ++ ++ if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { ++ renderer->Release(); ++ // this will delete the renderer ++ unload_add_on(image); ++ } ++ return B_OK; ++ } ++ unload_add_on(image); ++ ++ return status; ++} +diff --git a/src/hgl/GLRendererRoster.h b/src/hgl/GLRendererRoster.h +new file mode 100644 +index 0000000..5c8da27 +--- /dev/null ++++ b/src/hgl/GLRendererRoster.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * Authors: ++ * Philippe Houdoin ++ */ ++#ifndef _GLRENDERER_ROSTER_H ++#define _GLRENDERER_ROSTER_H ++ ++ ++#include ++ ++#include ++ ++ ++struct renderer_item { ++ BGLRenderer* renderer; ++ entry_ref ref; ++ ino_t node; ++ image_id image; ++}; ++ ++typedef std::map RendererMap; ++ ++ ++class GLRendererRoster { ++ public: ++ GLRendererRoster(BGLView* view, ulong options); ++ virtual ~GLRendererRoster(); ++ ++ BGLRenderer* GetRenderer(int32 id = 0); ++ ++ private: ++ void AddDefaultPaths(); ++ status_t AddPath(const char* path); ++ status_t AddRenderer(BGLRenderer* renderer, ++ image_id image, const entry_ref* ref, ino_t node); ++ status_t CreateRenderer(const entry_ref& ref); ++ ++ RendererMap fRenderers; ++ int32 fNextID; ++ BGLView* fView; ++ ulong fOptions; ++ bool fSafeMode; ++ const char* fABISubDirectory; ++ ++}; ++ ++ ++#endif /* _GLRENDERER_ROSTER_H */ +diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp +new file mode 100644 +index 0000000..9ae5b5c +--- /dev/null ++++ b/src/hgl/GLView.cpp +@@ -0,0 +1,643 @@ ++/* ++ * Copyright 2006-2012, Haiku. All rights reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * Authors: ++ * Jérôme Duval, korli@users.berlios.de ++ * Philippe Houdoin, philippe.houdoin@free.fr ++ * Stefano Ceccherini, burton666@libero.it ++ */ ++ ++#include ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "interface/DirectWindowPrivate.h" ++#include "GLDispatcher.h" ++#include "GLRendererRoster.h" ++ ++ ++struct glview_direct_info { ++ direct_buffer_info* direct_info; ++ bool direct_connected; ++ bool enable_direct_mode; ++ ++ glview_direct_info(); ++ ~glview_direct_info(); ++}; ++ ++ ++BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, ++ ulong options) ++ : ++ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), ++ // | B_FULL_UPDATE_ON_RESIZE) ++ fGc(NULL), ++ fOptions(options), ++ fDitherCount(0), ++ fDrawLock("BGLView draw lock"), ++ fDisplayLock("BGLView display lock"), ++ fClipInfo(NULL), ++ fRenderer(NULL), ++ fRoster(NULL), ++ fDitherMap(NULL) ++{ ++ fRoster = new GLRendererRoster(this, options); ++} ++ ++ ++BGLView::~BGLView() ++{ ++ delete fClipInfo; ++ if (fRenderer) ++ fRenderer->Release(); ++} ++ ++ ++void ++BGLView::LockGL() ++{ ++ // TODO: acquire the OpenGL API lock it on this glview ++ ++ fDisplayLock.Lock(); ++ if (fRenderer) ++ fRenderer->LockGL(); ++} ++ ++ ++void ++BGLView::UnlockGL() ++{ ++ if (fRenderer) ++ fRenderer->UnlockGL(); ++ fDisplayLock.Unlock(); ++ ++ // TODO: release the GL API lock to others glviews ++} ++ ++ ++void ++BGLView::SwapBuffers() ++{ ++ SwapBuffers(false); ++} ++ ++ ++void ++BGLView::SwapBuffers(bool vSync) ++{ ++ if (fRenderer) { ++ _LockDraw(); ++ fRenderer->SwapBuffers(vSync); ++ _UnlockDraw(); ++ } ++} ++ ++ ++BView* ++BGLView::EmbeddedView() ++{ ++ return NULL; ++} ++ ++ ++void* ++BGLView::GetGLProcAddress(const char* procName) ++{ ++ BGLDispatcher* glDispatcher = NULL; ++ ++ if (fRenderer) ++ glDispatcher = fRenderer->GLDispatcher(); ++ ++ if (glDispatcher) ++ return (void*)glDispatcher->AddressOf(procName); ++ ++ return NULL; ++} ++ ++ ++status_t ++BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) ++{ ++ if (!fRenderer) ++ return B_ERROR; ++ ++ if (!dest || !dest->Bounds().IsValid()) ++ return B_BAD_VALUE; ++ ++ return fRenderer->CopyPixelsOut(source, dest); ++} ++ ++ ++status_t ++BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) ++{ ++ if (!fRenderer) ++ return B_ERROR; ++ ++ if (!source || !source->Bounds().IsValid()) ++ return B_BAD_VALUE; ++ ++ return fRenderer->CopyPixelsIn(source, dest); ++} ++ ++ ++/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum ++ without breaking this method signature. ++ Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: ++ unsigned long. ++ */ ++void ++BGLView::ErrorCallback(unsigned long errorCode) ++{ ++ char msg[32]; ++ sprintf(msg, "GL: Error code $%04lx.", errorCode); ++ // TODO: under BeOS R5, it call debugger(msg); ++ fprintf(stderr, "%s\n", msg); ++} ++ ++ ++void ++BGLView::Draw(BRect updateRect) ++{ ++ if (fRenderer) { ++ _LockDraw(); ++ fRenderer->Draw(updateRect); ++ _UnlockDraw(); ++ return; ++ } ++ // TODO: auto-size and center the string ++ MovePenTo(8, 32); ++ DrawString("No OpenGL renderer available!"); ++} ++ ++ ++void ++BGLView::AttachedToWindow() ++{ ++ BView::AttachedToWindow(); ++ ++ fBounds = Bounds(); ++ for (BView* view = this; view != NULL; view = view->Parent()) ++ view->ConvertToParent(&fBounds); ++ ++ fRenderer = fRoster->GetRenderer(); ++ if (fRenderer != NULL) { ++ // Jackburton: The following code was commented because it doesn't look ++ // good in "direct" mode: ++ // when the window is moved, the app_server doesn't paint the view's ++ // background, and the stuff behind the window itself shows up. ++ // Setting the view color to black, instead, looks a bit more elegant. ++#if 0 ++ // Don't paint white window background when resized ++ SetViewColor(B_TRANSPARENT_32_BIT); ++#else ++ SetViewColor(0, 0, 0); ++#endif ++ ++ // Set default OpenGL viewport: ++ LockGL(); ++ glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); ++ UnlockGL(); ++ fRenderer->FrameResized(Bounds().IntegerWidth(), ++ Bounds().IntegerHeight()); ++ ++ if (fClipInfo) { ++ fRenderer->DirectConnected(fClipInfo->direct_info); ++ fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); ++ } ++ ++ return; ++ } ++ ++ fprintf(stderr, "no renderer found! \n"); ++ ++ // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing ++ // context ++ SetFont(be_bold_font); ++ // SetFontSize(16); ++} ++ ++ ++void ++BGLView::AllAttached() ++{ ++ BView::AllAttached(); ++} ++ ++ ++void ++BGLView::DetachedFromWindow() ++{ ++ if (fRenderer) ++ fRenderer->Release(); ++ fRenderer = NULL; ++ ++ BView::DetachedFromWindow(); ++} ++ ++ ++void ++BGLView::AllDetached() ++{ ++ BView::AllDetached(); ++} ++ ++ ++void ++BGLView::FrameResized(float width, float height) ++{ ++ fBounds = Bounds(); ++ for (BView* v = this; v; v = v->Parent()) ++ v->ConvertToParent(&fBounds); ++ ++ if (fRenderer) { ++ LockGL(); ++ _LockDraw(); ++ _CallDirectConnected(); ++ fRenderer->FrameResized(width, height); ++ _UnlockDraw(); ++ UnlockGL(); ++ } ++ ++ BView::FrameResized(width, height); ++} ++ ++ ++status_t ++BGLView::Perform(perform_code d, void* arg) ++{ ++ return BView::Perform(d, arg); ++} ++ ++ ++status_t ++BGLView::Archive(BMessage* data, bool deep) const ++{ ++ return BView::Archive(data, deep); ++} ++ ++ ++void ++BGLView::MessageReceived(BMessage* msg) ++{ ++ BView::MessageReceived(msg); ++} ++ ++ ++void ++BGLView::SetResizingMode(uint32 mode) ++{ ++ BView::SetResizingMode(mode); ++} ++ ++ ++void ++BGLView::GetPreferredSize(float* _width, float* _height) ++{ ++ if (_width) ++ *_width = 0; ++ if (_height) ++ *_height = 0; ++} ++ ++ ++void ++BGLView::Show() ++{ ++ BView::Show(); ++} ++ ++ ++void ++BGLView::Hide() ++{ ++ BView::Hide(); ++} ++ ++ ++BHandler* ++BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, ++ int32 form, const char* property) ++{ ++ return BView::ResolveSpecifier(msg, index, specifier, form, property); ++} ++ ++ ++status_t ++BGLView::GetSupportedSuites(BMessage* data) ++{ ++ return BView::GetSupportedSuites(data); ++} ++ ++ ++void ++BGLView::DirectConnected(direct_buffer_info* info) ++{ ++ if (fClipInfo == NULL) { ++ fClipInfo = new (std::nothrow) glview_direct_info(); ++ if (fClipInfo == NULL) ++ return; ++ } ++ ++ direct_buffer_info* localInfo = fClipInfo->direct_info; ++ ++ switch (info->buffer_state & B_DIRECT_MODE_MASK) { ++ case B_DIRECT_START: ++ fClipInfo->direct_connected = true; ++ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); ++ _UnlockDraw(); ++ break; ++ ++ case B_DIRECT_MODIFY: ++ _LockDraw(); ++ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); ++ _UnlockDraw(); ++ break; ++ ++ case B_DIRECT_STOP: ++ fClipInfo->direct_connected = false; ++ _LockDraw(); ++ break; ++ } ++ ++ if (fRenderer) ++ _CallDirectConnected(); ++} ++ ++ ++void ++BGLView::EnableDirectMode(bool enabled) ++{ ++ if (fRenderer) ++ fRenderer->EnableDirectMode(enabled); ++ if (fClipInfo == NULL) { ++ fClipInfo = new (std::nothrow) glview_direct_info(); ++ if (fClipInfo == NULL) ++ return; ++ } ++ ++ fClipInfo->enable_direct_mode = enabled; ++} ++ ++ ++void ++BGLView::_LockDraw() ++{ ++ if (!fClipInfo || !fClipInfo->enable_direct_mode) ++ return; ++ ++ fDrawLock.Lock(); ++} ++ ++ ++void ++BGLView::_UnlockDraw() ++{ ++ if (!fClipInfo || !fClipInfo->enable_direct_mode) ++ return; ++ ++ fDrawLock.Unlock(); ++} ++ ++ ++void ++BGLView::_CallDirectConnected() ++{ ++ if (!fClipInfo) ++ return; ++ ++ direct_buffer_info* localInfo = fClipInfo->direct_info; ++ direct_buffer_info* info = (direct_buffer_info*)malloc( ++ DIRECT_BUFFER_INFO_AREA_SIZE); ++ if (info == NULL) ++ return; ++ ++ memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); ++ ++ // Collect the rects into a BRegion, then clip to the view's bounds ++ BRegion region; ++ for (uint32 c = 0; c < localInfo->clip_list_count; c++) ++ region.Include(localInfo->clip_list[c]); ++ BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, ++ localInfo->window_bounds.top); ++ info->window_bounds = boundsRegion.RectAtInt(0); ++ // window_bounds are now view bounds ++ region.IntersectWith(&boundsRegion); ++ ++ info->clip_list_count = region.CountRects(); ++ info->clip_bounds = region.FrameInt(); ++ ++ for (uint32 c = 0; c < info->clip_list_count; c++) ++ info->clip_list[c] = region.RectAtInt(c); ++ fRenderer->DirectConnected(info); ++ free(info); ++} ++ ++ ++//---- virtual reserved methods ---------- ++ ++ ++void BGLView::_ReservedGLView1() {} ++void BGLView::_ReservedGLView2() {} ++void BGLView::_ReservedGLView3() {} ++void BGLView::_ReservedGLView4() {} ++void BGLView::_ReservedGLView5() {} ++void BGLView::_ReservedGLView6() {} ++void BGLView::_ReservedGLView7() {} ++void BGLView::_ReservedGLView8() {} ++ ++ ++// #pragma mark - ++ ++ ++// BeOS compatibility: contrary to others BView's contructors, ++// BGLView one wants a non-const name argument. ++BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, ++ ulong options) ++ : ++ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), ++ fGc(NULL), ++ fOptions(options), ++ fDitherCount(0), ++ fDrawLock("BGLView draw lock"), ++ fDisplayLock("BGLView display lock"), ++ fClipInfo(NULL), ++ fRenderer(NULL), ++ fRoster(NULL), ++ fDitherMap(NULL) ++{ ++ fRoster = new GLRendererRoster(this, options); ++} ++ ++ ++#if 0 ++// TODO: implement BGLScreen class... ++ ++ ++BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, ++ status_t* error, bool debug) ++ : ++ BWindowScreen(name, screenMode, error, debug) ++{ ++} ++ ++ ++BGLScreen::~BGLScreen() ++{ ++} ++ ++ ++void ++BGLScreen::LockGL() ++{ ++} ++ ++ ++void ++BGLScreen::UnlockGL() ++{ ++} ++ ++ ++void ++BGLScreen::SwapBuffers() ++{ ++} ++ ++ ++void ++BGLScreen::ErrorCallback(unsigned long errorCode) ++{ ++ // Mesa's GLenum is not ulong but uint! ++ char msg[32]; ++ sprintf(msg, "GL: Error code $%04lx.", errorCode); ++ // debugger(msg); ++ fprintf(stderr, "%s\n", msg); ++ return; ++} ++ ++ ++void ++BGLScreen::ScreenConnected(bool enabled) ++{ ++} ++ ++ ++void ++BGLScreen::FrameResized(float width, float height) ++{ ++ return BWindowScreen::FrameResized(width, height); ++} ++ ++ ++status_t ++BGLScreen::Perform(perform_code d, void* arg) ++{ ++ return BWindowScreen::Perform(d, arg); ++} ++ ++ ++status_t ++BGLScreen::Archive(BMessage* data, bool deep) const ++{ ++ return BWindowScreen::Archive(data, deep); ++} ++ ++ ++void ++BGLScreen::MessageReceived(BMessage* msg) ++{ ++ BWindowScreen::MessageReceived(msg); ++} ++ ++ ++void ++BGLScreen::Show() ++{ ++ BWindowScreen::Show(); ++} ++ ++ ++void ++BGLScreen::Hide() ++{ ++ BWindowScreen::Hide(); ++} ++ ++ ++BHandler* ++BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, ++ int32 form, const char* property) ++{ ++ return BWindowScreen::ResolveSpecifier(msg, index, specifier, ++ form, property); ++} ++ ++ ++status_t ++BGLScreen::GetSupportedSuites(BMessage* data) ++{ ++ return BWindowScreen::GetSupportedSuites(data); ++} ++ ++ ++//---- virtual reserved methods ---------- ++ ++void BGLScreen::_ReservedGLScreen1() {} ++void BGLScreen::_ReservedGLScreen2() {} ++void BGLScreen::_ReservedGLScreen3() {} ++void BGLScreen::_ReservedGLScreen4() {} ++void BGLScreen::_ReservedGLScreen5() {} ++void BGLScreen::_ReservedGLScreen6() {} ++void BGLScreen::_ReservedGLScreen7() {} ++void BGLScreen::_ReservedGLScreen8() {} ++#endif ++ ++ ++const char* color_space_name(color_space space) ++{ ++#define C2N(a) case a: return #a ++ ++ switch (space) { ++ C2N(B_RGB24); ++ C2N(B_RGB32); ++ C2N(B_RGBA32); ++ C2N(B_RGB32_BIG); ++ C2N(B_RGBA32_BIG); ++ C2N(B_GRAY8); ++ C2N(B_GRAY1); ++ C2N(B_RGB16); ++ C2N(B_RGB15); ++ C2N(B_RGBA15); ++ C2N(B_CMAP8); ++ default: ++ return "Unknown!"; ++ }; ++ ++#undef C2N ++}; ++ ++ ++glview_direct_info::glview_direct_info() ++{ ++ // TODO: See direct_window_data() in app_server's ServerWindow.cpp ++ direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); ++ direct_connected = false; ++ enable_direct_mode = false; ++} ++ ++ ++glview_direct_info::~glview_direct_info() ++{ ++ free(direct_info); ++} ++ +diff --git a/src/hgl/SConscript b/src/hgl/SConscript +new file mode 100644 +index 0000000..70db149 +--- /dev/null ++++ b/src/hgl/SConscript +@@ -0,0 +1,36 @@ ++####################################################################### ++# SConscript for Haiku OpenGL kit ++ ++Import('*') ++ ++env = env.Clone() ++ ++env.Append(CPPPATH = [ ++ '#/src/mapi', ++ '#/src/mesa', ++ '#/src/mesa/main', ++ '#/include/HaikuGL', ++ '/boot/system/develop/headers/private', ++ Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers ++]) ++ ++env.Prepend(LIBS = [ ++ glapi ++]) ++ ++sources = [ ++ 'GLView.cpp', ++ 'GLRenderer.cpp', ++ 'GLRendererRoster.cpp', ++ 'GLDispatcher.cpp', ++] ++ ++# libGL.so ++libgl = env.SharedLibrary( ++ target ='GL', ++ source = sources, ++ SHLIBSUFFIX = env['SHLIBSUFFIX'], ++) ++ ++env.Alias('libgl-haiku', libgl) ++Export('libgl') +diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript +index ca0423e..aef7300 100644 +--- a/src/mesa/drivers/haiku/swrast/SConscript ++++ b/src/mesa/drivers/haiku/swrast/SConscript +@@ -16,6 +16,8 @@ env.Prepend(LIBS = [ + mesa, + ]) + ++env.Prepend(LIBS = [libgl]) ++ + sources = [ + 'SoftwareRast.cpp' + ] +-- +1.8.3.4 + +From fc7707b49c064f17ed345cf70e89e8dfa8a6738d Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Tue, 21 Jan 2014 18:40:22 +0000 +Subject: [PATCH] hgl: atomic stores no longer need to be volatile + +* Our atomics were revamped to no longer require + volatile int pointers +--- + include/HaikuGL/GLRenderer.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/HaikuGL/GLRenderer.h b/include/HaikuGL/GLRenderer.h +index 7ffcc34..02a438d 100644 +--- a/include/HaikuGL/GLRenderer.h ++++ b/include/HaikuGL/GLRenderer.h +@@ -61,7 +61,7 @@ private: + virtual status_t _Reserved_Renderer_3(int32, void *); + virtual status_t _Reserved_Renderer_4(int32, void *); + +- volatile int32 fRefCount; // How much we're still usefull? ++ int32 fRefCount; // How much we're still usefull? + BGLView* fView; // Never forget who is the boss! + ulong fOptions; // Keep that tune in memory + BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher +-- +1.8.3.4 +