unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager.
@ 2020-02-12 16:30 Brice Waegeneire
  2020-02-12 16:37 ` [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-12 16:30 UTC (permalink / raw)
  To: 39579

When creating a new virtual machine in virt-manager, the OS list was empty and
we were forced to use the non-descriptive "Generic default" OS. This patch
serie fixes it.

Brice Waegeneire (3):
  gnu: osinfo-db-tools: Add osinfo-db-tools.
  gnu: osinfo-db: Add osinfo-db.
  gnu: virt-manager: Include operating systems list.

 gnu/packages/virtualization.scm | 91 ++++++++++++++++++++++++++++++++-
 1 file changed, 89 insertions(+), 2 deletions(-)

-- 
2.25.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
@ 2020-02-12 16:37 ` Brice Waegeneire
  2020-02-16 19:10   ` Jakub Kądziołka
  2020-02-12 16:37 ` [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-12 16:37 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (osinfo-db-tools): New variable.
---
 gnu/packages/virtualization.scm | 40 +++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 3670b396a5..57d433599a 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
@@ -1382,3 +1384,41 @@ which is a hypervisor.")
     ;; TODO: Some files are licensed differently.  List those.
     (license license:gpl2)
     (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
+
+(define-public osinfo-db-tools
+  (package
+    (name "osinfo-db-tools")
+    (version "1.7.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
+                                  version ".tar.xz"))
+
+              (sha256
+               (base32
+                "08x8mrafphyll0d35xdc143rip3ahrz6bmzhc85nwhq7yk2vxpab"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--prefix=" (assoc-ref %outputs "out")))))
+    (inputs
+     `(("libsoup" ,libsoup)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)
+       ("json-glib" ,json-glib)
+       ("libarchive" ,libarchive)
+       ("gobject-introspection" ,gobject-introspection)))
+    (native-inputs
+     `(("perl" ,perl)
+       ("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ;; Tests
+       ("python" ,python)
+       ("pytest" ,python-pytest)
+       ("requests" ,python-requests)
+       ))
+    (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
+    (synopsis "Tools for managing the osinfo database")
+    (description "This package contains a set of tools to assist administrators and
+developers in managing the database.")
+    (license license:lgpl2.0+)))
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
  2020-02-12 16:37 ` [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
@ 2020-02-12 16:37 ` Brice Waegeneire
  2020-02-16 19:13   ` Jakub Kądziołka
  2020-02-12 16:37 ` [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list Brice Waegeneire
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-12 16:37 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (osinfo-db): New variable.
---
 gnu/packages/virtualization.scm | 37 +++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

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+)))
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
  2020-02-12 16:37 ` [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
  2020-02-12 16:37 ` [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
@ 2020-02-12 16:37 ` Brice Waegeneire
  2020-02-16 19:27   ` Jakub Kądziołka
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-12 16:37 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (virt-manager)[inputs]: Add osinfo-db.
[arguments]: Add phase patch.
---
 gnu/packages/virtualization.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 3769ece889..222d59d8bc 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -328,12 +328,22 @@ server and embedded PowerPC, and S390 guests.")
        (list (string-append "-Dwith-usb-ids-path="
                             (assoc-ref %build-inputs "usb.ids"))
              (string-append "-Dwith-pci-ids-path="
-                            (assoc-ref %build-inputs "pci.ids")))))
+                            (assoc-ref %build-inputs "pci.ids")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "osinfo/osinfo_loader.c"
+               (("path = DATA_DIR.*")
+                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
+                               "/share/osinfo\";")))
+             #t)))))
     (inputs
      `(("libsoup" ,libsoup)
        ("libxml2" ,libxml2)
        ("libxslt" ,libxslt)
-       ("gobject-introspection" ,gobject-introspection)))
+       ("gobject-introspection" ,gobject-introspection)
+       ("osinfo-db" ,osinfo-db)))
     (native-inputs
      `(("glib" ,glib "bin")  ; glib-mkenums, etc.
        ("gtk-doc" ,gtk-doc)
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools.
  2020-02-12 16:37 ` [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
@ 2020-02-16 19:10   ` Jakub Kądziołka
  2020-02-16 19:56     ` Jakub Kądziołka
  0 siblings, 1 reply; 13+ messages in thread
From: Jakub Kądziołka @ 2020-02-16 19:10 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 39579

[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]

On Wed, Feb 12, 2020 at 05:37:09PM +0100, Brice Waegeneire wrote:
> +(define-public osinfo-db-tools
> +  (package
> +    (name "osinfo-db-tools")
> +    (version "1.7.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
> +                                  version ".tar.xz"))
> +
> +              (sha256
> +               (base32
> +                "08x8mrafphyll0d35xdc143rip3ahrz6bmzhc85nwhq7yk2vxpab"))))
> +    (build-system meson-build-system)
> +    (arguments
> +     `(#:configure-flags
> +       (list (string-append "--prefix=" (assoc-ref %outputs "out")))))
If I'm reading the source correctly, this argument isn't even used by
meson-build-system. Why is this necessary?

> +    (inputs
> +     `(("libsoup" ,libsoup)
> +       ("libxml2" ,libxml2)
> +       ("libxslt" ,libxslt)
> +       ("json-glib" ,json-glib)
> +       ("libarchive" ,libarchive)
> +       ("gobject-introspection" ,gobject-introspection)))
guix lint suggests that g-i should be a native-input

> +    (native-inputs
> +     `(("perl" ,perl)
> +       ("gettext" ,gettext-minimal)
> +       ("pkg-config" ,pkg-config)
> +       ;; Tests
> +       ("python" ,python)
> +       ("pytest" ,python-pytest)
> +       ("requests" ,python-requests)
> +       ))
You cruel madman, these parenthesis must be feeling quite lonely ;)

> +    (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
> +    (synopsis "Tools for managing the osinfo database")
> +    (description "This package contains a set of tools to assist administrators and
> +developers in managing the database.")
Please break lines at 80 characters when not inconvenient.

> +    (license license:lgpl2.0+)))
> -- 
> 2.25.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db.
  2020-02-12 16:37 ` [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
@ 2020-02-16 19:13   ` Jakub Kądziołka
  0 siblings, 0 replies; 13+ messages in thread
From: Jakub Kądziołka @ 2020-02-16 19:13 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 39579

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

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+)))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list.
  2020-02-12 16:37 ` [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list Brice Waegeneire
@ 2020-02-16 19:27   ` Jakub Kądziołka
  0 siblings, 0 replies; 13+ messages in thread
