Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

87 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchurl,
cpio,
xorgproto,
libX11,
libXmu,
libXaw,
libXt,
tcl,
tk,
libXext,
fontconfig,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "xconq";
version = "7.5.0-0pre.0.20050612";
src = fetchurl {
url = "mirror://sourceforge/project/xconq/xconq/xconq-${version}/xconq-${version}.tar.gz";
sha256 = "1za78yx57mgwcmmi33wx3533yz1x093dnqis8q2qmqivxav51lca";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
cpio
xorgproto
libX11
libXmu
libXaw
libXt
tcl
tk
libXext
fontconfig
];
configureFlags = [
"--enable-alternate-scoresdir=scores"
"--with-tclconfig=${tcl}/lib"
"--with-tkconfig=${tk}/lib"
];
env.CXXFLAGS = toString [
"-std=c++11"
"-DUSE_INTERP_RESULT"
"-Wno-writable-strings"
];
enableParallelBuilding = true;
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
'';
meta = with lib; {
description = "Programmable turn-based strategy game";
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
license = licenses.gpl2Plus;
};
}