2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper, jre
|
2020-04-24 23:36:52 +00:00
|
|
|
, useCCTweaked ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "unstable-2023-07-08";
|
|
|
|
rev = "989cfe52a0458b991e0a7d87edec81d3fef472ac";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
baseUrl = "https://emux.cc/versions/${lib.substring 0 8 rev}/CCEmuX";
|
2020-04-24 23:36:52 +00:00
|
|
|
jar =
|
|
|
|
if useCCTweaked
|
|
|
|
then fetchurl {
|
|
|
|
url = "${baseUrl}-cct.jar";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-nna5KRp6jVLkbWKOHGtQqaPr3Zl05mVkCf/8X9C5lRY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = "${baseUrl}-cc.jar";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-2Z38O6z7OrHKe8GdLnexin749uJzQaCZglS+SwVD5YE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
desktopIcon = fetchurl {
|
|
|
|
url = "https://github.com/CCEmuX/CCEmuX/raw/${rev}/src/main/resources/img/icon.png";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-gqWURXaOFD/4aZnjmgtKb0T33NbrOdyRTMmLmV42q+4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "CCEmuX";
|
|
|
|
exec = "ccemux";
|
|
|
|
icon = desktopIcon;
|
|
|
|
comment = "A modular ComputerCraft emulator";
|
|
|
|
desktopName = "CCEmuX";
|
|
|
|
genericName = "ComputerCraft Emulator";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Emulator" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ccemux";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = jar;
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A modular ComputerCraft emulator";
|
|
|
|
homepage = "https://github.com/CCEmuX/CCEmuX";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ CrazedProgrammer viluon ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|