2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, wrapQtAppsHook
|
2020-04-24 23:36:52 +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
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "2020.3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
shortVersion = builtins.substring 0 6 version;
|
|
|
|
data = stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "flightgear-data";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-22 02:08:21 +00:00
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/FlightGear-${version}-data.txz";
|
|
|
|
sha256 = "sha256-/KFumHRkmRvsU/L1i11jG/KbqobnOEP7l4lyPMKHycA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/FlightGear"
|
|
|
|
tar xf "${src}" -C "$out/share/FlightGear/" --strip-components=1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "flightgear";
|
|
|
|
# inheriting data for `nix-prefetch-url -A pkgs.flightgear.data.src`
|
|
|
|
inherit version data;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/${pname}-${version}.tar.bz2";
|
2021-04-22 02:08:21 +00:00
|
|
|
sha256 = "XXDqhZ9nR+FwQ3LauZe8iGxOjlyDXDrEtj61BQGVDYc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Of all the files in the source and data archives, there doesn't seem to be
|
|
|
|
# a decent icon :-)
|
|
|
|
iconsrc = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://wiki.flightgear.org/w/images/6/62/FlightGear_logo.png";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1ikz413jia55vfnmx8iwrlxvx8p16ggm81mbrj66wam3q7s2dm5p";
|
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "flightgear";
|
|
|
|
exec = "fgfs";
|
|
|
|
icon = iconsrc;
|
|
|
|
comment = "FlightGear Flight Simulator";
|
|
|
|
desktopName = "FlightGear";
|
|
|
|
genericName = "Flight simulator";
|
|
|
|
categories = "Game;Simulation";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake wrapQtAppsHook ];
|
|
|
|
buildInputs = [
|
|
|
|
freeglut freealut libGLU libGL libICE libjpeg openal openscenegraph plib
|
|
|
|
libSM libunwind libX11 xorgproto libXext libXi
|
|
|
|
libXmu libXt simgear zlib boost libpng udev fltk13 apr qtbase
|
|
|
|
glew qtdeclarative
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/applications/"
|
|
|
|
cp "${desktopItem}"/share/applications/* "$out/share/applications/" #*/
|
|
|
|
'';
|
|
|
|
|
|
|
|
qtWrapperArgs = [
|
|
|
|
"--set FG_ROOT ${data}/share/FlightGear"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Flight simulator";
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
hydraPlatforms = []; # disabled from hydra because it's so big
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|