gnu: libosinfo: Use hwdata for pci.ids and usb.ids.
*  gnu/packages/virtualization.scm (libosinfo)
[arguments]: Use gexps.
[configure-flags]: Search usb.ids and pci.ids via search-input-file.
[phases]{patch-osinfo-path}: Use search-input-directory.
[inputs]: Use new style.
[native-inputs]: Use new style.  Replace pci.ids and usb.ids by the hwdata pci
and usb outputs, respectively.
Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									03d8fd4557
								
							
						
					
					
						commit
						5b59df328b
					
				
					 1 changed files with 28 additions and 40 deletions
				
			
		| 
						 | 
					@ -99,8 +99,9 @@
 | 
				
			||||||
  #:use-module (gnu packages ninja)
 | 
					  #:use-module (gnu packages ninja)
 | 
				
			||||||
  #:use-module (gnu packages onc-rpc)
 | 
					  #:use-module (gnu packages onc-rpc)
 | 
				
			||||||
  #:use-module (gnu packages package-management)
 | 
					  #:use-module (gnu packages package-management)
 | 
				
			||||||
  #:use-module (gnu packages perl)
 | 
					  #:use-module (gnu packages pciutils)
 | 
				
			||||||
  #:use-module (gnu packages pcre)
 | 
					  #:use-module (gnu packages pcre)
 | 
				
			||||||
 | 
					  #:use-module (gnu packages perl)
 | 
				
			||||||
  #:use-module (gnu packages pkg-config)
 | 
					  #:use-module (gnu packages pkg-config)
 | 
				
			||||||
  #:use-module (gnu packages polkit)
 | 
					  #:use-module (gnu packages polkit)
 | 
				
			||||||
  #:use-module (gnu packages protobuf)
 | 
					  #:use-module (gnu packages protobuf)
 | 
				
			||||||
| 
						 | 
					@ -1056,46 +1057,33 @@ of one or more RISC-V harts.")
 | 
				
			||||||
         "0nd360c9ampw8hb6xh5g45q858df2r4jj9q88bcl6gzgaj0l3wxl"))))
 | 
					         "0nd360c9ampw8hb6xh5g45q858df2r4jj9q88bcl6gzgaj0l3wxl"))))
 | 
				
			||||||
    (build-system meson-build-system)
 | 
					    (build-system meson-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:configure-flags
 | 
					     (list
 | 
				
			||||||
       (list (string-append "-Dwith-usb-ids-path="
 | 
					      #:configure-flags
 | 
				
			||||||
                            (assoc-ref %build-inputs "usb.ids"))
 | 
					      #~(list (string-append "-Dwith-usb-ids-path="
 | 
				
			||||||
             (string-append "-Dwith-pci-ids-path="
 | 
					                             (search-input-file %build-inputs
 | 
				
			||||||
                            (assoc-ref %build-inputs "pci.ids")))
 | 
					                                                "share/hwdata/usb.ids"))
 | 
				
			||||||
       #:phases
 | 
					              (string-append "-Dwith-pci-ids-path="
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					                             (search-input-file %build-inputs
 | 
				
			||||||
         (add-after 'unpack 'patch-osinfo-path
 | 
					                                                "share/hwdata/pci.ids")))
 | 
				
			||||||
           (lambda* (#:key inputs #:allow-other-keys)
 | 
					      #:phases
 | 
				
			||||||
             (substitute* "osinfo/osinfo_loader.c"
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
               (("path = DATA_DIR.*")
 | 
					          (add-after 'unpack 'patch-osinfo-path
 | 
				
			||||||
                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
 | 
					            (lambda* (#:key native-inputs inputs #:allow-other-keys)
 | 
				
			||||||
                               "/share/osinfo\";"))))))))
 | 
					              (substitute* "osinfo/osinfo_loader.c"
 | 
				
			||||||
    (inputs
 | 
					                (("path = DATA_DIR.*")
 | 
				
			||||||
     `(("libsoup" ,libsoup-minimal-2)
 | 
					                 (format #f "path = ~s;"
 | 
				
			||||||
       ("libxml2" ,libxml2)
 | 
					                         (search-input-directory (or native-inputs inputs)
 | 
				
			||||||
       ("libxslt" ,libxslt)
 | 
					                                                 "share/osinfo")))))))))
 | 
				
			||||||
       ("osinfo-db" ,osinfo-db)))
 | 
					    (inputs (list libsoup-minimal-2 libxml2 libxslt osinfo-db))
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     `(("glib" ,glib "bin")  ; glib-mkenums, etc.
 | 
					     (list `(,glib "bin")                ;glib-mkenums, etc.
 | 
				
			||||||
       ("gobject-introspection" ,gobject-introspection)
 | 
					           gobject-introspection
 | 
				
			||||||
       ("gtk-doc" ,gtk-doc/stable)
 | 
					           gtk-doc/stable
 | 
				
			||||||
       ("vala" ,vala)
 | 
					           `(,hwdata "pci")
 | 
				
			||||||
       ("intltool" ,intltool)
 | 
					           `(,hwdata "usb")
 | 
				
			||||||
       ("pkg-config" ,pkg-config)
 | 
					           vala
 | 
				
			||||||
       ("pci.ids"
 | 
					           intltool
 | 
				
			||||||
        ,(origin
 | 
					           pkg-config))
 | 
				
			||||||
           (method url-fetch)
 | 
					 | 
				
			||||||
           (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
 | 
					 | 
				
			||||||
       ("usb.ids"
 | 
					 | 
				
			||||||
        ,(origin
 | 
					 | 
				
			||||||
           (method url-fetch)
 | 
					 | 
				
			||||||
           (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
 | 
					 | 
				
			||||||
           (file-name "usb.ids")
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
 | 
					 | 
				
			||||||
    (home-page "https://libosinfo.org/")
 | 
					    (home-page "https://libosinfo.org/")
 | 
				
			||||||
    (synopsis "Operating system information database")
 | 
					    (synopsis "Operating system information database")
 | 
				
			||||||
    (description "libosinfo is a GObject based library API for managing
 | 
					    (description "libosinfo is a GObject based library API for managing
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue