2024-03-10 14:40:07 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ant
|
|
|
|
, jdk
|
|
|
|
, jre
|
2023-06-28 21:20:11 +02:00
|
|
|
, docbook-xsl-ns
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, imagemagick
|
|
|
|
, libxslt
|
2024-03-10 14:40:07 +01:00
|
|
|
, stripJavaArchivesHook
|
2023-06-28 21:20:11 +02:00
|
|
|
, makeWrapper
|
|
|
|
}:
|
2016-11-20 15:07:33 +01:00
|
|
|
|
2024-03-10 14:40:07 +01:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "gogui";
|
2024-03-10 14:40:07 +01:00
|
|
|
version = "1.5.4a";
|
2023-06-28 21:20:11 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Remi-Coulom";
|
|
|
|
repo = "gogui";
|
2024-03-10 14:40:07 +01:00
|
|
|
rev = "v${finalAttrs.version}";
|
2023-12-15 14:56:47 +01:00
|
|
|
hash = "sha256-UFhOk2mAnTtxfwEOHquN64YDCRq7nNUqZAPQf77MEEw=";
|
2016-11-20 15:07:33 +01:00
|
|
|
};
|
2023-06-28 21:20:11 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
2024-03-10 14:40:07 +01:00
|
|
|
jdk
|
2023-06-28 21:20:11 +02:00
|
|
|
docbook-xsl-ns
|
|
|
|
imagemagick
|
|
|
|
libxslt
|
2024-03-10 14:40:07 +01:00
|
|
|
stripJavaArchivesHook
|
|
|
|
makeWrapper
|
2023-06-28 21:20:11 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
substituteInPlace doc/manual/xml/book.xml \
|
2024-03-10 14:40:07 +01:00
|
|
|
--replace-fail http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
|
2023-06-28 21:20:11 +02:00
|
|
|
${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
|
|
|
|
substituteInPlace doc/manual/xml/manpages.xml \
|
2024-03-10 14:40:07 +01:00
|
|
|
--replace-fail http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
|
2023-06-28 21:20:11 +02:00
|
|
|
${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
|
|
|
|
|
|
|
|
# generate required gui images from svg
|
|
|
|
# see https://github.com/Remi-Coulom/gogui/issues/36
|
|
|
|
sizes=( 16x16 24x24 32x32 48x48 64x64 )
|
|
|
|
for i in src/net/sf/gogui/images/*.svg; do
|
|
|
|
for j in ''${sizes[@]}; do
|
|
|
|
convert $i -resize $j src/net/sf/gogui/images/$(basename $i .svg)-''${j}.png
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in src/net/sf/gogui/images/gogui-{black,white,setup}.svg; do
|
|
|
|
convert $i -resize 8x8 src/net/sf/gogui/images/$(basename $i .svg)-8x8.png
|
|
|
|
done
|
|
|
|
|
|
|
|
ant -Ddocbook-xsl.dir=${docbook-xsl-ns}/xml/xsl/docbook
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2016-11-20 15:07:33 +01:00
|
|
|
installPhase = ''
|
2023-06-28 21:20:11 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
# copy documentation
|
2016-11-20 15:07:33 +01:00
|
|
|
mkdir -p $out/share/doc
|
|
|
|
mv -vi doc $out/share/doc/gogui
|
2023-06-28 21:20:11 +02:00
|
|
|
|
|
|
|
# make man pages available
|
|
|
|
mkdir -p $out/share/man/
|
|
|
|
ln -s $out/share/doc/gogui/manual/man $out/share/man/man1
|
|
|
|
|
|
|
|
# copy programs
|
2024-03-10 14:40:07 +01:00
|
|
|
mv -vi bin lib $out/
|
2023-06-28 21:20:11 +02:00
|
|
|
|
|
|
|
# wrap programs
|
2016-11-20 15:07:33 +01:00
|
|
|
for x in $out/bin/*; do
|
2024-03-10 14:40:07 +01:00
|
|
|
wrapProgram $x \
|
|
|
|
--prefix PATH : ${jre}/bin \
|
|
|
|
--set GOGUI_JAVA_HOME ${jre}
|
2016-11-20 15:07:33 +01:00
|
|
|
done
|
2023-06-28 21:20:11 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-11-20 15:07:33 +01:00
|
|
|
'';
|
2023-06-28 21:20:11 +02:00
|
|
|
|
2016-11-20 15:07:33 +01:00
|
|
|
meta = {
|
|
|
|
description = "A graphical user interface to programs that play the board game Go and support the Go Text Protocol such as GNU Go";
|
2023-06-28 21:20:11 +02:00
|
|
|
homepage = "https://github.com/Remi-Coulom/gogui";
|
2024-03-10 14:40:07 +01:00
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
mainProgram = "gogui";
|
|
|
|
maintainers = with lib.maintainers; [ cleverca22 omnipotententity ];
|
2021-01-15 05:31:39 +01:00
|
|
|
platforms = lib.platforms.unix;
|
2016-11-20 15:07:33 +01:00
|
|
|
};
|
2024-03-10 14:40:07 +01:00
|
|
|
})
|