about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/astronomy
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/astronomy')
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch19
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/openspace/assets.patch100
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/openspace/config.patch49
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/openspace/constexpr.patch91
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/openspace/default.nix89
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/openspace/vrpn.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xplanet/gcc6.patch128
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xplanet/giflib.patch141
18 files changed, 1010 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix b/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix
new file mode 100644
index 000000000000..3150d41ca9f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, jre, makeWrapper, unzip }:
+
+stdenv.mkDerivation rec {
+  name = "astrolabe-generator-${version}";
+  version = "3.3";
+
+  src = fetchurl {
+    url = "https://github.com/wymarc/astrolabe-generator/releases/download/v${version}/AstrolabeGenerator-${version}.zip";
+    sha256 = "141gfmrqa1mf2qas87qig4phym9fg9gbrcfl2idzd5gi91824dn9";
+  };
+
+  buildInputs = [ jre ];
+  nativeBuildInputs = [ makeWrapper unzip ];
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/java}
+    cp AstrolabeGenerator-${version}.jar $out/share/java
+
+    makeWrapper ${jre}/bin/java $out/bin/AstrolabeGenerator \
+      --add-flags "-jar $out/share/java/AstrolabeGenerator-${version}.jar"
+  '';
+
+  meta = with stdenv.lib;{
+    homepage = https://www.astrolabeproject.com;
+    description = "A Java-based tool for generating EPS files for constructing astrolabes and related tools";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.genesis ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix b/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix
new file mode 100644
index 000000000000..e3ceffd34c19
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, fetchurl, freeglut, gtk2, gtkglext, libjpeg_turbo, libtheora, libXmu
+, lua, libGLU_combined, pkgconfig, perl, autoreconfHook
+}:
+
+let
+  name = "celestia-1.6.1";
+
+  gcc46Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-gcc46.patch?h=packages/celestia";
+    sha256 = "0my7dpyh5wpz5df7bjhwb4db3ci2rn8ib1nkjv15fbp1g76bxfaz";
+    name = "celestia-1.6.1-gcc46.patch";
+  };
+
+  libpng15Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-libpng15.patch?h=packages/celestia";
+    sha256 = "1jrmbwmvs9b6k2b2g4104q22v4vqi0wfpz6hmfhniaq34626jcms";
+    name = "celestia-1.6.1-libpng15.patch";
+  };
+
+  libpng16Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-libpng16.patch?h=packages/celestia";
+    sha256 = "1q85prw4ci6d50lri8w1jm19pghxw96qizf5dl4g0j86rlhlkc8f";
+    name = "celestia-1.6.1-libpng16.patch";
+  };
+
+  linkingPatch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-linking.patch?h=packages/celestia";
+    sha256 = "1m8xyq26nm352828bp12c3b8f6m9bys9fwfxbfzqppllk7il2f24";
+    name = "celestia-1.6.1-linking.patch";
+  };
+
+  gcc47Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc-4.7-fixes.diff?h=packages/celestia";
+    sha256 = "1na26c7pv9qfv8a981m1zvglhv05r3h8513xqjra91qhhzx8wr8n";
+    name = "gcc-4.7-fixes.diff";
+  };
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/celestia/${name}.tar.gz";
+    sha256 = "1i1lvhbgllsh2z8i6jj4mvrjak4a7r69psvk7syw03s4p7670mfk";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ freeglut gtk2 gtkglext libjpeg_turbo libtheora libXmu libGLU_combined lua
+    perl autoreconfHook ];
+
+  patchPhase = ''
+    patch -Np0 -i "${gcc46Patch}"
+    patch -Np0 -i "${libpng15Patch}"
+    patch -Np2 -i "${libpng16Patch}"
+    patch -Np1 -i "${linkingPatch}"
+    patch -Np1 -i "${gcc47Patch}"
+  '';
+
+  configureFlags = [
+    "--with-gtk"
+    "--with-lua=${lua}"
+  ];
+
+  installPhase = ''make MKDIR_P="mkdir -p" install'';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Free space simulation";
+    homepage = https://celestia.space/;
+    license = stdenv.lib.licenses.gpl2;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.peti ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch
new file mode 100644
index 000000000000..40696a03dec7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch
@@ -0,0 +1,12 @@
+diff -ruN gildas-src-jul18a/admin/define-system.sh gildas-src-jul18a.aarch64/admin/define-system.sh
+--- gildas-src-jul18a/admin/define-system.sh	2018-06-12 15:22:32.000000000 +0200
++++ gildas-src-jul18a.aarch64/admin/define-system.sh	2018-07-21 13:05:52.000000000 +0200
+@@ -174,7 +174,7 @@
+     DEFAULT_CONFIG=          # Default config is empty
+     case `uname` in
+         Linux)
+-            if [ `uname -m | grep -c "x86_64"` -ne 0 ]; then
++            if [ `uname -m | grep -c "64"` -ne 0 ]; then
+         	GAG_MACHINE=x86_64
+             else
+         	GAG_MACHINE=pc
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch
new file mode 100644
index 000000000000..4d6654a99aee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch
@@ -0,0 +1,22 @@
+diff -ruN gildas-src-jun18a/admin/define-system.sh gildas-src-jun18a.clang/admin/define-system.sh
+--- gildas-src-jun18a/admin/define-system.sh	2018-03-12 11:07:57.000000000 +0100
++++ gildas-src-jun18a.clang/admin/define-system.sh	2018-06-12 14:56:14.000000000 +0200
+@@ -218,13 +218,13 @@
+         	else
+         	    GAG_MACHINE=pc
+         	fi
+-                if which gcc > /dev/null 2>&1; then
+-                    DEFAULT_CCOMPILER=gcc
++                if which clang > /dev/null 2>&1; then
++                    DEFAULT_CCOMPILER=clang
+                 fi
+-                if which g++ > /dev/null 2>&1; then
+-                    DEFAULT_CXXCOMPILER=g++
+-                elif which clang++ > /dev/null 2>&1; then
++                if which clang++ > /dev/null 2>&1; then
+                     DEFAULT_CXXCOMPILER=clang++
++                elif which g++ > /dev/null 2>&1; then
++                    DEFAULT_CXXCOMPILER=g++
+                 fi
+         	if which ifort > /dev/null 2>&1; then
+         	    DEFAULT_FCOMPILER=ifort
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix
new file mode 100644
index 000000000000..57cecb3cb4cd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, fetchurl, gtk2-x11 , pkgconfig , python27 , gfortran , lesstif
+, cfitsio , getopt , perl , groff , which
+}:
+
+let
+  python27Env = python27.withPackages(ps: with ps; [ numpy ]);
+in
+
+stdenv.mkDerivation rec {
+  srcVersion = "feb19b";
+  version = "20190201_b";
+  name = "gildas-${version}";
+
+  src = fetchurl {
+    # For each new release, the upstream developers of Gildas move the
+    # source code of the previous release to a different directory
+    urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.gz"
+      "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.gz" ];
+    sha256 = "5b6da12ac869176d7a9a3d6a6620db1dbaa44a4785e2dd59dd1a8c38ea9cab87";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkgconfig groff perl getopt gfortran which ];
+
+  buildInputs = [ gtk2-x11 lesstif cfitsio python27Env ];
+
+  patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ];
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
+
+  configurePhase=''
+    substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
+    substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python27Env}
+    substituteInPlace utilities/main/gag-makedepend.pl --replace '/usr/bin/perl' ${perl}/bin/perl
+    source admin/gildas-env.sh -c gfortran -o openmp
+    echo "gag_doc:        $out/share/doc/" >> kernel/etc/gag.dico.lcl
+  '';
+
+  postInstall=''
+    mkdir -p $out/bin
+    cp -a ../gildas-exe-${srcVersion}/* $out
+    mv $out/$GAG_EXEC_SYSTEM $out/libexec
+    cp admin/wrapper.sh $out/bin/gildas-wrapper.sh
+    chmod 755 $out/bin/gildas-wrapper.sh
+    for i in $out/libexec/bin/* ; do
+      ln -s $out/bin/gildas-wrapper.sh $out/bin/$(basename "$i")
+    done
+  '';
+
+  meta = {
+    description = "Radioastronomy data analysis software";
+    longDescription = ''
+      GILDAS is a collection of state-of-the-art software
+      oriented toward (sub-)millimeter radioastronomical
+      applications (either single-dish or interferometer).
+      It is daily used to reduce all data acquired with the
+      IRAM 30M telescope and Plateau de Bure Interferometer
+      PDBI (except VLBI observations). GILDAS is easily
+      extensible. GILDAS is written in Fortran-90, with a
+      few parts in C/C++ (mainly keyboard interaction,
+      plotting, widgets).'';
+    homepage = http://www.iram.fr/IRAMFR/GILDAS/gildas.html;
+    license = stdenv.lib.licenses.free;
+    maintainers = [ stdenv.lib.maintainers.bzizou stdenv.lib.maintainers.smaret ];
+    platforms = stdenv.lib.platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch
new file mode 100644
index 000000000000..2e470a1e9cdc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch
@@ -0,0 +1,19 @@
+diff --new-file -r -u gildas-src-feb17d.orig/admin/wrapper.sh gildas-src-feb17d/admin/wrapper.sh
+--- gildas-src-feb17d.orig/admin/wrapper.sh	1970-01-01 01:00:00.000000000 +0100
++++ gildas-src-feb17d/admin/wrapper.sh	2017-05-18 21:00:01.660778782 +0200
+@@ -0,0 +1,15 @@
++#!/bin/sh -e
++
++export GAG_ROOT_DIR="%%OUT%%"
++export GAG_PATH="${GAG_ROOT_DIR}/etc"
++export GAG_EXEC_SYSTEM="libexec"
++export PYTHONHOME="%%PYTHONHOME%%"
++if [ -z "\$PYTHONPATH" ]; then
++  PYTHONPATH="${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/python"
++else
++  PYTHONPATH="${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/python:${PYTHONPATH}"
++fi
++export PYTHONPATH
++export LD_LIBRARY_PATH=${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/lib/
++me=`basename $0`
++exec ${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/bin/${me} ${*}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix
new file mode 100644
index 000000000000..9bacf6d90417
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, pkgconfig, intltool
+, gtk3, glib, curl, goocanvas2, gpsd
+, hamlib, wrapGAppsHook
+}:
+
+let
+  version = "2.2.1";
+in stdenv.mkDerivation {
+  name = "gpredict-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/csete/gpredict/releases/download/v${version}/gpredict-${version}.tar.bz2";
+    sha256 = "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7";
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ];
+  buildInputs = [ curl glib gtk3 goocanvas2 gpsd hamlib ];
+
+  meta = with stdenv.lib; {
+    description = "Real time satellite tracking and orbit prediction";
+    longDescription = ''
+      Gpredict is a real time satellite tracking and orbit prediction program
+      written using the Gtk+ widgets. Gpredict is targetted mainly towards ham radio
+      operators but others interested in satellite tracking may find it useful as
+      well. Gpredict uses the SGP4/SDP4 algorithms, which are compatible with the
+      NORAD Keplerian elements.
+    '';
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    homepage = http://gpredict.oz9aec.net/;
+    maintainers = [ maintainers.markuskowa maintainers.cmcdragonkai ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
new file mode 100644
index 000000000000..03d0018f237b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU_combined, libpng, lua5, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  name = "gravit-0.5.1";
+
+  src = fetchurl {
+    url = "https://gravit.slowchop.com/media/downloads/${name}.tgz";
+    sha256 = "14vf7zj2bgrl96wsl3f1knsggc8h9624354ajzd72l46y09x5ky7";
+  };
+
+  buildInputs = [ libGLU_combined SDL SDL_ttf SDL_image lua5 libpng libSM libICE ];
+
+  nativeBuildInputs = [ autoconf automake ];
+
+  preConfigure = ''
+    ./autogen.sh
+
+    # Build fails on Linux with windres.
+    export ac_cv_prog_WINDRES=
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://gravit.slowchop.com;
+    description = "Beautiful OpenGL-based gravity simulator";
+    license = stdenv.lib.licenses.gpl2;
+
+    longDescription = ''
+      Gravit is a gravity simulator which runs under Linux, Windows and
+      macOS. It uses Newtonian physics using the Barnes-Hut N-body
+      algorithm. Although the main goal of Gravit is to be as accurate
+      as possible, it also creates beautiful looking gravity patterns.
+      It records the history of each particle so it can animate and
+      display a path of its travels. At any stage you can rotate your
+      view in 3D and zoom in and out.
+    '';
+
+    platforms = stdenv.lib.platforms.mesaPlatforms;
+    hydraPlatforms = stdenv.lib.platforms.linux; # darwin times out
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/openspace/assets.patch b/nixpkgs/pkgs/applications/science/astronomy/openspace/assets.patch
new file mode 100644
index 000000000000..38c17ad4593a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/openspace/assets.patch
@@ -0,0 +1,100 @@
+diff --git a/data/assets/scene/solarsystem/planets/jupiter/jup310.asset b/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
+index c15f6d9..1f8ddaf 100755
+--- a/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
++++ b/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
+@@ -1,8 +1,8 @@
+-local Kernels = asset.syncedResource({
+-    Name = "Jupiter Spice Kernels (jup310)",
+-    Type = "TorrentSynchronization",
+-    Identifier = "jup310",
+-    Magnet = "magnet:?xt=urn:btih:E8B7D7E136DE1C6249158B254BFC8B9ECE2A0539&dn=jup310.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
+-})
++-- local Kernels = asset.syncedResource({
++--     Name = "Jupiter Spice Kernels (jup310)",
++--     Type = "TorrentSynchronization",
++--     Identifier = "jup310",
++--     Magnet = "magnet:?xt=urn:btih:E8B7D7E136DE1C6249158B254BFC8B9ECE2A0539&dn=jup310.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
++-- })
+ 
+-asset.export("Kernels", Kernels .. '/jup310.bsp')
++-- asset.export("Kernels", Kernels .. '/jup310.bsp')
+diff --git a/data/assets/scene/solarsystem/planets/mars/mar097.asset b/data/assets/scene/solarsystem/planets/mars/mar097.asset
+index e77d67d..8d738a6 100755
+--- a/data/assets/scene/solarsystem/planets/mars/mar097.asset
++++ b/data/assets/scene/solarsystem/planets/mars/mar097.asset
+@@ -1,8 +1,8 @@
+-local Kernels = asset.syncedResource({
+-    Name = "Mars Spice Kernels",
+-    Type = "TorrentSynchronization",
+-    Identifier = "mat097",
+-    Magnet = "magnet:?xt=urn:btih:308F326B9AF864294D73042FBBED33B17291E27E&dn=mar097.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
+-})
++-- local Kernels = asset.syncedResource({
++--     Name = "Mars Spice Kernels",
++--     Type = "TorrentSynchronization",
++--     Identifier = "mat097",
++--     Magnet = "magnet:?xt=urn:btih:308F326B9AF864294D73042FBBED33B17291E27E&dn=mar097.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
++-- })
+ 
+-asset.export("Kernels", Kernels .. '/mar097.bsp')
++-- asset.export("Kernels", Kernels .. '/mar097.bsp')
+diff --git a/data/assets/scene/solarsystem/planets/neptune/nep081.asset b/data/assets/scene/solarsystem/planets/neptune/nep081.asset
+index e9c49ce..cfb5fac 100755
+--- a/data/assets/scene/solarsystem/planets/neptune/nep081.asset
++++ b/data/assets/scene/solarsystem/planets/neptune/nep081.asset
+@@ -1,8 +1,8 @@
+-local Kernels = asset.syncedResource({
+-    Name = "Neptune Spice Kernels (nep081)",
+-    Type = "TorrentSynchronization",
+-    Identifier = "nep081",
+-    Magnet = "magnet:?xt=urn:btih:A6079CF8D4BF3B6BB38F4F9F633CB7724FF91693&dn=nep081.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
+-})
++-- local Kernels = asset.syncedResource({
++--     Name = "Neptune Spice Kernels (nep081)",
++--     Type = "TorrentSynchronization",
++--     Identifier = "nep081",
++--     Magnet = "magnet:?xt=urn:btih:A6079CF8D4BF3B6BB38F4F9F633CB7724FF91693&dn=nep081.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
++-- })
+ 
+-asset.export("Kernels", Kernels .. '/nep081.bsp')
++-- asset.export("Kernels", Kernels .. '/nep081.bsp')
+diff --git a/data/assets/scene/solarsystem/planets/saturn/sat375.asset b/data/assets/scene/solarsystem/planets/saturn/sat375.asset
+index a55f2ed..f904b3c 100755
+--- a/data/assets/scene/solarsystem/planets/saturn/sat375.asset
++++ b/data/assets/scene/solarsystem/planets/saturn/sat375.asset
+@@ -1,8 +1,8 @@
+-local Kernels = asset.syncedResource({
+-    Name = "Saturn Spice Kernels (sat375)",
+-    Type = "TorrentSynchronization",
+-    Identifier = "sat375",
+-    Magnet = "magnet:?xt=urn:btih:79083d2069df389e65d7688bb326c7aaf1953845&dn=sat375.bsp"
+-})
++-- local Kernels = asset.syncedResource({
++--     Name = "Saturn Spice Kernels (sat375)",
++--     Type = "TorrentSynchronization",
++--     Identifier = "sat375",
++--     Magnet = "magnet:?xt=urn:btih:79083d2069df389e65d7688bb326c7aaf1953845&dn=sat375.bsp"
++-- })
+ 
+-asset.export("Kernels", Kernels .. '/sat375.bsp')
++-- asset.export("Kernels", Kernels .. '/sat375.bsp')
+diff --git a/data/assets/scene/solarsystem/planets/uranus/ura111.asset b/data/assets/scene/solarsystem/planets/uranus/ura111.asset
+index 665d059..8f95f34 100755
+--- a/data/assets/scene/solarsystem/planets/uranus/ura111.asset
++++ b/data/assets/scene/solarsystem/planets/uranus/ura111.asset
+@@ -1,8 +1,8 @@
+-local Kernels = asset.syncedResource({
+-    Name = "Uranus Spice Kernels (ura111)",
+-    Type = "TorrentSynchronization",
+-    Identifier = "ura111",
+-    Magnet = "magnet:?xt=urn:btih:26C4903D1A12AE439480F31B45BAEB5781D2B305&dn=ura111.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
+-})
++-- local Kernels = asset.syncedResource({
++--     Name = "Uranus Spice Kernels (ura111)",
++--     Type = "TorrentSynchronization",
++--     Identifier = "ura111",
++--     Magnet = "magnet:?xt=urn:btih:26C4903D1A12AE439480F31B45BAEB5781D2B305&dn=ura111.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
++-- })
+ 
+-asset.export("Kernels", Kernels .. '/ura111.bsp')
++-- asset.export("Kernels", Kernels .. '/ura111.bsp')
diff --git a/nixpkgs/pkgs/applications/science/astronomy/openspace/config.patch b/nixpkgs/pkgs/applications/science/astronomy/openspace/config.patch
new file mode 100644
index 000000000000..826edea09071
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/openspace/config.patch
@@ -0,0 +1,49 @@
+diff --git a/openspace.cfg b/openspace.cfg
+index c86830b..e7f89d9 100755
+--- a/openspace.cfg
++++ b/openspace.cfg
+@@ -2,18 +2,21 @@
+ -- require('scripts/configuration_helper.lua')
+ -- which defines helper functions useful to customize the configuration
+ 
++userdir = os.getenv("HOME") .. "/.openspace/"
++os.execute("mkdir -p " .. userdir)
++
+ return {
+     -- Determines which SGCT configuration file is loaded, that is, if there rendering
+     -- occurs in a single window, a fisheye projection, or a dome cluster system
+ 
+     -- A regular 1280x720 window
+-    SGCTConfig = sgct.config.single{},
++    -- SGCTConfig = sgct.config.single{},
+ 
+     -- A regular 1920x1080 window
+     -- SGCTConfig = sgct.config.single{1920, 1080},
+     
+     -- A windowed 1920x1080 fullscreen
+-    -- SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}, shared=true, name="WV_OBS_SPOUT1"},
++    SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}, shared=true, name="WV_OBS_SPOUT1"},
+ 
+     -- A 1k fisheye rendering
+     -- SGCTConfig = sgct.config.fisheye{1024, 1024},
+@@ -53,15 +56,15 @@ return {
+         TASKS = "${DATA}/tasks",
+         WEB = "${DATA}/web",
+ 
+-        CACHE = "${BASE}/cache",
++        CACHE  = userdir .. "cache",
+         CONFIG = "${BASE}/config",
+-        DOCUMENTATION = "${BASE}/documentation",
+-        LOGS = "${BASE}/logs",
++        DOCUMENTATION = userdir .. "documentation",
++        LOGS    = userdir .. "logs",
+         MODULES = "${BASE}/modules",
+         SCRIPTS = "${BASE}/scripts",
+         SHADERS = "${BASE}/shaders",
+-        SYNC = "${BASE}/sync",
+-        TESTDIR = "${BASE}/tests"
++        SYNC    = userdir .. "sync",
++        TESTDIR = userdir .. "tests"
+     },
+     Fonts = {
+         Mono = "${FONTS}/Bitstream-Vera-Sans-Mono/VeraMono.ttf",
diff --git a/nixpkgs/pkgs/applications/science/astronomy/openspace/constexpr.patch b/nixpkgs/pkgs/applications/science/astronomy/openspace/constexpr.patch
new file mode 100644
index 000000000000..d9fc91d7c277
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/openspace/constexpr.patch
@@ -0,0 +1,91 @@
+diff --git a/include/openspace/util/distanceconversion.h b/include/openspace/util/distanceconversion.h
+index 80a3a96..7059752 100755
+--- a/include/openspace/util/distanceconversion.h
++++ b/include/openspace/util/distanceconversion.h
+@@ -159,24 +159,34 @@ constexpr const char* nameForDistanceUnit(DistanceUnit unit, bool pluralForm = f
+ }
+ 
+ constexpr DistanceUnit distanceUnitFromString(const char* unitName) {
++    int result = -1;
++  
+     int i = 0;
+     for (const char* val : DistanceUnitNamesSingular) {
+         if (ghoul::equal(unitName, val)) {
+-            return static_cast<DistanceUnit>(i);
++            result = i;
++            break;
+         }
+         ++i;
+     }
+ 
+-    i = 0;
+-    for (const char* val : DistanceUnitNamesPlural) {
+-        if (ghoul::equal(unitName, val)) {
+-            return static_cast<DistanceUnit>(i);
++    if (result == -1) {
++        i = 0;
++        for (const char* val : DistanceUnitNamesPlural) {
++            if (ghoul::equal(unitName, val)) {
++                result = i;
++                break;
++            }
++            ++i;
+         }
+-        ++i;
+     }
+ 
+-    ghoul_assert(false, "Unit name is not a valid name");
+-    throw ghoul::MissingCaseException();
++    if (result != -1)
++        return static_cast<DistanceUnit>(result);
++    else {
++        ghoul_assert(false, "Unit name is not a valid name");
++        throw ghoul::MissingCaseException();
++    }
+ }
+ 
+ 
+diff --git a/include/openspace/util/timeconversion.h b/include/openspace/util/timeconversion.h
+index a36c92a..699bca9 100755
+--- a/include/openspace/util/timeconversion.h
++++ b/include/openspace/util/timeconversion.h
+@@ -142,23 +142,32 @@ constexpr const char* nameForTimeUnit(TimeUnit unit, bool pluralForm = false) {
+ }
+ 
+ constexpr TimeUnit timeUnitFromString(const char* unitName) {
++    int result = -1;
++    
+     int i = 0;
+     for (const char* val : TimeUnitNamesSingular) {
+         if (ghoul::equal(unitName, val)) {
+-            return static_cast<TimeUnit>(i);
++            result = i;
++            break;
+         }
+         ++i;
+     }
+ 
+-    i = 0;
+-    for (const char* val : TimeUnitNamesPlural) {
+-        if (ghoul::equal(unitName, val)) {
+-            return static_cast<TimeUnit>(i);
++    if (result == -1) {
++        i = 0;
++        for (const char* val : TimeUnitNamesPlural) {
++            if (ghoul::equal(unitName, val)) {
++                result = i;
++                break;
++            }
++            ++i;
+         }
+-        ++i;
+     }
+ 
+-    throw ghoul::MissingCaseException();
++    if (result != -1)
++        return static_cast<TimeUnit>(result);
++    else
++        throw ghoul::MissingCaseException();
+ }
+ 
+ std::pair<double, std::string> simplifyTime(double seconds,
diff --git a/nixpkgs/pkgs/applications/science/astronomy/openspace/default.nix b/nixpkgs/pkgs/applications/science/astronomy/openspace/default.nix
new file mode 100644
index 000000000000..ee3a71cf1813
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/openspace/default.nix
@@ -0,0 +1,89 @@
+{ stdenv, fetchFromGitHub, fetchurl, makeWrapper, cmake
+, curl, boost, gdal, glew, soil
+, libX11, libXi, libXxf86vm, libXcursor, libXrandr, libXinerama }:
+
+stdenv.mkDerivation rec {
+  version = "0.11.1";
+  name    = "openspace-${version}";
+  
+  src = fetchFromGitHub {
+    owner  = "OpenSpace";
+    repo   = "OpenSpace";
+    rev    = "a65eea61a1b8807ce3d69e9925e75f8e3dfb085d";
+    sha256 = "0msqixf30r0d41xmfmzkdfw6w9jkx2ph5clq8xiwrg1jc3z9q7nv";
+    fetchSubmodules = true;
+  };
+  
+  buildInputs = [
+    makeWrapper cmake
+    curl boost gdal glew soil
+    libX11 libXi libXxf86vm libXcursor libXrandr libXinerama
+  ];
+      
+  glmPlatformH = fetchurl {
+    url    = "https://raw.githubusercontent.com/g-truc/glm/dd48b56e44d699a022c69155c8672caacafd9e8a/glm/simd/platform.h";
+    sha256 = "0y91hlbgn5va7ijg5mz823gqkq9hqxl00lwmdwnf8q2g086rplzw";
+  };
+  
+  # See <https://github.com/g-truc/glm/issues/726>
+  prePatch = ''
+    cp ${glmPlatformH} ext/sgct/include/glm/simd/platform.h
+    cp ${glmPlatformH} ext/ghoul/ext/glm/glm/simd/platform.h
+  '';
+  
+  patches = [
+    # See <https://github.com/opensgct/sgct/issues/13>
+    ./vrpn.patch
+    
+    ./constexpr.patch
+    ./config.patch
+
+    # WARNING: This patch disables some slow torrents in a very dirty way.
+    ./assets.patch 
+  ];
+  
+  bundle = "$out/usr/share/openspace";
+  
+  preConfigure = ''
+    cmakeFlagsArray=(
+      $cmakeFlagsArray
+      "-DCMAKE_BUILD_TYPE="
+      "-DCMAKE_INSTALL_PREFIX=${bundle}"
+    )
+  '';
+  
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p ${bundle}
+  '';
+  
+  postInstall = ''
+    cp ext/spice/libSpice.so       ${bundle}/lib
+    cp ext/ghoul/ext/lua/libLua.so ${bundle}/lib
+  '';
+  
+  postFixup = ''
+    for bin in ${bundle}/bin/*
+    do
+      rpath=$(patchelf --print-rpath $bin)
+      patchelf --set-rpath $rpath:${bundle}/lib $bin
+      
+      name=$(basename $bin)
+      makeWrapper $bin $out/bin/$name --run "cd ${bundle}"
+    done
+  '';
+  
+  meta = {
+    description     = "Open-source astrovisualization project";
+    longDescription = ''
+      OpenSpace is open source interactive data visualization software
+      designed to visualize the entire known universe and portray our
+      ongoing efforts to investigate the cosmos.
+
+      WARNING: This build is not very usable for now.
+    '';
+    homepage  = https://www.openspaceproject.com/;
+    license   = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/openspace/vrpn.patch b/nixpkgs/pkgs/applications/science/astronomy/openspace/vrpn.patch
new file mode 100644
index 000000000000..9386d0257b7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/openspace/vrpn.patch
@@ -0,0 +1,13 @@
+diff --git a/ext/sgct/src/deps/vrpn/vrpn_Connection.C b/ext/sgct/src/deps/vrpn/vrpn_Connection.C
+index d6ffdc5..f90a2b2 100755
+--- a/ext/sgct/src/deps/vrpn/vrpn_Connection.C
++++ b/ext/sgct/src/deps/vrpn/vrpn_Connection.C
+@@ -2489,7 +2489,7 @@ static int vrpn_start_server(const char *machine, char *server_name, char *args,
+ #if defined(sparc) || defined(FreeBSD) || defined(_AIX) || defined(__ANDROID__)
+             int status; // doesn't exist on sparc_solaris or FreeBSD
+ #else
+-            union wait status;
++            int status;
+ #endif
+ 
+             /* Check to see if they called back yet. */
diff --git a/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix b/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix
new file mode 100644
index 000000000000..eb7ba2a8c9c4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -0,0 +1,38 @@
+{ mkDerivation, lib, fetchFromGitHub
+, cmake, freetype, libpng, libGLU_combined, openssl, perl, libiconv
+, qtscript, qtserialport, qttools
+, qtmultimedia, qtlocation, makeWrapper, qtbase
+}:
+
+mkDerivation rec {
+  name = "stellarium-${version}";
+  version = "0.18.3";
+
+  src = fetchFromGitHub {
+    owner = "Stellarium";
+    repo = "stellarium";
+    rev = "v${version}";
+    sha256 = "1cnwfk3vdsxh8gacw22qik401z0kpzd1ralbg9ph2cjqx9x2m1s1";
+  };
+
+  nativeBuildInputs = [ cmake perl ];
+
+  buildInputs = [
+    freetype libpng libGLU_combined openssl libiconv qtscript qtserialport qttools
+    qtmultimedia qtlocation qtbase makeWrapper
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/stellarium \
+      --prefix QT_PLUGIN_PATH : "${qtbase}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins"
+  '';
+
+  meta = with lib; {
+    description = "Free open-source planetarium";
+    homepage = http://stellarium.org/;
+    license = licenses.gpl2;
+
+    platforms = platforms.linux; # should be mesaPlatforms, but we don't have qt on darwin
+    maintainers = with maintainers; [ peti ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix b/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix
new file mode 100644
index 000000000000..fef4ca1907fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, imake, gccmakedep, libXt, libXext }:
+
+stdenv.mkDerivation rec {
+  name = "xearth-${version}";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "http://xearth.org/${name}.tar.gz";
+    sha256 = "bcb1407cc35b3f6dd3606b2c6072273b6a912cbd9ed1ae22fb2d26694541309c";
+  };
+
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libXt libXext ];
+
+  installFlags=[ "DESTDIR=$(out)/" "BINDIR=bin" "MANDIR=man/man1"];
+  installTargets="install install.man";
+
+  meta = with stdenv.lib; {
+    description = "sets the X root window to an image of the Earth";
+    homepage = "http://xplanet.org";
+    longDescription =
+      '' Xearth  sets  the X root window to an image of the Earth, as seen from your favorite vantage point in space,
+         correctly shaded for the current position of the Sun.
+	 By default, xearth updates the displayed image every  five  minutes.
+      '';
+    maintainers = [ maintainers.mafo ];
+    license = "xearth";
+    platforms=platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix b/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix
new file mode 100644
index 000000000000..7abd83b6dc12
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, pkgconfig, freetype, pango, libpng, libtiff, giflib
+, libjpeg, netpbm}:
+
+stdenv.mkDerivation rec {
+  name = "xplanet-1.3.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xplanet/${name}.tar.gz";
+    sha256 = "0hml2v228wi2r61m1pgka7h96rl92b6apk0iigm62miyp4mp9ys4";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ freetype pango libpng libtiff giflib libjpeg netpbm ];
+
+  patches = [
+    ./giflib.patch
+    ./gcc6.patch
+  ];
+
+  meta = {
+    description = "Renders an image of the earth or other planets into the X root window";
+    homepage = http://xplanet.sourceforge.net;
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.sander ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xplanet/gcc6.patch b/nixpkgs/pkgs/applications/science/astronomy/xplanet/gcc6.patch
new file mode 100644
index 000000000000..b30385a50f83
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xplanet/gcc6.patch
@@ -0,0 +1,128 @@
+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
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xplanet/giflib.patch b/nixpkgs/pkgs/applications/science/astronomy/xplanet/giflib.patch
new file mode 100644
index 000000000000..653b9c8dc7d6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xplanet/giflib.patch
@@ -0,0 +1,141 @@
+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);
+