summaryrefslogtreecommitdiff
path: root/misc/celestia/patches
diff options
context:
space:
mode:
Diffstat (limited to 'misc/celestia/patches')
-rw-r--r--misc/celestia/patches/patch-aa28
-rw-r--r--misc/celestia/patches/patch-ab15
-rw-r--r--misc/celestia/patches/patch-ac22
-rw-r--r--misc/celestia/patches/patch-ad85
-rw-r--r--misc/celestia/patches/patch-ae23
-rw-r--r--misc/celestia/patches/patch-af13
-rw-r--r--misc/celestia/patches/patch-ag13
-rw-r--r--misc/celestia/patches/patch-ah27
-rw-r--r--misc/celestia/patches/patch-ai44
-rw-r--r--misc/celestia/patches/patch-ak39
-rw-r--r--misc/celestia/patches/patch-al13
-rw-r--r--misc/celestia/patches/patch-am71
-rw-r--r--misc/celestia/patches/patch-an21
-rw-r--r--misc/celestia/patches/patch-ao13
-rw-r--r--misc/celestia/patches/patch-ap16
-rw-r--r--misc/celestia/patches/patch-src_celengine_astro.cpp16
-rw-r--r--misc/celestia/patches/patch-src_celengine_cmdparser.cpp53
-rw-r--r--misc/celestia/patches/patch-src_celengine_command.cpp109
-rw-r--r--misc/celestia/patches/patch-src_celengine_console.cpp12
-rw-r--r--misc/celestia/patches/patch-src_celengine_galaxy.cpp15
-rw-r--r--misc/celestia/patches/patch-src_celengine_vecgl.h48
-rw-r--r--misc/celestia/patches/patch-src_celestia_eclipsefinder.cpp12
-rw-r--r--misc/celestia/patches/patch-src_celestia_url.cpp12
-rw-r--r--misc/celestia/patches/patch-src_celmath_mathlib.h6
24 files changed, 295 insertions, 431 deletions
diff --git a/misc/celestia/patches/patch-aa b/misc/celestia/patches/patch-aa
index e236d673cd8..1c5f4bdfdd9 100644
--- a/misc/celestia/patches/patch-aa
+++ b/misc/celestia/patches/patch-aa
@@ -1,19 +1,8 @@
-$NetBSD: patch-aa,v 1.6 2007/01/26 04:25:46 markd Exp $
+$NetBSD: patch-aa,v 1.7 2013/10/27 21:21:26 dholland Exp $
---- configure.orig 2006-02-15 21:53:09.000000000 +0000
+--- configure.orig 2011-06-05 18:33:27.000000000 +0000
+++ configure
-@@ -21716,8 +21716,8 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtoo
-
-
- CELESTIA_CPPFLAGS=""
--CELESTIA_CFLAGS="-O2 -Wall -ffast-math -fexpensive-optimizations"
--CELESTIA_CXXFLAGS="-O2 -Wall -ffast-math -fexpensive-optimizations"
-+CELESTIA_CFLAGS="-Wall -ffast-math -fexpensive-optimizations"
-+CELESTIA_CXXFLAGS="-Wall -ffast-math -fexpensive-optimizations"
-
- echo "$as_me:$LINENO: checking whether to include debugging code" >&5
- echo $ECHO_N "checking whether to include debugging code... $ECHO_C" >&6
-@@ -37346,19 +37346,19 @@ else
+@@ -26740,19 +26740,19 @@ if test "$kde_have_all_paths" = "no" &&
if test "$ac_use_path_checking" = "default"; then
if test -z "$kde_htmldir"; then
@@ -37,7 +26,7 @@ $NetBSD: patch-aa,v 1.6 2007/01/26 04:25:46 markd Exp $
fi
if test -z "$kde_locale"; then
kde_locale='\${datadir}/locale'
-@@ -37367,31 +37367,31 @@ if test "$ac_use_path_checking" = "defau
+@@ -26761,31 +26761,31 @@ if test "$ac_use_path_checking" = "defau
kde_cgidir='\${exec_prefix}/cgi-bin'
fi
if test -z "$kde_confdir"; then
@@ -77,12 +66,3 @@ $NetBSD: patch-aa,v 1.6 2007/01/26 04:25:46 markd Exp $
fi
if test -z "$kde_moduledir"; then
if test "$kde_qtver" = "2"; then
-@@ -39509,7 +39509,7 @@ echo "$as_me:$LINENO: checking whether t
- echo $ECHO_N "checking whether to enable Celestia Extension Language... $ECHO_C" >&6
- if (test "$enable_lua" != "no"); then
- CXXFLAGS="$CXXFLAGS -DCELX"
-- LDFLAGS="$LDFLAGS -llualib -llua"
-+ LDFLAGS="$LDFLAGS -llua"
-
- if (test "$lua_includes" != "no"); then
- CXXFLAGS="$CXXFLAGS -I$lua_includes"
diff --git a/misc/celestia/patches/patch-ab b/misc/celestia/patches/patch-ab
index c2c7bbb46bc..746feea0878 100644
--- a/misc/celestia/patches/patch-ab
+++ b/misc/celestia/patches/patch-ab
@@ -1,19 +1,8 @@
-$NetBSD: patch-ab,v 1.5 2011/11/25 22:08:30 joerg Exp $
+$NetBSD: patch-ab,v 1.6 2013/10/27 21:21:26 dholland Exp $
--- src/celutil/formatnum.cpp.orig 2006-02-13 14:33:02.000000000 +0000
+++ src/celutil/formatnum.cpp
-@@ -7,8 +7,10 @@
- // as published by the Free Software Foundation; either version 2
- // of the License, or (at your option) any later version.
-
-+#include <climits>
- #include <cmath>
- #include <cstdio>
-+#include <cstring>
- #include <string>
- #include "formatnum.h"
-
-@@ -60,9 +62,9 @@ std::ostream& operator<<(std::ostream& o
+@@ -61,9 +61,9 @@ std::ostream& operator<<(std::ostream& o
char buf[32];
char obuf[64];
double value = num.getRoundedValue();
diff --git a/misc/celestia/patches/patch-ac b/misc/celestia/patches/patch-ac
deleted file mode 100644
index b89e3c01547..00000000000
--- a/misc/celestia/patches/patch-ac
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ac,v 1.4 2006/02/17 23:46:39 adam Exp $
-
---- config.h.in.orig 2006-02-15 22:53:21.000000000 +0100
-+++ config.h.in
-@@ -248,7 +248,7 @@ int res_init(void);
-
-
-
--#if !defined(HAVE_STRLCAT_PROTO)
-+#if !defined(HAVE_STRLCAT_PROTO) && defined(KDELIBSUFF)
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -260,7 +260,7 @@ unsigned long strlcat(char*, const char*
-
-
-
--#if !defined(HAVE_STRLCPY_PROTO)
-+#if !defined(HAVE_STRLCPY_PROTO) && defined(KDELIBSUFF)
- #ifdef __cplusplus
- extern "C" {
- #endif
diff --git a/misc/celestia/patches/patch-ad b/misc/celestia/patches/patch-ad
index eac06f900fe..e643979e332 100644
--- a/misc/celestia/patches/patch-ad
+++ b/misc/celestia/patches/patch-ad
@@ -1,85 +1,10 @@
-$NetBSD: patch-ad,v 1.4 2006/12/13 16:45:42 obache Exp $
+$NetBSD: patch-ad,v 1.5 2013/10/27 21:21:26 dholland Exp $
---- src/celestia/celestiacore.cpp.orig 2006-02-08 09:03:15.000000000 +0000
+Honor PKG_SYSCONFDIR.
+
+--- src/celestia/celestiacore.cpp.orig 2011-06-05 16:11:13.000000000 +0000
+++ src/celestia/celestiacore.cpp
-@@ -2577,16 +2577,16 @@ static void displayAngle(Overlay& overla
-
- if (degrees > 0)
- {
-- overlay.printf("%d%s %02d' %.1f\"",
-+ overlay.myprintf("%d%s %02d' %.1f\"",
- degrees, UTF8_DEGREE_SIGN, minutes, seconds);
- }
- else if (minutes > 0)
- {
-- overlay.printf("%02d' %.1f\"", minutes, seconds);
-+ overlay.myprintf("%02d' %.1f\"", minutes, seconds);
- }
- else
- {
-- overlay.printf("%.1f\"", seconds);
-+ overlay.myprintf("%.1f\"", seconds);
- }
- }
-
-@@ -2625,7 +2625,7 @@ static void displayApparentMagnitude(Ove
- overlay << _("Absolute magnitude: ");
- }
-
-- overlay.printf("%.1f\n", appMag);
-+ overlay.myprintf("%.1f\n", appMag);
- }
-
- static void displayAcronym(Overlay& overlay, char* s)
-@@ -2665,7 +2665,7 @@ static void displayStarInfo(Overlay& ove
- return;
- }
-
-- overlay.printf(_("Abs (app) mag: %.2f (%.2f)\n"),
-+ overlay.myprintf(_("Abs (app) mag: %.2f (%.2f)\n"),
- star.getAbsoluteMagnitude(),
- astro::absToAppMag(star.getAbsoluteMagnitude(),
- (float) distance));
-@@ -2687,7 +2687,7 @@ static void displayStarInfo(Overlay& ove
- if (detail > 1)
- {
- overlay << _("Surface temp: ") << SigDigitNum(star.getTemperature(), 3) << " K\n";
-- overlay.printf(_("Radius: %.2f Rsun\n"), star.getRadius() / 696000.0f);
-+ overlay.myprintf(_("Radius: %.2f Rsun\n"), star.getRadius() / 696000.0f);
-
- overlay << _("Rotation period: ");
- float period = star.getRotationElements().period;
-@@ -2782,7 +2782,7 @@ static void displayPlanetInfo(Overlay& o
- float appMag = body.getApparentMagnitude(*sun,
- bodyPos - Point3d(0, 0, 0),
- viewVec);
-- overlay.printf(_("Apparent mag: %.2f\n"), appMag);
-+ overlay.myprintf(_("Apparent mag: %.2f\n"), appMag);
- #endif
- }
- }
-@@ -3140,9 +3140,9 @@ void CelestiaCore::renderOverlay()
-
- // Field of view
- float fov = radToDeg(sim->getActiveObserver()->getFOV());
-- overlay->printf(_("FOV: "));
-+ overlay->myprintf(_("FOV: "));
- displayAngle(*overlay, fov);
-- overlay->printf(" (%.2f%s)\n", views[activeView]->zoom,
-+ overlay->myprintf(" (%.2f%s)\n", views[activeView]->zoom,
- UTF8_MULTIPLICATION_SIGN);
- overlay->endText();
- glPopMatrix();
-@@ -3341,7 +3341,7 @@ void CelestiaCore::renderOverlay()
- movieCapture->getFrameRate();
- int min = (int) (sec / 60);
- sec -= min * 60.0f;
-- overlay->printf("%3d:%05.2f", min, sec);
-+ overlay->myprintf("%3d:%05.2f", min, sec);
- glPopMatrix();
-
- glPushMatrix();
-@@ -3547,7 +3547,7 @@ bool CelestiaCore::initSimulation(const
+@@ -4103,7 +4103,7 @@ bool CelestiaCore::initSimulation(const
}
else
{
diff --git a/misc/celestia/patches/patch-ae b/misc/celestia/patches/patch-ae
index 8665bdbf545..f16a9e7abe7 100644
--- a/misc/celestia/patches/patch-ae
+++ b/misc/celestia/patches/patch-ae
@@ -1,21 +1,24 @@
-$NetBSD: patch-ae,v 1.4 2006/02/17 23:46:40 adam Exp $
+$NetBSD: patch-ae,v 1.5 2013/10/27 21:21:26 dholland Exp $
---- Makefile.in.orig 2006-02-15 22:53:42.000000000 +0100
+- handle celestia.cfg using the pkgsrc method for config files
+- don't use mv -b, which isn't standard
+
+--- Makefile.in.orig 2011-06-05 18:34:26.000000000 +0000
+++ Makefile.in
-@@ -307,7 +307,6 @@ noinst_DATA = \
-
+@@ -444,7 +444,6 @@ noinst_DATA = \
+ $(dosstuff)
pkgdata_DATA = \
- celestia.cfg \
controls.txt \
COPYING \
$(wildcard *.cel)
-@@ -848,7 +847,7 @@ dist-hook:
+@@ -1064,7 +1063,7 @@ dist-hook:
install-data-hook:
- if [ "$(kde_datadir)" -a -d $(kde_datadir)/@PACKAGE@ -a ! -h $(kde_datadir)/@PACKAGE@ ] ; then \
-- mv -f -b $(kde_datadir)/@PACKAGE@/* $(datadir)/@PACKAGE@/ ; \
-+ mv -f $(kde_datadir)/@PACKAGE@/* $(datadir)/@PACKAGE@/ ; \
- rmdir $(kde_datadir)/@PACKAGE@ ; \
+ if [ "$(kde_datadir)" -a -d $(DESTDIR)/$(kde_datadir)/@PACKAGE@ -a ! -h $(DESTDIR)/$(kde_datadir)/@PACKAGE@ ] ; then \
+- mv -f -b $(DESTDIR)/$(kde_datadir)/@PACKAGE@/* $(DESTDIR)/$(datadir)/@PACKAGE@/ ; \
++ mv -f $(DESTDIR)/$(kde_datadir)/@PACKAGE@/* $(DESTDIR)/$(datadir)/@PACKAGE@/ ; \
+ rmdir $(DESTDIR)/$(kde_datadir)/@PACKAGE@ ; \
fi
- if [ "$(kde_datadir)" -a ! -h $(kde_datadir)/@PACKAGE@ ] ; then \
+ if [ "$(kde_datadir)" -a ! -h $(DESTDIR)/$(kde_datadir)/@PACKAGE@ ] ; then \
diff --git a/misc/celestia/patches/patch-af b/misc/celestia/patches/patch-af
deleted file mode 100644
index 4de5c5ecda9..00000000000
--- a/misc/celestia/patches/patch-af
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-af,v 1.3 2006/08/14 22:43:08 wiz Exp $
-
---- src/celengine/star.h.orig 2005-12-06 17:30:23.000000000 +0000
-+++ src/celengine/star.h
-@@ -30,7 +30,7 @@ class StarDetails
- // orbits and StarDetails objects. Currently, it's assumed that they
- // have lifetimes that continue until program termination.
- public:
-- StarDetails::StarDetails();
-+ StarDetails();
-
- inline float getRadius() const;
- inline float getTemperature() const;
diff --git a/misc/celestia/patches/patch-ag b/misc/celestia/patches/patch-ag
deleted file mode 100644
index 601148f5c73..00000000000
--- a/misc/celestia/patches/patch-ag
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ag,v 1.3 2006/08/14 22:43:08 wiz Exp $
-
---- src/celengine/command.h.orig 2004-12-22 22:07:15.000000000 +0000
-+++ src/celengine/command.h
-@@ -94,7 +94,7 @@ class CommandGoto : public Instantaneous
- class CommandGotoLongLat : public InstantaneousCommand
- {
- public:
-- CommandGotoLongLat::CommandGotoLongLat(double t,
-+ CommandGotoLongLat(double t,
- double dist,
- float _longitude, float _latitude,
- Vec3f _up);
diff --git a/misc/celestia/patches/patch-ah b/misc/celestia/patches/patch-ah
index 2bb41a5bded..8d3539b9a18 100644
--- a/misc/celestia/patches/patch-ah
+++ b/misc/celestia/patches/patch-ah
@@ -1,29 +1,12 @@
-$NetBSD: patch-ah,v 1.5 2011/11/25 22:08:30 joerg Exp $
+$NetBSD: patch-ah,v 1.6 2013/10/27 21:21:26 dholland Exp $
---- src/celutil/util.h.orig 2005-08-15 20:34:43.000000000 +0000
+--- src/celutil/util.h.orig 2011-06-05 16:11:15.000000000 +0000
+++ src/celutil/util.h
-@@ -12,22 +12,16 @@
- #ifndef _UTIL_H_
- #define _UTIL_H_
+@@ -12,6 +12,7 @@
+ #ifndef _CELUTIL_UTIL_H_
+ #define _CELUTIL_UTIL_H_
+#include <algorithm>
#include <string>
#include <vector>
#include <iostream>
- #include <functional>
-
--#ifndef min
--#define min(a, b) ((a) < (b) ? (a) : (b))
--#endif
--
--#ifndef max
--#define max(a, b) ((a) < (b) ? (b) : (a))
--#endif
--
- #ifdef _WIN32
- #define _(s) s
- #else
-+#include <libintl.h>
- #define _(s) gettext(s)
- #endif
-
diff --git a/misc/celestia/patches/patch-ai b/misc/celestia/patches/patch-ai
index d9cc747923e..a8b469441dc 100644
--- a/misc/celestia/patches/patch-ai
+++ b/misc/celestia/patches/patch-ai
@@ -1,8 +1,8 @@
-$NetBSD: patch-ai,v 1.3 2006/08/14 22:43:08 wiz Exp $
+$NetBSD: patch-ai,v 1.4 2013/10/27 21:21:26 dholland Exp $
---- src/celestia/celx.cpp.orig 2006-01-07 00:01:51.000000000 +0000
+--- src/celestia/celx.cpp.orig 2011-06-05 16:11:13.000000000 +0000
+++ src/celestia/celx.cpp
-@@ -368,6 +368,18 @@ static CelestiaCore* getAppCore(lua_Stat
+@@ -492,6 +492,18 @@ static CelestiaCore* getAppCore(lua_Stat
return appCore;
}
@@ -21,44 +21,12 @@ $NetBSD: patch-ai,v 1.3 2006/08/14 22:43:08 wiz Exp $
LuaState::LuaState() :
timeout(MaxTimeslice),
-@@ -378,7 +390,7 @@ LuaState::LuaState() :
- scriptAwakenTime(0.1),
- ioMode(NoIO)
+@@ -503,7 +515,7 @@ LuaState::LuaState() :
+ ioMode(NoIO),
+ eventHandlerEnabled(false)
{
- state = lua_open();
+ state = lua_newstate(l_alloc, NULL);
timer = CreateTimer();
screenshotCount = 0;
}
-@@ -472,6 +484,7 @@ void LuaState::cleanup()
- }
-
-
-+
- bool LuaState::createThread()
- {
- // Initialize the coroutine which wraps the script
-@@ -598,7 +611,7 @@ bool LuaState::charEntered(const char* c
- int stackTop = lua_gettop(costate);
- if (strcmp(c_p, "y") == 0)
- {
-- lua_iolibopen(costate);
-+ luaopen_io(costate);
- ioMode = IOAllowed;
- }
- else
-@@ -4577,10 +4590,10 @@ bool LuaState::init(CelestiaCore* appCor
- initMaps();
-
- // Import the base and math libraries
-- lua_baselibopen(state);
-- lua_mathlibopen(state);
-- lua_tablibopen(state);
-- lua_strlibopen(state);
-+ luaopen_base(state);
-+ luaopen_math(state);
-+ luaopen_table(state);
-+ luaopen_string(state);
-
- // Add an easy to use wait function, so that script writers can
- // live in ignorance of coroutines. There will probably be a significant
diff --git a/misc/celestia/patches/patch-ak b/misc/celestia/patches/patch-ak
index 15fc0be7fc7..965ea3888ac 100644
--- a/misc/celestia/patches/patch-ak
+++ b/misc/celestia/patches/patch-ak
@@ -1,16 +1,35 @@
-$NetBSD: patch-ak,v 1.2 2012/07/03 17:40:36 joerg Exp $
+$NetBSD: patch-ak,v 1.3 2013/10/27 21:21:26 dholland Exp $
---- src/celestia/Makefile.in.orig 2006-02-15 21:53:43.000000000 +0000
+- fix locale directory
+- use libintl where needed
+
+--- src/celestia/Makefile.in.orig 2011-06-05 18:34:28.000000000 +0000
+++ src/celestia/Makefile.in
-@@ -298,9 +298,9 @@ SUBDIRS = res $(am__append_1) $(am__appe
- bin_PROGRAMS = celestia
+@@ -213,7 +213,7 @@ DCOPIDL = @DCOPIDL@
+ DCOPIDL2CPP = @DCOPIDL2CPP@
+ DCOPIDLNG = @DCOPIDLNG@
+ DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+-DEFS = -DCONFIG_DATA_DIR='"$(PKGDATADIR)"' -DLOCALEDIR='"$(datadir)/locale"' @DEFS@
++DEFS = -DCONFIG_DATA_DIR='"$(PKGDATADIR)"' -DLOCALEDIR='"$(localedir)"' @DEFS@
+ DEPDIR = @DEPDIR@
+ DL_LIBS = @DL_LIBS@
+ DSYMUTIL = @DSYMUTIL@
+@@ -474,7 +474,7 @@ xdg_menudir = @xdg_menudir@
+ SUBDIRS = res $(am__append_1) $(am__append_2)
INCLUDES = -I..
-
--localedir = $(datadir)/locale
-+localedir = /usr/pkg/share/locale
@ENABLE_KDE_TRUE@celestiaKDELIBS = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) \
--@ENABLE_KDE_TRUE@ $(LIBSOCKET) kde/libkdegui.a
-+@ENABLE_KDE_TRUE@ $(LIBSOCKET) $(LIBINTL) kde/libkdegui.a
+-@ENABLE_KDE_TRUE@ $(LIBSOCKET) -lDCOP kde/libkdegui.a
++@ENABLE_KDE_TRUE@ $(LIBSOCKET) $(LIBINTL) -lDCOP kde/libkdegui.a
@ENABLE_KDE_TRUE@celestia_LDFLAGS = $(all_libraries) $(KDE_RPATH)
- @ENABLE_GTK_TRUE@celestiaGTKLIBS = gtk/libgtkgui.a
+ @ENABLE_GTK_TRUE@celestiaGTKLIBS = $(GTK_LIBS) gtk/libgtkgui.a
+@@ -538,7 +538,8 @@ celestia_LDADD = \
+ ../cel3ds/libcel3ds.a \
+ ../celmath/libcelmath.a \
+ ../celutil/libcelutil.a \
+- $(SPICE_LIBS)
++ $(SPICE_LIBS) \
++ $(INTLLIBS)
+
+ noinst_HEADERS = $(wildcard *.h)
+ noinst_DATA = ../../celestia
diff --git a/misc/celestia/patches/patch-al b/misc/celestia/patches/patch-al
deleted file mode 100644
index 5cdaf99ee3e..00000000000
--- a/misc/celestia/patches/patch-al
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-al,v 1.2 2012/07/03 17:40:36 joerg Exp $
-
---- src/celestia/kde/doc/celestia/Makefile.in.orig 2006-02-15 21:53:43.000000000 +0000
-+++ src/celestia/kde/doc/celestia/Makefile.in
-@@ -642,7 +642,7 @@ install-docs: docs-am install-nls
- $(INSTALL_DATA) $(srcdir)/index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/celestia/; \
- fi
- -rm -f $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/celestia/common
-- $(LN_S) $(kde_libs_htmldir)/$(KDE_LANG)/common $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/celestia/common
-+ $(LN_S) $(kde_htmldir)/$(KDE_LANG)/common $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/celestia/common
-
- uninstall-docs:
- -rm -rf $(kde_htmldir)/$(KDE_LANG)/celestia
diff --git a/misc/celestia/patches/patch-am b/misc/celestia/patches/patch-am
index f5894408d49..c7cbbda0af3 100644
--- a/misc/celestia/patches/patch-am
+++ b/misc/celestia/patches/patch-am
@@ -1,32 +1,60 @@
-$NetBSD: patch-am,v 1.2 2012/07/03 17:40:36 joerg Exp $
+$NetBSD: patch-am,v 1.3 2013/10/27 21:21:26 dholland Exp $
---- src/celutil/unixdirectory.cpp.orig 2005-03-05 13:56:14.000000000 +0000
+- dragonfly doesn't have wordexp.h
+- use glob.h instead of wordexp.h when not using wordexp.h
+
+--- src/celutil/unixdirectory.cpp.orig 2011-06-05 16:11:15.000000000 +0000
+++ src/celutil/unixdirectory.cpp
-@@ -7,11 +7,19 @@
- // as published by the Free Software Foundation; either version 2
- // of the License, or (at your option) any later version.
+@@ -11,20 +11,30 @@
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <dirent.h>
+-#include <wordexp.h>
+-#include "directory.h"
+-
+-using namespace std;
+#if defined(__DragonFly__)
+#define NO_WORDEXP
+#endif
+
+ #ifdef TARGET_OS_MAC
+ #ifdef QT_CORE_LIB
+ // Crash on Mac OS X / Qt4 version when calling wordfree.
+ // This seems to happen only with Leopard.
+-#define WORDEXP_PROBLEM
++#define NO_WORDEXP
++#endif
+ #endif
+
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <dirent.h>
+#ifdef NO_WORDEXP
+#include <glob.h>
+#else
- #include <wordexp.h>
-+#endif
- #include "directory.h"
++#include <wordexp.h>
+ #endif
- using namespace std;
-@@ -98,6 +106,19 @@ bool IsDirectory(const std::string& file
- }
++#include "directory.h"
++
++using namespace std;
++
++
+ class UnixDirectory : public Directory
+ {
+ public:
+@@ -107,7 +117,7 @@ bool IsDirectory(const std::string& file
- std::string WordExp(const std::string& filename) {
-+#ifdef NO_WORDEXP
+ std::string WordExp(const std::string& filename)
+ {
+-#ifndef WORDEXP_PROBLEM
++#ifndef NO_WORDEXP
+ wordexp_t result;
+ std::string expanded;
+
+@@ -130,7 +140,17 @@ std::string WordExp(const std::string& f
+ expanded = result.we_wordv[0];
+ wordfree(&result);
+ #else
+- std::string expanded = filename;
+ glob_t g;
+ std::string expanded;
+ glob(filename.c_str(), GLOB_NOSORT | GLOB_TILDE, NULL, &g);
@@ -38,13 +66,6 @@ $NetBSD: patch-am,v 1.2 2012/07/03 17:40:36 joerg Exp $
+ globfree(&g);
+ return expanded;
+ }
-+#else
- wordexp_t result;
- std::string expanded;
-
-@@ -121,4 +142,5 @@ std::string WordExp(const std::string& f
- wordfree(&result);
-
+ #endif
return expanded;
-+#endif
}
diff --git a/misc/celestia/patches/patch-an b/misc/celestia/patches/patch-an
deleted file mode 100644
index ff264e115ed..00000000000
--- a/misc/celestia/patches/patch-an
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-an,v 1.2 2011/11/25 22:08:30 joerg Exp $
-
---- src/celengine/overlay.cpp.orig 2005-07-19 20:30:54.000000000 +0000
-+++ src/celengine/overlay.cpp
-@@ -9,6 +9,7 @@
-
- #include <cstdarg>
- #include <cstdio>
-+#include <cstring>
- #include <celutil/utf8.h>
- #include "gl.h"
- #include "vecgl.h"
-@@ -173,7 +174,7 @@ void Overlay::print(char* s)
- }
-
-
--void Overlay::printf(const char* format, ...)
-+void Overlay::myprintf(const char* format, ...)
- {
- va_list args;
- va_start(args, format);
diff --git a/misc/celestia/patches/patch-ao b/misc/celestia/patches/patch-ao
deleted file mode 100644
index 720e325f1d9..00000000000
--- a/misc/celestia/patches/patch-ao
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ao,v 1.1 2006/12/13 16:45:42 obache Exp $
-
---- src/celengine/overlay.h.orig 2004-01-03 20:30:42.000000000 +0000
-+++ src/celengine/overlay.h
-@@ -63,7 +63,7 @@ class Overlay : public std::ostream
- void print(wchar_t);
- void print(char);
- void print(char*);
-- void printf(const char*, ...);
-+ void myprintf(const char*, ...);
-
-
- private:
diff --git a/misc/celestia/patches/patch-ap b/misc/celestia/patches/patch-ap
index 2948c9c535a..cc7b23809bb 100644
--- a/misc/celestia/patches/patch-ap
+++ b/misc/celestia/patches/patch-ap
@@ -1,10 +1,11 @@
-$NetBSD: patch-ap,v 1.3 2013/02/17 09:39:09 dholland Exp $
+$NetBSD: patch-ap,v 1.4 2013/10/27 21:21:26 dholland Exp $
https://sourceforge.net/tracker/?func=detail&aid=3018741&group_id=21302&atid=121302
+(there's a leftover bit apparently missed upstream)
Also, add <cstring> to fix build with png 1.6.
---- src/celengine/image.cpp.orig 2005-07-19 20:30:54.000000000 +0000
+--- src/celengine/image.cpp.orig 2011-06-05 16:11:09.000000000 +0000
+++ src/celengine/image.cpp
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
@@ -13,7 +14,7 @@ Also, add <cstring> to fix build with png 1.6.
+#include <cstring>
#include <fstream>
- #ifndef MACOSX
+ #ifndef TARGET_OS_MAC
@@ -78,7 +79,7 @@ using namespace std;
// Define various expansion transformations for old versions of libpng
#if PNG_LIBPNG_VER < 10004
@@ -23,12 +24,3 @@ Also, add <cstring> to fix build with png 1.6.
#define png_set_tRNS_to_alpha(p) png_set_expand(p)
#endif // PNG_LIBPNG_VER < 10004
-@@ -720,7 +721,7 @@ Image* LoadPNGImage(const string& filena
-
- 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 --git a/misc/celestia/patches/patch-src_celengine_astro.cpp b/misc/celestia/patches/patch-src_celengine_astro.cpp
new file mode 100644
index 00000000000..f4e7ccb9140
--- /dev/null
+++ b/misc/celestia/patches/patch-src_celengine_astro.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_celengine_astro.cpp,v 1.1 2013/10/27 21:21:26 dholland Exp $
+
+Handle a tzname incompatibility between BSD and Linux.
+
+--- src/celengine/astro.cpp~ 2011-06-05 16:11:09.000000000 +0000
++++ src/celengine/astro.cpp
+@@ -522,7 +522,8 @@ const char* astro::Date::toCStr(Format f
+ 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(__NetBSD__) || \
++ defined(__OpenBSD__) || defined(__DragonFly__)
+ // 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/misc/celestia/patches/patch-src_celengine_cmdparser.cpp b/misc/celestia/patches/patch-src_celengine_cmdparser.cpp
new file mode 100644
index 00000000000..da45f700cdd
--- /dev/null
+++ b/misc/celestia/patches/patch-src_celengine_cmdparser.cpp
@@ -0,0 +1,53 @@
+$NetBSD: patch-src_celengine_cmdparser.cpp,v 1.1 2013/10/27 21:21:26 dholland Exp $
+
+Fix build with lua switched off.
+(This is probably not the right place to switch it off, but it does
+build this way.)
+
+--- src/celengine/cmdparser.cpp~ 2011-06-05 16:11:09.000000000 +0000
++++ src/celengine/cmdparser.cpp
+@@ -797,10 +797,14 @@ int parseRenderFlags(string s)
+ {
+ string name = tokenizer.getNameValue();
+
++#ifdef CELX
+ if (CelxLua::RenderFlagMap.count(name) == 0)
+ cerr << "Unknown render flag: " << name << "\n";
+ else
+ flags |= CelxLua::RenderFlagMap[name];
++#else
++ cerr << "Unknown render flag: " << name << "\n";
++#endif
+
+ ttype = tokenizer.nextToken();
+ if (ttype == Tokenizer::TokenBar)
+@@ -826,10 +830,14 @@ int parseLabelFlags(string s)
+ {
+ string name = tokenizer.getNameValue();
+
++#ifdef CELX
+ if (CelxLua::LabelFlagMap.count(name) == 0)
+ cerr << "Unknown label flag: " << name << "\n";
+ else
+ flags |= CelxLua::LabelFlagMap[name];
++#else
++ cerr << "Unknown label flag: " << name << "\n";
++#endif
+
+ ttype = tokenizer.nextToken();
+ if (ttype == Tokenizer::TokenBar)
+@@ -856,10 +864,14 @@ int parseOrbitFlags(string s)
+ string name = tokenizer.getNameValue();
+ name[0] = toupper(name[0]);
+
++#ifdef CELX
+ if (CelxLua::BodyTypeMap.count(name) == 0)
+ cerr << "Unknown orbit flag: " << name << "\n";
+ else
+ flags |= CelxLua::BodyTypeMap[name];
++#else
++ cerr << "Unknown orbit flag: " << name << "\n";
++#endif
+
+ ttype = tokenizer.nextToken();
+ if (ttype == Tokenizer::TokenBar)
diff --git a/misc/celestia/patches/patch-src_celengine_command.cpp b/misc/celestia/patches/patch-src_celengine_command.cpp
new file mode 100644
index 00000000000..f586ee66f97
--- /dev/null
+++ b/misc/celestia/patches/patch-src_celengine_command.cpp
@@ -0,0 +1,109 @@
+$NetBSD: patch-src_celengine_command.cpp,v 1.1 2013/10/27 21:21:26 dholland Exp $
+
+Fix build with lua switched off.
+(This is probably not the right place to switch it off, but it does
+build this way.)
+
+--- src/celengine/command.cpp~ 2013-10-27 20:32:16.000000000 +0000
++++ src/celengine/command.cpp
+@@ -11,7 +11,9 @@
+ #include <celutil/util.h>
+ #include <celestia/celestiacore.h>
+ #include <celestia/imagecapture.h>
++#ifdef CELX
+ #include <celestia/celx_internal.h>
++#endif
+ #include "astro.h"
+ #include "command.h"
+ #include "execution.h"
+@@ -773,6 +775,7 @@ CommandSplitView::CommandSplitView(unsig
+
+ void CommandSplitView::process(ExecutionEnvironment& env)
+ {
++#ifdef CELX
+ vector<Observer*> observer_list;
+ getObservers(env.getCelestiaCore(), observer_list);
+
+@@ -785,6 +786,7 @@ void CommandSplitView::process(Execution
+ View::Type type = (compareIgnoringCase(splitType, "h") == 0) ? View::HorizontalSplit : View::VerticalSplit;
+ env.getCelestiaCore()->splitView(type, view, (float)splitPos);
+ }
++#endif
+ }
+
+
+@@ -796,6 +800,7 @@ CommandDeleteView::CommandDeleteView(uns
+
+ void CommandDeleteView::process(ExecutionEnvironment& env)
+ {
++#ifdef CELX
+ vector<Observer*> observer_list;
+ getObservers(env.getCelestiaCore(), observer_list);
+
+@@ -807,6 +810,7 @@ void CommandDeleteView::process(Executio
+ View* view = getViewByObserver(env.getCelestiaCore(), obs);
+ env.getCelestiaCore()->deleteView(view);
+ }
++#endif
+ }
+
+
+@@ -817,8 +823,10 @@ CommandSingleView::CommandSingleView()
+
+ void CommandSingleView::process(ExecutionEnvironment& env)
+ {
++#ifdef CELX
+ View* view = getViewByObserver(env.getCelestiaCore(), env.getSimulation()->getActiveObserver());
+ env.getCelestiaCore()->singleView(view);
++#endif
+ }
+
+
+@@ -834,6 +840,7 @@ CommandSetActiveView::CommandSetActiveVi
+
+ void CommandSetActiveView::process(ExecutionEnvironment& env)
+ {
++#ifdef CELX
+ vector<Observer*> observer_list;
+ getObservers(env.getCelestiaCore(), observer_list);
+
+@@ -843,6 +850,7 @@ void CommandSetActiveView::process(Execu
+ View* view = getViewByObserver(env.getCelestiaCore(), obs);
+ env.getCelestiaCore()->setActiveView(view);
+ }
++#endif
+ }
+
+
+@@ -892,6 +900,7 @@ CommandSetLineColor::CommandSetLineColor
+
+ void CommandSetLineColor::process(ExecutionEnvironment& /* env */)
+ {
++#ifdef CELX
+ if (CelxLua::LineColorMap.count(item) == 0)
+ {
+ cerr << "Unknown line style: " << item << "\n";
+@@ -900,6 +909,7 @@ void CommandSetLineColor::process(Execut
+ {
+ *CelxLua::LineColorMap[item] = color;
+ }
++#endif
+ }
+
+
+@@ -914,6 +924,7 @@ CommandSetLabelColor::CommandSetLabelCol
+
+ void CommandSetLabelColor::process(ExecutionEnvironment& /* env */)
+ {
++#ifdef CELX
+ if (CelxLua::LabelColorMap.count(item) == 0)
+ {
+ cerr << "Unknown label style: " << item << "\n";
+@@ -922,6 +933,7 @@ void CommandSetLabelColor::process(Execu
+ {
+ *CelxLua::LabelColorMap[item] = color;
+ }
++#endif
+ }
+
+
diff --git a/misc/celestia/patches/patch-src_celengine_console.cpp b/misc/celestia/patches/patch-src_celengine_console.cpp
deleted file mode 100644
index 6b838b2735c..00000000000
--- a/misc/celestia/patches/patch-src_celengine_console.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-src_celengine_console.cpp,v 1.2 2012/07/03 17:40:36 joerg Exp $
-
---- src/celengine/console.cpp.orig 2005-07-19 20:30:54.000000000 +0000
-+++ src/celengine/console.cpp
-@@ -9,6 +9,7 @@
-
- #include <cstdarg>
- #include <cstdio>
-+#include <cstring>
- #include <cassert>
- #include "celutil/utf8.h"
- #include "gl.h"
diff --git a/misc/celestia/patches/patch-src_celengine_galaxy.cpp b/misc/celestia/patches/patch-src_celengine_galaxy.cpp
deleted file mode 100644
index 73edcfae053..00000000000
--- a/misc/celestia/patches/patch-src_celengine_galaxy.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_celengine_galaxy.cpp,v 1.2 2012/07/03 17:40:36 joerg Exp $
-
---- src/celengine/galaxy.cpp.orig 2005-12-05 05:42:43.000000000 +0000
-+++ src/celengine/galaxy.cpp
-@@ -311,8 +311,8 @@ void Galaxy::renderGalaxyEllipsoid(const
- float discSizeInPixels = pixelSize * getRadius() / offset.length();
- unsigned int nRings = (unsigned int) (discSizeInPixels / 4.0f);
- unsigned int nSlices = (unsigned int) (discSizeInPixels / 4.0f);
-- nRings = max(nRings, 100);
-- nSlices = max(nSlices, 100);
-+ nRings = max(nRings, 100U);
-+ nSlices = max(nSlices, 100U);
-
- VertexProcessor* vproc = context.getVertexProcessor();
- if (vproc == NULL)
diff --git a/misc/celestia/patches/patch-src_celengine_vecgl.h b/misc/celestia/patches/patch-src_celengine_vecgl.h
deleted file mode 100644
index ca9bbcf63f4..00000000000
--- a/misc/celestia/patches/patch-src_celengine_vecgl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-$NetBSD: patch-src_celengine_vecgl.h,v 1.1 2012/07/03 17:40:36 joerg Exp $
-
---- src/celengine/vecgl.h.orig 2012-07-03 14:48:42.000000000 +0000
-+++ src/celengine/vecgl.h
-@@ -89,17 +89,20 @@ inline void glScale(const Vec3f& v)
-
- inline void glLightDirection(GLenum light, const Vec3f& dir)
- {
-- glLightfv(light, GL_POSITION, &(Vec4f(dir.x, dir.y, dir.z, 0.0f).x));
-+ Vec4f t(dir.x, dir.y, dir.z, 0.0f);
-+ glLightfv(light, GL_POSITION, &t.x);
- }
-
- inline void glLightPosition(GLenum light, const Point3f& pos)
- {
-- glLightfv(light, GL_POSITION, &(Vec4f(pos.x, pos.y, pos.z, 1.0f).x));
-+ Vec4f t(pos.x, pos.y, pos.z, 1.0f);
-+ glLightfv(light, GL_POSITION, &t.x);
- }
-
- inline void glLightColor(GLenum light, GLenum which, const Vec3f& color)
- {
-- glLightfv(light, which, &(Vec4f(color.x, color.y, color.z, 1.0f).x));
-+ Vec4f t(color.x, color.y, color.z, 1.0f);
-+ glLightfv(light, which, &t.x);
- }
-
- inline void glLightColor(GLenum light, GLenum which, const Vec4f& color)
-@@ -109,15 +112,15 @@ inline void glLightColor(GLenum light, G
-
- inline void glLightColor(GLenum light, GLenum which, const Color& color)
- {
-+ Vec4f t(color.red(), color.green(), color.blue(), color.alpha());
- glLightfv(light, which,
-- &(Vec4f(color.red(), color.green(), color.blue(), color.alpha()).x));
-+ &t.x);
- }
-
- inline void glAmbientLightColor(const Color& color)
- {
-- glLightModelfv(GL_LIGHT_MODEL_AMBIENT,
-- &(Vec4f(color.red(), color.green(), color.blue(),
-- color.alpha()).x));
-+ Vec4f t(color.red(), color.green(), color.blue(), color.alpha());
-+ glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &t.x);
- }
-
- #endif // _VECGL_H_
diff --git a/misc/celestia/patches/patch-src_celestia_eclipsefinder.cpp b/misc/celestia/patches/patch-src_celestia_eclipsefinder.cpp
deleted file mode 100644
index 2360af26c46..00000000000
--- a/misc/celestia/patches/patch-src_celestia_eclipsefinder.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-src_celestia_eclipsefinder.cpp,v 1.2 2012/07/03 17:40:36 joerg Exp $
-
---- src/celestia/eclipsefinder.cpp.orig 2004-09-09 06:34:50.000000000 +0000
-+++ src/celestia/eclipsefinder.cpp
-@@ -10,6 +10,7 @@
- // as published by the Free Software Foundation; either version 2
- // of the License, or (at your option) any later version.
-
-+#include <cstring>
- #include <string>
- #include <sstream>
- #include <algorithm>
diff --git a/misc/celestia/patches/patch-src_celestia_url.cpp b/misc/celestia/patches/patch-src_celestia_url.cpp
deleted file mode 100644
index f364ce46ff3..00000000000
--- a/misc/celestia/patches/patch-src_celestia_url.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-src_celestia_url.cpp,v 1.2 2012/07/03 17:40:36 joerg Exp $
-
---- src/celestia/url.cpp.orig 2005-11-18 08:00:39.000000000 +0000
-+++ src/celestia/url.cpp
-@@ -15,6 +15,7 @@
- * *
- ***************************************************************************/
-
-+#include <cstring>
- #include <string>
- #include <stdio.h>
- #include "celestiacore.h"
diff --git a/misc/celestia/patches/patch-src_celmath_mathlib.h b/misc/celestia/patches/patch-src_celmath_mathlib.h
index c24dd461bf9..7c74b80ce2d 100644
--- a/misc/celestia/patches/patch-src_celmath_mathlib.h
+++ b/misc/celestia/patches/patch-src_celmath_mathlib.h
@@ -1,9 +1,9 @@
-$NetBSD: patch-src_celmath_mathlib.h,v 1.2 2012/07/03 17:40:36 joerg Exp $
+$NetBSD: patch-src_celmath_mathlib.h,v 1.3 2013/10/27 21:21:26 dholland Exp $
---- src/celmath/mathlib.h.orig 2002-03-12 04:58:25.000000000 +0000
+--- src/celmath/mathlib.h.orig 2011-06-05 16:11:15.000000000 +0000
+++ src/celmath/mathlib.h
@@ -11,7 +11,7 @@
- #define _MATHLIB_H_
+ #define _CELMATH_MATHLIB_H_
#include <cmath>
-#include <stdlib.h>