summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/import/minetest.scm6
-rw-r--r--tests/minetest.scm10
2 files changed, 15 insertions, 1 deletions
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index e1f8487b75..c8209aba79 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -371,7 +371,11 @@ official Minetest forum and the Git repository (if any)."
 DEPENDENCIES as a list of AUTHOR/NAME strings."
   (define dependency-list
     (assoc-ref dependencies author/name))
-  (filter-map
+  ;; A mod can have multiple dependencies implemented by the same mod,
+  ;; so remove duplicate mod names.
+  (define (filter-deduplicate-map f list)
+    (delete-duplicates (filter-map f list)))
+  (filter-deduplicate-map
    (lambda (dependency)
      (and (not (dependency-optional? dependency))
           (not (builtin-mod? (dependency-name dependency)))
diff --git a/tests/minetest.scm b/tests/minetest.scm
index c6e872e918..80e2697a3d 100644
--- a/tests/minetest.scm
+++ b/tests/minetest.scm
@@ -331,6 +331,16 @@ during a dynamic extent where that package is available on ContentDB."
                                  "some-modpack/containing-mese")))
               #:inputs '())
 
+;; See e.g. 'orwell/basic_trains'
+(test-package* "minetest->guix-package, multiple dependencies implemented by one mod"
+  (list #:name "frobnicate"
+        #:guix-name "minetest-frobnicate"
+        #:upstream-name "Author/frobnicate"
+        #:requirements '(("frob" #f ("Author/frob"))
+                         ("frob_x" #f ("Author/frob")))
+        #:inputs '("minetest-frob"))
+  (list #:author "Author" #:name "frob"))
+
 
 ;; License
 (test-package "minetest->guix-package, identical licenses"