Files
nixpkgs/pkgs/by-name/su/superTux/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

99 lines
2.4 KiB
Nix

{
lib,
stdenv,
fetchurl,
cmake,
pkg-config,
boost,
curl,
SDL2,
SDL2_image,
libSM,
libXext,
libpng,
freetype,
libGLU,
libGL,
glew,
glm,
openal,
libogg,
libvorbis,
}:
stdenv.mkDerivation rec {
pname = "supertux";
version = "0.6.3";
src = fetchurl {
url = "https://github.com/SuperTux/supertux/releases/download/v${version}/SuperTux-v${version}-Source.tar.gz";
sha256 = "1xkr3ka2sxp5s0spp84iv294i29s1vxqzazb6kmjc0n415h0x57p";
};
postPatch = ''
sed '1i#include <memory>' -i external/partio_zip/zip_manager.hpp # gcc12
# Fix build with cmake 4. Remove for version >= 0.6.4.
# See <https://github.com/SuperTux/supertux/pull/3093>
substituteInPlace CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 3.1)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/physfs/CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 2.8.12)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/sexp-cpp/CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 3.0)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/squirrel/CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 2.8)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/tinygettext/CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 2.4)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/SDL_ttf/CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 3.0)' \
'cmake_minimum_required(VERSION 4.0)'
substituteInPlace external/discord-sdk/CMakeLists.txt --replace-fail \
'cmake_minimum_required (VERSION 3.2.0)' \
'cmake_minimum_required (VERSION 4.0)'
'';
nativeBuildInputs = [
pkg-config
cmake
];
buildInputs = [
boost
curl
SDL2
SDL2_image
libSM
libXext
libpng
freetype
libGL
libGLU
glew
glm
openal
libogg
libvorbis
];
cmakeFlags = [ "-DENABLE_BOOST_STATIC_LIBS=OFF" ];
postInstall = ''
mkdir $out/bin
ln -s $out/games/supertux2 $out/bin
'';
meta = with lib; {
description = "Classic 2D jump'n run sidescroller game";
homepage = "https://supertux.github.io/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ pSub ];
platforms = with platforms; linux;
mainProgram = "supertux2";
};
}