logisim: create desktop entry (#131450)

This commit is contained in:
Angus Trau 2021-07-26 07:46:34 +10:00 committed by GitHub
parent 2f9cf506dd
commit 351b7d24e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, jre, makeWrapper }:
{ lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }:
stdenv.mkDerivation rec {
pname = "logisim";
@ -11,17 +11,39 @@ stdenv.mkDerivation rec {
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ];
desktopItems = [
(makeDesktopItem {
name = pname;
desktopName = "Logisim";
exec = "logisim";
icon = "logisim";
comment = meta.description;
categories = "Education;";
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
# Create icons
unzip $src "resources/logisim/img/*"
for size in 16 20 24 48 64 128
do
install -D "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png"
done
runHook postInstall
'';
meta = with lib; {
homepage = "http://ozark.hendrix.edu/~burch/logisim";
homepage = "http://www.cburch.com/logisim/";
description = "Educational tool for designing and simulating digital logic circuits";
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ angustrau ];
license = licenses.gpl2Plus;
platforms = platforms.unix;
};