2021-01-15 05:31:39 +01:00
|
|
|
{ lib, stdenv
|
2020-11-21 15:57:21 +01:00
|
|
|
, fetchsvn
|
|
|
|
# jdk8 is needed for building, but the game runs on newer jres as well
|
|
|
|
, jdk8
|
|
|
|
, jre
|
|
|
|
, ant
|
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
2022-05-20 11:51:34 +02:00
|
|
|
, copyDesktopItems
|
2021-11-13 23:00:20 +01:00
|
|
|
, nixosTests
|
2020-11-21 15:57:21 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
2022-02-28 18:10:56 +01:00
|
|
|
name = "domination";
|
2020-11-21 15:57:21 +01:00
|
|
|
desktopName = "Domination";
|
|
|
|
exec = "domination";
|
|
|
|
icon = "domination";
|
|
|
|
};
|
|
|
|
editorDesktopItem = makeDesktopItem {
|
2022-02-28 18:10:56 +01:00
|
|
|
name = "domination-map-editor";
|
2020-11-21 15:57:21 +01:00
|
|
|
desktopName = "Domination Map Editor";
|
|
|
|
exec = "domination-map-editor";
|
|
|
|
icon = "domination";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "domination";
|
2021-11-13 17:49:46 +01:00
|
|
|
version = "1.2.4";
|
2020-11-21 15:57:21 +01:00
|
|
|
|
|
|
|
# The .zip releases do not contain the build.xml file
|
|
|
|
src = fetchsvn {
|
|
|
|
url = "https://svn.code.sf.net/p/domination/code/Domination";
|
|
|
|
# There are no tags in the repository.
|
|
|
|
# Look for commits like "new version x.y.z info on website"
|
|
|
|
# or "website update for x.y.z".
|
2021-11-13 17:49:46 +01:00
|
|
|
rev = "2109";
|
|
|
|
sha256 = "sha256-awTaEkv0zUXgrKVKuFzi5sgHgrfiNmAFMODO5U0DL6I=";
|
2020-11-21 15:57:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
jdk8
|
|
|
|
ant
|
|
|
|
makeWrapper
|
2022-05-20 11:51:34 +02:00
|
|
|
copyDesktopItems
|
2020-11-21 15:57:21 +01:00
|
|
|
];
|
|
|
|
|
2021-11-13 17:49:46 +01:00
|
|
|
buildPhase = ''
|
2022-05-20 11:51:34 +02:00
|
|
|
runHook preBuild
|
2021-11-13 17:49:46 +01:00
|
|
|
cd swingUI
|
|
|
|
ant
|
2022-05-20 11:51:34 +02:00
|
|
|
runHook postBuild
|
2021-11-13 17:49:46 +01:00
|
|
|
'';
|
2020-11-21 15:57:21 +01:00
|
|
|
|
2022-05-20 11:51:34 +02:00
|
|
|
desktopItems = [
|
|
|
|
desktopItem
|
|
|
|
editorDesktopItem
|
|
|
|
];
|
|
|
|
|
2020-11-21 15:57:21 +01:00
|
|
|
installPhase = ''
|
2022-05-20 11:51:34 +02:00
|
|
|
runHook preInstall
|
2020-11-21 15:57:21 +01:00
|
|
|
# Remove unnecessary files and launchers (they'd need to be wrapped anyway)
|
|
|
|
rm -r \
|
|
|
|
build/game/src.zip \
|
|
|
|
build/game/*.sh \
|
|
|
|
build/game/*.cmd \
|
|
|
|
build/game/*.exe \
|
|
|
|
build/game/*.app
|
|
|
|
|
|
|
|
mkdir -p $out/share/domination
|
|
|
|
cp -r build/game/* $out/share/domination/
|
|
|
|
|
|
|
|
# Reimplement the two launchers mentioned in Unix_shortcutSpec.xml with makeWrapper
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/domination \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out/share/domination" \
|
2020-11-21 15:57:21 +01:00
|
|
|
--add-flags "-jar $out/share/domination/Domination.jar"
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/domination-map-editor \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out/share/domination" \
|
2020-11-21 15:57:21 +01:00
|
|
|
--add-flags "-cp $out/share/domination/Domination.jar net.yura.domination.ui.swinggui.SwingGUIFrame"
|
|
|
|
|
|
|
|
install -Dm644 build/game/resources/icon.png $out/share/pixmaps/domination.png
|
2022-05-20 11:51:34 +02:00
|
|
|
runHook postInstall
|
2020-11-21 15:57:21 +01:00
|
|
|
'';
|
|
|
|
|
2021-11-13 23:00:20 +01:00
|
|
|
passthru.tests = {
|
|
|
|
domination-starts = nixosTests.domination;
|
|
|
|
};
|
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
meta = with lib; {
|
2020-11-21 15:57:21 +01:00
|
|
|
homepage = "http://domination.sourceforge.net/";
|
|
|
|
downloadPage = "http://domination.sourceforge.net/download.shtml";
|
|
|
|
description = "A game that is a bit like the board game Risk or RisiKo";
|
|
|
|
longDescription = ''
|
|
|
|
Domination is a game that is a bit like the well known board game of Risk
|
|
|
|
or RisiKo. It has many game options and includes many maps.
|
|
|
|
It includes a map editor, a simple map format, multiplayer network play,
|
|
|
|
single player, hotseat, 5 user interfaces and many more features.
|
|
|
|
'';
|
2022-06-02 15:38:41 +02:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # source bundles dependencies as jars
|
|
|
|
];
|
2020-11-21 15:57:21 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|