Celestia: fix build

This commit is contained in:
Gerasim Troeglazov
2018-09-16 14:20:32 +10:00
parent 683099f64a
commit 123a7005c0
4 changed files with 449 additions and 137 deletions

View File

@@ -0,0 +1,105 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "Celestia",
long_info = "@LONG_INFO@"
};
resource app_signature "@APP_SIGNATURE@";
resource vector_icon {
$"6E6369660703FFD04203FF930003FF740003FFEDB903D55A0005000400841502"
$"1ABFB9C444C5BBC444BDFCC444BACEC3F0BC53C426BAE9C495BB44C5D0BB11C5"
$"35B82CC56EB416C3ADB59EC4A9B416C3ACB37EC33DB388C345B3E4C49FB554C7"
$"0FB484C5E9B5F7C757B77FC7D1B6B1C798B7C7C7E5B8D9C81BB8DBC820B8D2C8"
$"0CB916C68C2D5131C691BC09C7A43553BBBCC70FBB44C5D1BB79C673BCA8C5FD"
$"BFB9C6153CC615C126C615C3D0C5DCC286C601C3D0C5DCC579C5A1C579C5A1C8"
$"67C523CBF3C33CCABAC449CB8DC49FCA1DC70FCAEDC5E9C7B4C820BFB9C8CFC3"
$"F2C8E0BE72C8CABC07C7A3BD33C835BC95C8B9BE1ECA97BD4AC9B7BE1FCA97BE"
$"20CA97BE1FCA97BE20CA97BE21CA98BE21CA98BEA7CA9EBFB9CAA1BF2FCAA1C2"
$"AACAA1C792C9BBC561CA4BC617CAE5C271CC27C459CBBDC8295CCC72BFB9CC72"
$"C5D0CC7241CC62C0FBCC6CC091CACCC2E1020CCAD6B987CAC1B962C87FBACBBF"
$"B9BBA2C465BBA2BE8DBBA2BC56BB7BBD6ABB94BBCABC6CBB12BE85BB5CBD72BB"
$"12BE85BB13BE85BB13BE85BB13BE85BB13BE85BB13BE85BB84BE94BC6FBEACBB"
$"F8BEA1BC6FBEACBC6FBEABBC6FBEABBEDABED5C1EEC020C06FBFDCC254C032C2"
$"64BF6CC29FBFC2C264BF6CC1EFBEC0C1EFBEC0C674BE7CCBE5BC02CA2FBD6ECC"
$"1CBCB90204C05CBEE0C0B6BEE0C002BEE0BFB9BE73BFB9BEAFBFB9BE37C05CBE"
$"06C002BE06C0B6BE06C0FEBE73C0FEBE37C0FEBEAF0216B7DFC9BB2B58B7DFC9"
$"BBB7DFC9BBB7DFC9BBB7DFC9BBB7DFC9BBB7DFC9BBB7F9C9C2B88FC9E5B88FC9"
$"E5BA33CA43BE1ECA97BC16CA81BD4AC9B7BC07C7A3BC95C8B9BBCDC787BB5DC7"
$"51BB92C77130502F50B90C502E50B8D9C81B2D51B8DBC820B8DDC825B8DDC823"
$"B8DEC825B8DEC826B8DEC826B8B2C81DB77FC7D1B7C7C7E4B6B1C798B554C70F"
$"B5F7C757B485C5E9B37EC33DB3E4C49FB37EC33DB416C3ADB416C3ACB59EC4A9"
$"BB44C5D0B82DC56EBB11C535BACEC3F0BAE9C495B78BC37CB370C15D2346B36E"
$"C15CB36BC159B36CC15AB360C14FB310C0FBB318C105B310C0FBB310C0FBB310"
$"C0FBB305C09120BFB9204120C5D10203BB0EC7C8BA69C766BB92C815BBE8C90D"
$"BBEEC871BBE1C9A9B95CC7C8B970C86AB948C7250208C4E7B55BC52CB551C1F5"
$"B5EFBD8AB9C0BF60B786BD8AB9C0BD8AB9C0BD8AB9C0BD8AB9C0BD8AB9C0BD8A"
$"B9C0BE40B9CBBFB9B9D0BEFAB9D0C0A4B9D0C474B983C474B983C69DB93AC9F0"
$"B823C87FB8BF582BC6A9B50E5528C69DB50502082D30B6E7B8F33031BD8AB9C0"
$"3331BF60B786C4E7B55BC1F5B5EFC350B598BFB9B5B9C190B5B9BD2FB5B93025"
$"BB62B56B30252F253025B8BA25B7C5B5CBB7CEB5C4B734B640B582B824B58FB8"
$"13B593B82B020CCAD6B987C87FBACBCAC1B962C9F0B823C9F1B825C9F0B823C9"
$"F0B823C9F0B823C87FB8BFC474B983C69DB93AC474B983C2E7B9AEC2E7B9AEC2"
$"BDB9B2C269B9B8C293B9B5C18BB9C8BFB9B9D0C0A4B9D0BEFAB9D0BD8AB9C0BE"
$"40B9CBBD18BA4BBC56BB7BBCB1BADFBC53BB7BBC4DBB7ABC50BB7ABC50BB7ABC"
$"56BB7BBC53BB7BBD6ABB94BFB9BBA2BE8DBBA2C465BBA20207BCADB35EBDC3B3"
$"033522B8CFB50C3223BAD1B57ABFB9B5B9BD2FB5B9C190B5B9C4E7B55BC350B5"
$"98C52CB551C5B4B53AC571B546C606B52CC6A4B50CC656B51CC665B4E34921C4"
$"8EB3B44520020FC1EFBEC0C674BE7CC1EFBEC0C264BF6CC264BF6CC29FBFC2C1"
$"EEC020C254C032C06FBFDCBC6FBEABBEDABED5BC6FBEABBC6FBEACBC6FBEACBB"
$"F8BEA1BB13BE86BB84BE94BAD1BF7ABAA3C182BAAAC07ABAA3C182BAA4C182BA"
$"A4C182BAA4C182BAA4C182BAA4C182BC37C1B8BFB9C1D6BDEEC1D6C54FC1D6CC"
$"6CBF17CA22C0B7CC6FBF4DCC70BF56CC71BF5ECC70BF45CC6DBF08CC6EBF11CC"
$"6CBEF2CC5BBE3ACC5CBE43CC44BD77CBE5BC02CC1CBCB9CA2FBD6E0205B38DBC"
$"022234B4F1BD2ABB12BE85B7ABBE14BB5DBD72BC4DBB7ABC50BB7B2D33B49CB9"
$"882D34B49CB988B49CB987B49CB9872234020ABFB9C1D6C54FC1D6BDEEC1D6BA"
$"A4C182BC37C1B8BAA3C19FBAA2C1D8BAA2C1BBBAA2C28EBACFC3F0BAB2C341B7"
$"8CC37CB392C17AB4EEC298B4EEC298BACEC3F0B78BC37CBC53C426BFB9C444BD"
$"FCC444C5BBC444CC62C0FBCACCC2E1CC6CC091CC72BFB9CC7241CC72BF82CC6C"
$"BF17CC6FBF4DCA22C0B7020ACA1DC70FC7B4C81FCAEDC5E9CBF3C33CCB8DC49F"
$"CABAC449C579C5A1C867C523C579C5A1C3D0C5DCC3D0C5DCC286C601BFB9C615"
$"C126C6153CC615BB44C5D1BCA8C5FDBB79C673BC09C7A4BBBCC70FBBCFC788BB"
$"5DC751BB95C76CBB95C76CBC07C7A3BBCDC787BD33C835BFB9C8CFBE72C8CAC3"
$"F2C8E00204C792C9BB4E5EC561CA4BBFB9CAA1C2AACAA1BF2FCAA1BE21CA98BE"
$"A7CA9EBEC7CB47C021CC70C018CC7049600206BAA3C182B74DC110BAAAC07ABB"
$"13BE85BAD1BF7ABB13BE85BB13BE85BB13BE85BB13BE85BB12BE85BB12BE85B7"
$"ABBE14B38DBC02B4F1BD2A203BB306BF17B303BF4DB493C0310208B310C0FBB3"
$"0FC0FAB310C0FBB310C0FBB310C0FBB318C105B392C17AB390C179B4EEC298BA"
$"CFC3F0B78CC37CBAB2C341BAA4C1823346BAA4C182BAA4C182BAA4C182BAA4C1"
$"82BAA3C182BAA3C182B74DC110B306BF17B493C031B303BF4D0208BD8AB9C0BD"
$"18BA4BBD8AB9C0BD8AB9C0BD8AB9C0BD8AB9C0BD8AB9C0BD8AB9C0BBD4B9A7B8"
$"CDB923B8CEB923B8BAB91FB581B824B593B82BB581B824B581B824B581B82425"
$"2F243124B9C52431BC4DBB7A2C34BC50BB7A020CC04ACC6CC019CC6EBF80CBE5"
$"BE21CA98BEC7CB47BE21CA98BE20CA97BE20CA97BE1FCA97BE1ECA97BE1FCA97"
$"BC16CA81B88FC9E5345BB873C9DFB7DFC9BBB7F9C9C2B7DFC9BBB7DFC9BBB7DF"
$"C9BBB7DFC9BBB7DFC9BBB7DFC9BBB7F6C9CDB8D1CA68B8CFCA67B95ACAC0BA8D"
$"CB59BA88CB57BADBCB7BBD76CC3EBBC8CBF33E60BEBACC67BEABCC66BF0ECC6E"
$"0203BBE8C90DBBE1C9A9BBEEC871BB0EC7C8BB92C815BA69C766B95CC7C8B948"
$"C725B970C86A0204C05CBE06C000BE06C0B7BE06C0FEBE73C0FEBE36C0FEBEB0"
$"C05CBEE0C0B7BEE0C000BEE0BFB9BE73BFB9BEB0BFB9BE3602044030C34530BC"
$"3A30304030BC3A30C3454050BC3A50C34550504050C34550BC3A140A06011402"
$"4120000000000000003E6000C700004A38000A0501140241E000000000000000"
$"41DFFFC9BFFFC9BFFF0A000100023F7FBB0000000000003F7F2E440000440488"
$"0A00020102023F7FBB0000000000003F7F2E4400004404880A01020304023F7F"
$"BB0000000000003F7F2E4400004404880A010105023F7FBB0000000000003F7F"
$"2E4400004404880A020106023F7FBB0000000000003F7F2E4400004404880A03"
$"0107023F7FBB0000000000003F7F2E4400004404880A040108023F7FBB000000"
$"0000003F7F2E4400004404880A010109023F7FBB0000000000003F7F2E440000"
$"4404880A01010A023F7FBB0000000000003F7F2E4400004404880A02010B023F"
$"7FBB0000000000003F7F2E4400004404880A03010C023F7FBB0000000000003F"
$"7F2E4400004404880A02010D023F7FBB0000000000003F7F2E4400004404880A"
$"02010E023F7FBB0000000000003F7F2E4400004404880A04010F023F7FBB0000"
$"000000003F7F2E4400004404880A000110023F7FBB0000000000003F7F2E4400"
$"004404880A040111023F7FBB0000000000003F7F2E4400004404880A00011202"
$"3F7FBB0000000000003F7F2E4400004404880A010113023F7FBB000000000000"
$"3F7F2E440000440488"
};