From: Jakub Kądziołka @ 2020-02-16 19:27 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 39579

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

On Wed, Feb 12, 2020 at 05:37:11PM +0100, Brice Waegeneire wrote:
> * gnu/packages/virtualization.scm (virt-manager)[inputs]: Add osinfo-db.
> [arguments]: Add phase patch.
> ---
>  gnu/packages/virtualization.scm | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
> index 3769ece889..222d59d8bc 100644
> --- a/gnu/packages/virtualization.scm
> +++ b/gnu/packages/virtualization.scm
> @@ -328,12 +328,22 @@ server and embedded PowerPC, and S390 guests.")
>         (list (string-append "-Dwith-usb-ids-path="
>                              (assoc-ref %build-inputs "usb.ids"))
>               (string-append "-Dwith-pci-ids-path="
> -                            (assoc-ref %build-inputs "pci.ids")))))
> +                            (assoc-ref %build-inputs "pci.ids")))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (substitute* "osinfo/osinfo_loader.c"
> +               (("path = DATA_DIR.*")
> +                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
> +                               "/share/osinfo\";")))
> +             #t)))))
'patch is somewhat non-descriptive, how about 'patch-osinfo-path ?

>      (inputs
>       `(("libsoup" ,libsoup)
>         ("libxml2" ,libxml2)
>         ("libxslt" ,libxslt)
> -       ("gobject-introspection" ,gobject-introspection)))
> +       ("gobject-introspection" ,gobject-introspection)
> +       ("osinfo-db" ,osinfo-db)))
>      (native-inputs
>       `(("glib" ,glib "bin")  ; glib-mkenums, etc.
>         ("gtk-doc" ,gtk-doc)
> -- 
> 2.25.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools.
  2020-02-16 19:10   ` Jakub Kądziołka
@ 2020-02-16 19:56     ` Jakub Kądziołka
  0 siblings, 0 replies; 13+ messages in thread
From: Jakub Kądziołka @ 2020-02-16 19:56 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 39579

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

On Sun, Feb 16, 2020 at 08:10:18PM +0100, Jakub Kądziołka wrote:
> On Wed, Feb 12, 2020 at 05:37:09PM +0100, Brice Waegeneire wrote:
> > +(define-public osinfo-db-tools
> > +  (package
> > +    (name "osinfo-db-tools")
> > +    (version "1.7.0")
> > +    (source (origin
> > +              (method url-fetch)
> > +              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
> > +                                  version ".tar.xz"))
> > +
> > +              (sha256
> > +               (base32
> > +                "08x8mrafphyll0d35xdc143rip3ahrz6bmzhc85nwhq7yk2vxpab"))))
> > +    (build-system meson-build-system)
> > +    (arguments
> > +     `(#:configure-flags
> > +       (list (string-append "--prefix=" (assoc-ref %outputs "out")))))
> If I'm reading the source correctly, this argument isn't even used by
> meson-build-system. Why is this necessary?
Okay, I wasn't reading the source correctly, Vim's
search-at-word-boundaries hid the point where the variable is being
used. Still, the prefix option is already being set by
meson-build-system itself. I'm confused as to what this argument
is supposed to do.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH v2 0/3] Include operating systems list in virt-manager.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (2 preceding siblings ...)
  2020-02-12 16:37 ` [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list Brice Waegeneire
@ 2020-02-16 20:47 ` Brice Waegeneire
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-16 20:47 UTC (permalink / raw)
  To: 39579

The useless configure-flag of osinfo-db-tools has been removed and the
package definition has been linted. osinfo-db has been linted and it's
build call osinfo-db-import by it's absolute path. The commit message
refering to virt-manager has been by the correct libosinfo, the libosinfo
patch phase has been renamed and gobject-introspection has been moved to
native-inputs as suggested by guix lint.

Brice Waegeneire (3):
  gnu: osinfo-db-tools: Add osinfo-db-tools.
  gnu: osinfo-db: Add osinfo-db.
  gnu: libosinfo: Include operating systems list.

 gnu/packages/virtualization.scm | 87 ++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 2 deletions(-)

-- 
2.25.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH v2 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (3 preceding siblings ...)
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 0/3] Include operating systems list in virt-manager Brice Waegeneire
@ 2020-02-16 20:47 ` Brice Waegeneire
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-16 20:47 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (osinfo-db-tools): New variable.
---
 gnu/packages/virtualization.scm | 36 +++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 3670b396a5..ca8f143f51 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
@@ -1382,3 +1384,37 @@ which is a hypervisor.")
     ;; TODO: Some files are licensed differently.  List those.
     (license license:gpl2)
     (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
+
+(define-public osinfo-db-tools
+  (package
+    (name "osinfo-db-tools")
+    (version "1.7.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
+                                  version ".tar.xz"))
+
+              (sha256
+               (base32
+                "08x8mrafphyll0d35xdc143rip3ahrz6bmzhc85nwhq7yk2vxpab"))))
+    (build-system meson-build-system)
+    (inputs
+     `(("libsoup" ,libsoup)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)
+       ("json-glib" ,json-glib)
+       ("libarchive" ,libarchive)))
+    (native-inputs
+     `(("perl" ,perl)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ;; Tests
+       ("python" ,python)
+       ("pytest" ,python-pytest)
+       ("requests" ,python-requests)))
+    (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
+    (synopsis "Tools for managing the osinfo database")
+    (description "This package contains a set of tools to assist
+administrators and developers in managing the database.")
+    (license license:lgpl2.0+)))
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH v2 2/3] gnu: osinfo-db: Add osinfo-db.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (4 preceding siblings ...)
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
@ 2020-02-16 20:47 ` Brice Waegeneire
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 3/3] gnu: libosinfo: Include operating systems list Brice Waegeneire
  2020-02-19 22:06 ` bug#39579: Done: Include operating systems list in virt-manager Jakub Kądziołka
  7 siblings, 0 replies; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-16 20:47 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (osinfo-db): New variable.
---
 gnu/packages/virtualization.scm | 37 +++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index ca8f143f51..308cadbe14 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:)
@@ -1418,3 +1419,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"))
+                (osinfo-db-import
+                 (string-append (assoc-ref %build-inputs "osinfo-db-tools")
+                                "/bin/osinfo-db-import")))
+           (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+)))
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#39579] [PATCH v2 3/3] gnu: libosinfo: Include operating systems list.
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (5 preceding siblings ...)
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
@ 2020-02-16 20:47 ` Brice Waegeneire
  2020-02-19 22:06 ` bug#39579: Done: Include operating systems list in virt-manager Jakub Kądziołka
  7 siblings, 0 replies; 13+ messages in thread
