SF.net SVN: gar:[26749] csw/mgar/pkg

jake_goerzen at users.sourceforge.net jake_goerzen at users.sourceforge.net
Mon Apr 19 21:25:47 CEST 2021


Revision: 26749
          http://sourceforge.net/p/gar/code/26749
Author:   jake_goerzen
Date:     2021-04-19 19:25:46 +0000 (Mon, 19 Apr 2021)
Log Message:
-----------
celestia: initial commit at version 1.6.1

Added Paths:
-----------
    csw/mgar/pkg/celestia/
    csw/mgar/pkg/celestia/Makefile
    csw/mgar/pkg/celestia/branches/
    csw/mgar/pkg/celestia/tags/
    csw/mgar/pkg/celestia/trunk/
    csw/mgar/pkg/celestia/trunk/Makefile
    csw/mgar/pkg/celestia/trunk/checksums
    csw/mgar/pkg/celestia/trunk/files/
    csw/mgar/pkg/celestia/trunk/files/0001-one-big-patch.patch
    csw/mgar/pkg/celestia/trunk/files/0003-hardcode-zlib-compression.patch

Added: csw/mgar/pkg/celestia/Makefile
===================================================================
--- csw/mgar/pkg/celestia/Makefile	                        (rev 0)
+++ csw/mgar/pkg/celestia/Makefile	2021-04-19 19:25:46 UTC (rev 26749)
@@ -0,0 +1,2 @@
+%:
+	$(MAKE) -C trunk $*

Index: csw/mgar/pkg/celestia/trunk
===================================================================
--- csw/mgar/pkg/celestia/trunk	2021-04-18 08:42:44 UTC (rev 26748)
+++ csw/mgar/pkg/celestia/trunk	2021-04-19 19:25:46 UTC (rev 26749)

Property changes on: csw/mgar/pkg/celestia/trunk
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+work
Added: csw/mgar/pkg/celestia/trunk/Makefile
===================================================================
--- csw/mgar/pkg/celestia/trunk/Makefile	                        (rev 0)
+++ csw/mgar/pkg/celestia/trunk/Makefile	2021-04-19 19:25:46 UTC (rev 26749)
@@ -0,0 +1,56 @@
+NAME = celestia
+VERSION = 1.6.1
+GARTYPE = v2
+
+DESCRIPTION = Real-time 3D visualization of space
+define BLURB
+  Celestia is a free 3D astronomy program.  Based on the Hipparcos Catalogue,
+ it allows users to display objects ranging in scale from artificial satellites
+ to entire galaxies in three dimensions using OpenGL.
+endef
+
+MASTER_SITES = $(SF_MIRRORS)
+MASTER_SITES += http://www.lua.org/ftp/
+DISTFILES  = $(NAME)-$(VERSION).tar.gz
+DISTFILES += lua-5.1.5.tar.gz
+
+# Build package on Solaris 10
+PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386
+
+PATCHFILES = 0001-one-big-patch.patch
+PATCHFILES += 0003-hardcode-zlib-compression.patch
+
+GARCOMPILER = GNU
+
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibintl9
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibz1
+RUNTIME_DEP_PKGS_CSWcelestia += CSWfreeglut
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibpng16-16
+RUNTIME_DEP_PKGS_CSWcelestia += CSWmesa
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibstdc++6
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibgcc-s1
+RUNTIME_DEP_PKGS_CSWcelestia += CSWlibjpeg7
+
+CXXFLAGS = -std=c++11
+CPPFLAGS = -I../../../lua-5.1.5/include
+
+LDFLAGS = -L$(PWD)/$(WORKDIR)/lua-5.1.5/lib -L/opt/csw/lib -Bdirect -lintl -lGL
+
+CONFIGURE_ARGS = $(DIRPATHS)
+CONFIGURE_ARGS += --with-glut
+
+CHECKPKG_OVERRIDES_CSWcelestia += file-with-bad-content|/usr/local|root/opt/csw/bin/celestia
+CHECKPKG_OVERRIDES_CSWcelestia += surplus-dependency|CSWlibz1
+
+include gar/category.mk
+
+# ./configure needs this to find xgettext
+PATH := /opt/csw/gnu:$(PATH)
+
+pre-configure-modulated:
+	# Celestia needs an older Lua (version 5.1) to build
+	# we will build our own version in the source tree and celestia
+	# will link against this static library.
+	cd $(WORKDIR) && gzip -dc /home/src/lua-5.1.5.tar.gz | tar -xf -
+	cd $(WORKDIR)/lua-5.1.5 && make solaris local
+	@$(MAKECOOKIE)


