summary refs log tree commit diff
path: root/pkgs/development/web/protege-distribution
diff options
context:
space:
mode:
authorTomas Antonio Lopez <entropy.overseer@entropic.network>2021-06-19 03:46:50 +0900
committerTomas Antonio Lopez <entropy.overseer@entropic.network>2021-06-19 04:03:18 +0900
commit39a4c607827c1aa41794035226cae4fa2d1e8277 (patch)
treec4bde15c8a916b7e63652615e1d9108867676d74 /pkgs/development/web/protege-distribution
parent228baac5a4409f498d55a897ffffc3c2f1f8839f (diff)
downloadnixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar.gz
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar.bz2
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar.lz
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar.xz
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.tar.zst
nixpkgs-39a4c607827c1aa41794035226cae4fa2d1e8277.zip
protege-distribution: init at 5.5.0
Protege Desktop distribution package with third-party plugins.
Diffstat (limited to 'pkgs/development/web/protege-distribution')
-rw-r--r--pkgs/development/web/protege-distribution/default.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/pkgs/development/web/protege-distribution/default.nix b/pkgs/development/web/protege-distribution/default.nix
new file mode 100644
index 00000000000..49d28cb17ee
--- /dev/null
+++ b/pkgs/development/web/protege-distribution/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv, fetchurl, unzip, jre8, copyDesktopItems, makeDesktopItem }:
+
+stdenv.mkDerivation rec {
+  pname = "protege-distribution";
+  version = "5.5.0";
+
+  src = fetchurl {
+    url = "https://github.com/protegeproject/protege-distribution/releases/download/v${version}/Protege-${version}-platform-independent.zip";
+    sha256 = "092x22wyisdnhccx817mqq15sxqdfc7iz4whr4mbvzrd9di6ipjq";
+  };
+
+  nativeBuildInputs = [ unzip copyDesktopItems ];
+
+  postPatch = ''
+    # Delete all those commands meant to change directory to the source directory
+    sed -i -e '3,9d' run.sh
+
+    # Change directory to where the application is stored to avoid heavy patching
+    # of searchpaths
+    sed -i -e "2a\
+    cd $out/protege" run.sh
+
+    # Set the correct Java executable (Protege is a JRE 8 application)
+    substituteInPlace run.sh \
+      --replace "java -X" "exec ${jre8.outPath}/bin/java -X" \
+
+    # Silence console logs, since these are not shown in graphical environments
+    sed -i -e '4,8d;21d' conf/logback.xml
+  '';
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+
+    # Delete non-Linux launch scripts
+    rm run.{bat,command}
+
+    # Move launch script into /bin, giving it a recognizable name
+    install -D run.sh $out/bin/run-protege
+
+    # Copy icon to where it can be found
+    install -D app/Protege.ico $out/share/icons/hicolor/128x128/apps/protege.ico
+
+    # Move everything else under protege/
+    mkdir $out/protege
+    mv {bin,bundles,conf,plugins} $out/protege
+
+    runHook postInstall
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "Protege";
+      desktopName = "Protege Desktop";
+      icon = "protege.ico";
+      comment = "OWL2 ontology editor";
+      exec = "run-protege";
+    })
+  ];
+
+  meta = with lib; {
+    description = "The OWL2 ontology editor from Stanford, with third-party plugins included";
+    homepage = "https://protege.stanford.edu/";
+    downloadPage = "https://protege.stanford.edu/products.php#desktop-protege";
+    maintainers = with maintainers; [ nessdoor ];
+    license = with licenses; [ asl20 bsd2 epl10 lgpl3 ];
+    platforms = platforms.linux;
+  };
+}