diff mbox series

[bug#39579,2/3] gnu: osinfo-db: Add osinfo-db.

Message ID 20200212163711.17468-2-brice@waegenei.re
State Accepted
Headers show
Series Include operating systems list in virt-manager. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Brice Waegeneire Feb. 12, 2020, 4:37 p.m. UTC
* gnu/packages/virtualization.scm (osinfo-db): New variable.
---
 gnu/packages/virtualization.scm | 37 +++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Comments

Maja Kądziołka Feb. 16, 2020, 7:13 p.m. UTC | #1
On Wed, Feb 12, 2020 at 05:37:10PM +0100, Brice Waegeneire wrote:
> +(define-public osinfo-db
> +  (package
> +    (name "osinfo-db")
> +    (version "20200203")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
> +                                  version ".tar.xz"))
> +              (sha256
> +               (base32
> +                "1zjq1dhlci00j17dij7s3l30hybzmaykpk5b6bd5xbllp745njn5"))))
> +    (build-system trivial-build-system)
> +    (arguments
> +     `(#:modules ((guix build utils))
> +       #:builder
> +       (begin
> +         (use-modules (guix build utils))
> +         (let* ((out (assoc-ref %outputs "out"))
> +                (osinfo-dir (string-append out "/share/osinfo"))
> +                (source (assoc-ref %build-inputs "source")))
> +           (set-path-environment-variable
> +            "PATH" '("bin")
> +            (list (assoc-ref %build-inputs "osinfo-db-tools")))
> +           (mkdir-p osinfo-dir)
> +           (invoke "osinfo-db-import" "--dir" osinfo-dir source)
Wouldn't it be simpler to invoke osinfo-db-import with a full path to
the binary instead of adding to $PATH?

> +           #t))))
> +    (native-inputs
> +     `(("intltool" ,intltool)
> +       ("osinfo-db-tools" ,osinfo-db-tools)))
> +    (home-page "https://gitlab.com/libosinfo/osinfo-db")
> +    (synopsis "Database of information about operating systems")
> +    (description "Osinfo-db provides the database files for use with the
> +libosinfo library. It provides information about guest operating systems for
                    ^^
Use two spaces after a sentence. (please run guix lint on your packages)

> +use with virtualization provisioning tools")
> +    (license license:lgpl2.0+)))
diff mbox series

Patch

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 57d433599a..3769ece889 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -92,6 +92,7 @@ 
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -1422,3 +1423,39 @@  which is a hypervisor.")
     (description "This package contains a set of tools to assist administrators and
 developers in managing the database.")
     (license license:lgpl2.0+)))
+
+(define-public osinfo-db
+  (package
+    (name "osinfo-db")
+    (version "20200203")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1zjq1dhlci00j17dij7s3l30hybzmaykpk5b6bd5xbllp745njn5"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let* ((out (assoc-ref %outputs "out"))
+                (osinfo-dir (string-append out "/share/osinfo"))
+                (source (assoc-ref %build-inputs "source")))
+           (set-path-environment-variable
+            "PATH" '("bin")
+            (list (assoc-ref %build-inputs "osinfo-db-tools")))
+           (mkdir-p osinfo-dir)
+           (invoke "osinfo-db-import" "--dir" osinfo-dir source)
+           #t))))
+    (native-inputs
+     `(("intltool" ,intltool)
+       ("osinfo-db-tools" ,osinfo-db-tools)))
+    (home-page "https://gitlab.com/libosinfo/osinfo-db")
+    (synopsis "Database of information about operating systems")
+    (description "Osinfo-db provides the database files for use with the
+libosinfo library. It provides information about guest operating systems for
+use with virtualization provisioning tools")
+    (license license:lgpl2.0+)))