Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
hedgewars: 1.0.0-beta1 -> 1.0.0-beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Sep 19, 2019
1 parent e19054a commit 751b661
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 35 deletions.
81 changes: 48 additions & 33 deletions pkgs/games/hedgewars/default.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
{ SDL2_image, SDL2_ttf, SDL2_net, fpc, qt5, ghcWithPackages, ffmpeg, freeglut
, stdenv, makeWrapper, fetchhg, cmake, pkgconfig, lua5_1, SDL2, SDL2_mixer
, zlib, libpng, libGLU_combined, physfs
{ mkDerivation, SDL2_image, SDL2_ttf, SDL2_net, fpc, ghcWithPackages, ffmpeg, freeglut
, lib, fetchhg, cmake, pkgconfig, lua5_1, SDL2, SDL2_mixer
, zlib, libpng, libGL, libGLU, physfs
, qtbase, qttools
, withServer ? true
}:

let
ghc = ghcWithPackages (pkgs: with pkgs; [
network vector utf8-string bytestring random hslogger
SHA entropy pkgs.zlib sandi regex-tdfa
SHA bytestring entropy hslogger network pkgs.zlib random
regex-tdfa sandi utf8-string vector
]);

in
stdenv.mkDerivation {
version = "1.0.0-beta1";
mkDerivation rec {
pname = "hedgewars";
version = "1.0.0-beta2";

# it's crazy slow to fetch the whole repo but the beta versions are not
# released as tarballs
src = fetchhg {
url = "https://hg.hedgewars.org/hedgewars/";
rev = "7ab5cf405686";
sha256 = "1yrspi82ym5zpavka4cv0vh86g3i2mbbg8ccfcsid4f38lgbb9y4";
rev = "dff37ac61dcf";
sha256 = "1dsq6wfv3d7jfnr068b7ixpnqp0h6mj7zgby6h1viwblgbirri78";
};

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ cmake pkgconfig qttools ];

buildInputs = [
SDL2_ttf SDL2_net cmake lua5_1 SDL2 SDL2_mixer SDL2_image fpc
ghc ffmpeg freeglut makeWrapper physfs
qt5.qttools qt5.qtbase
];
SDL2_ttf SDL2_net SDL2 SDL2_mixer SDL2_image
fpc lua5_1
ffmpeg freeglut physfs
qtbase
] ++ lib.optional withServer ghc;

postPatch = ''
substituteInPlace gameServer/CMakeLists.txt --replace mask evaluate
substituteInPlace gameServer/CMakeLists.txt \
--replace mask evaluate
'';

preBuild = ''
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${SDL2_image}/lib
-rpath ${SDL2_mixer}/lib
-rpath ${SDL2_net}/lib
-rpath ${SDL2_ttf}/lib
-rpath ${SDL2.out}/lib
-rpath ${libpng.out}/lib
-rpath ${lua5_1}/lib
-rpath ${libGLU_combined}/lib
-rpath ${zlib.out}/lib
"
'';
cmakeFlags = [
"-DNOVERSIONINFOUPDATE=ON"
"-DNOSERVER=${if withServer then "OFF" else "ON"}"
];

postInstall = ''
wrapProgram $out/bin/hwengine --prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH:${stdenv.lib.makeLibraryPath [ libGLU_combined freeglut physfs ]}
'';
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 ]}"
];

meta = with stdenv.lib; {
meta = with lib; {
description = "Turn-based strategy artillery game similar to Worms";
homepage = http://hedgewars.org/;
homepage = "http://hedgewars.org/";
license = licenses.gpl2;
longDescription = ''
Each player controls a team of several hedgehogs. During the course of
Expand All @@ -74,7 +89,7 @@ stdenv.mkDerivation {
hedgehog or hedgehogs after a player's or CPU turn is shown only when
all movement on the battlefield has ceased).'';
maintainers = with maintainers; [ kragniz fpletz ];
platforms = ghc.meta.platforms;
inherit (ghc.meta) platforms;
hydraPlatforms = [];
};
}
3 changes: 1 addition & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22051,9 +22051,8 @@ in

hawkthorne = callPackage ../games/hawkthorne { love = love_0_9; };

hedgewars = callPackage ../games/hedgewars {
hedgewars = libsForQt5.callPackage ../games/hedgewars {
inherit (haskellPackages) ghcWithPackages;
ffmpeg = ffmpeg_2;
};

hexen = callPackage ../games/hexen { };
Expand Down

0 comments on commit 751b661

Please sign in to comment.