3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/misc/emulators/ccemux/default.nix

68 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper, jre
2018-08-07 20:45:01 +01:00
, useCCTweaked ? true
}:
let
2019-03-20 20:31:37 +00:00
version = "1.1.1";
rev = "af12e2e4da586275ba931eae8f40a2201251bf59";
2018-08-07 20:45:01 +01:00
2021-01-15 13:21:58 +00:00
baseUrl = "https://emux.cc/versions/${lib.substring 0 8 rev}/CCEmuX";
2018-08-07 20:45:01 +01:00
jar =
if useCCTweaked
then fetchurl {
url = "${baseUrl}-cct.jar";
2019-03-20 20:31:37 +00:00
sha256 = "0d9gzi1h5vz32fp4lfn7dam189jcm7bwbqwmlpj0c47p8l0d4lsv";
2018-08-07 20:45:01 +01:00
}
else fetchurl {
url = "${baseUrl}-cc.jar";
2019-03-20 20:31:37 +00:00
sha256 = "0ky5vxh8m1v98zllifxif8xxd25j2xdp19hjnj4xlkck71lbnb34";
2018-08-07 20:45:01 +01:00
};
desktopIcon = fetchurl {
url = "https://github.com/CCEmuX/CCEmuX/raw/${rev}/src/main/resources/img/icon.png";
sha256 = "1vmb6rg9k2y99j8xqfgbsvfgfi3g985rmqwrd7w3y54ffr2r99c2";
};
desktopItem = makeDesktopItem {
name = "CCEmuX";
exec = "ccemux";
2019-09-09 00:38:31 +01:00
icon = desktopIcon;
2018-08-07 20:45:01 +01:00
comment = "A modular ComputerCraft emulator";
desktopName = "CCEmuX";
genericName = "ComputerCraft Emulator";
categories = "Emulator;";
2018-08-07 20:45:01 +01:00
};
in
stdenv.mkDerivation rec {
2019-08-13 22:52:01 +01:00
pname = "ccemux";
inherit version;
2018-08-07 20:45:01 +01:00
src = jar;
2019-06-19 16:45:34 +01:00
dontUnpack = true;
2018-08-07 20:45:01 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/ccemux}
cp -r ${desktopItem}/share/applications $out/share/applications
install -D ${src} $out/share/ccemux/ccemux.jar
install -D ${desktopIcon} $out/share/pixmaps/ccemux.png
makeWrapper ${jre}/bin/java $out/bin/ccemux \
--add-flags "-jar $out/share/ccemux/ccemux.jar"
runHook postInstall
'';
meta = with lib; {
2018-08-07 20:45:01 +01:00
description = "A modular ComputerCraft emulator";
homepage = "https://github.com/CCEmuX/CCEmuX";
2018-08-07 20:45:01 +01:00
license = licenses.mit;
maintainers = with maintainers; [ CrazedProgrammer ];
};
}