diff --git a/sci-astronomy/celestia/celestia-1.6.1.recipe b/sci-astronomy/celestia/celestia-1.6.2.1.recipe similarity index 81% rename from sci-astronomy/celestia/celestia-1.6.1.recipe rename to sci-astronomy/celestia/celestia-1.6.2.1.recipe index 96e4204d2..7e96c29a2 100644 --- a/sci-astronomy/celestia/celestia-1.6.1.recipe +++ b/sci-astronomy/celestia/celestia-1.6.2.1.recipe @@ -12,18 +12,23 @@ 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-2018 Celestia Development Team" +COPYRIGHT="2001-2020 Celestia Development Team" LICENSE="GNU GPL v2" -REVISION="5" -SOURCE_URI="http://fossies.org/linux/misc/celestia-$portVersion.tar.gz" -CHECKSUM_SHA256="d35570ccb9440fc0bd3e73eb9b4c3e8a4c25f3ae444a13d1175053fa16dc34c4" -SOURCE_DIR="celestia-$portVersion" +REVISION="1" +SOURCE_URI="https://fossies.org/linux/misc/Celestia-$portVersion.tar.gz" +CHECKSUM_SHA256="be146fa9d6f4c38c686cc1728677d73e4457d85dbf051e485f24537c3e4d452d" +SOURCE_DIR="Celestia-$portVersion" PATCHES="celestia-$portVersion.patchset" ADDITIONAL_FILES="celestia.rdef.in" ARCHITECTURES="!x86_gcc2 x86 x86_64" SECONDARY_ARCHITECTURES="x86" +GLOBAL_WRITABLE_FILES=" + settings/Celestia/scripts directory auto-merge + settings/Celestia/celestia.cfg keep-old + " + PROVIDES=" celestia$secondaryArchSuffix = $portVersion app:celestia$secondaryArchSuffix = $portVersion @@ -70,7 +75,7 @@ BUILD() -fomit-frame-pointer; do sed -i \ -e "s/${cf}//g" \ - configure.in admin/* || die "sed failed" + configure.ac admin/* || die "sed failed" done autoreconf -fi @@ -82,7 +87,6 @@ BUILD() --datadir=$dataDir \ --disable-rpath \ --with-glut \ - --disable-nls \ --with-lua make $jobArgs @@ -90,10 +94,15 @@ BUILD() INSTALL() { - mkdir -p $appsDir + mkdir -p $appsDir $settingsDir/Celestia make install mv $binDir/celestia $appsDir/Celestia rm -rf $binDir + + mv $dataDir/celestia/scripts $settingsDir/Celestia + ln -s $settingsDir/Celestia/scripts $dataDir/celestia/scripts + mv $dataDir/celestia/celestia.cfg $settingsDir/Celestia + ln -s $settingsDir/Celestia/celestia.cfg $dataDir/celestia/celestia.cfg local APP_SIGNATURE="application/x-vnd.celestia" local MAJOR="`echo "$portVersion" | cut -d. -f1`" diff --git a/sci-astronomy/celestia/patches/celestia-1.6.1.patchset b/sci-astronomy/celestia/patches/celestia-1.6.2.1.patchset similarity index 74% rename from sci-astronomy/celestia/patches/celestia-1.6.1.patchset rename to sci-astronomy/celestia/patches/celestia-1.6.2.1.patchset index ccba22ace..520703fd1 100644 --- a/sci-astronomy/celestia/patches/celestia-1.6.1.patchset +++ b/sci-astronomy/celestia/patches/celestia-1.6.2.1.patchset @@ -1,14 +1,14 @@ -From 1cb3637fae9bca7ba8662e5854c0b2aed82aad5b Mon Sep 17 00:00:00 2001 +From 97a1a74bd98ea803db7a89fb5e64ccdae30139b0 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sat, 15 Sep 2018 22:09:15 +1000 +Date: Wed, 30 Dec 2020 15:35:17 +1000 Subject: Fix build for haiku diff --git a/src/celengine/astro.cpp b/src/celengine/astro.cpp -index 989dead..bc2b52f 100644 +index d5ae1f2..b196025 100644 --- a/src/celengine/astro.cpp +++ b/src/celengine/astro.cpp -@@ -522,7 +522,7 @@ const char* astro::Date::toCStr(Format format) const +@@ -525,7 +525,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; @@ -17,277 +17,6 @@ index 989dead..bc2b52f 100644 // tm_zone is a non-const string field on the Mac and FreeBSD (why?) cal_time.tm_zone = const_cast(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 --#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 - #include - #include -+#if !defined(__HAIKU__) - #include -+#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 2efebe98af6ad5a8ee7ffbb79aeb9297a59e8271 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 - #include - -+#ifdef __HAIKU__ -+#include -+#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 - #include - -+#ifdef __HAIKU__ -+#include -+#endif -+ - #ifndef _WIN32 - #ifndef TARGET_OS_MAC - #include --- -2.19.0 - - -From daf6a9be27322ed45c81f709728c2c9b64d8a0db 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 bool testIntersection(const Ray3& ray, - const Sphere& sphere, --- -2.19.0 - - -From 204164c0c62a43ddc21655f3318ad59d778391af 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 1492101fa45a846b28e210bd4dc11afca7d6707d 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 - #include - #endif -+#ifdef __HAIKU__ -+#include -+#endif - #include - #include - #include -@@ -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 64b8b223eb1128f81ca816a82632f50c0b4f73c3 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 -+#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 - - -From b773b49085ab7d8f5e5c9e386062ff07fe58da4f Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sun, 16 Sep 2018 20:00:58 +1000 -Subject: Fix build for x86 arch - - diff --git a/src/celengine/cmdparser.cpp b/src/celengine/cmdparser.cpp index e2daf31..32fe5de 100644 --- a/src/celengine/cmdparser.cpp @@ -334,29 +63,59 @@ index a09fc76..9105474 100644 if (img == NULL) return NULL; -diff --git a/src/celengine/render.cpp b/src/celengine/render.cpp -index 56d0c21..140e7a2 100644 ---- a/src/celengine/render.cpp -+++ b/src/celengine/render.cpp -@@ -1537,7 +1537,7 @@ static void computeOrbitSectionBoundingVolumes(Renderer::CachedOrbit& orbit) +diff --git a/src/celengine/glext.cpp b/src/celengine/glext.cpp +index 4bde792..386c348 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 +-#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) +@@ -672,9 +672,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/celengine/image.cpp b/src/celengine/image.cpp +index 2058c94..51bee03 100644 +--- a/src/celengine/image.cpp ++++ b/src/celengine/image.cpp +@@ -63,6 +63,10 @@ extern "C" { + #include + #include + ++#ifdef __HAIKU__ ++#include ++#endif ++ + using namespace std; - Renderer::OrbitSection section; - section.firstSample = samplesPerSection * i; -- unsigned int lastSample = min((unsigned int) orbit.trajectory.size() - 1, section.firstSample + nSamples + 1); -+ unsigned int lastSample = min((unsigned int) orbit.trajectory.size() - 1, (unsigned int)(section.firstSample + nSamples + 1)); - // Set the initial axis and origin of the capsule bounding volume; they will be adjusted - // to contain all points in the trajectory. The length of the axis may change, but the --- -2.19.0 - - -From b6fcb045a3665123d91855df2cdf8b0037679823 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sun, 16 Sep 2018 20:51:42 +1000 -Subject: Fix crash on mesh render - - diff --git a/src/celengine/mesh.cpp b/src/celengine/mesh.cpp index 38f32bf..2fc1277 100644 --- a/src/celengine/mesh.cpp @@ -378,6 +137,166 @@ index 38f32bf..2fc1277 100644 if (vbObject != 0) { glx::glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbObject); +diff --git a/src/celengine/render.cpp b/src/celengine/render.cpp +index 279de3e..0e6d600 100644 +--- a/src/celengine/render.cpp ++++ b/src/celengine/render.cpp +@@ -1537,7 +1537,7 @@ static void computeOrbitSectionBoundingVolumes(Renderer::CachedOrbit& orbit) + + Renderer::OrbitSection section; + section.firstSample = samplesPerSection * i; +- unsigned int lastSample = min((unsigned int) orbit.trajectory.size() - 1, section.firstSample + nSamples + 1); ++ unsigned int lastSample = min((unsigned int) orbit.trajectory.size() - 1, (unsigned int)(section.firstSample + nSamples + 1)); + + // Set the initial axis and origin of the capsule bounding volume; they will be adjusted + // to contain all points in the trajectory. The length of the axis may change, but the +diff --git a/src/celengine/texture.cpp b/src/celengine/texture.cpp +index 8e4bd67..4a9453c 100644 +--- a/src/celengine/texture.cpp ++++ b/src/celengine/texture.cpp +@@ -29,6 +29,10 @@ + #include /* for memcpy */ + #include + ++#ifdef __HAIKU__ ++#include ++#endif ++ + #ifndef _WIN32 + #ifndef TARGET_OS_MAC + #include +diff --git a/src/celestia/glutmain.cpp b/src/celestia/glutmain.cpp +index c7a8ad3..ffe2261 100644 +--- a/src/celestia/glutmain.cpp ++++ b/src/celestia/glutmain.cpp +@@ -25,6 +25,9 @@ + #include + #include + #endif ++#ifdef __HAIKU__ ++#include ++#endif + #include + #include + #include +@@ -433,12 +436,14 @@ static void dirFixup(char *argv0) { + + int main(int argc, char* argv[]) + { ++#ifndef __HAIKU__ + setlocale(LC_ALL, ""); + setlocale(LC_NUMERIC, "C"); ++#endif + bindtextdomain(PACKAGE, LOCALEDIR); + bind_textdomain_codeset(PACKAGE, "UTF-8"); + textdomain(PACKAGE); +- ++ + #ifdef MACOSX + #define BUNDLEONLY 1 + #ifndef BUNDLEONLY +@@ -496,12 +501,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); +@@ -518,7 +538,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)); +diff --git a/src/celestia/imagecapture.cpp b/src/celestia/imagecapture.cpp +index c094378..65c8887 100644 +--- a/src/celestia/imagecapture.cpp ++++ b/src/celestia/imagecapture.cpp +@@ -182,7 +182,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, +diff --git a/src/celutil/basictypes.h b/src/celutil/basictypes.h +index d64f523..d178af2 100644 +--- a/src/celutil/basictypes.h ++++ b/src/celutil/basictypes.h +@@ -15,6 +15,9 @@ + typedef unsigned int uint; + + // Fixed size types ++#ifdef __HAIKU__ ++#include ++#else + typedef int32_t int32; + typedef uint32_t uint32; + typedef int16_t int16; +@@ -23,6 +26,7 @@ typedef int8_t int8; + typedef uint8_t uint8; + typedef int64_t int64; + typedef uint64_t uint64; ++#endif + + #ifndef INT64_MAX + #define INT64_MAX 9223372036854775807LL +diff --git a/src/celutil/unixdirectory.cpp b/src/celutil/unixdirectory.cpp +index bcbc1e8..71283ff 100644 +--- a/src/celutil/unixdirectory.cpp ++++ b/src/celutil/unixdirectory.cpp +@@ -12,20 +12,20 @@ + #include + #include + #include ++#ifndef __HAIKU__ + #include ++#endif + #include + #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 +2.28.0