diff --git a/pkgs/games/wesnoth/add-acl-prefix-to-libext.patch b/pkgs/games/wesnoth/add-acl-prefix-to-libext.patch new file mode 100644 index 00000000000..6ff96efda1e --- /dev/null +++ b/pkgs/games/wesnoth/add-acl-prefix-to-libext.patch @@ -0,0 +1,28 @@ +diff -Naur wesnoth-upstream-1.8.5/m4/boost.m4 wesnoth-1.8.5/m4/boost.m4 + +Libtools seems to set a variable called acl_libext while the Boost +library check code uses a variable called libext. This patch makes +the Boost check use the variable acl_libext actually set by libtools. + +--- wesnoth-upstream-1.8.5/m4/boost.m4 2010-10-02 20:35:59.577619372 -0430 ++++ wesnoth-1.8.5/m4/boost.m4 2010-10-02 20:39:10.383653233 -0430 +@@ -252,8 +252,8 @@ + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" + $boost_guess_use_mt && boost_mt=-mt + # Look for the abs path the static archive. +- # $libext is computed by Libtool but let's make sure it's non empty. +- test -z "$libext" && ++ # $acl_libext is computed by Libtool but let's make sure it's non empty. ++ test -z "$acl_libext" && + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. +@@ -309,7 +309,7 @@ + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( + *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) +- Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$acl_libext" + test -e "$Boost_lib_LIBS" || continue;; #( + *) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; diff --git a/pkgs/games/wesnoth/default.nix b/pkgs/games/wesnoth/default.nix index 5433c0018a5..59c2de21a48 100644 --- a/pkgs/games/wesnoth/default.nix +++ b/pkgs/games/wesnoth/default.nix @@ -1,22 +1,53 @@ -{ stdenv, fetchurl, SDL, SDL_image, SDL_mixer, SDL_net, SDL_ttf, pango -, gettext, zlib, boost, freetype, libpng, pkgconfig }: +{ stdenv, fetchurl, automake, autoconf, SDL, SDL_image, SDL_mixer, SDL_net, SDL_ttf, pango +, gettext, zlib, boost, freetype, libpng, pkgconfig, lua, dbus, fontconfig, libtool +, fribidi, asciidoc }: stdenv.mkDerivation rec { pname = "wesnoth"; - version = "1.6.5"; + version = "1.8.5"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://sourceforge/sourceforge/${pname}/${name}.tar.bz2"; - sha256 = "1mrhgwp8iw27ifpavnf4y69zf9fqfy7j4sfwkfzsay226sp4gw3y"; + sha256 = "1yjmqvwzz446vvkjg923ypwnmhb0fbgqj0ax0k7s102la37bv8zc"; }; - buildInputs = [ SDL SDL_image SDL_mixer SDL_net SDL_ttf pango gettext zlib boost freetype libpng pkgconfig ]; + buildInputs = [ SDL SDL_image SDL_mixer SDL_net SDL_ttf pango gettext zlib boost fribidi + automake autoconf freetype libpng pkgconfig lua dbus fontconfig libtool ]; - configureFlags = "--with-preferences-dir=.${name} --program-suffix=-${version} --with-datadir-name=${name} --with-boost=${boost}/include --disable-python"; + # The patch and the preInstall sed substitution fix errors which I + # believe arise from autotools version mismatches. Rather than + # hunt for the correct automake and autoconf versions these changes + # make the build work with the versions current in Nixpkgs. + patches = ./add-acl-prefix-to-libext.patch; - meta = { + preInstall = '' + sed -i -e s,@MKINSTALLDIRS@,`pwd`/config/mkinstalldirs, po/*/Makefile + ''; + + configurePhase = '' + ./autogen.sh --prefix=$out --with-boost=${boost} \ + --with-preferences-dir=.${name} --program-suffix=-${version} \ + --with-datadir-name=${name} + ''; + + # Make the package build with the gcc currently available in Nixpkgs. + NIX_CFLAGS_COMPILE = "-Wno-ignored-qualifiers"; + + meta = with stdenv.lib; { description = "The Battle for Wesnoth, a free, turn-based strategy game with a fantasy theme"; + longDescription = '' + The Battle for Wesnoth is a Free, turn-based tactical strategy + game with a high fantasy theme, featuring both single-player, and + online/hotseat multiplayer combat. Fight a desperate battle to + reclaim the throne of Wesnoth, or take hand in any number of other + adventures. + ''; + + homepage = http://www.wesnoth.org/; + license = licenses.gpl2; + maintainers = [ maintainers.kkallio ]; + platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4ddad02ac30..bad773df55a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5081,6 +5081,7 @@ let wesnoth = callPackage ../games/wesnoth { inherit (gtkLibs) pango; + lua = lua5; }; wirelesstools = callPackage ../os-specific/linux/wireless-tools { };