2021-06-21 06:19:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-10-24 05:51:22 +00:00
|
|
|
, pkg-config # needed to find minizip
|
2021-06-21 06:19:11 +00:00
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, SDL2_mixer
|
|
|
|
, SDL2_net
|
|
|
|
, SDL2_ttf
|
|
|
|
, cmake
|
|
|
|
, curl
|
|
|
|
, doxygen
|
|
|
|
, gettext
|
|
|
|
, glew
|
|
|
|
, graphviz
|
|
|
|
, icu
|
|
|
|
, installShellFiles
|
|
|
|
, libpng
|
|
|
|
, lua
|
|
|
|
, python3
|
|
|
|
, zlib
|
2022-10-24 05:51:22 +00:00
|
|
|
, minizip
|
|
|
|
, asio
|
|
|
|
, libSM
|
|
|
|
, libICE
|
|
|
|
, libXext
|
2024-08-19 16:59:24 +00:00
|
|
|
, darwin
|
2014-03-29 15:10:03 +00:00
|
|
|
}:
|
2011-04-17 17:55:29 +00:00
|
|
|
|
2017-02-15 06:11:59 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "widelands";
|
2024-03-31 04:17:16 +00:00
|
|
|
version = "1.2";
|
2011-04-17 17:55:29 +00:00
|
|
|
|
2021-06-21 06:19:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "widelands";
|
|
|
|
repo = "widelands";
|
|
|
|
rev = "v${version}";
|
2024-03-31 04:17:16 +00:00
|
|
|
sha256 = "sha256-V7eappIMEQMNbf9EGQhv71Fwz0wH679ifi/qAHWwMNU=";
|
2011-04-17 17:55:29 +00:00
|
|
|
};
|
2014-03-29 15:10:03 +00:00
|
|
|
|
2021-06-21 06:19:11 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xdg/org.widelands.Widelands.desktop \
|
|
|
|
--replace 'Exec=widelands' "Exec=$out/bin/widelands"
|
2014-03-29 15:10:03 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-21 06:19:11 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-Wno-dev" # dev warnings are only needed for upstream development
|
2022-10-24 05:51:22 +00:00
|
|
|
"-DWL_INSTALL_BASEDIR=${placeholder "out"}/share/widelands" # for COPYING, Changelog, etc.
|
|
|
|
"-DWL_INSTALL_DATADIR=${placeholder "out"}/share/widelands" # for game data
|
|
|
|
"-DWL_INSTALL_BINDIR=${placeholder "out"}/bin"
|
2021-06-21 06:19:11 +00:00
|
|
|
];
|
|
|
|
|
2022-10-24 05:51:22 +00:00
|
|
|
nativeBuildInputs = [ cmake doxygen gettext graphviz installShellFiles pkg-config ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2014-03-29 15:10:03 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-21 06:19:11 +00:00
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
SDL2_mixer
|
|
|
|
SDL2_net
|
|
|
|
SDL2_ttf
|
|
|
|
curl
|
|
|
|
glew
|
|
|
|
icu
|
|
|
|
libpng
|
|
|
|
lua
|
|
|
|
python3
|
|
|
|
zlib
|
2022-10-24 05:51:22 +00:00
|
|
|
minizip
|
|
|
|
asio
|
|
|
|
libSM # XXX: these should be propagated by SDL2?
|
|
|
|
libICE
|
2024-08-19 16:59:24 +00:00
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isLinux libXext
|
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
|
|
Cocoa
|
|
|
|
]);
|
2014-03-29 15:10:03 +00:00
|
|
|
|
2024-08-19 16:59:24 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isLinux ''
|
2021-06-21 06:19:11 +00:00
|
|
|
install -Dm444 -t $out/share/applications ../xdg/org.widelands.Widelands.desktop
|
|
|
|
|
|
|
|
for s in 16 32 48 64 128; do
|
|
|
|
install -Dm444 ../data/images/logos/wl-ico-''${s}.png $out/share/icons/hicolor/''${s}x''${s}/org.widelands.Widelands.png
|
|
|
|
done
|
2024-08-19 16:59:24 +00:00
|
|
|
'' + ''
|
2021-06-21 06:19:11 +00:00
|
|
|
installManPage ../xdg/widelands.6
|
2017-02-15 06:11:59 +00:00
|
|
|
'';
|
2021-06-21 06:19:11 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RTS with multiple-goods economy";
|
|
|
|
homepage = "https://widelands.org/";
|
|
|
|
longDescription = ''
|
|
|
|
Widelands is a real time strategy game based on "The Settlers" and "The
|
|
|
|
Settlers II". It has a single player campaign mode, as well as a networked
|
|
|
|
multiplayer mode.
|
|
|
|
'';
|
2024-03-31 04:17:16 +00:00
|
|
|
changelog = "https://github.com/widelands/widelands/releases/tag/v${version}";
|
2022-10-24 05:51:22 +00:00
|
|
|
mainProgram = "widelands";
|
2021-06-21 06:19:11 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ raskin jcumming ];
|
2024-08-19 16:59:24 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-06-21 06:19:11 +00:00
|
|
|
hydraPlatforms = [ ];
|
|
|
|
};
|
2014-03-29 15:10:03 +00:00
|
|
|
}
|