2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, cpio, xorgproto, libX11, libXmu, libXaw, libXt, tcl, tk
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXext, fontconfig, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-19 23:45:15 +00:00
|
|
|
pname = "xconq";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "7.5.0-0pre.0.20050612";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-19 23:45:15 +00:00
|
|
|
url = "mirror://sourceforge/project/xconq/xconq/xconq-${version}/xconq-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1za78yx57mgwcmmi33wx3533yz1x093dnqis8q2qmqivxav51lca";
|
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ cpio xorgproto libX11 libXmu libXaw libXt tcl tk libXext fontconfig ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-alternate-scoresdir=scores"
|
|
|
|
"--with-tclconfig=${tcl}/lib"
|
|
|
|
"--with-tkconfig=${tk}/lib"
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
CXXFLAGS = " --std=c++11 ";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
# Fix Makefiles
|
|
|
|
find . -name 'Makefile.in' -exec sed -re 's@^ ( *)(cd|[&][&])@ \1\2@' -i '{}' ';'
|
|
|
|
find . -name 'Makefile.in' -exec sed -e '/chown/d; /chgrp/d' -i '{}' ';'
|
|
|
|
# do not set sticky bit in nix store
|
|
|
|
find . -name 'Makefile.in' -exec sed -e 's/04755/755/g' -i '{}' ';'
|
|
|
|
sed -e '/^ * *[$][(]tcltkdir[)]\/[*][.][*]/d' -i tcltk/Makefile.in
|
|
|
|
|
|
|
|
# Fix C files
|
|
|
|
sed -re 's@[(]int[)]color@(long)color@' -i tcltk/tkmap.c
|
|
|
|
sed -re '/unitp = view_unit[(]uview[)]/aelse *unitp = NULL\;' -i tcltk/tkmap.c
|
|
|
|
sed -re 's@BMAP_BYTE char@BMAP_BYTE unsigned char@' -i kernel/ui.h
|
|
|
|
|
|
|
|
# Fix TCL files
|
|
|
|
sed -re 's@MediumBlue@LightBlue@g' -i tcltk/tkconq.tcl
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for file in $out/bin/*; do
|
|
|
|
wrapProgram $file --prefix TCLLIBPATH ' ' "${tk}/lib"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A programmable turn-based strategy game";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|