View File

@@ -12,14 +12,16 @@ Celestia is expandable. Celestia comes with a large catalog of stars, galaxies,
planets, moons, asteroids, comets, and spacecraft. If that's not enough, you \
can download dozens of easy to install add-ons with more objects."
HOMEPAGE="http://celestia.sourceforge.net"
COPYRIGHT="2001-2011 Celestia Development Team"
COPYRIGHT="2001-2018 Celestia Development Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://fossies.org/linux/misc/celestia-1.6.1.tar.gz"
REVISION="2"
SOURCE_URI="http://fossies.org/linux/misc/celestia-$portVersion.tar.gz"
CHECKSUM_SHA256="d35570ccb9440fc0bd3e73eb9b4c3e8a4c25f3ae444a13d1175053fa16dc34c4"
SOURCE_DIR="celestia-$portVersion"
PATCHES="celestia-$portVersion.patchset"
ADDITIONAL_FILES="celestia.rdef.in"
ARCHITECTURES="!x86_gcc2 x86 ?x86_64"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
@@ -27,42 +29,85 @@ PROVIDES="
app:celestia$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lua$secondaryArchSuffix
haiku$secondaryArchSuffix
lib:libgl$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libglut$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:liblua$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
lua${secondaryArchSuffix}_devel
haiku${secondaryArchSuffix}_devel
devel:libgl$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libglut$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:liblua5.1$secondaryArchSuffix
devel:libpng$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autoreconf
cmd:gcc$secondaryArchSuffix
cmd:gettext
cmd:libtoolize
cmd:gettext
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
libtoolize -fci
runConfigure ./configure --with-glut
{
local
for cf in -O2 -ffast-math \
-fexpensive-optimizations \
-fomit-frame-pointer; do
sed -i \
-e "s/${cf}//g" \
configure.in admin/* || die "sed failed"
done
autoreconf -fi
export LIBS="-lbe -lnetwork -lglut -lGL -lintl"
./configure \
--prefix=$appsDir \
--datarootdir=$dataDir \
--datadir=$dataDir \
--disable-rpath \
--with-glut \
--disable-nls \
--with-lua
make $jobArgs
}
INSTALL()
{
make install
mv $appsDir/bin/celestia $appsDir/Celestia
rm -rf $appsDir/bin
local APP_SIGNATURE="application/x-vnd.celestia"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/celestia.rdef.in > celestia.rdef
addResourcesToBinaries celestia.rdef $appsDir/Celestia
mimeset -f $appsDir/Celestia
addAppDeskbarSymlink $appsDir/Celestia
}

View File

@@ -1,121 +0,0 @@
diff -Naur celestia-1.6.0/configure.in celestia-1.6.0-haiku/configure.in
--- celestia-1.6.0/configure.in 2009-06-22 15:52:39.019660800 +0000
+++ celestia-1.6.0-haiku/configure.in 2010-08-12 23:41:43.749469696 +0000
@@ -193,7 +193,7 @@
AM_CONDITIONAL(ENABLE_SPICE, test "$SPICELIB" != "")
-LIBS="$LIBS -lm"
+LIBS="$LIBS -lintl"
dnl Use Gtk if requested
GTK_LIBS=""
@@ -237,7 +237,7 @@
CFLAGS="$CFLAGS $CELESTIAFLAGS $CELESTIA_CFLAGS"
CXXFLAGS="$CXXFLAGS $CELESTIAFLAGS $CELESTIA_CXXFLAGS"
LIBS="$LIBS $CELESTIALIBS"
-LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lXmu -lXi -lXext -lX11 -lm -lz $X_EXTRA_LIBS"
+LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lz $X_EXTRA_LIBS"
dnl Check for zlib -- libGL requires it.
AC_CHECK_LIB(z, deflate, ,
diff -Naur celestia-1.6.0/data/Makefile.am celestia-1.6.0-haiku/data/Makefile.am
--- celestia-1.6.0/data/Makefile.am 2009-06-22 15:48:06.024903680 +0000
+++ celestia-1.6.0-haiku/data/Makefile.am 2010-08-12 23:56:00.052428800 +0000
@@ -15,8 +15,7 @@
$(wildcard *.xyz) \
$(wildcard *.xyzv) \
$(wildcard *.dsc) \
- $(wildcard *.stc) \
- stars.dat
+ $(wildcard *.stc)
EXTRA_DIST = \
$(pkgdata_DATA) \
diff -Naur celestia-1.6.0/src/celengine/astro.cpp celestia-1.6.0-haiku/src/celengine/astro.cpp
--- celestia-1.6.0/src/celengine/astro.cpp 2009-06-22 15:44:08.046137344 +0000
+++ celestia-1.6.0-haiku/src/celengine/astro.cpp 2010-08-12 19:00:33.000000000 +0000
@@ -522,7 +522,7 @@
cal_time.tm_sec = (int)seconds;
cal_time.tm_wday = wday;
cal_time.tm_gmtoff = utc_offset;
-#if defined(TARGET_OS_MAC) || defined(__FreeBSD__)
+#if defined(TARGET_OS_MAC) || defined(__FreeBSD__) || defined(__HAIKU__)
// tm_zone is a non-const string field on the Mac and FreeBSD (why?)
cal_time.tm_zone = const_cast<char*>(tzname.c_str());
#else
diff -Naur celestia-1.6.0/src/celengine/glext.cpp celestia-1.6.0-haiku/src/celengine/glext.cpp
--- celestia-1.6.0/src/celengine/glext.cpp 2009-06-22 15:44:08.049020928 +0000
+++ celestia-1.6.0-haiku/src/celengine/glext.cpp 2010-08-12 19:07:19.000000000 +0000
@@ -12,10 +12,10 @@
#ifndef _WIN32
// Assume that this is a UNIX/X11 system if it's not Windows or Mac OS X.
-#ifndef TARGET_OS_MAC
+#if !defined(TARGET_OS_MAC) && !defined(__HAIKU__)
#include "GL/glx.h"
#include <dlfcn.h>
-#endif /* ! TARGET_OS_MAC */
+#endif /* ! TARGET_OS_MAC || HAIKU */
#endif /* ! _WIN32 */
#include "glext.h"
@@ -306,7 +306,7 @@
#else
-#ifndef TARGET_OS_MAC
+#if !defined(TARGET_OS_MAC) && !defined(__HAIKU__)
#if defined(_WIN32)
#define GET_GL_PROC_ADDRESS(name) wglGetProcAddress(name)
@@ -692,9 +692,11 @@
static void InitExt_GLX_SGI_video_sync()
{
+#if defined(GET_GL_PROC_ADDRESS)
glx::glXGetVideoSyncSGI = (glx::PFNGLXGETVIDEOSYNCSGIPROC) GET_GL_PROC_ADDRESS("glXGetVideoSyncSGI");
glx::glXWaitVideoSyncSGI = (glx::PFNGLXWAITVIDEOSYNCSGIPROC) GET_GL_PROC_ADDRESS("glXWaitVideoSyncSGI");
glx::glXGetRefreshRateSGI = (glx::PFNGLXGETREFRESHRATESGIPROC) GET_GL_PROC_ADDRESS("glXGetRefreshRateSGI");
+#endif
}
diff -Naur celestia-1.6.0/src/celengine/image.cpp celestia-1.6.0-haiku/src/celengine/image.cpp
--- celestia-1.6.0/src/celengine/image.cpp 2009-06-22 15:44:08.049545216 +0000
+++ celestia-1.6.0-haiku/src/celengine/image.cpp 2010-08-12 19:09:42.000000000 +0000
@@ -737,7 +737,7 @@
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
{
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
diff -Naur celestia-1.6.0/src/celutil/unixdirectory.cpp celestia-1.6.0-haiku/src/celutil/unixdirectory.cpp
--- celestia-1.6.0/src/celutil/unixdirectory.cpp 2009-06-22 15:44:24.030408704 +0000
+++ celestia-1.6.0-haiku/src/celutil/unixdirectory.cpp 2010-08-12 18:58:58.000000000 +0000
@@ -11,19 +11,19 @@
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
+#if !defined(__HAIKU__)
#include <wordexp.h>
+#endif
#include "directory.h"
using namespace std;
-#ifdef TARGET_OS_MAC
-#ifdef QT_CORE_LIB
+#if defined(__HAIKU__) || defined(TARGET_OS_MAC) && defined(QT_CORE_LIB)
// Crash on Mac OS X / Qt4 version when calling wordfree.
// This seems to happen only with Leopard.
#define WORDEXP_PROBLEM
#endif
-#endif
class UnixDirectory : public Directory
{

View File

@@ -0,0 +1,283 @@
From 920f812d2f38ff96c703dd24ea6779e9766e67d9 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 15 Sep 2018 22:09:15 +1000
Subject: Fix build for haiku
diff --git a/src/celengine/astro.cpp b/src/celengine/astro.cpp
index 989dead..bc2b52f 100644
--- a/src/celengine/astro.cpp
+++ b/src/celengine/astro.cpp
@@ -522,7 +522,7 @@ const char* astro::Date::toCStr(Format format) const
cal_time.tm_sec = (int)seconds;
cal_time.tm_wday = wday;
cal_time.tm_gmtoff = utc_offset;
-#if defined(TARGET_OS_MAC) || defined(__FreeBSD__)
+#if defined(TARGET_OS_MAC) || defined(__FreeBSD__) || defined(__HAIKU__)
// tm_zone is a non-const string field on the Mac and FreeBSD (why?)
cal_time.tm_zone = const_cast<char*>(tzname.c_str());
#else
diff --git a/src/celengine/glext.cpp b/src/celengine/glext.cpp
index 0f04423..5326029 100644
--- a/src/celengine/glext.cpp
+++ b/src/celengine/glext.cpp
@@ -12,10 +12,10 @@
#ifndef _WIN32
// Assume that this is a UNIX/X11 system if it's not Windows or Mac OS X.
-#ifndef TARGET_OS_MAC
+#if !defined(TARGET_OS_MAC) && !defined(__HAIKU__)
#include "GL/glx.h"
#include <dlfcn.h>
-#endif /* ! TARGET_OS_MAC */
+#endif /* ! TARGET_OS_MAC || HAIKU */
#endif /* ! _WIN32 */
#include "glext.h"
@@ -306,7 +306,7 @@ extern QGLContext* glctx;
#else
-#ifndef TARGET_OS_MAC
+#if !defined(TARGET_OS_MAC) && !defined(__HAIKU__)
#if defined(_WIN32)
#define GET_GL_PROC_ADDRESS(name) wglGetProcAddress(name)
@@ -692,9 +692,11 @@ static void InitExt_EXT_swap_control()
static void InitExt_GLX_SGI_video_sync()
{
+#if defined(GET_GL_PROC_ADDRESS)
glx::glXGetVideoSyncSGI = (glx::PFNGLXGETVIDEOSYNCSGIPROC) GET_GL_PROC_ADDRESS("glXGetVideoSyncSGI");
glx::glXWaitVideoSyncSGI = (glx::PFNGLXWAITVIDEOSYNCSGIPROC) GET_GL_PROC_ADDRESS("glXWaitVideoSyncSGI");
glx::glXGetRefreshRateSGI = (glx::PFNGLXGETREFRESHRATESGIPROC) GET_GL_PROC_ADDRESS("glXGetRefreshRateSGI");
+#endif
}
diff --git a/src/celutil/unixdirectory.cpp b/src/celutil/unixdirectory.cpp
index 9a1b054..dda19e0 100644
--- a/src/celutil/unixdirectory.cpp
+++ b/src/celutil/unixdirectory.cpp
@@ -11,19 +11,19 @@
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
+#if !defined(__HAIKU__)
#include <wordexp.h>
+#endif
#include "directory.h"
using namespace std;
-#ifdef TARGET_OS_MAC
-#ifdef QT_CORE_LIB
+#if defined(__HAIKU__) || defined(TARGET_OS_MAC) && defined(QT_CORE_LIB)
// Crash on Mac OS X / Qt4 version when calling wordfree.
// This seems to happen only with Leopard.
#define WORDEXP_PROBLEM
#endif
-#endif
class UnixDirectory : public Directory
{
--
2.19.0
From de882a7f5ff40f9367dc7c8b8f5bfb06c4b9623e Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 15 Sep 2018 22:31:57 +1000
Subject: Add missing headers
diff --git a/src/celengine/image.cpp b/src/celengine/image.cpp
index a36b9c1..3f94565 100644
--- a/src/celengine/image.cpp
+++ b/src/celengine/image.cpp
@@ -67,6 +67,10 @@ extern "C" {
#include <algorithm>
#include <cmath>
+#ifdef __HAIKU__
+#include <string.h>
+#endif
+
using namespace std;
diff --git a/src/celengine/texture.cpp b/src/celengine/texture.cpp
index 0775204..5500143 100644
--- a/src/celengine/texture.cpp
+++ b/src/celengine/texture.cpp
@@ -29,6 +29,10 @@
#include <cstdio>
#include <cassert>
+#ifdef __HAIKU__
+#include <string.h>
+#endif
+
#ifndef _WIN32
#ifndef TARGET_OS_MAC
#include <config.h>
--
2.19.0
From 7efacb288eb0d6d6f26c8225b4f66f9150be1f1c Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 15 Sep 2018 22:55:24 +1000
Subject: Add missing header
diff --git a/src/celmath/intersect.h b/src/celmath/intersect.h
index 38fb01f..44791ff 100644
--- a/src/celmath/intersect.h
+++ b/src/celmath/intersect.h
@@ -15,7 +15,7 @@
#include "ray.h"
#include "sphere.h"
#include "ellipsoid.h"
-
+#include "mathlib.h"
template<class T> bool testIntersection(const Ray3<T>& ray,
const Sphere<T>& sphere,
--
2.19.0
From ef4cc25bf26d4584a599f5c69cde50673c61e8aa Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 15 Sep 2018 23:47:31 +1000
Subject: Fix for png16
diff --git a/src/celestia/imagecapture.cpp b/src/celestia/imagecapture.cpp
index 92602da..c2c2520 100644
--- a/src/celestia/imagecapture.cpp
+++ b/src/celestia/imagecapture.cpp
@@ -181,7 +181,7 @@ bool CaptureGLBufferToPNG(const string& filename,
// png_init_io(png_ptr, out);
png_set_write_fn(png_ptr, (void*) out, PNGWriteData, NULL);
- png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
+ png_set_compression_level(png_ptr, PNG_Z_DEFAULT_COMPRESSION);
png_set_IHDR(png_ptr, info_ptr,
width, height,
8,
--
2.19.0
From ff3d1c6e61a926febd23a3ca1966d3d2242a491f Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 16 Sep 2018 13:12:37 +1000
Subject: Disable GLSL shaders. Add window size and position for Haiku.
diff --git a/src/celestia/glutmain.cpp b/src/celestia/glutmain.cpp
index 4b14167..9c1ed7f 100644
--- a/src/celestia/glutmain.cpp
+++ b/src/celestia/glutmain.cpp
@@ -24,6 +24,9 @@
#include <Carbon/Carbon.h>
#include <GLUT/glut.h>
#endif
+#ifdef __HAIKU__
+#include <Screen.h>
+#endif
#include <celengine/celestia.h>
#include <celmath/vecmath.h>
#include <celmath/quaternion.h>
@@ -432,12 +435,13 @@ static void dirFixup(char *argv0) {
int main(int argc, char* argv[])
{
+#ifndef __HAIKU__
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
bindtextdomain(PACKAGE, LOCALEDIR);
bind_textdomain_codeset(PACKAGE, "UTF-8");
textdomain(PACKAGE);
-
+#endif
#ifdef MACOSX
#define BUNDLEONLY 1
#ifndef BUNDLEONLY
@@ -495,12 +499,27 @@ int main(int argc, char* argv[])
}
glutInit(&argc, argv);
+#ifdef __HAIKU__
+ BScreen screen(B_MAIN_SCREEN_ID);
+ int screenWidth = screen.Frame().Width();
+ int screenHeight = screen.Frame().Height();
+ int winWidth = screenWidth >= 1024 ? 800 : 640;
+ int winHeight = screenHeight >= 768 ? 600 : 480;
+ int winPosX = (screenWidth - winWidth ) / 2;
+ int winPosY = (screenHeight - winHeight ) / 2;
+ glutInitWindowSize(winWidth, winHeight);
+ glutInitWindowPosition(winPosX, winPosY);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ mainWindow = glutCreateWindow("Celestia");
+ Resize(winWidth, winHeight);
+#else
glutInitWindowSize(480, 360);
glutInitWindowPosition(0, 0);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
mainWindow = glutCreateWindow("Celestia");
Resize(480, 360);
+#endif
glutReshapeFunc(Resize);
glutDisplayFunc(Display);
glutIdleFunc(Idle);
@@ -517,7 +536,9 @@ int main(int argc, char* argv[])
// GL should be all set up, now initialize the renderer.
appCore->initRenderer();
-
+#ifdef __HAIKU__
+ appCore->getRenderer()->getGLContext()->setRenderPath(GLContext::GLPath_Basic);
+#endif
// Set the simulation starting time to the current system time
time_t curtime=time(NULL);
appCore->start((double) curtime / 86400.0 + (double) astro::Date(1970, 1, 1));
--
2.19.0
From 5977aaeb2572e274b0295cfe65546ecf430cf0ba Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 16 Sep 2018 13:34:04 +1000
Subject: Use system type defs
diff --git a/src/celutil/basictypes.h b/src/celutil/basictypes.h
index 560b39b..e2200c6 100644
--- a/src/celutil/basictypes.h
+++ b/src/celutil/basictypes.h
@@ -13,13 +13,16 @@
typedef unsigned int uint;
// Fixed size types
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#else
typedef int int32;
typedef unsigned int uint32;
typedef short int16;
typedef unsigned short uint16;
typedef char int8;
typedef unsigned char uint8;
-
+#endif
#ifdef _MSC_VER
// MS Visual C++ does not include stdint.h
typedef __int64 int64;
--
2.19.0