base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / jf / jflap / package.nix
blob0559f89227878ad1068d543d8e881566a5189fde
1 { lib
2 , stdenvNoCC
3 , fetchurl
4 , jre8
5 , makeWrapper
6 , makeDesktopItem
7 , copyDesktopItems
8 }:
10 stdenvNoCC.mkDerivation rec {
11   pname = "jflap";
12   version = "7.1";
14   src = fetchurl {
15     url = "https://www.jflap.org/jflaptmp/july27-18/JFLAP${version}.jar";
16     sha256 = "oiwJXdxWsYFj6Ovu7xZbOgTLVw8160a5YQUWbgbJlAY=";
17   };
19   nativeBuildInputs = [
20     makeWrapper
21     copyDesktopItems
22   ];
24   buildInputs = [
25     jre8
26   ];
28   dontUnpack = true;
30   desktopItems = [
31     (makeDesktopItem {
32       name = "jflap";
33       desktopName = "jflap";
34       genericName = "Formal language application";
35       exec = "jflap";
36       icon = fetchurl {
37         url = "https://www.jflap.org/jflapLogo2.jpg";
38         sha256 = "sha256-IiworHI+GT6Fm6B0E+FXnKe+hN8nZYPrxHGZFAcsWDw=";
39       };
40       comment = meta.description;
41       categories = [
42         "Development"
43         "Education"
44         "ComputerScience"
45         "DataVisualization"
46         "Engineering"
47         "Java"
48       ];
49     })
50   ];
52   installPhase = ''
53     runHook preInstall
54     mkdir -p $out/share/java
55     cp -s $src $out/share/java/jflap.jar
56     makeWrapper ${jre8}/bin/java $out/bin/jflap \
57       --prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on" \
58       --add-flags "-jar $out/share/java/jflap.jar"
59     runHook postInstall
60   '';
62   meta = with lib; {
63     description = "GUI tool for experimenting with formal languages topics";
64     homepage = "https://www.jflap.org/";
65     license = licenses.unfree;
66     sourceProvenance = with sourceTypes; [ binaryBytecode ];
67     maintainers = with maintainers; [ grnnja yuu ];
68     platforms = jre8.meta.platforms;
69   };