2022-07-16 17:02:26 +00:00
|
|
|
{ stdenv, SDL2_image, SDL2_ttf, SDL2_net, fpc, ghcWithPackages, ffmpeg, freeglut
|
2021-01-17 05:49:22 +00:00
|
|
|
, lib, fetchurl, cmake, pkg-config, lua5_1, SDL2, SDL2_mixer
|
2019-09-19 12:45:35 +00:00
|
|
|
, zlib, libpng, libGL, libGLU, physfs
|
2022-07-16 17:02:26 +00:00
|
|
|
, qtbase, qttools, wrapQtAppsHook
|
2020-09-03 13:39:38 +00:00
|
|
|
, llvm
|
2019-09-19 12:45:35 +00:00
|
|
|
, withServer ? true
|
2014-10-14 15:40:56 +00:00
|
|
|
}:
|
|
|
|
|
2015-05-04 10:43:24 +00:00
|
|
|
let
|
2020-05-06 04:09:54 +00:00
|
|
|
# gameServer/hedgewars-server.cabal depends on network < 3
|
2015-05-04 10:43:24 +00:00
|
|
|
ghc = ghcWithPackages (pkgs: with pkgs; [
|
2020-05-06 04:09:54 +00:00
|
|
|
SHA bytestring entropy hslogger network_2_6_3_1 pkgs.zlib random
|
2019-09-19 12:45:35 +00:00
|
|
|
regex-tdfa sandi utf8-string vector
|
2015-05-04 10:43:24 +00:00
|
|
|
]);
|
2019-09-19 12:45:35 +00:00
|
|
|
|
2015-05-04 10:43:24 +00:00
|
|
|
in
|
2022-07-16 17:02:26 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "hedgewars";
|
2019-10-23 22:43:40 +00:00
|
|
|
version = "1.0.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.hedgewars.org/download/releases/hedgewars-src-${version}.tar.bz2";
|
|
|
|
sha256 = "0nqm9w02m0xkndlsj6ys3wr0ik8zc14zgilq7k6fwjrf3zk385i1";
|
2014-10-14 15:40:56 +00:00
|
|
|
};
|
|
|
|
|
2022-07-16 17:02:26 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ];
|
2019-09-19 12:45:35 +00:00
|
|
|
|
2014-10-14 15:40:56 +00:00
|
|
|
buildInputs = [
|
2019-09-19 12:45:35 +00:00
|
|
|
SDL2_ttf SDL2_net SDL2 SDL2_mixer SDL2_image
|
|
|
|
fpc lua5_1
|
2020-09-03 13:39:38 +00:00
|
|
|
llvm # hard-requirement on aarch64, for some reason not strictly necessary on x86-64
|
2021-05-05 21:40:29 +00:00
|
|
|
ffmpeg freeglut physfs
|
2019-09-19 12:45:35 +00:00
|
|
|
qtbase
|
|
|
|
] ++ lib.optional withServer ghc;
|
2014-10-14 15:40:56 +00:00
|
|
|
|
2022-07-08 02:14:12 +00:00
|
|
|
patches = [
|
|
|
|
./qt515.patch
|
|
|
|
];
|
|
|
|
|
2016-08-06 17:20:18 +00:00
|
|
|
postPatch = ''
|
2019-09-19 12:45:35 +00:00
|
|
|
substituteInPlace gameServer/CMakeLists.txt \
|
|
|
|
--replace mask evaluate
|
2020-09-03 10:49:11 +00:00
|
|
|
|
|
|
|
# compile with fpc >= 3.2.0
|
|
|
|
# https://github.com/archlinux/svntogit-community/blob/75a1b3900fb3dd553d5114bbc8474d85fd6abb02/trunk/PKGBUILD#L26
|
|
|
|
sed -i 's/procedure ShiftWorld(Dir: LongInt); inline;/procedure ShiftWorld(Dir: LongInt);/' hedgewars/uWorld.pas
|
2016-08-06 17:20:18 +00:00
|
|
|
'';
|
|
|
|
|
2019-09-19 12:45:35 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DNOVERSIONINFOUPDATE=ON"
|
|
|
|
"-DNOSERVER=${if withServer then "OFF" else "ON"}"
|
|
|
|
];
|
2014-10-14 15:40:56 +00:00
|
|
|
|
2020-05-06 04:09:54 +00:00
|
|
|
|
2020-09-03 10:49:11 +00:00
|
|
|
# hslogger brings network-3 and network-bsd which conflict with
|
2020-05-06 04:09:54 +00:00
|
|
|
# network-2.6.3.1
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace gameServer/CMakeLists.txt \
|
|
|
|
--replace "haskell_flags}" \
|
|
|
|
"haskell_flags} -package network-2.6.3.1 -hide-package network-bsd"
|
|
|
|
'';
|
|
|
|
|
2019-09-19 12:45:35 +00:00
|
|
|
NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [
|
|
|
|
SDL2.out
|
|
|
|
SDL2_image
|
|
|
|
SDL2_mixer
|
|
|
|
SDL2_net
|
|
|
|
SDL2_ttf
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libpng.out
|
|
|
|
lua5_1
|
|
|
|
physfs
|
|
|
|
zlib.out
|
|
|
|
];
|
|
|
|
|
|
|
|
qtWrapperArgs = [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libGLU freeglut physfs ]}"
|
|
|
|
];
|
2014-10-14 15:40:56 +00:00
|
|
|
|
2019-09-19 12:45:35 +00:00
|
|
|
meta = with lib; {
|
2014-12-30 02:31:03 +00:00
|
|
|
description = "Turn-based strategy artillery game similar to Worms";
|
2019-09-19 12:45:35 +00:00
|
|
|
homepage = "http://hedgewars.org/";
|
2014-10-14 15:40:56 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
longDescription = ''
|
|
|
|
Each player controls a team of several hedgehogs. During the course of
|
|
|
|
the game, players take turns with one of their hedgehogs. They then use
|
|
|
|
whatever tools and weapons are available to attack and kill the
|
|
|
|
opponents' hedgehogs, thereby winning the game. Hedgehogs may move
|
|
|
|
around the terrain in a variety of ways, normally by walking and jumping
|
|
|
|
but also by using particular tools such as the "Rope" or "Parachute", to
|
|
|
|
move to otherwise inaccessible areas. Each turn is time-limited to
|
|
|
|
ensure that players do not hold up the game with excessive thinking or
|
|
|
|
moving.
|
|
|
|
|
|
|
|
A large variety of tools and weapons are available for players during
|
|
|
|
the game: Grenade, Cluster Bomb, Bazooka, UFO, Homing Bee, Shotgun,
|
|
|
|
Desert Eagle, Fire Punch, Baseball Bat, Dynamite, Mine, Rope, Pneumatic
|
|
|
|
pick, Parachute. Most weapons, when used, cause explosions that deform
|
|
|
|
the terrain, removing circular chunks. The landscape is an island
|
|
|
|
floating on a body of water, or a restricted cave with water at the
|
|
|
|
bottom. A hedgehog dies when it enters the water (either by falling off
|
|
|
|
the island, or through a hole in the bottom of it), it is thrown off
|
|
|
|
either side of the arena or when its health is reduced, typically from
|
|
|
|
contact with explosions, to zero (the damage dealt to the attacked
|
|
|
|
hedgehog or hedgehogs after a player's or CPU turn is shown only when
|
|
|
|
all movement on the battlefield has ceased).'';
|
2016-08-06 17:20:18 +00:00
|
|
|
maintainers = with maintainers; [ kragniz fpletz ];
|
2021-05-05 20:45:52 +00:00
|
|
|
inherit (fpc.meta) platforms;
|
2022-08-18 04:22:37 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/pull/185755#issuecomment-1219024584
|
|
|
|
broken = true;
|
2022-08-19 04:01:44 +00:00
|
|
|
hydraPlatforms = platforms.none;
|
2014-10-14 15:40:56 +00:00
|
|
|
};
|
|
|
|
}
|