nixpkgs/pkgs/games/xconq/default.nix

55 lines
1.7 KiB
Nix
Raw Normal View History

{ 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 {
name = "${baseName}-${version}";
2016-02-07 22:30:22 +00:00
baseName = "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 {
url = "mirror://sourceforge/project/${baseName}/${baseName}/${name}/${name}.tar.gz";
sha256 = "1za78yx57mgwcmmi33wx3533yz1x093dnqis8q2qmqivxav51lca";
};
buildInputs = [ cpio xorgproto libX11 libXmu libXaw libXt tcl tk libXext
2015-07-01 20:06:39 +00:00
fontconfig makeWrapper ];
2015-07-01 20:06:39 +00:00
configureFlags = [
"--enable-alternate-scoresdir=scores"
"--with-tclconfig=${tcl}/lib"
"--with-tkconfig=${tk}/lib"
];
hardeningDisable = [ "format" ];
2016-02-07 22:30:22 +00:00
2015-07-01 20:06:39 +00:00
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 '{}' ';'
2017-06-17 09:46:48 +00:00
# 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
2015-07-01 20:06:39 +00:00
# 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
2017-08-29 18:31:45 +00:00
sed -re 's@BMAP_BYTE char@BMAP_BYTE unsigned char@' -i kernel/ui.h
2015-07-01 20:06:39 +00:00
# Fix TCL files
sed -re 's@MediumBlue@LightBlue@g' -i tcltk/tkconq.tcl
2015-07-01 20:06:39 +00:00
'';
2015-07-01 20:06:39 +00:00
postInstall = ''
for file in $out/bin/*; do
wrapProgram $file --prefix TCLLIBPATH ' ' "${tk}/lib"
done
'';
meta = with lib; {
description = "A programmable turn-based strategy game";
2015-07-01 20:06:39 +00:00
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
license = licenses.gpl2;
};
2015-07-01 20:06:39 +00:00
}