2015-07-01 23:06:39 +03:00
|
|
|
{ stdenv, fetchurl, cpio, xproto, libX11, libXmu, libXaw, libXt, tcl, tk
|
|
|
|
, libXext, fontconfig, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "${baseName}-${version}";
|
2016-02-08 01:30:22 +03:00
|
|
|
baseName = "xconq";
|
2015-07-01 23:06:39 +03:00
|
|
|
version = "7.5.0-0pre.0.20050612";
|
2016-02-08 01:30:22 +03:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/project/${baseName}/${baseName}/${name}/${name}.tar.gz";
|
|
|
|
sha256 = "1za78yx57mgwcmmi33wx3533yz1x093dnqis8q2qmqivxav51lca";
|
2011-05-28 19:36:56 +04:00
|
|
|
};
|
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
buildInputs = [ cpio xproto libX11 libXmu libXaw libXt tcl tk libXext
|
|
|
|
fontconfig makeWrapper ];
|
2011-05-28 19:36:56 +04:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-alternate-scoresdir=scores"
|
|
|
|
"--with-tclconfig=${tcl}/lib"
|
|
|
|
"--with-tkconfig=${tk}/lib"
|
|
|
|
];
|
2011-05-28 19:36:56 +04:00
|
|
|
|
2016-02-26 20:38:15 +03:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-08 01:30:22 +03:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
patchPhase = ''
|
|
|
|
# Fix Makefiles
|
2011-05-28 19:36:56 +04:00
|
|
|
find . -name 'Makefile.in' -exec sed -re 's@^ ( *)(cd|[&][&])@ \1\2@' -i '{}' ';'
|
|
|
|
find . -name 'Makefile.in' -exec sed -e '/chown/d; /chgrp/d' -i '{}' ';'
|
2017-06-17 12:46:48 +03:00
|
|
|
# do not set sticky bit in nix store
|
2017-06-16 15:04:54 +03:00
|
|
|
find . -name 'Makefile.in' -exec sed -e 's/04755/755/g' -i '{}' ';'
|
2011-05-28 19:36:56 +04:00
|
|
|
sed -e '/^ * *[$][(]tcltkdir[)]\/[*][.][*]/d' -i tcltk/Makefile.in
|
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
# Fix C files
|
2011-05-28 19:36:56 +04:00
|
|
|
sed -re 's@[(]int[)]color@(long)color@' -i tcltk/tkmap.c
|
2011-05-31 23:34:06 +04:00
|
|
|
sed -re '/unitp = view_unit[(]uview[)]/aelse *unitp = NULL\;' -i tcltk/tkmap.c
|
2017-08-29 21:31:45 +03:00
|
|
|
sed -re 's@BMAP_BYTE char@BMAP_BYTE unsigned char@' -i kernel/ui.h
|
2011-05-28 19:36:56 +04:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
# Fix TCL files
|
2011-06-01 00:18:40 +04:00
|
|
|
sed -re 's@MediumBlue@LightBlue@g' -i tcltk/tkconq.tcl
|
2015-07-01 23:06:39 +03:00
|
|
|
'';
|
2011-06-01 00:18:40 +04:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
postInstall = ''
|
|
|
|
for file in $out/bin/*; do
|
|
|
|
wrapProgram $file --prefix TCLLIBPATH ' ' "${tk}/lib"
|
|
|
|
done
|
|
|
|
'';
|
2011-05-28 19:36:56 +04:00
|
|
|
|
2015-07-01 23:06:39 +03:00
|
|
|
meta = with stdenv.lib; {
|
2011-05-28 19:36:56 +04:00
|
|
|
description = "A programmable turn-based strategy game";
|
2015-07-01 23:06:39 +03:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
2011-05-28 19:36:56 +04:00
|
|
|
};
|
2015-07-01 23:06:39 +03:00
|
|
|
}
|