nixpkgs/pkgs/games/flightgear/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
2.4 KiB
Nix
Raw Normal View History

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