nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.9 KiB
Nix
Raw Normal View History

2024-03-20 06:25:55 +01:00
{ lib
, stdenv
, fetchurl
, jre
, makeBinaryWrapper
, copyDesktopItems
, makeDesktopItem
, desktopToDarwinBundle
, unzip
}:
2021-07-25 11:39:49 +02:00
2024-03-20 06:25:55 +01: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-07-25 11:39:49 +02:00
pname = "logisim-evolution";
2022-10-03 19:42:45 +02:00
version = "3.8.0";
2021-07-25 11:39:49 +02:00
src = fetchurl {
2024-03-20 06:25:55 +01: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-07-25 11:39:49 +02:00
};
dontUnpack = true;
2024-03-20 06:25:55 +01:00
nativeBuildInputs = [
makeBinaryWrapper
copyDesktopItems
unzip
] ++ lib.optionals stdenv.isDarwin [
desktopToDarwinBundle
];
2021-07-25 11:39:49 +02:00
desktopItems = [
(makeDesktopItem {
2024-03-20 06:25:55 +01:00
name = "logisim-evolution";
2021-07-25 11:39:49 +02:00
desktopName = "Logisim-evolution";
exec = "logisim-evolution";
icon = "logisim-evolution";
2024-03-20 06:25:55 +01:00
comment = finalAttrs.meta.description;
categories = [ "Education" ];
2021-07-25 11:39:49 +02:00
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src"
2024-03-20 06:25:55 +01:00
install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/logisim-evolution.svg
2021-07-25 11:39:49 +02:00
runHook postInstall
'';
2024-03-20 06:25:55 +01:00
meta = {
changelog = "https://github.com/logisim-evolution/logisim-evolution/releases/tag/v${finalAttrs.version}";
2021-07-25 11:39:49 +02:00
homepage = "https://github.com/logisim-evolution/logisim-evolution";
description = "Digital logic designer and simulator";
mainProgram = "logisim-evolution";
2024-03-20 06:25:55 +01:00
maintainers = with lib.maintainers; [ emilytrau ];
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.gpl3Only;
platforms = lib.platforms.unix;
2021-07-25 11:39:49 +02:00
};
2024-03-20 06:25:55 +01:00
})