Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00

97 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
doxygen,
graphviz,
makeWrapper,
boost,
SDL2,
python3,
freetype,
openal,
libogg,
libvorbis,
zlib,
libpng,
libtiff,
libjpeg,
libGLU,
libGL,
glew,
libxslt,
}:
stdenv.mkDerivation {
pname = "freeorion";
version = "0.5.0.1-unstable-2024-07-28";
src = fetchFromGitHub {
owner = "freeorion";
repo = "freeorion";
# Current `release-0.5` commit to pick up Boost and GCC 14 fixes
# until another release is cut.
rev = "dc3d6a4f01aa78229c419fa17b4e383f73b024e2";
hash = "sha256-9yPk77YeYkGMJqrlDYRTUMDKMWpxUXhVCnHhomiUc/A=";
};
buildInputs = [
(boost.override {
enablePython = true;
python = python3;
})
(python3.withPackages (p: with p; [ pycodestyle ]))
SDL2
freetype
glew
libGL
libGLU
libjpeg
libogg
libpng
libtiff
libvorbis
openal
zlib
];
nativeBuildInputs = [
cmake
doxygen
graphviz
makeWrapper
];
# as of 0.5.0.1 FreeOrion doesn't work with "-DOpenGL_GL_PREFERENCE=GLVND"
cmakeFlags = [ "-DOpenGL_GL_PREFERENCE=LEGACY" ];
postInstall = ''
mkdir -p $out/libexec
# We need final slashes for XSLT replace to work properly
substitute ${./fix-paths.xslt} $out/share/freeorion/fix-paths.xslt \
--subst-var-by nixStore "$NIX_STORE/" \
--subst-var-by out "$out/"
substitute ${./fix-paths.sh} $out/libexec/fix-paths \
--subst-var-by libxsltBin ${libxslt.bin} \
--subst-var-by shell ${stdenv.shell} \
--subst-var out
chmod +x $out/libexec/fix-paths
wrapProgram $out/bin/freeorion \
--run $out/libexec/fix-paths \
--prefix LD_LIBRARY_PATH : $out/lib/freeorion
'';
meta = with lib; {
description = "Free, open source, turn-based space empire and galactic conquest (4X) computer game";
homepage = "https://www.freeorion.org/";
license = with licenses; [
gpl2Only
cc-by-sa-30
];
platforms = platforms.linux;
maintainers = with maintainers; [ tex ];
};
}