2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "logisim";
|
2021-07-21 07:28:18 +00:00
|
|
|
version = "2.7.1";
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "mirror://sourceforge/project/circuit/${lib.versions.majorMinor version}.x/${version}/logisim-generic-${version}.jar";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1hkvc9zc7qmvjbl9579p84hw3n8wl3275246xlzj136i5b0phain";
|
|
|
|
};
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ];
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
desktopName = "Logisim";
|
|
|
|
exec = "logisim";
|
|
|
|
icon = "logisim";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Education;";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-05 21:33:18 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
mkdir -p $out/bin
|
2020-04-24 23:36:52 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
# 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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
meta = with lib; {
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "http://www.cburch.com/logisim/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Educational tool for designing and simulating digital logic circuits";
|
2021-08-05 21:33:18 +00:00
|
|
|
maintainers = with maintainers; [ angustrau ];
|
2021-07-21 07:28:18 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|