diff mbox series

[bug#64934,10/42] gnu: Add java-httpcomponents-httpclient-cache.

Message ID 43ddbd7a4ce09818f45f69557dcc9556c163b4e0.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:32 p.m. UTC
* gnu/packages/java.scm (java-httpcomponents-httpclient-cache): New variable.
---
 gnu/packages/java.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 7df8e1e2d8..18d56a18c5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -6278,6 +6278,34 @@  (define-public java-httpcomponents-httpclient
 standards and recommendations.")
     (license license:asl2.0)))
 
+(define-public java-httpcomponents-httpclient-cache
+  (package (inherit java-httpcomponents-httpclient)
+    (name "java-httpcomponents-httpclient-cache")
+    (arguments
+     `(#:jar-name "httpcomponents-httpclient-cache.jar"
+       #:source-dir "src/main/java"
+       #:test-dir "src/test"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'delete-unused-impls
+           (lambda _
+             (for-each
+              delete-file-recursively
+              '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
+                "src/main/java/org/apache/http/impl/client/cache/memcached/"
+                "src/test/java/org/apache/http/impl/client/cache/ehcache/"
+                "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
+         (add-after 'unpack 'chdir
+           (lambda _ (chdir "httpclient-cache"))))))
+    (inputs
+     (modify-inputs (package-inputs java-httpcomponents-httpclient)
+                    (prepend java-httpcomponents-httpclient
+                             java-httpcomponents-httpmime
+                             java-hamcrest-core)))
+    (native-inputs (list java-easymock-3.2 java-easymock-class-extension))
+    (description "This package provides an API for caching accessed HTTP
+resources.")))
+
 (define-public java-httpcomponents-httpmime
   (package (inherit java-httpcomponents-httpclient)
     (name "java-httpcomponents-httpmime")