Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protege: init at 5.6.4 #316647

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions pkgs/by-name/pr/protege/enforce-plugin-versions.patch
Original file line number Diff line number Diff line change
@@ -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 @@
<release>11</release>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>3.1.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.12.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>3.1.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ </plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -476,6 +494,7 @@
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
+ <requirePluginVersions/>
</rules>
</configuration>
</execution>
93 changes: 93 additions & 0 deletions pkgs/by-name/pr/protege/package.nix
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is not supported on Darwin, making the build not even evaluate there (I don't mean to request to fix this issue, just pointing out this fact after seeing ofborg logs for x86_64-darwin).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guessed as much, since the icon format on Darwin is different

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;
doronbehar marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that, I would suggest to set platforms to unix and broken = stdenv.isDarwin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that, I would suggest to set platforms to unix and broken = stdenv.isDarwin.

Further more, we can use platforms.unix, and see what ofborg's CI says. If it will fail on Darwin, we can set meta.broken and even quote in a comment an excerpt from the error we got from there, so Darwin users who will want to unbreak it will have a clue what they have to tackle with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see how ofBorg behaves, but I see no reason for it failing in any obvious way. I think Darwin users would just find themselves with a bogus package that needs to be started directly from the store path, as the corresponding startup script is not getting copied into /bin (if that's where today's Darwin systems expect to find user applications, that is).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see how ofBorg behaves, but I see no reason for it failing in any obvious way. I think Darwin users would just find themselves with a bogus package that needs to be started directly from the store path, as the corresponding startup script is not getting copied into /bin (if that's where today's Darwin systems expect to find user applications, that is).

Yes ideally Darwin users would want to put something in $out/Applications, but it's not so bad for them as a start to have something only in $out/bin.

# 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 ];
};
}
24 changes: 24 additions & 0 deletions pkgs/by-name/pr/protege/platform-independent-only.patch
Original file line number Diff line number Diff line change
@@ -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 @@
</archiverConfig>
<descriptors>
<descriptor>src/main/assembly/protege-platform-independent.xml</descriptor>
- <descriptor>src/main/assembly/protege-os-x.xml</descriptor>
- <descriptor>src/main/assembly/protege-win.xml</descriptor>
- <descriptor>src/main/assembly/protege-linux.xml</descriptor>
</descriptors>
</configuration>
</execution>
@@ -165,9 +162,6 @@
</archiverConfig>
<descriptors>
<descriptor>src/main/assembly/protege-platform-independent.xml</descriptor>
- <descriptor>src/main/assembly/protege-os-x.xml</descriptor>
- <descriptor>src/main/assembly/protege-win.xml</descriptor>
- <descriptor>src/main/assembly/protege-linux.xml</descriptor>
</descriptors>
</configuration>
</execution>