2013-10-06 21:36:18 +02:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, freeglut, freealut, mesa, libICE, libjpeg, openal, openscenegraph, plib
|
|
|
|
, libSM, libunwind, libX11, xproto, libXext, xextproto, libXi, inputproto
|
|
|
|
, libXmu, libXt, simgear, zlib, boost, cmake, libpng, udev, fltk13, apr
|
2013-10-21 22:22:24 +02:00
|
|
|
, makeDesktopItem
|
2013-10-06 21:36:18 +02:00
|
|
|
}:
|
2011-04-09 20:57:00 +02:00
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "2.12.0";
|
|
|
|
name = "flightgear-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ftp.linux.kiev.ua/pub/fgfs/Source/${name}.tar.bz2";
|
|
|
|
sha256 = "0h9ka4pa2njxbvy5jlmnsjy5ynzms504ygqn7hd80g3c58drsjc4";
|
2011-04-09 20:57:00 +02:00
|
|
|
};
|
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
datasrc = fetchurl {
|
|
|
|
url = "http://ftp.igh.cnrs.fr/pub/flightgear/ftp/Shared/FlightGear-data-${version}.tar.bz";
|
|
|
|
sha256 = "0qjvcj2cz7ypa91v95lws44fg8c1p0pazv24ljkai2m2r0jgsv8k";
|
2011-04-09 20:57:00 +02:00
|
|
|
};
|
|
|
|
|
2013-10-21 22:22:24 +02:00
|
|
|
# Of all the files in the source and data archives, there doesn't seem to be
|
|
|
|
# a decent icon :-)
|
|
|
|
iconsrc = fetchurl {
|
|
|
|
url = "http://wiki.flightgear.org/images/6/62/FlightGear_logo.png";
|
|
|
|
sha256 = "1ikz413jia55vfnmx8iwrlxvx8p16ggm81mbrj66wam3q7s2dm5p";
|
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "flightgear";
|
|
|
|
exec = "fgfs";
|
|
|
|
icon = "${iconsrc}";
|
|
|
|
comment = "FlightGear Flight Simulator";
|
|
|
|
desktopName = "FlightGear";
|
|
|
|
genericName = "Flight simulator";
|
|
|
|
categories = "Game;Simulation";
|
|
|
|
};
|
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
buildInputs = [
|
|
|
|
freeglut freealut mesa libICE libjpeg openal openscenegraph plib
|
|
|
|
libSM libunwind libX11 xproto libXext xextproto libXi inputproto
|
|
|
|
libXmu libXt simgear zlib boost cmake libpng udev fltk13 apr
|
|
|
|
];
|
2011-04-09 20:57:00 +02:00
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
preConfigure = ''
|
|
|
|
export cmakeFlagsArray=(-DFG_DATA_DIR="$out/share/FlightGear/")
|
|
|
|
'';
|
2011-04-09 20:57:00 +02:00
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
postInstall = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/share/FlightGear"
|
2013-10-06 21:36:18 +02:00
|
|
|
tar xvf "${datasrc}" -C "$out/share/FlightGear/" --strip-components=1
|
2013-10-21 22:22:24 +02:00
|
|
|
|
|
|
|
mkdir -p "$out/share/applications/"
|
|
|
|
cp "${desktopItem}"/share/applications/* "$out/share/applications/"
|
2013-10-06 21:36:18 +02:00
|
|
|
'';
|
2013-02-23 20:32:12 +01:00
|
|
|
|
2013-10-06 21:36:18 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Flight simulator";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
#platforms = platforms.linux; # disabled from hydra because it's so big
|
|
|
|
license = licenses.gpl2;
|
2011-04-09 20:57:00 +02:00
|
|
|
};
|
2013-10-06 21:36:18 +02:00
|
|
|
}
|