From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH] gnu: Add Xplanet Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Mar 2020 08:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40322@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158555639029787 (code B ref -1); Mon, 30 Mar 2020 08:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Mar 2020 08:19:50 +0000 Received: from localhost ([127.0.0.1]:60408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIpe9-0007kM-C0 for submit@debbugs.gnu.org; Mon, 30 Mar 2020 04:19:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:34213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIpe7-0007kF-Ty for submit@debbugs.gnu.org; Mon, 30 Mar 2020 04:19:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIpe5-0004ze-GO for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIpe2-00071f-Ul for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:45 -0400 Received: from vkten.in ([104.244.73.96]:39936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIpe2-0006yL-Jn for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:42 -0400 Received: (qmail 11753 invoked from network); 30 Mar 2020 08:19:37 -0000 Received: from unknown (HELO tulip) (vkor@vkten.in@117.246.211.161) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 30 Mar 2020 08:19:37 -0000 Date: Mon, 30 Mar 2020 13:49:29 +0530 From: R Veera Kumar Message-ID: <20200330081929.GA7259@tulip> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 104.244.73.96 X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Xplanet renders an image of a planet into an X window or file. Signed-off-by: R Veera Kumar --- gnu/packages/astronomy.scm | 51 ++++++ .../patches/xplanet-1.3.1-c++11.patch | 157 ++++++++++++++++++ ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 12 ++ .../xplanet-1.3.1-libimage_gif.c.patch | 50 ++++++ ...planet-1.3.1-readConfig-fixclang.cpp.patch | 74 +++++++++ ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 11 ++ 6 files changed, 355 insertions(+) create mode 100644 gnu/packages/patches/xplanet-1.3.1-c++11.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 3bb236fde9..efcba8f311 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -25,9 +25,11 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages image) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages version-control) #:use-module (gnu packages pkg-config) @@ -41,6 +43,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages maths) + #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -289,3 +292,51 @@ Mechanics, Astrometry and Astrodynamics library.") (license (list license:lgpl2.0+ license:gpl2+)))) ; examples/transforms.c & lntest/*.c +(define-public xplanet + (package + (name "xplanet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/xplanet/xplanet/" + version "/xplanet-" version ".tar.gz")) + (sha256 + (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023")) + (patches + (search-patches + "xplanet-1.3.1-c++11.patch" + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" + "xplanet-1.3.1-libimage_gif.c.patch" + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("libxext" ,libxext) + ("libice" ,libice) + ("freetype" ,freetype) + ("pango" ,pango) + ("giflib" ,giflib) + ("libjpeg", libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (list + "--without-pnm" ;; no proper pnm library in guix + "--without-cspice"))) ;; no jpl cspice support + (home-page "http://xplanet.sourceforge.net/") + (synopsis "Planetary body renderer") + (description + "Xplanet renders an image of a planet into an X window or file. +All of the major planets and most satellites can be drawn and different map +projections are also supported, including azimuthal, hemisphere, Lambert, +Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/xplanet-1.3.1-c++11.patch b/gnu/packages/patches/xplanet-1.3.1-c++11.patch new file mode 100644 index 0000000000..3ead8872e0 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-c++11.patch @@ -0,0 +1,157 @@ +Index: src/libannotate/addArcs.cpp +=================================================================== +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp +--- a/src/libannotate/addArcs.cpp (revision 206) ++++ b/src/libannotate/addArcs.cpp (revision 207) +@@ -258,7 +258,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readArcFile(line, planet, view, projection, + planetProperties, annotationMap); + +@@ -292,7 +292,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[256]; +- while (inFile.getline (line, 256, '\n') != NULL) ++ while (inFile.getline (line, 256, '\n')) + readArcFile(line, NULL, view, NULL, NULL, annotationMap); + + inFile.close(); +Index: src/libannotate/addMarkers.cpp +=================================================================== +diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp +--- a/src/libannotate/addMarkers.cpp (revision 206) ++++ b/src/libannotate/addMarkers.cpp (revision 207) +@@ -429,7 +429,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, planetProperties->MarkerColor(), 3); +@@ -475,7 +475,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, options->Color(), 3); +Index: src/libannotate/addSatellites.cpp +=================================================================== +diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp +--- a/src/libannotate/addSatellites.cpp (revision 206) ++++ b/src/libannotate/addSatellites.cpp (revision 207) +@@ -488,10 +488,10 @@ + { + ifstream inFile(tleFile.c_str()); + char lines[3][80]; +- while (inFile.getline(lines[0], 80) != NULL) ++ while (inFile.getline(lines[0], 80)) + { +- if ((inFile.getline(lines[1], 80) == NULL) +- || (inFile.getline(lines[2], 80) == NULL)) ++ if ((!inFile.getline(lines[1], 80)) ++ || (!inFile.getline(lines[2], 80))) + { + ostringstream errStr; + errStr << "Malformed TLE file (" << tleFile << ")?\n"; +@@ -542,7 +542,7 @@ + { + ifstream inFile(satFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readSatelliteFile(line, planet, view, projection, + planetProperties, annotationMap); + +Index: src/libannotate/addSpiceObjects.cpp +=================================================================== +diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp +--- a/src/libannotate/addSpiceObjects.cpp (revision 206) ++++ b/src/libannotate/addSpiceObjects.cpp (revision 207) +@@ -524,7 +524,7 @@ + { + ifstream inFile(kernelFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int ii = 0; + while (isDelimiter(line[ii])) +@@ -576,7 +576,7 @@ + { + ifstream inFile(spiceFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + readSpiceFile(line, planetsFromSunMap, view, projection, + annotationMap); + inFile.close(); +Index: src/libmultiple/RayleighScattering.cpp +=================================================================== +diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp +--- a/src/libmultiple/RayleighScattering.cpp (revision 206) ++++ b/src/libmultiple/RayleighScattering.cpp (revision 207) +@@ -369,7 +369,7 @@ + + diskTemplate_.clear(); + limbTemplate_.clear(); +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -439,7 +439,7 @@ + values.clear(); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -470,7 +470,7 @@ + double &value) + { + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +Index: src/libmultiple/drawStars.cpp +=================================================================== +diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp +--- a/src/libmultiple/drawStars.cpp (revision 206) ++++ b/src/libmultiple/drawStars.cpp (revision 207) +@@ -41,7 +41,7 @@ + ifstream inFile(starMap.c_str()); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + if (line[0] == '#') continue; + +Index: src/readConfig.cpp +=================================================================== +diff --git a/src/readConfig.cpp b/src/readConfig.cpp +--- a/src/readConfig.cpp (revision 206) ++++ b/src/readConfig.cpp (revision 207) +@@ -550,7 +550,7 @@ + + ifstream inFile(configFile.c_str()); + char *line = new char[256]; +- while (inFile.getline(line, 256, '\n') != NULL) ++ while (inFile.getline(line, 256, '\n')) + readConfig(line, planetProperties); + + // This condition will only be true if [default] is the only diff --git a/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch new file mode 100644 index 0000000000..2f6c5c77de --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch @@ -0,0 +1,12 @@ +diff -uNr xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp +--- xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp 2020-03-28 22:08:44.432499170 +0530 +@@ -51,7 +51,7 @@ + string outputFilename = options->OutputBase(); + int startIndex = options->OutputStartIndex(); + int stopIndex = options->NumTimes() + startIndex - 1; +- if (stopIndex > 1) ++ if (stopIndex > 0) + { + const int digits = (int) (log10((double) stopIndex) + 1); + char buffer[64]; diff --git a/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch new file mode 100644 index 0000000000..d5b3d0cdef --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch @@ -0,0 +1,50 @@ +diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c +--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530 +@@ -21,7 +21,7 @@ + #include + #include + #include +- ++#include + #include + + /* +@@ -178,8 +178,12 @@ + *BufferP++ = ColorMapEntry->Blue; + } + } +- ++ ++#if GIFLIB_MAJOR >= 5 ++ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(GifFile) == GIF_ERROR) { ++#endif + return(0); + } + +@@ -493,7 +497,11 @@ + static void QuitGifError(GifFileType *GifFile) + { + fprintf(stderr, "Error writing GIF file\n"); ++#if GIFLIB_MAJOR >= 5 ++ if (GifFile != NULL) EGifCloseFile(GifFile, NULL); ++#else + if (GifFile != NULL) EGifCloseFile(GifFile); ++#endif + } + + int +@@ -589,7 +597,11 @@ + Ptr += width; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) ++#else + if (EGifCloseFile(GifFile) == GIF_ERROR) ++#endif + + { + QuitGifError(GifFile); diff --git a/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch new file mode 100644 index 0000000000..2f018a03d2 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch @@ -0,0 +1,74 @@ +diff -uNr xplanet-1.3.1/src/readConfig.cpp xplanet-1.3.1.new/src/readConfig.cpp +--- xplanet-1.3.1/src/readConfig.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/readConfig.cpp 2020-03-28 22:17:19.919078929 +0530 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + using namespace std; + + #include "body.h" +@@ -20,6 +21,8 @@ + static PlanetProperties *defaultProperties; + static PlanetProperties *currentProperties; + ++static inline unsigned char i2b( int x ) { return static_cast(x) & 0xffU; } ++ + static void + readConfig(const char *line, PlanetProperties *planetProperties[]) + { +@@ -49,7 +52,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->ArcColor(color); + } + else +@@ -179,7 +182,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->Color(color); + } + else +@@ -244,7 +247,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->GridColor(color); + } + else +@@ -296,7 +299,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->MarkerColor(color); + } + else +@@ -403,7 +406,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->OrbitColor(color); + } + else +@@ -473,7 +476,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->TextColor(color); + } + else diff --git a/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch new file mode 100644 index 0000000000..fea2062f4a --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch @@ -0,0 +1,11 @@ +diff -uNr xplanet-1.3.1/src/xpUtil.cpp xplanet-1.3.1.new/src/xpUtil.cpp +--- xplanet-1.3.1/src/xpUtil.cpp 2016-03-12 08:36:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/xpUtil.cpp 2020-03-28 22:19:10.629891166 +0530 +@@ -434,6 +434,7 @@ + if (jd >= toJulian(2009, 1, 1, 0, 0, 0)) delta_at++; // 34 + if (jd >= toJulian(2012, 7, 1, 0, 0, 0)) delta_at++; // 35 + if (jd >= toJulian(2015, 7, 1, 0, 0, 0)) delta_at++; // 36 ++ if (jd >= toJulian(2017, 1, 1, 0, 0, 0)) delta_at++; // 37 + + const double J2000 = toJulian(2000, 1, 1, 12, 0, 0); + const double m = m0 + m1 * (jd - J2000) * 86400; -- 2.26.0 From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH] gnu: Add Xplanet Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Mar 2020 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: R Veera Kumar Cc: 40322@debbugs.gnu.org Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.158556566214180 (code B ref 40322); Mon, 30 Mar 2020 10:55:02 +0000 Received: (at 40322) by debbugs.gnu.org; 30 Mar 2020 10:54:22 +0000 Received: from localhost ([127.0.0.1]:32785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIs3i-0003gd-Di for submit@debbugs.gnu.org; Mon, 30 Mar 2020 06:54:22 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:37708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIs3h-0003gT-1C for 40322@debbugs.gnu.org; Mon, 30 Mar 2020 06:54:21 -0400 Received: from localhost (unknown [185.128.244.187]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 741373362976; Mon, 30 Mar 2020 12:54:19 +0200 (CEST) Date: Mon, 30 Mar 2020 12:54:18 +0200 From: Danny Milosavljevic Message-ID: <20200330125418.24702631@scratchpost.org> In-Reply-To: <20200330081929.GA7259@tulip> References: <20200330081929.GA7259@tulip> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/TfbAdqC3gsIhfi.lJR+zpVX"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/TfbAdqC3gsIhfi.lJR+zpVX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi, please add an extra line to each patch which records where you got it from = (at least the author and year). Otherwise OK. --Sig_/TfbAdqC3gsIhfi.lJR+zpVX Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6Bz9oACgkQ5xo1VCww uqV5XQf8CG7PUIKP5/kDi8qp3TbG9txM5Izfgt44jaF1M20L8rQZJIMYdAxC0IHi g35FKBj0bw2Qb6aHMCphaRoG4U3mip/j/wtzkF8bPPbCmpu9hI+H8EdcNDPlXtq0 /Gq/Glt+GLnvrxfo7Al+MW57mCgFqNrqdq5PZjaQmuLodtI7SajETQj3Ve4TSxXW JNWoWyM/3JPslZj21rRvfi5TVUMzY1JlrFQvJZ47wat/Aeddh8AEqj3ETXsBTYtl SrTDTbYqifzG7VcpUHXD/YTPFwXQb6OqrXvlY7zw1Gk14fNaDZMp+eGy5C+7+sNC ceM1aoTjeLKPRDFYk96deEVn9P61tw== =HJ8P -----END PGP SIGNATURE----- --Sig_/TfbAdqC3gsIhfi.lJR+zpVX-- From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v2] gnu: Add Xplanet References: <20200330081929.GA7259@tulip> In-Reply-To: <20200330081929.GA7259@tulip> Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Mar 2020 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40322@debbugs.gnu.org Cc: Danny Milosavljevic Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.158558757513497 (code B ref 40322); Mon, 30 Mar 2020 17:00:02 +0000 Received: (at 40322) by debbugs.gnu.org; 30 Mar 2020 16:59:35 +0000 Received: from localhost ([127.0.0.1]:34938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIxl8-0003Vc-Sy for submit@debbugs.gnu.org; Mon, 30 Mar 2020 12:59:35 -0400 Received: from vkten.in ([104.244.73.96]:56734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIxl6-0003VO-Lg for 40322@debbugs.gnu.org; Mon, 30 Mar 2020 12:59:33 -0400 Received: (qmail 19430 invoked from network); 30 Mar 2020 16:59:11 -0000 Received: from unknown (HELO tulip) (vkor@vkten.in@117.246.179.23) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 30 Mar 2020 16:59:11 -0000 Date: Mon, 30 Mar 2020 22:28:08 +0530 From: R Veera Kumar Message-ID: <20200330165808.GA10546@tulip> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Xplanet renders an image of a planet into an X window or file. Signed-off-by: R Veera Kumar --- Changes in v2: - Add origin, author and year in patches --- gnu/packages/astronomy.scm | 51 ++++++ ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 16 ++ .../xplanet-1.3.1-libimage_gif.c.patch | 54 ++++++ ...planet-1.3.1-readConfig-fixclang.cpp.patch | 78 +++++++++ ...xplanet-1.3.1-remove-null-comparison.patch | 161 ++++++++++++++++++ ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 15 ++ 6 files changed, 375 insertions(+) create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 3bb236fde9..b6ae59ba22 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -25,9 +25,11 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages image) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages version-control) #:use-module (gnu packages pkg-config) @@ -41,6 +43,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages maths) + #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -289,3 +292,51 @@ Mechanics, Astrometry and Astrodynamics library.") (license (list license:lgpl2.0+ license:gpl2+)))) ; examples/transforms.c & lntest/*.c +(define-public xplanet + (package + (name "xplanet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/xplanet/xplanet/" + version "/xplanet-" version ".tar.gz")) + (sha256 + (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023")) + (patches + (search-patches + "xplanet-1.3.1-remove-null-comparison.patch" + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" + "xplanet-1.3.1-libimage_gif.c.patch" + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("libxext" ,libxext) + ("libice" ,libice) + ("freetype" ,freetype) + ("pango" ,pango) + ("giflib" ,giflib) + ("libjpeg", libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (list + "--without-pnm" ;; no proper pnm library in guix + "--without-cspice"))) ;; no jpl cspice support + (home-page "http://xplanet.sourceforge.net/") + (synopsis "Planetary body renderer") + (description + "Xplanet renders an image of a planet into an X window or file. +All of the major planets and most satellites can be drawn and different map +projections are also supported, including azimuthal, hemisphere, Lambert, +Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch new file mode 100644 index 0000000000..bf52b0ca27 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch @@ -0,0 +1,16 @@ +Origin: $NetBSD: patch-src_libdisplay_DisplayOutput.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp +--- xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp 2020-03-28 22:08:44.432499170 +0530 +@@ -51,7 +51,7 @@ + string outputFilename = options->OutputBase(); + int startIndex = options->OutputStartIndex(); + int stopIndex = options->NumTimes() + startIndex - 1; +- if (stopIndex > 1) ++ if (stopIndex > 0) + { + const int digits = (int) (log10((double) stopIndex) + 1); + char buffer[64]; diff --git a/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch new file mode 100644 index 0000000000..58efc906dc --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch @@ -0,0 +1,54 @@ +Origin: $NetBSD: patch-src_libimage_gif.c,v 1.4 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c +--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530 +@@ -21,7 +21,7 @@ + #include + #include + #include +- ++#include + #include + + /* +@@ -178,8 +178,12 @@ + *BufferP++ = ColorMapEntry->Blue; + } + } +- ++ ++#if GIFLIB_MAJOR >= 5 ++ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(GifFile) == GIF_ERROR) { ++#endif + return(0); + } + +@@ -493,7 +497,11 @@ + static void QuitGifError(GifFileType *GifFile) + { + fprintf(stderr, "Error writing GIF file\n"); ++#if GIFLIB_MAJOR >= 5 ++ if (GifFile != NULL) EGifCloseFile(GifFile, NULL); ++#else + if (GifFile != NULL) EGifCloseFile(GifFile); ++#endif + } + + int +@@ -589,7 +597,11 @@ + Ptr += width; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) ++#else + if (EGifCloseFile(GifFile) == GIF_ERROR) ++#endif + + { + QuitGifError(GifFile); diff --git a/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch new file mode 100644 index 0000000000..102887b780 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch @@ -0,0 +1,78 @@ +Origin: $NetBSD: patch-src_readConfig-fixclang.cpp,v 1.2 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/readConfig.cpp xplanet-1.3.1.new/src/readConfig.cpp +--- xplanet-1.3.1/src/readConfig.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/readConfig.cpp 2020-03-28 22:17:19.919078929 +0530 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + using namespace std; + + #include "body.h" +@@ -20,6 +21,8 @@ + static PlanetProperties *defaultProperties; + static PlanetProperties *currentProperties; + ++static inline unsigned char i2b( int x ) { return static_cast(x) & 0xffU; } ++ + static void + readConfig(const char *line, PlanetProperties *planetProperties[]) + { +@@ -49,7 +52,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->ArcColor(color); + } + else +@@ -179,7 +182,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->Color(color); + } + else +@@ -244,7 +247,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->GridColor(color); + } + else +@@ -296,7 +299,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->MarkerColor(color); + } + else +@@ -403,7 +406,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->OrbitColor(color); + } + else +@@ -473,7 +476,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->TextColor(color); + } + else diff --git a/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch new file mode 100644 index 0000000000..002701ed0c --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch @@ -0,0 +1,161 @@ +Origin: Gentoo Harri Nieminen 2017-02-28 +Url: https://gitweb.gentoo.org/repo/gentoo.git/log/x11-misc/xplanet/files/ ++xplanet-1.3.1-remove-null-comparison.patch + +Index: src/libannotate/addArcs.cpp +=================================================================== +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp +--- a/src/libannotate/addArcs.cpp (revision 206) ++++ b/src/libannotate/addArcs.cpp (revision 207) +@@ -258,7 +258,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readArcFile(line, planet, view, projection, + planetProperties, annotationMap); + +@@ -292,7 +292,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[256]; +- while (inFile.getline (line, 256, '\n') != NULL) ++ while (inFile.getline (line, 256, '\n')) + readArcFile(line, NULL, view, NULL, NULL, annotationMap); + + inFile.close(); +Index: src/libannotate/addMarkers.cpp +=================================================================== +diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp +--- a/src/libannotate/addMarkers.cpp (revision 206) ++++ b/src/libannotate/addMarkers.cpp (revision 207) +@@ -429,7 +429,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, planetProperties->MarkerColor(), 3); +@@ -475,7 +475,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, options->Color(), 3); +Index: src/libannotate/addSatellites.cpp +=================================================================== +diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp +--- a/src/libannotate/addSatellites.cpp (revision 206) ++++ b/src/libannotate/addSatellites.cpp (revision 207) +@@ -488,10 +488,10 @@ + { + ifstream inFile(tleFile.c_str()); + char lines[3][80]; +- while (inFile.getline(lines[0], 80) != NULL) ++ while (inFile.getline(lines[0], 80)) + { +- if ((inFile.getline(lines[1], 80) == NULL) +- || (inFile.getline(lines[2], 80) == NULL)) ++ if ((!inFile.getline(lines[1], 80)) ++ || (!inFile.getline(lines[2], 80))) + { + ostringstream errStr; + errStr << "Malformed TLE file (" << tleFile << ")?\n"; +@@ -542,7 +542,7 @@ + { + ifstream inFile(satFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readSatelliteFile(line, planet, view, projection, + planetProperties, annotationMap); + +Index: src/libannotate/addSpiceObjects.cpp +=================================================================== +diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp +--- a/src/libannotate/addSpiceObjects.cpp (revision 206) ++++ b/src/libannotate/addSpiceObjects.cpp (revision 207) +@@ -524,7 +524,7 @@ + { + ifstream inFile(kernelFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int ii = 0; + while (isDelimiter(line[ii])) +@@ -576,7 +576,7 @@ + { + ifstream inFile(spiceFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + readSpiceFile(line, planetsFromSunMap, view, projection, + annotationMap); + inFile.close(); +Index: src/libmultiple/RayleighScattering.cpp +=================================================================== +diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp +--- a/src/libmultiple/RayleighScattering.cpp (revision 206) ++++ b/src/libmultiple/RayleighScattering.cpp (revision 207) +@@ -369,7 +369,7 @@ + + diskTemplate_.clear(); + limbTemplate_.clear(); +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -439,7 +439,7 @@ + values.clear(); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -470,7 +470,7 @@ + double &value) + { + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +Index: src/libmultiple/drawStars.cpp +=================================================================== +diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp +--- a/src/libmultiple/drawStars.cpp (revision 206) ++++ b/src/libmultiple/drawStars.cpp (revision 207) +@@ -41,7 +41,7 @@ + ifstream inFile(starMap.c_str()); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + if (line[0] == '#') continue; + +Index: src/readConfig.cpp +=================================================================== +diff --git a/src/readConfig.cpp b/src/readConfig.cpp +--- a/src/readConfig.cpp (revision 206) ++++ b/src/readConfig.cpp (revision 207) +@@ -550,7 +550,7 @@ + + ifstream inFile(configFile.c_str()); + char *line = new char[256]; +- while (inFile.getline(line, 256, '\n') != NULL) ++ while (inFile.getline(line, 256, '\n')) + readConfig(line, planetProperties); + + // This condition will only be true if [default] is the only diff --git a/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch new file mode 100644 index 0000000000..a47623fa00 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch @@ -0,0 +1,15 @@ +$NetBSD: patch-src_xpUtil-Add2017LeapSecond.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/xpUtil.cpp xplanet-1.3.1.new/src/xpUtil.cpp +--- xplanet-1.3.1/src/xpUtil.cpp 2016-03-12 08:36:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/xpUtil.cpp 2020-03-28 22:19:10.629891166 +0530 +@@ -434,6 +434,7 @@ + if (jd >= toJulian(2009, 1, 1, 0, 0, 0)) delta_at++; // 34 + if (jd >= toJulian(2012, 7, 1, 0, 0, 0)) delta_at++; // 35 + if (jd >= toJulian(2015, 7, 1, 0, 0, 0)) delta_at++; // 36 ++ if (jd >= toJulian(2017, 1, 1, 0, 0, 0)) delta_at++; // 37 + + const double J2000 = toJulian(2000, 1, 1, 12, 0, 0); + const double m = m0 + m1 * (jd - J2000) * 86400; -- 2.26.0 From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v2] gnu: Add Xplanet Resent-From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Mar 2020 20:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: R Veera Kumar Cc: 40322@debbugs.gnu.org, Danny Milosavljevic Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.15855990419602 (code B ref 40322); Mon, 30 Mar 2020 20:11:02 +0000 Received: (at 40322) by debbugs.gnu.org; 30 Mar 2020 20:10:41 +0000 Received: from localhost ([127.0.0.1]:35145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ0k5-0002Uo-0J for submit@debbugs.gnu.org; Mon, 30 Mar 2020 16:10:41 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:46038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ0k0-0002Ub-FS for 40322@debbugs.gnu.org; Mon, 30 Mar 2020 16:10:39 -0400 Received: (qmail 22944 invoked by uid 1009); 30 Mar 2020 22:10:34 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25766. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.023153 secs); 30 Mar 2020 20:10:34 -0000 Received: from unknown (HELO gravity) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with SMTP; 30 Mar 2020 22:10:34 +0200 Date: Mon, 30 Mar 2020 22:10:32 +0200 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Message-ID: <20200330201032.ta53dlld3ybwggsa@gravity> References: <20200330165808.GA10546@tulip> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6evhd7xcy6tn5dr3" Content-Disposition: inline In-Reply-To: <20200330165808.GA10546@tulip> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --6evhd7xcy6tn5dr3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 30, 2020 at 10:28:08PM +0530, R Veera Kumar wrote: > gnu/packages/astronomy.scm | 51 ++++++ > ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 16 ++ > .../xplanet-1.3.1-libimage_gif.c.patch | 54 ++++++ > ...planet-1.3.1-readConfig-fixclang.cpp.patch | 78 +++++++++ > ...xplanet-1.3.1-remove-null-comparison.patch | 161 ++++++++++++++++++ > ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 15 ++ > 6 files changed, 375 insertions(+) > create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_Display= Output.cpp.patch > create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.pat= ch > create mode 100644 gnu/packages/patches/xplanet-1.3.1-readConfig-fixclan= g.cpp.patch > create mode 100644 gnu/packages/patches/xplanet-1.3.1-remove-null-compar= ison.patch > create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017Leap= Second.cpp.patch Veera, don't forget to register your new files in gnu/local.mk Regards, Jakub K=C4=85dzio=C5=82ka --6evhd7xcy6tn5dr3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl6CUjgACgkQ4xWnWEYT FWQxQxAAlADHVE33A2gSO34o1Ay48npLJDPXcvf2xL/LK5oE0y4mBRierS86ADQ+ 2lVryaaxTv8V36DyxiQVxVlgrcnxN+Q7n1p9ntDYE5JRCnS3eN6GsnqZH7YHKso7 IDBLHDRKlsZvroWzfoANIouJVGxclXznd7GkUOuPWrsECxEEG/S0imsVQ1gNUg1S xNidSTbTtdgDl2vj1w24/vuEoIEiWEJUtevvlv2ZoF79TF4ou00DHZR5ZQZFE6Lx bhF702ehm1yLs+YsXB+Iqp4G7DfjFOu4yONF0DKS/2TyBNu3AYILY1acR6C0FfNg 79HX4ZFPfEI/XRa9ZIPM8j1cuSj4Nqs+2iQHuVQXkkScYjAuSSz8dsHEFMreWcue Qd9gMyP7THUMjsMGo1UfrpLQ/bSd2FD/E9qUIlQoy22DLttz9UejeeSXxEZfeOwA 0ltHUV+WgqAjkjHrXno1qxXlxLNYcb4Mehn+4EsJw/87dnYUiaRVEZx8BSLO6hXD 3CwM5bhMxVGCmQ0tefpMHkUjOgnYqRo2RgGx0r6PtJsX5q2avIHzacpF1lf52HtN ELcXpbk+m1P/EK082JNKiVhddwv8clHf7SDgAe3mxwwhXyb2jljGc58P5hAldaOB LkNoxuQJ+IgUEiNz96xiXnvrehZjR8a2ZCY9CCmstGtzZ/wZsuk= =jZFv -----END PGP SIGNATURE----- --6evhd7xcy6tn5dr3-- From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v3] gnu: Add Xplanet. References: <20200330081929.GA7259@tulip> In-Reply-To: <20200330081929.GA7259@tulip> Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 31 Mar 2020 07:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40322@debbugs.gnu.org Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.15856415144558 (code B ref 40322); Tue, 31 Mar 2020 07:59:02 +0000 Received: (at 40322) by debbugs.gnu.org; 31 Mar 2020 07:58:34 +0000 Received: from localhost ([127.0.0.1]:35472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJBn1-0001BJ-3B for submit@debbugs.gnu.org; Tue, 31 Mar 2020 03:58:33 -0400 Received: from vkten.in ([104.244.73.96]:56738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJBmw-0001B2-5q for 40322@debbugs.gnu.org; Tue, 31 Mar 2020 03:58:25 -0400 Received: (qmail 1069 invoked from network); 31 Mar 2020 07:58:06 -0000 Received: from unknown (HELO tulip) (vkor@vkten.in@117.249.234.149) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 31 Mar 2020 07:58:06 -0000 Date: Tue, 31 Mar 2020 13:27:57 +0530 From: R Veera Kumar Message-ID: <20200331075757.GA1219@tulip> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/astronomy.scm (xplanet): New variable. * gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch: New file. * gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch: New file. * gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch: New file. * gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch: New file. * gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch: New file. * gnu/packages/astronomy.scm (xplanet)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add them. Signed-off-by: R Veera Kumar --- Changes in v3: - Add patches to gnu/local.mk - Put Copyright marks in files Changes in v2: - Add origin, author and year in patches --- gnu/local.mk | 6 + gnu/packages/astronomy.scm | 52 ++++++ ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 16 ++ .../xplanet-1.3.1-libimage_gif.c.patch | 54 ++++++ ...planet-1.3.1-readConfig-fixclang.cpp.patch | 78 +++++++++ ...xplanet-1.3.1-remove-null-comparison.patch | 161 ++++++++++++++++++ ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 15 ++ 7 files changed, 382 insertions(+) create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch diff --git a/gnu/local.mk b/gnu/local.mk index eec65c6565..1470b227d9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -28,6 +28,7 @@ # Copyright © 2019 Amin Bandali # Copyright © 2020 Brendan Tildesley # Copyright © 2020 Vincent Legoll +# Copyright © 2020 R Veera Kumar # # This file is part of GNU Guix. # @@ -1524,6 +1525,11 @@ dist_patch_DATA = \ %D%/packages/patches/xmoto-utf8.patch \ %D%/packages/patches/xmoto-remove-glext.patch \ %D%/packages/patches/xmoto-reproducible.patch \ + %D%/packages/patches/xplanet-1.3.1-remove-null-comparison.patch \ + %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ + %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ + %D%/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch \ + %D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \ %D%/packages/patches/xsane-fix-memory-leak.patch \ %D%/packages/patches/xsane-fix-pdf-floats.patch \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 3bb236fde9..49fe76128e 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Efraim Flashner ;;; Copyright © 2019 by Amar Singh +;;; Copyright © 2020 R Veera Kumar ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,9 +26,11 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages image) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages version-control) #:use-module (gnu packages pkg-config) @@ -41,6 +44,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages maths) + #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -289,3 +293,51 @@ Mechanics, Astrometry and Astrodynamics library.") (license (list license:lgpl2.0+ license:gpl2+)))) ; examples/transforms.c & lntest/*.c +(define-public xplanet + (package + (name "xplanet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/xplanet/xplanet/" + version "/xplanet-" version ".tar.gz")) + (sha256 + (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023")) + (patches + (search-patches + "xplanet-1.3.1-remove-null-comparison.patch" + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" + "xplanet-1.3.1-libimage_gif.c.patch" + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("libxext" ,libxext) + ("libice" ,libice) + ("freetype" ,freetype) + ("pango" ,pango) + ("giflib" ,giflib) + ("libjpeg", libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (list + "--without-pnm" ;; no proper pnm library in guix + "--without-cspice"))) ;; no jpl cspice support + (home-page "http://xplanet.sourceforge.net/") + (synopsis "Planetary body renderer") + (description + "Xplanet renders an image of a planet into an X window or file. +All of the major planets and most satellites can be drawn and different map +projections are also supported, including azimuthal, hemisphere, Lambert, +Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch new file mode 100644 index 0000000000..bf52b0ca27 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch @@ -0,0 +1,16 @@ +Origin: $NetBSD: patch-src_libdisplay_DisplayOutput.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp +--- xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp 2020-03-28 22:08:44.432499170 +0530 +@@ -51,7 +51,7 @@ + string outputFilename = options->OutputBase(); + int startIndex = options->OutputStartIndex(); + int stopIndex = options->NumTimes() + startIndex - 1; +- if (stopIndex > 1) ++ if (stopIndex > 0) + { + const int digits = (int) (log10((double) stopIndex) + 1); + char buffer[64]; diff --git a/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch new file mode 100644 index 0000000000..58efc906dc --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch @@ -0,0 +1,54 @@ +Origin: $NetBSD: patch-src_libimage_gif.c,v 1.4 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c +--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530 +@@ -21,7 +21,7 @@ + #include + #include + #include +- ++#include + #include + + /* +@@ -178,8 +178,12 @@ + *BufferP++ = ColorMapEntry->Blue; + } + } +- ++ ++#if GIFLIB_MAJOR >= 5 ++ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(GifFile) == GIF_ERROR) { ++#endif + return(0); + } + +@@ -493,7 +497,11 @@ + static void QuitGifError(GifFileType *GifFile) + { + fprintf(stderr, "Error writing GIF file\n"); ++#if GIFLIB_MAJOR >= 5 ++ if (GifFile != NULL) EGifCloseFile(GifFile, NULL); ++#else + if (GifFile != NULL) EGifCloseFile(GifFile); ++#endif + } + + int +@@ -589,7 +597,11 @@ + Ptr += width; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) ++#else + if (EGifCloseFile(GifFile) == GIF_ERROR) ++#endif + + { + QuitGifError(GifFile); diff --git a/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch new file mode 100644 index 0000000000..102887b780 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch @@ -0,0 +1,78 @@ +Origin: $NetBSD: patch-src_readConfig-fixclang.cpp,v 1.2 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/readConfig.cpp xplanet-1.3.1.new/src/readConfig.cpp +--- xplanet-1.3.1/src/readConfig.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/readConfig.cpp 2020-03-28 22:17:19.919078929 +0530 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + using namespace std; + + #include "body.h" +@@ -20,6 +21,8 @@ + static PlanetProperties *defaultProperties; + static PlanetProperties *currentProperties; + ++static inline unsigned char i2b( int x ) { return static_cast(x) & 0xffU; } ++ + static void + readConfig(const char *line, PlanetProperties *planetProperties[]) + { +@@ -49,7 +52,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->ArcColor(color); + } + else +@@ -179,7 +182,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->Color(color); + } + else +@@ -244,7 +247,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->GridColor(color); + } + else +@@ -296,7 +299,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->MarkerColor(color); + } + else +@@ -403,7 +406,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->OrbitColor(color); + } + else +@@ -473,7 +476,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->TextColor(color); + } + else diff --git a/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch new file mode 100644 index 0000000000..002701ed0c --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch @@ -0,0 +1,161 @@ +Origin: Gentoo Harri Nieminen 2017-02-28 +Url: https://gitweb.gentoo.org/repo/gentoo.git/log/x11-misc/xplanet/files/ ++xplanet-1.3.1-remove-null-comparison.patch + +Index: src/libannotate/addArcs.cpp +=================================================================== +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp +--- a/src/libannotate/addArcs.cpp (revision 206) ++++ b/src/libannotate/addArcs.cpp (revision 207) +@@ -258,7 +258,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readArcFile(line, planet, view, projection, + planetProperties, annotationMap); + +@@ -292,7 +292,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[256]; +- while (inFile.getline (line, 256, '\n') != NULL) ++ while (inFile.getline (line, 256, '\n')) + readArcFile(line, NULL, view, NULL, NULL, annotationMap); + + inFile.close(); +Index: src/libannotate/addMarkers.cpp +=================================================================== +diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp +--- a/src/libannotate/addMarkers.cpp (revision 206) ++++ b/src/libannotate/addMarkers.cpp (revision 207) +@@ -429,7 +429,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, planetProperties->MarkerColor(), 3); +@@ -475,7 +475,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, options->Color(), 3); +Index: src/libannotate/addSatellites.cpp +=================================================================== +diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp +--- a/src/libannotate/addSatellites.cpp (revision 206) ++++ b/src/libannotate/addSatellites.cpp (revision 207) +@@ -488,10 +488,10 @@ + { + ifstream inFile(tleFile.c_str()); + char lines[3][80]; +- while (inFile.getline(lines[0], 80) != NULL) ++ while (inFile.getline(lines[0], 80)) + { +- if ((inFile.getline(lines[1], 80) == NULL) +- || (inFile.getline(lines[2], 80) == NULL)) ++ if ((!inFile.getline(lines[1], 80)) ++ || (!inFile.getline(lines[2], 80))) + { + ostringstream errStr; + errStr << "Malformed TLE file (" << tleFile << ")?\n"; +@@ -542,7 +542,7 @@ + { + ifstream inFile(satFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readSatelliteFile(line, planet, view, projection, + planetProperties, annotationMap); + +Index: src/libannotate/addSpiceObjects.cpp +=================================================================== +diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp +--- a/src/libannotate/addSpiceObjects.cpp (revision 206) ++++ b/src/libannotate/addSpiceObjects.cpp (revision 207) +@@ -524,7 +524,7 @@ + { + ifstream inFile(kernelFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int ii = 0; + while (isDelimiter(line[ii])) +@@ -576,7 +576,7 @@ + { + ifstream inFile(spiceFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + readSpiceFile(line, planetsFromSunMap, view, projection, + annotationMap); + inFile.close(); +Index: src/libmultiple/RayleighScattering.cpp +=================================================================== +diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp +--- a/src/libmultiple/RayleighScattering.cpp (revision 206) ++++ b/src/libmultiple/RayleighScattering.cpp (revision 207) +@@ -369,7 +369,7 @@ + + diskTemplate_.clear(); + limbTemplate_.clear(); +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -439,7 +439,7 @@ + values.clear(); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -470,7 +470,7 @@ + double &value) + { + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +Index: src/libmultiple/drawStars.cpp +=================================================================== +diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp +--- a/src/libmultiple/drawStars.cpp (revision 206) ++++ b/src/libmultiple/drawStars.cpp (revision 207) +@@ -41,7 +41,7 @@ + ifstream inFile(starMap.c_str()); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + if (line[0] == '#') continue; + +Index: src/readConfig.cpp +=================================================================== +diff --git a/src/readConfig.cpp b/src/readConfig.cpp +--- a/src/readConfig.cpp (revision 206) ++++ b/src/readConfig.cpp (revision 207) +@@ -550,7 +550,7 @@ + + ifstream inFile(configFile.c_str()); + char *line = new char[256]; +- while (inFile.getline(line, 256, '\n') != NULL) ++ while (inFile.getline(line, 256, '\n')) + readConfig(line, planetProperties); + + // This condition will only be true if [default] is the only diff --git a/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch new file mode 100644 index 0000000000..a47623fa00 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch @@ -0,0 +1,15 @@ +$NetBSD: patch-src_xpUtil-Add2017LeapSecond.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/xpUtil.cpp xplanet-1.3.1.new/src/xpUtil.cpp +--- xplanet-1.3.1/src/xpUtil.cpp 2016-03-12 08:36:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/xpUtil.cpp 2020-03-28 22:19:10.629891166 +0530 +@@ -434,6 +434,7 @@ + if (jd >= toJulian(2009, 1, 1, 0, 0, 0)) delta_at++; // 34 + if (jd >= toJulian(2012, 7, 1, 0, 0, 0)) delta_at++; // 35 + if (jd >= toJulian(2015, 7, 1, 0, 0, 0)) delta_at++; // 36 ++ if (jd >= toJulian(2017, 1, 1, 0, 0, 0)) delta_at++; // 37 + + const double J2000 = toJulian(2000, 1, 1, 12, 0, 0); + const double m = m0 + m1 * (jd - J2000) * 86400; -- 2.26.0 From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v3] gnu: Add Xplanet. Resent-From: Eric Bavier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 31 Mar 2020 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: R Veera Kumar Cc: 40322@debbugs.gnu.org, Guix-patches Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.158566623624512 (code B ref 40322); Tue, 31 Mar 2020 14:51:02 +0000 Received: (at 40322) by debbugs.gnu.org; 31 Mar 2020 14:50:36 +0000 Received: from localhost ([127.0.0.1]:36774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJIDs-0006NI-Dp for submit@debbugs.gnu.org; Tue, 31 Mar 2020 10:50:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJIDq-0006N0-76 for 40322@debbugs.gnu.org; Tue, 31 Mar 2020 10:50:34 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4CB4A2400FE for <40322@debbugs.gnu.org>; Tue, 31 Mar 2020 16:50:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1585666228; bh=D3N42mv0za/oa8FUl2s6C7nEpLtkEh2dDTawCosoAVI=; h=Date:From:To:Cc:Subject:From; b=csbCOtTeqU/nTYvvSlt0Xjj25iv1VAEk/Tpw/m3wu/Xi5/uGOb4NeiMNucG88uRDF PneTl6Iout9fGQkLFE3W6cZ8We7i0ec+Ynv6j4D561uNCfR/WGpNM/K2A2257CcLeH /rGuR4RHh0p2/qctK/fomJiXEv2TuPyvSBw78dbEc2ll/CfuYXTxRNhYtBh2n9bTHs jgTIfp2MsSSi029sJDNdA6bDxwQXEjjaXY4ZEGGmsmsfXODcSh1C3A9sRYV+yV1vIn SobmgOQjsnZ7VcAuzrsMY4GxzO1/QO5loIpDLj1GW4+7aDLPnsa/EhthSnHm8rcqcl WCGfoTIDZrDMw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48sC1H3gvJz9rxV; Tue, 31 Mar 2020 16:50:27 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 31 Mar 2020 09:50:27 -0500 From: Eric Bavier In-Reply-To: <20200331075757.GA1219@tulip> References: <20200330081929.GA7259@tulip> <20200331075757.GA1219@tulip> Message-ID: <0b0a249b0cdf15e14056c2c277e97187@posteo.net> X-Sender: bavier@posteo.net User-Agent: Posteo Webmail X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 31.03.2020 02:57, R Veera Kumar wrote: > + (patches > + (search-patches > + "xplanet-1.3.1-remove-null-comparison.patch" > + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" > + "xplanet-1.3.1-libimage_gif.c.patch" > + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" Is this patch necessary if we're building with gcc? > + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) > + (build-system gnu-build-system) > + (native-inputs > + `(("pkg-config" ,pkg-config))) > + (inputs > + `(("libx11" ,libx11) > + ("libxscrnsaver" ,libxscrnsaver) > + ("libxext" ,libxext) > + ("libice" ,libice) > + ("freetype" ,freetype) > + ("pango" ,pango) > + ("giflib" ,giflib) > + ("libjpeg", libjpeg) > + ("libpng" ,libpng) > + ("libtiff" ,libtiff) > + ("zlib" ,zlib))) > + (arguments > + `(#:configure-flags > + (list > + "--without-pnm" ;; no proper pnm library in guix The "netpbm" package provides a pnm library. > diff --git > a/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > new file mode 100644 > index 0000000000..002701ed0c > --- /dev/null > +++ b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > @@ -0,0 +1,161 @@ > +Origin: Gentoo Harri Nieminen 2017-02-28 > +Url: > https://gitweb.gentoo.org/repo/gentoo.git/log/x11-misc/xplanet/files/ > ++xplanet-1.3.1-remove-null-comparison.patch > + > +Index: src/libannotate/addArcs.cpp > +=================================================================== > +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp > +--- a/src/libannotate/addArcs.cpp (revision 206) > ++++ b/src/libannotate/addArcs.cpp (revision 207) > +@@ -258,7 +258,7 @@ > + { > + ifstream inFile(arcFile.c_str()); > + char *line = new char[MAX_LINE_LENGTH]; > +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != > NULL) > ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) I'm worried this might not be correct. The "getline" function always returns it's first parameter, which, I think, can never evaluate to a falsy value. The safer option would be to call ".eof()" on the result, and would match the intentions. See e.g. https://notabug.org/bavier/guix-bavier/src/master/bavier/patches/xplanet-cxx11-eof.patch -- `~Eric From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v3] gnu: Add Xplanet. Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Apr 2020 17:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Eric Bavier Cc: 40322@debbugs.gnu.org, Guix-patches Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.158576090926792 (code B ref 40322); Wed, 01 Apr 2020 17:09:01 +0000 Received: (at 40322) by debbugs.gnu.org; 1 Apr 2020 17:08:29 +0000 Received: from localhost ([127.0.0.1]:38607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJgqr-0006y3-Hc for submit@debbugs.gnu.org; Wed, 01 Apr 2020 13:08:29 -0400 Received: from vkten.in ([104.244.73.96]:56774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJgqp-0006xW-Cv for 40322@debbugs.gnu.org; Wed, 01 Apr 2020 13:08:28 -0400 Received: (qmail 29316 invoked from network); 1 Apr 2020 17:08:20 -0000 Received: from unknown (HELO tulip) (vkor@vkten.in@117.209.143.139) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 1 Apr 2020 17:08:20 -0000 Date: Wed, 1 Apr 2020 22:38:12 +0530 From: R Veera Kumar Message-ID: <20200401170812.GB16198@tulip> References: <20200330081929.GA7259@tulip> <20200331075757.GA1219@tulip> <0b0a249b0cdf15e14056c2c277e97187@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b0a249b0cdf15e14056c2c277e97187@posteo.net> X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Mar 31, 2020 at 09:50:27AM -0500, Eric Bavier wrote: > On 31.03.2020 02:57, R Veera Kumar wrote: > > + (patches > > + (search-patches > > + "xplanet-1.3.1-remove-null-comparison.patch" > > + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" > > + "xplanet-1.3.1-libimage_gif.c.patch" > > + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" > > Is this patch necessary if we're building with gcc? > No. It is to build with clang. I thought since Guix also has clang, it might be useful in future. I will drop it. > > + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) > > + (build-system gnu-build-system) > > + (native-inputs > > + `(("pkg-config" ,pkg-config))) > > + (inputs > > + ("giflib" ,giflib) > > + ("libjpeg", libjpeg) > > + ("libpng" ,libpng) > > + ("libtiff" ,libtiff) > > + ("zlib" ,zlib))) > > + (arguments > > + `(#:configure-flags > > + (list > > + "--without-pnm" ;; no proper pnm library in guix > > The "netpbm" package provides a pnm library. > I know it. It does not compiles with the current netpbm. The libnetpbm.so file is not installed by the pkg and xplanet configure script marks it as not available. I have filed bug report for this: #40376 It can be packaged without netpbm for now and when the fix is there I will enable it. > > diff --git > > a/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > > b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > > new file mode 100644 > > index 0000000000..002701ed0c > > --- /dev/null > > +++ b/gnu/packages/patches/xplanet-1.3.1-remove-null-comparison.patch > > @@ -0,0 +1,161 @@ > > +Origin: Gentoo Harri Nieminen 2017-02-28 > > +Url: > > https://gitweb.gentoo.org/repo/gentoo.git/log/x11-misc/xplanet/files/ > > ++xplanet-1.3.1-remove-null-comparison.patch > > + > > +Index: src/libannotate/addArcs.cpp > > +=================================================================== > > +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp > > +--- a/src/libannotate/addArcs.cpp (revision 206) > > ++++ b/src/libannotate/addArcs.cpp (revision 207) > > +@@ -258,7 +258,7 @@ > > + { > > + ifstream inFile(arcFile.c_str()); > > + char *line = new char[MAX_LINE_LENGTH]; > > +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != > > NULL) > > ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) > > I'm worried this might not be correct. The "getline" function always > returns it's first parameter, which, I think, can never evaluate to a falsy > value. The safer option would be to call ".eof()" on the result, and would > match the intentions. See e.g. https://notabug.org/bavier/guix-bavier/src/master/bavier/patches/xplanet-cxx11-eof.patch > Okay. I have tested with your patch and builds and works fine. R Veera Kumar > -- > `~Eric From unknown Sun Jun 15 08:42:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40322] [PATCH v4] gnu: Add xplanet. References: <20200330081929.GA7259@tulip> In-Reply-To: <20200330081929.GA7259@tulip> Resent-From: R Veera Kumar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Apr 2020 10:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40322 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40322@debbugs.gnu.org Cc: R Veera Kumar Received: via spool by 40322-submit@debbugs.gnu.org id=B40322.158582483432158 (code B ref 40322); Thu, 02 Apr 2020 10:54:02 +0000 Received: (at 40322) by debbugs.gnu.org; 2 Apr 2020 10:53:54 +0000 Received: from localhost ([127.0.0.1]:39263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJxTm-0008ME-Ah for submit@debbugs.gnu.org; Thu, 02 Apr 2020 06:53:53 -0400 Received: from vkten.in ([104.244.73.96]:56780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJxTi-0008LZ-3d for 40322@debbugs.gnu.org; Thu, 02 Apr 2020 06:53:45 -0400 Received: (qmail 17638 invoked from network); 2 Apr 2020 10:53:31 -0000 Received: from unknown (HELO localhost) (vkor@vkten.in@117.245.101.177) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 2 Apr 2020 10:53:31 -0000 From: R Veera Kumar Date: Thu, 2 Apr 2020 16:23:17 +0530 Message-Id: <20200402105317.12941-1-vkor@vkten.in> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/astronomy.scm (xplanet): New variable. * gnu/packages/astronomy.scm: Add missing modules. * gnu/packages/astronomy.scm: Add copyright line. * gnu/packages/patches/xplanet-1.3.1-cxx11-eof.patch: New file. * gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch: New file. * gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch: New file. * gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch: New file. * gnu/packages/astronomy.scm (xplanet)[source]: Use them. * gnu/local.mk (dist_patch_DATA): Add them. Signed-off-by: R Veera Kumar --- Changes in v4: - Add netpbm support - Drop patch for fix build with clang - Replace patch for cxx11 build fix with a correct one Changes in v3: - Add patches to gnu/local.mk - Put Copyright marks in files Changes in v2: - Add origin, author and year in patches --- gnu/local.mk | 5 + gnu/packages/astronomy.scm | 55 +++++++ .../patches/xplanet-1.3.1-cxx11-eof.patch | 154 ++++++++++++++++++ ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 16 ++ .../xplanet-1.3.1-libimage_gif.c.patch | 54 ++++++ ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 15 ++ 6 files changed, 299 insertions(+) create mode 100644 gnu/packages/patches/xplanet-1.3.1-cxx11-eof.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6c85e6e806..e049974908 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -28,6 +28,7 @@ # Copyright © 2019 Amin Bandali # Copyright © 2020 Brendan Tildesley # Copyright © 2020 Vincent Legoll +# Copyright © 2020 R Veera Kumar # # This file is part of GNU Guix. # @@ -1526,6 +1527,10 @@ dist_patch_DATA = \ %D%/packages/patches/xmoto-utf8.patch \ %D%/packages/patches/xmoto-remove-glext.patch \ %D%/packages/patches/xmoto-reproducible.patch \ + %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ + %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ + %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ + %D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \ %D%/packages/patches/xsane-fix-memory-leak.patch \ %D%/packages/patches/xsane-fix-pdf-floats.patch \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 3bb236fde9..ec90eba974 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Efraim Flashner ;;; Copyright © 2019 by Amar Singh +;;; Copyright © 2020 R Veera Kumar ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,9 +26,11 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages image) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages version-control) #:use-module (gnu packages pkg-config) @@ -41,6 +44,8 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages maths) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -289,3 +294,53 @@ Mechanics, Astrometry and Astrodynamics library.") (license (list license:lgpl2.0+ license:gpl2+)))) ; examples/transforms.c & lntest/*.c +(define-public xplanet + (package + (name "xplanet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/xplanet/xplanet/" + version "/xplanet-" version ".tar.gz")) + (sha256 + (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023")) + (patches + (search-patches + "xplanet-1.3.1-cxx11-eof.patch" + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" + "xplanet-1.3.1-libimage_gif.c.patch" + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("libice" ,libice) + ("freetype" ,freetype) + ("pango" ,pango) + ("giflib" ,giflib) + ("libjpeg", libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("netpbm" ,netpbm) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (let ((netpbm (assoc-ref %build-inputs "netpbm"))) + (append (list + ;; Give correct path for pnm.h header to configure script + (string-append "CPPFLAGS=-I" netpbm "/include/netpbm") + ;; no nasa jpl cspice support + "--without-cspice" ))))) + (home-page "http://xplanet.sourceforge.net/") + (synopsis "Planetary body renderer") + (description + "Xplanet renders an image of a planet into an X window or file. +All of the major planets and most satellites can be drawn and different map +projections are also supported, including azimuthal, hemisphere, Lambert, +Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/xplanet-1.3.1-cxx11-eof.patch b/gnu/packages/patches/xplanet-1.3.1-cxx11-eof.patch new file mode 100644 index 0000000000..b4d5850f75 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-cxx11-eof.patch @@ -0,0 +1,154 @@ +Author: Eric Bavier Date: 2020-01-13 +Url: https://notabug.org/bavier/guix-bavier/raw/master/bavier/patches/ ++xplanet-cxx11-eof.patch + +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp +index 2ee06c0..4fdb343 100644 +--- a/src/libannotate/addArcs.cpp ++++ b/src/libannotate/addArcs.cpp +@@ -258,7 +258,7 @@ addArcs(PlanetProperties *planetProperties, Planet *planet, + { + ifstream inFile(arcFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline (line, MAX_LINE_LENGTH, '\n').eof()) + readArcFile(line, planet, view, projection, + planetProperties, annotationMap); + +@@ -292,7 +292,7 @@ addArcs(View *view, multimap &annotationMap) + { + ifstream inFile(arcFile.c_str()); + char *line = new char[256]; +- while (inFile.getline (line, 256, '\n') != NULL) ++ while (!inFile.getline (line, 256, '\n').eof()) + readArcFile(line, NULL, view, NULL, NULL, annotationMap); + + inFile.close(); +diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp +index dde51c1..b641e6a 100644 +--- a/src/libannotate/addMarkers.cpp ++++ b/src/libannotate/addMarkers.cpp +@@ -429,7 +429,7 @@ addMarkers(PlanetProperties *planetProperties, Planet *planet, + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline (line, MAX_LINE_LENGTH, '\n').eof()) + { + unsigned char color[3]; + memcpy(color, planetProperties->MarkerColor(), 3); +@@ -475,7 +475,7 @@ addMarkers(View *view, const int width, const int height, + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline (line, MAX_LINE_LENGTH, '\n').eof()) + { + unsigned char color[3]; + memcpy(color, options->Color(), 3); +diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp +index 2634339..6d9d378 100644 +--- a/src/libannotate/addSatellites.cpp ++++ b/src/libannotate/addSatellites.cpp +@@ -488,10 +488,10 @@ loadSatelliteVector(PlanetProperties *planetProperties) + { + ifstream inFile(tleFile.c_str()); + char lines[3][80]; +- while (inFile.getline(lines[0], 80) != NULL) ++ while (!inFile.getline(lines[0], 80).eof()) + { +- if ((inFile.getline(lines[1], 80) == NULL) +- || (inFile.getline(lines[2], 80) == NULL)) ++ if ((inFile.getline(lines[1], 80).eof()) ++ || (inFile.getline(lines[2], 80).eof())) + { + ostringstream errStr; + errStr << "Malformed TLE file (" << tleFile << ")?\n"; +@@ -542,7 +542,7 @@ addSatellites(PlanetProperties *planetProperties, Planet *planet, + { + ifstream inFile(satFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline (line, MAX_LINE_LENGTH, '\n').eof()) + readSatelliteFile(line, planet, view, projection, + planetProperties, annotationMap); + +diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp +index 67b752c..eeadf6e 100644 +--- a/src/libannotate/addSpiceObjects.cpp ++++ b/src/libannotate/addSpiceObjects.cpp +@@ -524,7 +524,7 @@ processSpiceKernels(const bool load) + { + ifstream inFile(kernelFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + { + int ii = 0; + while (isDelimiter(line[ii])) +@@ -576,7 +576,7 @@ addSpiceObjects(map &planetsFromSunMap, + { + ifstream inFile(spiceFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + readSpiceFile(line, planetsFromSunMap, view, projection, + annotationMap); + inFile.close(); +diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp +index d885173..1be8ece 100644 +--- a/src/libmultiple/RayleighScattering.cpp ++++ b/src/libmultiple/RayleighScattering.cpp +@@ -369,7 +369,7 @@ RayleighScattering::readConfigFile(string configFile) + + diskTemplate_.clear(); + limbTemplate_.clear(); +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -439,7 +439,7 @@ RayleighScattering::readBlock(ifstream &inFile, + values.clear(); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -470,7 +470,7 @@ RayleighScattering::readValue(ifstream &inFile, + double &value) + { + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + { + int i = 0; + while (isDelimiter(line[i])) +diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp +index ff07c49..aabdfed 100644 +--- a/src/libmultiple/drawStars.cpp ++++ b/src/libmultiple/drawStars.cpp +@@ -41,7 +41,7 @@ drawStars(DisplayBase *display, View *view) + ifstream inFile(starMap.c_str()); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (!inFile.getline(line, MAX_LINE_LENGTH, '\n').eof()) + { + if (line[0] == '#') continue; + +diff --git a/src/readConfig.cpp b/src/readConfig.cpp +index cc1964f..4650527 100644 +--- a/src/readConfig.cpp ++++ b/src/readConfig.cpp +@@ -550,7 +550,7 @@ readConfigFile(string configFile, PlanetProperties *planetProperties[]) + + ifstream inFile(configFile.c_str()); + char *line = new char[256]; +- while (inFile.getline(line, 256, '\n') != NULL) ++ while (!inFile.getline(line, 256, '\n').eof()) + readConfig(line, planetProperties); + + // This condition will only be true if [default] is the only diff --git a/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch new file mode 100644 index 0000000000..bf52b0ca27 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch @@ -0,0 +1,16 @@ +Origin: $NetBSD: patch-src_libdisplay_DisplayOutput.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp +--- xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp 2020-03-28 22:08:44.432499170 +0530 +@@ -51,7 +51,7 @@ + string outputFilename = options->OutputBase(); + int startIndex = options->OutputStartIndex(); + int stopIndex = options->NumTimes() + startIndex - 1; +- if (stopIndex > 1) ++ if (stopIndex > 0) + { + const int digits = (int) (log10((double) stopIndex) + 1); + char buffer[64]; diff --git a/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch new file mode 100644 index 0000000000..58efc906dc --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch @@ -0,0 +1,54 @@ +Origin: $NetBSD: patch-src_libimage_gif.c,v 1.4 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c +--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530 +@@ -21,7 +21,7 @@ + #include + #include + #include +- ++#include + #include + + /* +@@ -178,8 +178,12 @@ + *BufferP++ = ColorMapEntry->Blue; + } + } +- ++ ++#if GIFLIB_MAJOR >= 5 ++ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(GifFile) == GIF_ERROR) { ++#endif + return(0); + } + +@@ -493,7 +497,11 @@ + static void QuitGifError(GifFileType *GifFile) + { + fprintf(stderr, "Error writing GIF file\n"); ++#if GIFLIB_MAJOR >= 5 ++ if (GifFile != NULL) EGifCloseFile(GifFile, NULL); ++#else + if (GifFile != NULL) EGifCloseFile(GifFile); ++#endif + } + + int +@@ -589,7 +597,11 @@ + Ptr += width; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) ++#else + if (EGifCloseFile(GifFile) == GIF_ERROR) ++#endif + + { + QuitGifError(GifFile); diff --git a/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch new file mode 100644 index 0000000000..a47623fa00 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch @@ -0,0 +1,15 @@ +$NetBSD: patch-src_xpUtil-Add2017LeapSecond.cpp,v 1.1 2019/11/16 17:36:28 ng0 Exp $ + +Modified by: R Veera Kumar 2020-03-28; change to patch -p1 + +diff -uNr xplanet-1.3.1/src/xpUtil.cpp xplanet-1.3.1.new/src/xpUtil.cpp +--- xplanet-1.3.1/src/xpUtil.cpp 2016-03-12 08:36:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/xpUtil.cpp 2020-03-28 22:19:10.629891166 +0530 +@@ -434,6 +434,7 @@ + if (jd >= toJulian(2009, 1, 1, 0, 0, 0)) delta_at++; // 34 + if (jd >= toJulian(2012, 7, 1, 0, 0, 0)) delta_at++; // 35 + if (jd >= toJulian(2015, 7, 1, 0, 0, 0)) delta_at++; // 36 ++ if (jd >= toJulian(2017, 1, 1, 0, 0, 0)) delta_at++; // 37 + + const double J2000 = toJulian(2000, 1, 1, 12, 0, 0); + const double m = m0 + m1 * (jd - J2000) * 86400; -- 2.26.0 From unknown Sun Jun 15 08:42:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: R Veera Kumar Subject: bug#40322: closed (Re: [bug#40322] [PATCH v4] gnu: Add xplanet.) Message-ID: References: <943cd689f0ea133dcefb6c0e213f5bd0@posteo.net> <20200330081929.GA7259@tulip> X-Gnu-PR-Message: they-closed 40322 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 40322@debbugs.gnu.org Date: Sun, 05 Apr 2020 04:40:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1586061602-8902-1" This is a multi-part message in MIME format... ------------=_1586061602-8902-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #40322: [PATCH] gnu: Add Xplanet which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 40322@debbugs.gnu.org. --=20 40322: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40322 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1586061602-8902-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 40322-done) by debbugs.gnu.org; 5 Apr 2020 04:39:29 +0000 Received: from localhost ([127.0.0.1]:45059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKx4C-0002Hb-MQ for submit@debbugs.gnu.org; Sun, 05 Apr 2020 00:39:28 -0400 Received: from mout01.posteo.de ([185.67.36.65]:44467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKx4B-0002H9-6T for 40322-done@debbugs.gnu.org; Sun, 05 Apr 2020 00:39:27 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2E06016005F for <40322-done@debbugs.gnu.org>; Sun, 5 Apr 2020 06:39:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1586061561; bh=CIzOjiOvnzRPXE5w2Fip7RTDCGqsS0yGg57w7ixVYYE=; h=Date:From:To:Cc:Subject:From; b=FjMdppAPVEN+7LQBoyJ+xj7/Fkq9e1FRi8+0uTHxHYS2Zapd226u8dkXIXfFasArR 1LYqpMXmROmSBUk07TpuYePFko3d7S1zq1CjvNkit6dzN17vy8e22eFxuqc9Rqnte8 Lz6XwhPSK/IR+8gYpWa7DI+TS3dbcs4PqzORezgSGoYR90Ucrki2cWDX/iiBf4Lj+Y VdcgS9WCkdwJ4UFB3j95BGrTYDySotLcHrhVARVC/34ZS8s03SgaUATZYiLrdYdz7+ fB64/Bzs4gGpBggvK8TVbFpkk/oMu2zvqPWZ/skO8A2V6LAxs+vhXe1oDbh8GPaoxp z1IZebn15m+4g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48w1Cr1TM3z6tm8; Sun, 5 Apr 2020 06:39:19 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 04 Apr 2020 23:39:19 -0500 From: Eric Bavier To: R Veera Kumar Subject: Re: [bug#40322] [PATCH v4] gnu: Add xplanet. In-Reply-To: <20200402105317.12941-1-vkor@vkten.in> References: <20200330081929.GA7259@tulip> <20200402105317.12941-1-vkor@vkten.in> Message-ID: <943cd689f0ea133dcefb6c0e213f5bd0@posteo.net> X-Sender: bavier@posteo.net User-Agent: Posteo Webmail X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40322-done Cc: 40322-done@debbugs.gnu.org, Guix-patches X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 02.04.2020 05:53, R Veera Kumar wrote: > * gnu/packages/astronomy.scm (xplanet): New variable. Pushed with slightly adjusted commit message in 77704cb13e5bebf412297dab764a00849a3cfdc0 Thanks! `~Eric ------------=_1586061602-8902-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Mar 2020 08:19:50 +0000 Received: from localhost ([127.0.0.1]:60408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIpe9-0007kM-C0 for submit@debbugs.gnu.org; Mon, 30 Mar 2020 04:19:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:34213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIpe7-0007kF-Ty for submit@debbugs.gnu.org; Mon, 30 Mar 2020 04:19:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIpe5-0004ze-GO for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIpe2-00071f-Ul for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:45 -0400 Received: from vkten.in ([104.244.73.96]:39936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIpe2-0006yL-Jn for guix-patches@gnu.org; Mon, 30 Mar 2020 04:19:42 -0400 Received: (qmail 11753 invoked from network); 30 Mar 2020 08:19:37 -0000 Received: from unknown (HELO tulip) (vkor@vkten.in@117.246.211.161) de/crypted with TLSv1.3: TLS_AES_256_GCM_SHA384 [256/256] DN=none by vkten with ESMTPSA; 30 Mar 2020 08:19:37 -0000 Date: Mon, 30 Mar 2020 13:49:29 +0530 From: R Veera Kumar To: guix-patches@gnu.org Subject: [PATCH] gnu: Add Xplanet Message-ID: <20200330081929.GA7259@tulip> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 104.244.73.96 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Xplanet renders an image of a planet into an X window or file. Signed-off-by: R Veera Kumar --- gnu/packages/astronomy.scm | 51 ++++++ .../patches/xplanet-1.3.1-c++11.patch | 157 ++++++++++++++++++ ...t-1.3.1-libdisplay_DisplayOutput.cpp.patch | 12 ++ .../xplanet-1.3.1-libimage_gif.c.patch | 50 ++++++ ...planet-1.3.1-readConfig-fixclang.cpp.patch | 74 +++++++++ ...t-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch | 11 ++ 6 files changed, 355 insertions(+) create mode 100644 gnu/packages/patches/xplanet-1.3.1-c++11.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch create mode 100644 gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 3bb236fde9..efcba8f311 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -25,9 +25,11 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages image) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages version-control) #:use-module (gnu packages pkg-config) @@ -41,6 +43,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages maths) + #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -289,3 +292,51 @@ Mechanics, Astrometry and Astrodynamics library.") (license (list license:lgpl2.0+ license:gpl2+)))) ; examples/transforms.c & lntest/*.c +(define-public xplanet + (package + (name "xplanet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/xplanet/xplanet/" + version "/xplanet-" version ".tar.gz")) + (sha256 + (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023")) + (patches + (search-patches + "xplanet-1.3.1-c++11.patch" + "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch" + "xplanet-1.3.1-libimage_gif.c.patch" + "xplanet-1.3.1-readConfig-fixclang.cpp.patch" + "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("libxext" ,libxext) + ("libice" ,libice) + ("freetype" ,freetype) + ("pango" ,pango) + ("giflib" ,giflib) + ("libjpeg", libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (list + "--without-pnm" ;; no proper pnm library in guix + "--without-cspice"))) ;; no jpl cspice support + (home-page "http://xplanet.sourceforge.net/") + (synopsis "Planetary body renderer") + (description + "Xplanet renders an image of a planet into an X window or file. +All of the major planets and most satellites can be drawn and different map +projections are also supported, including azimuthal, hemisphere, Lambert, +Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/xplanet-1.3.1-c++11.patch b/gnu/packages/patches/xplanet-1.3.1-c++11.patch new file mode 100644 index 0000000000..3ead8872e0 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-c++11.patch @@ -0,0 +1,157 @@ +Index: src/libannotate/addArcs.cpp +=================================================================== +diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp +--- a/src/libannotate/addArcs.cpp (revision 206) ++++ b/src/libannotate/addArcs.cpp (revision 207) +@@ -258,7 +258,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readArcFile(line, planet, view, projection, + planetProperties, annotationMap); + +@@ -292,7 +292,7 @@ + { + ifstream inFile(arcFile.c_str()); + char *line = new char[256]; +- while (inFile.getline (line, 256, '\n') != NULL) ++ while (inFile.getline (line, 256, '\n')) + readArcFile(line, NULL, view, NULL, NULL, annotationMap); + + inFile.close(); +Index: src/libannotate/addMarkers.cpp +=================================================================== +diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp +--- a/src/libannotate/addMarkers.cpp (revision 206) ++++ b/src/libannotate/addMarkers.cpp (revision 207) +@@ -429,7 +429,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, planetProperties->MarkerColor(), 3); +@@ -475,7 +475,7 @@ + { + ifstream inFile(markerFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + { + unsigned char color[3]; + memcpy(color, options->Color(), 3); +Index: src/libannotate/addSatellites.cpp +=================================================================== +diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp +--- a/src/libannotate/addSatellites.cpp (revision 206) ++++ b/src/libannotate/addSatellites.cpp (revision 207) +@@ -488,10 +488,10 @@ + { + ifstream inFile(tleFile.c_str()); + char lines[3][80]; +- while (inFile.getline(lines[0], 80) != NULL) ++ while (inFile.getline(lines[0], 80)) + { +- if ((inFile.getline(lines[1], 80) == NULL) +- || (inFile.getline(lines[2], 80) == NULL)) ++ if ((!inFile.getline(lines[1], 80)) ++ || (!inFile.getline(lines[2], 80))) + { + ostringstream errStr; + errStr << "Malformed TLE file (" << tleFile << ")?\n"; +@@ -542,7 +542,7 @@ + { + ifstream inFile(satFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline (line, MAX_LINE_LENGTH, '\n')) + readSatelliteFile(line, planet, view, projection, + planetProperties, annotationMap); + +Index: src/libannotate/addSpiceObjects.cpp +=================================================================== +diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp +--- a/src/libannotate/addSpiceObjects.cpp (revision 206) ++++ b/src/libannotate/addSpiceObjects.cpp (revision 207) +@@ -524,7 +524,7 @@ + { + ifstream inFile(kernelFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int ii = 0; + while (isDelimiter(line[ii])) +@@ -576,7 +576,7 @@ + { + ifstream inFile(spiceFile.c_str()); + char *line = new char[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + readSpiceFile(line, planetsFromSunMap, view, projection, + annotationMap); + inFile.close(); +Index: src/libmultiple/RayleighScattering.cpp +=================================================================== +diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp +--- a/src/libmultiple/RayleighScattering.cpp (revision 206) ++++ b/src/libmultiple/RayleighScattering.cpp (revision 207) +@@ -369,7 +369,7 @@ + + diskTemplate_.clear(); + limbTemplate_.clear(); +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -439,7 +439,7 @@ + values.clear(); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +@@ -470,7 +470,7 @@ + double &value) + { + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + int i = 0; + while (isDelimiter(line[i])) +Index: src/libmultiple/drawStars.cpp +=================================================================== +diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp +--- a/src/libmultiple/drawStars.cpp (revision 206) ++++ b/src/libmultiple/drawStars.cpp (revision 207) +@@ -41,7 +41,7 @@ + ifstream inFile(starMap.c_str()); + + char line[MAX_LINE_LENGTH]; +- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL) ++ while (inFile.getline(line, MAX_LINE_LENGTH, '\n')) + { + if (line[0] == '#') continue; + +Index: src/readConfig.cpp +=================================================================== +diff --git a/src/readConfig.cpp b/src/readConfig.cpp +--- a/src/readConfig.cpp (revision 206) ++++ b/src/readConfig.cpp (revision 207) +@@ -550,7 +550,7 @@ + + ifstream inFile(configFile.c_str()); + char *line = new char[256]; +- while (inFile.getline(line, 256, '\n') != NULL) ++ while (inFile.getline(line, 256, '\n')) + readConfig(line, planetProperties); + + // This condition will only be true if [default] is the only diff --git a/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch new file mode 100644 index 0000000000..2f6c5c77de --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch @@ -0,0 +1,12 @@ +diff -uNr xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp +--- xplanet-1.3.1/src/libdisplay/DisplayOutput.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libdisplay/DisplayOutput.cpp 2020-03-28 22:08:44.432499170 +0530 +@@ -51,7 +51,7 @@ + string outputFilename = options->OutputBase(); + int startIndex = options->OutputStartIndex(); + int stopIndex = options->NumTimes() + startIndex - 1; +- if (stopIndex > 1) ++ if (stopIndex > 0) + { + const int digits = (int) (log10((double) stopIndex) + 1); + char buffer[64]; diff --git a/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch new file mode 100644 index 0000000000..d5b3d0cdef --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-libimage_gif.c.patch @@ -0,0 +1,50 @@ +diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c +--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530 +@@ -21,7 +21,7 @@ + #include + #include + #include +- ++#include + #include + + /* +@@ -178,8 +178,12 @@ + *BufferP++ = ColorMapEntry->Blue; + } + } +- ++ ++#if GIFLIB_MAJOR >= 5 ++ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(GifFile) == GIF_ERROR) { ++#endif + return(0); + } + +@@ -493,7 +497,11 @@ + static void QuitGifError(GifFileType *GifFile) + { + fprintf(stderr, "Error writing GIF file\n"); ++#if GIFLIB_MAJOR >= 5 ++ if (GifFile != NULL) EGifCloseFile(GifFile, NULL); ++#else + if (GifFile != NULL) EGifCloseFile(GifFile); ++#endif + } + + int +@@ -589,7 +597,11 @@ + Ptr += width; + } + ++#if GIFLIB_MAJOR >= 5 ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) ++#else + if (EGifCloseFile(GifFile) == GIF_ERROR) ++#endif + + { + QuitGifError(GifFile); diff --git a/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch new file mode 100644 index 0000000000..2f018a03d2 --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-readConfig-fixclang.cpp.patch @@ -0,0 +1,74 @@ +diff -uNr xplanet-1.3.1/src/readConfig.cpp xplanet-1.3.1.new/src/readConfig.cpp +--- xplanet-1.3.1/src/readConfig.cpp 2013-02-17 01:07:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/readConfig.cpp 2020-03-28 22:17:19.919078929 +0530 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + using namespace std; + + #include "body.h" +@@ -20,6 +21,8 @@ + static PlanetProperties *defaultProperties; + static PlanetProperties *currentProperties; + ++static inline unsigned char i2b( int x ) { return static_cast(x) & 0xffU; } ++ + static void + readConfig(const char *line, PlanetProperties *planetProperties[]) + { +@@ -49,7 +52,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->ArcColor(color); + } + else +@@ -179,7 +182,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->Color(color); + } + else +@@ -244,7 +247,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->GridColor(color); + } + else +@@ -296,7 +299,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->MarkerColor(color); + } + else +@@ -403,7 +406,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->OrbitColor(color); + } + else +@@ -473,7 +476,7 @@ + int r, g, b; + if (sscanf(returnString, "%d,%d,%d", &r, &g, &b) == 3) + { +- unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff }; ++ unsigned char color[3] = { i2b(r), i2b(g), i2b(b) }; + currentProperties->TextColor(color); + } + else diff --git a/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch new file mode 100644 index 0000000000..fea2062f4a --- /dev/null +++ b/gnu/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch @@ -0,0 +1,11 @@ +diff -uNr xplanet-1.3.1/src/xpUtil.cpp xplanet-1.3.1.new/src/xpUtil.cpp +--- xplanet-1.3.1/src/xpUtil.cpp 2016-03-12 08:36:47.000000000 +0530 ++++ xplanet-1.3.1.new/src/xpUtil.cpp 2020-03-28 22:19:10.629891166 +0530 +@@ -434,6 +434,7 @@ + if (jd >= toJulian(2009, 1, 1, 0, 0, 0)) delta_at++; // 34 + if (jd >= toJulian(2012, 7, 1, 0, 0, 0)) delta_at++; // 35 + if (jd >= toJulian(2015, 7, 1, 0, 0, 0)) delta_at++; // 36 ++ if (jd >= toJulian(2017, 1, 1, 0, 0, 0)) delta_at++; // 37 + + const double J2000 = toJulian(2000, 1, 1, 12, 0, 0); + const double m = m0 + m1 * (jd - J2000) * 86400; -- 2.26.0 ------------=_1586061602-8902-1--