Property changes on: csw/mgar/pkg/celestia/trunk/Makefile
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: csw/mgar/pkg/celestia/trunk/checksums
===================================================================
--- csw/mgar/pkg/celestia/trunk/checksums	                        (rev 0)
+++ csw/mgar/pkg/celestia/trunk/checksums	2021-04-19 19:25:46 UTC (rev 26749)
@@ -0,0 +1,2 @@
+02208982a431b984502fac909bf380f4  celestia-1.6.1.tar.gz
+2e115fe26e435e33b0d5c022e4490567  lua-5.1.5.tar.gz

Added: csw/mgar/pkg/celestia/trunk/files/0001-one-big-patch.patch
===================================================================
--- csw/mgar/pkg/celestia/trunk/files/0001-one-big-patch.patch	                        (rev 0)
+++ csw/mgar/pkg/celestia/trunk/files/0001-one-big-patch.patch	2021-04-19 19:25:46 UTC (rev 26749)
@@ -0,0 +1,151 @@
+From ac14b6dbc21c1d0705a47006564c95647d4f4546 Mon Sep 17 00:00:00 2001
+From: Jake Goerzen <jgoerzen at opencsw.org>
+Date: Tue, 13 Apr 2021 23:55:37 +0200
+Subject: [PATCH] one-big-patch
+
+---
+ src/celengine/astro.cpp      | 7 ++++---
+ src/celengine/frametree.h    | 2 +-
+ src/celengine/image.cpp      | 1 +
+ src/celengine/planetgrid.cpp | 1 +
+ src/celengine/skygrid.cpp    | 2 +-
+ src/celengine/texture.cpp    | 2 ++
+ src/celmath/intersect.h      | 9 +++++----
+ 7 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/src/celengine/astro.cpp b/src/celengine/astro.cpp
+index 989dead..5fae78c 100644
+--- a/src/celengine/astro.cpp
++++ b/src/celengine/astro.cpp
+@@ -12,6 +12,7 @@
+ #include <iomanip>
+ #include <cstdio>
+ #include <time.h>
++#include <iso/time_iso.h>
+ #include <celutil/basictypes.h>
+ #include <celmath/mathlib.h>
+ #include "celestia.h"
+@@ -521,12 +522,12 @@ const char* astro::Date::toCStr(Format format) const
+     cal_time.tm_min = minute;
+     cal_time.tm_sec = (int)seconds;
+     cal_time.tm_wday = wday;
+-    cal_time.tm_gmtoff = utc_offset;
++    //cal_time.tm_gmtoff = utc_offset;
+ #if defined(TARGET_OS_MAC) || defined(__FreeBSD__)
+     // 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
+-    cal_time.tm_zone = tzname.c_str();
++    //cal_time.tm_zone = tzname.c_str();
+ #endif
+ 
+     const char* strftime_format;
+@@ -807,7 +808,7 @@ astro::TDBtoLocal(double tdb)
+             d.minute = localt->tm_min;
+             d.seconds = (int) localt->tm_sec;
+             d.wday = localt->tm_wday;
+-        #if defined(__GNUC__) && !defined(_WIN32)
++        #if defined(__GNUC__) && !defined(_WIN32) && !defined(__sun)
+             d.utc_offset = localt->tm_gmtoff;
+             d.tzname = localt->tm_zone;
+         #else
+diff --git a/src/celengine/frametree.h b/src/celengine/frametree.h
+index 2e1efa2..6794624 100644
+--- a/src/celengine/frametree.h
++++ b/src/celengine/frametree.h
+@@ -49,7 +49,7 @@ public:
+ 
+     bool isRoot() const
+     {
+-        return bodyParent == NULL;
++        return bodyParent == 0;
+     }
+ 
+     bool updateRequired() const
+diff --git a/src/celengine/image.cpp b/src/celengine/image.cpp
+index a36b9c1..d32c98d 100644
+--- a/src/celengine/image.cpp
++++ b/src/celengine/image.cpp
+@@ -8,6 +8,7 @@
+ // of the License, or (at your option) any later version.
+ 
+ #include <fstream>
++#include <string.h>
+ 
+ #ifndef TARGET_OS_MAC
+ #define JPEG_SUPPORT
+diff --git a/src/celengine/planetgrid.cpp b/src/celengine/planetgrid.cpp
+index cc86cae..4de52ef 100644
+--- a/src/celengine/planetgrid.cpp
++++ b/src/celengine/planetgrid.cpp
+@@ -12,6 +12,7 @@
+ 
+ #include <cstdio>
+ #include <cmath>
++#include <math.h>
+ #include <celmath/intersect.h>
+ #include "planetgrid.h"
+ #include "body.h"
+diff --git a/src/celengine/skygrid.cpp b/src/celengine/skygrid.cpp
+index c759b0d..b66d75b 100644
+--- a/src/celengine/skygrid.cpp
++++ b/src/celengine/skygrid.cpp
+@@ -36,7 +36,7 @@ const double POLAR_CROSS_SIZE = 0.01;
+ 
+ // Grid line spacing tables
+ static const int MSEC = 1;
+-static const int SEC = 1000;
++//static const int SEC = 1000;
+ static const int MIN = 60 * SEC;
+ static const int DEG = 60 * MIN;
+ static const int HR  = 60 * MIN;
+diff --git a/src/celengine/texture.cpp b/src/celengine/texture.cpp
+index 0775204..8506532 100644
+--- a/src/celengine/texture.cpp
++++ b/src/celengine/texture.cpp
+@@ -21,6 +21,8 @@
+ #endif
+ #endif
+ 
++#include <string.h>
++
+ #include <cmath>
+ #include <algorithm>
+ #include <iostream>
+diff --git a/src/celmath/intersect.h b/src/celmath/intersect.h
+index 38fb01f..0311fba 100644
+--- a/src/celmath/intersect.h
++++ b/src/celmath/intersect.h
+@@ -15,6 +15,7 @@
+ #include "ray.h"
+ #include "sphere.h"
+ #include "ellipsoid.h"
++#include "math.h"
+ 
+ 
+ template<class T> bool testIntersection(const Ray3<T>& ray,
+@@ -22,7 +23,7 @@ template<class T> bool testIntersection(const Ray3<T>& ray,
+                                         T& distance)
+ {
+     Vector3<T> diff = ray.origin - sphere.center;
+-    T s = (T) 1.0 / square(sphere.radius);
++    T s = (T) 1.0 / sqrt(sphere.radius);
+     T a = ray.direction * ray.direction * s;
+     T b = ray.direction * diff * s;
+     T c = diff * diff * s - (T) 1.0;
+@@ -73,9 +74,9 @@ template<class T> bool testIntersection(const Ray3<T>& ray,
+                                         T& distance)
+ {
+     Vector3<T> diff = ray.origin - e.center;
+-    Vector3<T> s((T) 1.0 / square(e.axes.x),
+-                 (T) 1.0 / square(e.axes.y),
+-                 (T) 1.0 / square(e.axes.z));
++    Vector3<T> s((T) 1.0 / sqrt(e.axes.x),
++                 (T) 1.0 / sqrt(e.axes.y),
++                 (T) 1.0 / sqrt(e.axes.z));
+     Vector3<T> sdir(ray.direction.x * s.x,
+                     ray.direction.y * s.y,
+                     ray.direction.z * s.z);
+-- 
+2.4.0
+

Added: csw/mgar/pkg/celestia/trunk/files/0003-hardcode-zlib-compression.patch
===================================================================
--- csw/mgar/pkg/celestia/trunk/files/0003-hardcode-zlib-compression.patch	                        (rev 0)
+++ csw/mgar/pkg/celestia/trunk/files/0003-hardcode-zlib-compression.patch	2021-04-19 19:25:46 UTC (rev 26749)
@@ -0,0 +1,26 @@
+From 0df951ee0632d0c7b79336a3b5c0589635d38b7c Mon Sep 17 00:00:00 2001
+From: Jake Goerzen <jgoerzen at opencsw.org>
+Date: Wed, 14 Apr 2021 00:23:32 +0200
+Subject: [PATCH 3/3] hardcode-zlib-compression
+
+---
+ src/celestia/imagecapture.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/celestia/imagecapture.cpp b/src/celestia/imagecapture.cpp
+index 92602da..d6bee2c 100644
+--- a/src/celestia/imagecapture.cpp
++++ b/src/celestia/imagecapture.cpp
+@@ -181,7 +181,8 @@ 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, Z_BEST_COMPRESSION);
++    png_set_compression_level(png_ptr, 3);
+     png_set_IHDR(png_ptr, info_ptr,
+                  width, height,
+                  8,
+-- 
+2.4.0
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list