summary refs log tree commit diff
path: root/pkgs/applications/science/logic/logisim/default.nix
blob: 1ca22cf769c68f799dcc1aef6ff21e5ab4f84c92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ lib, stdenv, fetchurl, jre, makeWrapper }:

let version = "2.7.1"; in

stdenv.mkDerivation {
  pname = "logisim";
  inherit version;

  src = fetchurl {
    url = "mirror://sourceforge/project/circuit/2.7.x/${version}/logisim-generic-${version}.jar";
    sha256 = "1hkvc9zc7qmvjbl9579p84hw3n8wl3275246xlzj136i5b0phain";
  };

  phases = [ "installPhase" ];

  nativeBuildInputs = [makeWrapper];

  installPhase = ''
    mkdir -pv $out/bin
    makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
  '';

  meta = {
    homepage = "http://ozark.hendrix.edu/~burch/logisim";
    description = "Educational tool for designing and simulating digital logic circuits";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
  };
}