nixpkgs/pkgs/by-name/xm/xmage/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

50 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchurl
, jdk8
, unzrip
}:
stdenv.mkDerivation (finalAttrs: {
pname = "xmage";
version = "1.4.51-dev_2024-01-30_19-35";
src = fetchurl {
url = "http://xmage.today/files/mage-full_${finalAttrs.version}.zip";
sha256 = "sha256-ogi0hd2FoulTnc3gg5cpLwr4Jln71YA0WBBZFOT6apg=";
};
preferLocalBuild = true;
unpackPhase = ''
${unzrip}/bin/unzrip $src
'';
installPhase = let
# upstream maintainers forgot to update version, so manual override for now
# strVersion = lib.substring 0 6 finalAttrs.version;
strVersion = "1.4.50";
in ''
mkdir -p $out/bin
cp -rv ./* $out
cat << EOS > $out/bin/xmage
exec ${jdk8}/bin/java -Xms256m -Xmx1024m -XX:MaxPermSize=384m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -jar $out/xmage/mage-client/lib/mage-client-${strVersion}.jar
EOS
chmod +x $out/bin/xmage
'';
meta = with lib; {
description = "Magic Another Game Engine";
mainProgram = "xmage";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.mit;
maintainers = with maintainers; [ matthiasbeyer abueide ];
homepage = "http://xmage.de/";
};
})