From: Brice Waegeneire @ 2020-02-16 20:47 UTC (permalink / raw)
  To: 39579

* gnu/packages/virtualization.scm (libosinfo)[inputs]: Add osinfo-db and
remove gobject-introspection.
[native-inputs]: Add gobject-introspection.
[arguments]: Add phase patch.

squash! gnu: virt-manager: Include operating systems list.
---
 gnu/packages/virtualization.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 308cadbe14..c34f742655 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -328,14 +328,24 @@ server and embedded PowerPC, and S390 guests.")
        (list (string-append "-Dwith-usb-ids-path="
                             (assoc-ref %build-inputs "usb.ids"))
              (string-append "-Dwith-pci-ids-path="
-                            (assoc-ref %build-inputs "pci.ids")))))
+                            (assoc-ref %build-inputs "pci.ids")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-osinfo-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "osinfo/osinfo_loader.c"
+               (("path = DATA_DIR.*")
+                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
+                               "/share/osinfo\";")))
+             #t)))))
     (inputs
      `(("libsoup" ,libsoup)
        ("libxml2" ,libxml2)
        ("libxslt" ,libxslt)
-       ("gobject-introspection" ,gobject-introspection)))
+       ("osinfo-db" ,osinfo-db)))
     (native-inputs
      `(("glib" ,glib "bin")  ; glib-mkenums, etc.
+       ("gobject-introspection" ,gobject-introspection)
        ("gtk-doc" ,gtk-doc)
        ("vala" ,vala)
        ("intltool" ,intltool)
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#39579: Done: Include operating systems list in virt-manager
  2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
                   ` (6 preceding siblings ...)
  2020-02-16 20:47 ` [bug#39579] [PATCH v2 3/3] gnu: libosinfo: Include operating systems list Brice Waegeneire
@ 2020-02-19 22:06 ` Jakub Kądziołka
  7 siblings, 0 replies; 13+ messages in thread
From: Jakub Kądziołka @ 2020-02-19 22:06 UTC (permalink / raw)
  To: 39579-done

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

It seems that my mail didn't get sent due to flaky internet, but I've
pushed the patches to master - closing.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-02-19 22:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-12 16:30 [bug#39579] [PATCH 0/3] Include operating systems list in virt-manager Brice Waegeneire
2020-02-12 16:37 ` [bug#39579] [PATCH 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
2020-02-16 19:10   ` Jakub Kądziołka
2020-02-16 19:56     ` Jakub Kądziołka
2020-02-12 16:37 ` [bug#39579] [PATCH 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
2020-02-16 19:13   ` Jakub Kądziołka
2020-02-12 16:37 ` [bug#39579] [PATCH 3/3] gnu: virt-manager: Include operating systems list Brice Waegeneire
2020-02-16 19:27   ` Jakub Kądziołka
2020-02-16 20:47 ` [bug#39579] [PATCH v2 0/3] Include operating systems list in virt-manager Brice Waegeneire
2020-02-16 20:47 ` [bug#39579] [PATCH v2 1/3] gnu: osinfo-db-tools: Add osinfo-db-tools Brice Waegeneire
2020-02-16 20:47 ` [bug#39579] [PATCH v2 2/3] gnu: osinfo-db: Add osinfo-db Brice Waegeneire
2020-02-16 20:47 ` [bug#39579] [PATCH v2 3/3] gnu: libosinfo: Include operating systems list Brice Waegeneire
2020-02-19 22:06 ` bug#39579: Done: Include operating systems list in virt-manager Jakub Kądziołka

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).