~hutzdog/patchwork

77cae3a373928db5afcd595484f3bd22ce0c3314 — hutzdog@proton.me 3 months ago 40f699e master
Use symlinks instead of duplicating the hwconfig package entirely
1 files changed, 32 insertions(+), 21 deletions(-)

M patchwork/packages/desktop.scm
M patchwork/packages/desktop.scm => patchwork/packages/desktop.scm +32 -21
@@ 16,14 16,18 @@
  #:use-module (gnu packages wm)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg)
  #:use-module (guix build union)
  #:use-module (guix build utils)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system meson)
  #:use-module (guix derivations)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix licenses)
  #:use-module (guix packages))
  #:use-module (guix monads)
  #:use-module (guix packages)
  #:use-module (guix store))

;; HYPRLAND / DEPENDENCIES (TODO: contribute upstream)
;;; A lot of these just need to be merged into mainline Guix (version bumps mostly), though there are a few that need better implementations first


@@ 82,27 86,34 @@
;; This cannot be upstreamed without modification, as it only can have 1 output. Either Hyprland will need to be patched, an aggregate package gets pushed to Guix that propogates all outputs, or some other solution will need to be found
(define-public hwdata-pkg-config
  (package
   (inherit hwdata)
   (outputs '("out"))
    (inherit hwdata)
    (name "hwdata-pkg-config")
    (synopsis "Hardware identification and configuration data (pkg-config compatible version)")
    (outputs '("out"))

    (arguments
     (list
      #:tests? #f
      #:target #f
      #:configure-flags #~(list (string-append "--datadir=" #$output "/share"))
      #:phases
      (with-imported-modules '((guix build union))
        #~(begin
            (use-modules ((guix build union)))
            (modify-phases %standard-phases
              (replace 'build
                (lambda _ (invoke "make" "hwdata.pc")))
              (replace 'install
                (lambda _
                  ;; TODO: find a way to just use all outputs rather than manually listing them
                  (union-build #$output '(#$hwdata:pci
                                          #$hwdata:iab
                                          #$hwdata:oui
                                          #$hwdata:pci
                                          #$hwdata:pnp
                                          #$hwdata:usb))
                  (install-file "hwdata.pc" (string-append #$output "/share/pkgconfig")))))))))))

   ;; HACK: this depends on #:phases being the last argument, I need to find a better way to do this
   (arguments
    (append (reverse (cddr (reverse (package-arguments hwdata))))
            (list
             #:phases
              #~(modify-phases
                 %standard-phases
                 (add-after 'build 'pkg-config
                            (lambda _
                              (invoke "make" "hwdata.pc")))
                 (replace 'install
                          (lambda _
                            (install-file "iab.txt" (string-append #$output "/share/hwdata"))
                            (install-file "oui.txt" (string-append #$output "/share/hwdata"))
                            (install-file "pci.ids" (string-append #$output "/share/hwdata"))
                            (install-file "pnp.ids" (string-append #$output "/share/hwdata"))
                            (install-file "usb.ids" (string-append #$output "/share/hwdata"))
                            (install-file "hwdata.pc" (string-append #$output "/share/pkgconfig"))))))))))

;; TODO: Wait for this to be packaged in Guix (no patch found)
(define-public tomlplusplus