From d5e6d0c0fb7fe765b7727fda23ca6f65e8003cb7 Mon Sep 17 00:00:00 2001 From: Tomas Antonio Lopez Date: Sun, 2 Jun 2024 13:10:11 +0200 Subject: [PATCH] protege: init at 5.6.4 --- .../pr/protege/enforce-plugin-versions.patch | 43 +++++++++ pkgs/by-name/pr/protege/package.nix | 93 +++++++++++++++++++ .../protege/platform-independent-only.patch | 24 +++++ 3 files changed, 160 insertions(+) create mode 100644 pkgs/by-name/pr/protege/enforce-plugin-versions.patch create mode 100644 pkgs/by-name/pr/protege/package.nix create mode 100644 pkgs/by-name/pr/protege/platform-independent-only.patch diff --git a/pkgs/by-name/pr/protege/enforce-plugin-versions.patch b/pkgs/by-name/pr/protege/enforce-plugin-versions.patch new file mode 100644 index 000000000000..1df4594f2c99 --- /dev/null +++ b/pkgs/by-name/pr/protege/enforce-plugin-versions.patch @@ -0,0 +1,43 @@ +diff --git a/pom.xml b/pom.xml +index 839bed04..4cb5f392 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -358,6 +358,30 @@ + 11 + + ++ ++ ++ org.apache.maven.plugins ++ maven-install-plugin ++ 3.1.1 ++ ++ ++ ++ org.apache.maven.plugins ++ maven-site-plugin ++ 3.12.1 ++ ++ ++ ++ org.apache.maven.plugins ++ maven-deploy-plugin ++ 3.1.1 ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ + + + org.apache.maven.plugins +@@ -476,6 +494,7 @@ + + 3.6.3 + ++ + + + diff --git a/pkgs/by-name/pr/protege/package.nix b/pkgs/by-name/pr/protege/package.nix new file mode 100644 index 000000000000..f6d22a08e2f5 --- /dev/null +++ b/pkgs/by-name/pr/protege/package.nix @@ -0,0 +1,93 @@ +{ lib +, fetchFromGitHub +, copyDesktopItems +, iconConvTools +, makeDesktopItem +, makeWrapper +, jdk11 +, maven +}: + +let + mvn = maven.override { jdk = jdk11; }; +in +mvn.buildMavenPackage rec { + pname = "protege"; + version = "5.6.4"; + + src = fetchFromGitHub { + owner = "protegeproject"; + repo = "protege"; + rev = version; + hash = "sha256-Q3MHa7nCeF31n7JPltcemFBc/sJwGA9Ev0ymjQhY/U0="; + }; + + mvnHash = "sha256-kemP2gDv1CYuaoK0fwzBxdLTusarPasf2jCDQj/HPYE="; + + patches = [ + # Pin built-in Maven plugins to avoid checksum variations on Maven updates + ./enforce-plugin-versions.patch + # Avoid building platform-dependent builds which embed their own JREs + ./platform-independent-only.patch + ]; + + nativeBuildInputs = [ + copyDesktopItems + iconConvTools + jdk11 + makeWrapper + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share/protege + + # Copy the application directory whole into the output, as it is used by the + # launcher script as a reference point to look for default configuration + mv protege-desktop/target/protege-${version}-platform-independent/Protege-${version} $out/Protege + + # Place a wrapper for the launcher script into a default /bin location + makeWrapper $out/Protege/run.sh $out/bin/protege \ + --set JAVA_HOME ${jdk11.home} + + # Link all jars from within the standard /share/protege directory + ln -s -t $out/share/protege $out/Protege/bundles/* + + # Generate and copy icons to where they can be found + icoFileToHiColorTheme $out/Protege/app/Protege.ico protege $out + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + name = pname; + desktopName = "Protege Desktop"; + genericName = "Ontology Editor"; + icon = "protege"; + comment = meta.description; + categories = [ "Development" ]; + exec = "protege"; + }) + ]; + + meta = { + homepage = "https://protege.stanford.edu/"; + downloadPage = "https://protege.stanford.edu/software.php#desktop-protege"; + description = "A free and open-source OWL 2 ontology editor"; + longDescription = '' + Protégé Desktop is a feature rich ontology editing environment with full + support for the OWL 2 Web Ontology Language, and direct in-memory + connections to description logic reasoners. + ''; + maintainers = with lib.maintainers; [ nessdoor ]; + license = with lib.licenses; [ bsd2 ]; + # TODO Protege is able to run on Darwin as well, but I (@nessdoor) had no + # way of testing it nor any experience in packaging Darwin apps, so I + # will leave the task to someone who has the right tools and knowledge. + platforms = lib.platforms.unix; + mainProgram = "protege"; + sourceProvenance = with lib.sourceTypes; [ fromSource binaryBytecode ]; + }; +} diff --git a/pkgs/by-name/pr/protege/platform-independent-only.patch b/pkgs/by-name/pr/protege/platform-independent-only.patch new file mode 100644 index 000000000000..d0f489372f2e --- /dev/null +++ b/pkgs/by-name/pr/protege/platform-independent-only.patch @@ -0,0 +1,24 @@ +diff --git a/protege-desktop/pom.xml b/protege-desktop/pom.xml +index 2f599708..60059308 100644 +--- a/protege-desktop/pom.xml ++++ b/protege-desktop/pom.xml +@@ -110,9 +110,6 @@ + + + src/main/assembly/protege-platform-independent.xml +- src/main/assembly/protege-os-x.xml +- src/main/assembly/protege-win.xml +- src/main/assembly/protege-linux.xml + + + +@@ -165,9 +162,6 @@ + + + src/main/assembly/protege-platform-independent.xml +- src/main/assembly/protege-os-x.xml +- src/main/assembly/protege-win.xml +- src/main/assembly/protege-linux.xml + + +