2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, wrapQtAppsHook
|
2019-11-10 16:44:34 +00:00
|
|
|
, freeglut, freealut, libGLU, libGL, libICE, libjpeg, openal, openscenegraph, plib
|
2018-12-31 03:40:47 +00:00
|
|
|
, libSM, libunwind, libX11, xorgproto, libXext, libXi
|
2013-10-06 19:36:18 +00:00
|
|
|
, libXmu, libXt, simgear, zlib, boost, cmake, libpng, udev, fltk13, apr
|
2022-11-13 22:43:07 +00:00
|
|
|
, makeDesktopItem, qtbase, qtdeclarative, glew, curl
|
2013-10-06 19:36:18 +00:00
|
|
|
}:
|
2011-04-09 18:57:00 +00:00
|
|
|
|
2016-12-24 21:57:25 +00:00
|
|
|
let
|
2023-05-15 05:57:52 +00:00
|
|
|
version = "2020.3.18";
|
2019-08-06 20:06:40 +00:00
|
|
|
shortVersion = builtins.substring 0 6 version;
|
2016-12-24 21:57:25 +00:00
|
|
|
data = stdenv.mkDerivation rec {
|
2020-07-01 12:57:03 +00:00
|
|
|
pname = "flightgear-data";
|
2019-08-13 21:52:01 +00:00
|
|
|
inherit version;
|
2016-12-24 21:57:25 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-17 23:04:38 +00:00
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/FlightGear-${version}-data.txz";
|
2023-05-15 05:57:52 +00:00
|
|
|
sha256 = "sha256-U8lsHrw40Xo6a3jZw6GiPnOALvvg9PdecVAdkZewUjg=";
|
2016-12-24 21:57:25 +00:00
|
|
|
};
|
|
|
|
|
2021-08-03 08:50:40 +00:00
|
|
|
dontUnpack = true;
|
2016-12-24 21:57:25 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/FlightGear"
|
|
|
|
tar xf "${src}" -C "$out/share/FlightGear/" --strip-components=1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2013-10-06 19:36:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-06 20:06:40 +00:00
|
|
|
pname = "flightgear";
|
2023-05-15 05:57:52 +00:00
|
|
|
# inheriting data for `nix-prefetch-url -A pkgs.flightgear.data.src`
|
2017-01-18 15:57:19 +00:00
|
|
|
inherit version data;
|
2013-10-06 19:36:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-06 20:06:40 +00:00
|
|
|
url = "mirror://sourceforge/flightgear/release-${shortVersion}/${pname}-${version}.tar.bz2";
|
2023-05-15 05:57:52 +00:00
|
|
|
sha256 = "sha256-OajjGj/Bgqg8H/6PjXkwJHwbSQqtzbQ1b3Xwk3aI3jc=";
|
2011-04-09 18:57:00 +00:00
|
|
|
};
|
|
|
|
|
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 {
|
2021-02-25 04:18:36 +00:00
|
|
|
url = "https://wiki.flightgear.org/w/images/6/62/FlightGear_logo.png";
|
2013-10-21 20:22:24 +00:00
|
|
|
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";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" "Simulation" ];
|
2013-10-21 20:22:24 +00:00
|
|
|
};
|
|
|
|
|
2019-08-06 20:06:40 +00:00
|
|
|
nativeBuildInputs = [ cmake wrapQtAppsHook ];
|
2013-10-06 19:36:18 +00:00
|
|
|
buildInputs = [
|
2019-11-10 16:44:34 +00:00
|
|
|
freeglut freealut libGLU libGL libICE libjpeg openal openscenegraph plib
|
2018-12-31 03:40:47 +00:00
|
|
|
libSM libunwind libX11 xorgproto libXext libXi
|
2019-08-06 20:06:40 +00:00
|
|
|
libXmu libXt simgear zlib boost libpng udev fltk13 apr qtbase
|
2022-11-13 22:43:07 +00:00
|
|
|
glew qtdeclarative curl
|
2013-10-06 19:36:18 +00:00
|
|
|
];
|
2011-04-09 18:57:00 +00:00
|
|
|
|
2013-10-06 19:36:18 +00:00
|
|
|
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/" #*/
|
2013-10-06 19:36:18 +00:00
|
|
|
'';
|
2013-02-23 19:32:12 +00:00
|
|
|
|
2019-07-05 15:42:08 +00:00
|
|
|
qtWrapperArgs = [
|
2019-08-06 20:06:40 +00:00
|
|
|
"--set FG_ROOT ${data}/share/FlightGear"
|
2019-07-05 15:42:08 +00:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-10-06 19:36:18 +00:00
|
|
|
description = "Flight simulator";
|
2020-05-09 09:25:07 +00:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
hydraPlatforms = []; # disabled from hydra because it's so big
|
2013-10-06 19:36:18 +00:00
|
|
|
license = licenses.gpl2;
|
2011-04-09 18:57:00 +00:00
|
|
|
};
|
2013-10-06 19:36:18 +00:00
|
|
|
}
|