2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, jre
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
|
|
|
, desktopToDarwinBundle
|
|
|
|
, unzip
|
|
|
|
}:
|
2021-08-12 14:41:47 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
icon = fetchurl {
|
|
|
|
url = "https://github.com/logisim-evolution/logisim-evolution/raw/9e0afa3cd6a8bfa75dab61830822cde83c70bb4b/artwork/logisim-evolution-icon.svg";
|
|
|
|
hash = "sha256-DNRimhNFt6jLdjqv7o2cNz38K6XnevxD0rGymym3xBs=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-12 14:41:47 +00:00
|
|
|
pname = "logisim-evolution";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "3.8.0";
|
2021-08-12 14:41:47 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${finalAttrs.version}/logisim-evolution-${finalAttrs.version}-all.jar";
|
|
|
|
hash = "sha256-TFm+fa3CMp0OMhnKBc6cLIWGQbIG/OpOOCG7ea7wbCw=";
|
2021-08-12 14:41:47 +00:00
|
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeBinaryWrapper
|
|
|
|
copyDesktopItems
|
|
|
|
unzip
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
desktopToDarwinBundle
|
|
|
|
];
|
2021-08-12 14:41:47 +00:00
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
2024-04-21 15:54:59 +00:00
|
|
|
name = "logisim-evolution";
|
2021-08-12 14:41:47 +00:00
|
|
|
desktopName = "Logisim-evolution";
|
|
|
|
exec = "logisim-evolution";
|
|
|
|
icon = "logisim-evolution";
|
2024-04-21 15:54:59 +00:00
|
|
|
comment = finalAttrs.meta.description;
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Education" ];
|
2021-08-12 14:41:47 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src"
|
2024-04-21 15:54:59 +00:00
|
|
|
install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/logisim-evolution.svg
|
2021-08-12 14:41:47 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/logisim-evolution/logisim-evolution/releases/tag/v${finalAttrs.version}";
|
2021-08-12 14:41:47 +00:00
|
|
|
homepage = "https://github.com/logisim-evolution/logisim-evolution";
|
|
|
|
description = "Digital logic designer and simulator";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "logisim-evolution";
|
|
|
|
maintainers = with lib.maintainers; [ emilytrau ];
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
platforms = lib.platforms.unix;
|
2021-08-12 14:41:47 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|