Merge pull request #75388 from Lassulus/xplanet
xplanet: 1.3.0 -> 1.3.1
This commit is contained in:
commit
2a1a4cad38
@ -1,29 +1,38 @@
|
|||||||
{stdenv, fetchurl, pkgconfig, freetype, pango, libpng, libtiff, giflib
|
{stdenv, fetchurl, fetchpatch, pkgconfig, freetype, pango, libpng, libtiff
|
||||||
, libjpeg, netpbm}:
|
, giflib, libjpeg, netpbm}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "xplanet-1.3.0";
|
pname = "xplanet";
|
||||||
|
version = "1.3.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/xplanet/${name}.tar.gz";
|
url = "mirror://sourceforge/xplanet/${pname}-${version}.tar.gz";
|
||||||
sha256 = "0hml2v228wi2r61m1pgka7h96rl92b6apk0iigm62miyp4mp9ys4";
|
sha256 = "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ freetype pango libpng libtiff giflib libjpeg netpbm ];
|
buildInputs = [ freetype pango libpng libtiff giflib libjpeg netpbm ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./giflib.patch
|
(fetchpatch {
|
||||||
./gcc6.patch
|
name = "giflib6.patch";
|
||||||
|
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/giflib6.patch?h=packages/xplanet&id=ce6f25eb369dc011161613894f01fd0a6ae85a09";
|
||||||
|
sha256 = "173l0xkqq0v2bpaff7hhwc7y2aw5cclqw8988k1nalhyfbrjb8bl";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
name = "xplanet-c++11.patch";
|
||||||
|
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/xplanet-c++11.patch?h=packages/xplanet&id=ce6f25eb369dc011161613894f01fd0a6ae85a09";
|
||||||
|
sha256 = "0vldai78ixw49bxch774pps6pq4sp0p33qvkvxywcz7p8kzpg8q2";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "Renders an image of the earth or other planets into the X root window";
|
description = "Renders an image of the earth or other planets into the X root window";
|
||||||
homepage = http://xplanet.sourceforge.net;
|
homepage = http://xplanet.sourceforge.net;
|
||||||
license = "GPL";
|
license = licenses.gpl2;
|
||||||
maintainers = [ stdenv.lib.maintainers.sander ];
|
maintainers = with maintainers; [ lassulus sander ];
|
||||||
platforms = stdenv.lib.platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,128 +0,0 @@
|
|||||||
diff --git c/src/libannotate/addArcs.cpp i/src/libannotate/addArcs.cpp
|
|
||||||
index 2ee06c0..0ff5478 100644
|
|
||||||
--- c/src/libannotate/addArcs.cpp
|
|
||||||
+++ i/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'))
|
|
||||||
readArcFile(line, planet, view, projection,
|
|
||||||
planetProperties, annotationMap);
|
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ addArcs(View *view, multimap<double, Annotation *> &annotationMap)
|
|
||||||
{
|
|
||||||
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();
|
|
||||||
diff --git c/src/libannotate/addMarkers.cpp i/src/libannotate/addMarkers.cpp
|
|
||||||
index 6a8a835..b35d820 100644
|
|
||||||
--- c/src/libannotate/addMarkers.cpp
|
|
||||||
+++ i/src/libannotate/addMarkers.cpp
|
|
||||||
@@ -423,7 +423,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'))
|
|
||||||
{
|
|
||||||
unsigned char color[3];
|
|
||||||
memcpy(color, planetProperties->MarkerColor(), 3);
|
|
||||||
@@ -469,7 +469,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'))
|
|
||||||
{
|
|
||||||
unsigned char color[3];
|
|
||||||
memcpy(color, options->Color(), 3);
|
|
||||||
diff --git c/src/libannotate/addSatellites.cpp i/src/libannotate/addSatellites.cpp
|
|
||||||
index 2634339..c9ff0b0 100644
|
|
||||||
--- c/src/libannotate/addSatellites.cpp
|
|
||||||
+++ i/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))
|
|
||||||
{
|
|
||||||
- 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 @@ 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'))
|
|
||||||
readSatelliteFile(line, planet, view, projection,
|
|
||||||
planetProperties, annotationMap);
|
|
||||||
|
|
||||||
diff --git c/src/libmultiple/RayleighScattering.cpp i/src/libmultiple/RayleighScattering.cpp
|
|
||||||
index d885173..7c25c1c 100644
|
|
||||||
--- c/src/libmultiple/RayleighScattering.cpp
|
|
||||||
+++ i/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'))
|
|
||||||
{
|
|
||||||
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'))
|
|
||||||
{
|
|
||||||
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'))
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
while (isDelimiter(line[i]))
|
|
||||||
diff --git c/src/libmultiple/drawStars.cpp i/src/libmultiple/drawStars.cpp
|
|
||||||
index ff07c49..22e41a0 100644
|
|
||||||
--- c/src/libmultiple/drawStars.cpp
|
|
||||||
+++ i/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'))
|
|
||||||
{
|
|
||||||
if (line[0] == '#') continue;
|
|
||||||
|
|
||||||
diff --git c/src/readConfig.cpp i/src/readConfig.cpp
|
|
||||||
index cc1964f..2946690 100644
|
|
||||||
--- c/src/readConfig.cpp
|
|
||||||
+++ i/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'))
|
|
||||||
readConfig(line, planetProperties);
|
|
||||||
|
|
||||||
// This condition will only be true if [default] is the only
|
|
@ -1,141 +0,0 @@
|
|||||||
diff -wbBur xplanet-1.3.0/src/libimage/gif.c xplanet-1.3.0.my/src/libimage/gif.c
|
|
||||||
--- xplanet-1.3.0/src/libimage/gif.c 2006-03-26 01:50:51.000000000 +0300
|
|
||||||
+++ xplanet-1.3.0.my/src/libimage/gif.c 2014-05-29 18:59:14.830652716 +0400
|
|
||||||
@@ -20,7 +20,7 @@
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
-
|
|
||||||
+#define FALSE 0
|
|
||||||
#include <gif_lib.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -42,11 +42,11 @@
|
|
||||||
int color_index;
|
|
||||||
unsigned char *ptr = NULL;
|
|
||||||
|
|
||||||
- infile = DGifOpenFileName(filename);
|
|
||||||
+ infile = DGifOpenFileName(filename, NULL);
|
|
||||||
|
|
||||||
if (infile == NULL)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|
||||||
{
|
|
||||||
if (DGifGetRecordType(infile, &record_type) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@
|
|
||||||
case IMAGE_DESC_RECORD_TYPE:
|
|
||||||
if (DGifGetImageDesc(infile) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -107,14 +107,14 @@
|
|
||||||
GifByteType *ext;
|
|
||||||
if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
while (ext != NULL)
|
|
||||||
{
|
|
||||||
if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -154,7 +154,7 @@
|
|
||||||
|
|
||||||
free(buffer);
|
|
||||||
|
|
||||||
- DGifCloseFile(infile);
|
|
||||||
+ DGifCloseFile(infile, NULL);
|
|
||||||
return(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
- colormap = MakeMapObject(colormap_size, NULL);
|
|
||||||
+ colormap = GifMakeMapObject(colormap_size, NULL);
|
|
||||||
|
|
||||||
for (i = 0; i < width * height; i++)
|
|
||||||
{
|
|
||||||
@@ -187,10 +187,10 @@
|
|
||||||
blue[i] = (GifByteType) rgb[3*i+2];
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
|
||||||
+ if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
|
||||||
buffer, colormap->Colors) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -198,24 +198,24 @@
|
|
||||||
free(green);
|
|
||||||
free(blue);
|
|
||||||
|
|
||||||
- outfile = EGifOpenFileName((char *) filename, FALSE);
|
|
||||||
+ outfile = EGifOpenFileName((char *) filename, FALSE, NULL);
|
|
||||||
if (outfile == NULL)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
|
|
||||||
== GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
|
|
||||||
== GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@
|
|
||||||
{
|
|
||||||
if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
|
|
||||||
{
|
|
||||||
- PrintGifError();
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
ptr += width;
|
|
||||||
@@ -232,8 +232,8 @@
|
|
||||||
|
|
||||||
EGifSpew(outfile);
|
|
||||||
|
|
||||||
- if (EGifCloseFile(outfile) == GIF_ERROR)
|
|
||||||
- PrintGifError();
|
|
||||||
+ if (EGifCloseFile(outfile, NULL) == GIF_ERROR)
|
|
||||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
||||||
|
|
||||||
free(buffer);
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user