nixpkgs/pkgs/games/flightgear/default.nix

82 lines
2.4 KiB
Nix
Raw Normal View History

2019-08-06 20:06:40 +00:00
{ stdenv, fetchurl, wrapQtAppsHook
2019-11-10 16:44:34 +00:00
, freeglut, freealut, libGLU, libGL, libICE, libjpeg, openal, openscenegraph, plib
, libSM, libunwind, libX11, xorgproto, libXext, libXi
, libXmu, libXt, simgear, zlib, boost, cmake, libpng, udev, fltk13, apr
, makeDesktopItem, qtbase, qtdeclarative, glew
}:
2016-12-24 21:57:25 +00:00
let
2019-08-06 20:06:40 +00:00
version = "2019.1.1";
shortVersion = builtins.substring 0 6 version;
2016-12-24 21:57:25 +00:00
data = stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "flightgear-base";
inherit version;
2016-12-24 21:57:25 +00:00
src = fetchurl {
url = "mirror://sourceforge/flightgear/release-${shortVersion}/FlightGear-${version}-data.tar.bz2";
2019-08-06 20:06:40 +00:00
sha256 = "14zm0hzshbca4ych72631hpc4pw2w24zib62ri3lwm8nz6j63qhf";
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
stdenv.mkDerivation rec {
2019-08-06 20:06:40 +00:00
pname = "flightgear";
# inheriting data for `nix-prefetch-url -A pkgs.flightgear.data.src`
inherit version data;
src = fetchurl {
2019-08-06 20:06:40 +00:00
url = "mirror://sourceforge/flightgear/release-${shortVersion}/${pname}-${version}.tar.bz2";
sha256 = "189wal08p9lrz757pmazxnf85sfymsqrm3nfvdad95pfp6bg7pyi";
};
2013-10-21 20:22:24 +00: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";
2019-09-08 23:38:31 +00:00
icon = iconsrc;
2013-10-21 20:22:24 +00:00
comment = "FlightGear Flight Simulator";
desktopName = "FlightGear";
genericName = "Flight simulator";
categories = "Game;Simulation";
};
2019-08-06 20:06:40 +00:00
nativeBuildInputs = [ cmake wrapQtAppsHook ];
buildInputs = [
2019-11-10 16:44:34 +00:00
freeglut freealut libGLU libGL libICE libjpeg openal openscenegraph plib
libSM libunwind libX11 xorgproto libXext libXi
2019-08-06 20:06:40 +00:00
libXmu libXt simgear zlib boost libpng udev fltk13 apr qtbase
glew qtdeclarative
];
postInstall = ''
2013-10-21 20:22:24 +00:00
mkdir -p "$out/share/applications/"
2016-12-24 21:57:25 +00:00
cp "${desktopItem}"/share/applications/* "$out/share/applications/" #*/
'';
qtWrapperArgs = [
2019-08-06 20:06:40 +00:00
"--set FG_ROOT ${data}/share/FlightGear"
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "Flight simulator";
2014-01-15 20:36:34 +00:00
maintainers = with maintainers; [ raskin the-kenny ];
platforms = platforms.linux;
hydraPlatforms = []; # disabled from hydra because it's so big
license = licenses.gpl2;
};
}