2016-12-24 21:57:25 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
2018-02-24 13:12:44 +00:00
|
|
|
, freeglut, freealut, libGLU_combined, libICE, libjpeg, openal, openscenegraph, plib
|
2013-10-06 20:36:18 +01:00
|
|
|
, libSM, libunwind, libX11, xproto, libXext, xextproto, libXi, inputproto
|
|
|
|
, libXmu, libXt, simgear, zlib, boost, cmake, libpng, udev, fltk13, apr
|
2017-09-28 18:09:17 +01:00
|
|
|
, makeDesktopItem, qtbase, qtdeclarative, glew
|
2013-10-06 20:36:18 +01:00
|
|
|
}:
|
2011-04-09 19:57:00 +01:00
|
|
|
|
2016-12-24 21:57:25 +00:00
|
|
|
let
|
2017-09-28 18:09:17 +01:00
|
|
|
version = "2017.3.1";
|
|
|
|
shortVersion = "2017.3";
|
2016-12-24 21:57:25 +00:00
|
|
|
data = stdenv.mkDerivation rec {
|
|
|
|
name = "flightgear-base-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/FlightGear-${version}-data.tar.bz2";
|
2017-09-28 18:09:17 +01:00
|
|
|
sha256 = "166q0fsbp17lx1l1n6i8cfk3d1i79pasz1liya09z6m2i1pb026z";
|
2016-12-24 21:57:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/FlightGear"
|
|
|
|
tar xf "${src}" -C "$out/share/FlightGear/" --strip-components=1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2013-10-06 20:36:18 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "flightgear-${version}";
|
2017-01-18 15:57:19 +00:00
|
|
|
# inheriting data for `nix-prefetch-url -A pkgs.flightgear.data.src`
|
|
|
|
inherit version data;
|
2013-10-06 20:36:18 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-12-24 21:57:25 +00:00
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/${name}.tar.bz2";
|
2017-09-28 18:09:17 +01:00
|
|
|
sha256 = "1kccf91vmxnzyki6grx09s10dvr4j6qrz34ikj7jn81g5scisbkg";
|
2011-04-09 19:57:00 +01:00
|
|
|
};
|
|
|
|
|
2013-10-21 21:22:24 +01: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 20:36:18 +01:00
|
|
|
buildInputs = [
|
2016-12-24 21:57:25 +00:00
|
|
|
makeWrapper
|
2018-02-24 13:12:44 +00:00
|
|
|
freeglut freealut libGLU_combined libICE libjpeg openal openscenegraph plib
|
2013-10-06 20:36:18 +01:00
|
|
|
libSM libunwind libX11 xproto libXext xextproto libXi inputproto
|
2015-09-27 16:36:23 +01:00
|
|
|
libXmu libXt simgear zlib boost cmake libpng udev fltk13 apr qtbase
|
2017-09-28 18:09:17 +01:00
|
|
|
glew qtdeclarative
|
2013-10-06 20:36:18 +01:00
|
|
|
];
|
2011-04-09 19:57:00 +01:00
|
|
|
|
2013-10-06 20:36:18 +01:00
|
|
|
postInstall = ''
|
2013-10-21 21:22:24 +01:00
|
|
|
mkdir -p "$out/share/applications/"
|
2016-12-24 21:57:25 +00:00
|
|
|
cp "${desktopItem}"/share/applications/* "$out/share/applications/" #*/
|
|
|
|
|
|
|
|
for f in $out/bin/* #*/
|
|
|
|
do
|
|
|
|
wrapProgram $f --set FG_ROOT "${data}/share/FlightGear"
|
|
|
|
done
|
2013-10-06 20:36:18 +01:00
|
|
|
'';
|
2013-02-23 19:32:12 +00:00
|
|
|
|
2017-09-28 18:09:17 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2013-10-06 20:36:18 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Flight simulator";
|
2014-01-15 20:36:34 +00:00
|
|
|
maintainers = with maintainers; [ raskin the-kenny ];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
hydraPlatforms = []; # disabled from hydra because it's so big
|
2013-10-06 20:36:18 +01:00
|
|
|
license = licenses.gpl2;
|
2011-04-09 19:57:00 +01:00
|
|
|
};
|
2013-10-06 20:36:18 +01:00
|
|
|
}
|