diff mbox series

[bug#64934,04/42] gnu: Add java-eclipse-rdf4j-model-api.

Message ID c1e24920bffcc22f07fe1b25d4b450134c0c4aa3.1690646441.git.liliana.prikler@gmail.com
State New
Headers show
Series I tried to semantic the web, and after downloading half the Internet, these are some packages I came up with | expand

Commit Message

Liliana Marie Prikler July 29, 2023, 2:10 p.m. UTC
Since RDF4J is a large framework with many parts, this patch also prepares
some boilerplate code for the other packages.

* gnu/packages/java-rdf.scm (%rdf4j-version, %rdf4j-sha256, %rdf4j-source)
(rdf4j-common-arguments): New variables.
(java-eclipse-rdf4j-model-api): New variable.
---
 gnu/packages/java-rdf.scm | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

Comments

Björn Höfling July 30, 2023, 5:26 p.m. UTC | #1
Hi Liliana,


On Sat, 29 Jul 2023 16:10:06 +0200
Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

> * gnu/packages/java-rdf.scm (%rdf4j-version, %rdf4j-sha256,

[..]
> +(define %rdf4j-version "3.7.7")


is there a reason you chose this version instead of the newest 4.3.4
version?

OK, I see: Because commons-rdf4j is 5 years old and depends on exactly
that version.

Just courious here, I don't want to add too much work for you here, but
have you tried to also add or build the 4.3.4 version?

Björn
diff mbox series

Patch

diff --git a/gnu/packages/java-rdf.scm b/gnu/packages/java-rdf.scm
index 066b383c5a..bf83c9ab5e 100644
--- a/gnu/packages/java-rdf.scm
+++ b/gnu/packages/java-rdf.scm
@@ -99,3 +99,47 @@  (define-public java-commons-rdf-simple
     (synopsis "Simple implementation of RDF 1.1 concepts")
     (description "This package provides a simple implementation of RDF 1.1
 concepts in Java.")))
+
+(define %rdf4j-version "3.7.7")
+(define %rdf4j-sha256
+  (base32 "1lala4wjl5lbg45jdgd94rfkvdg6r4vq23k3q54bkk9q3w9v2bdx"))
+(define %rdf4j-source
+  (origin
+   (method git-fetch)
+   (uri (git-reference
+         (url "https://github.com/eclipse/rdf4j")
+         (commit %rdf4j-version)))
+   (file-name (git-file-name "rdf4j" %rdf4j-version))
+   (sha256 %rdf4j-sha256)
+   (modules '((guix build utils)))
+   (snippet #~(begin (delete-file-recursively "site")))))
+
+(define (rdf4j-common-arguments jar-name directory)
+  (list #:source-dir "src/main/java"
+        #:test-dir "src/test/java"
+        #:tests? #f                     ; tests require junit 5
+        #:jar-name jar-name
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'chdir (lambda _ (chdir #$directory)))
+            (add-after 'chdir 'fix-pom
+              (lambda _
+                (substitute* "pom.xml"
+                  (("\\$\\{project\\.groupId\\}") "org.eclipse.rdf4j"))))
+            (replace 'install
+              (install-from-pom "pom.xml")))))
+
+(define-public java-eclipse-rdf4j-model-api
+  (package
+    (name "java-eclipse-rdf4j-model-api")
+    (version %rdf4j-version)
+    (source %rdf4j-source)
+    (build-system ant-build-system)
+    (arguments
+     (rdf4j-common-arguments "rdf4j-model-api.jar"
+                             "core/model-api"))
+    (home-page "https://rdf4j.org/")
+    (synopsis "RDF4J model interfaces")
+    (description "This package provides interfaces for the RDF data model used
+in the RDF4J framework.")
+    (license license:epl1.0)))