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