gnu: wpa-supplicant-gui: Fix build.

* gnu/packages/admin.scm (wpa-supplicant-gui)[build-system]: Use
qt-build-system.
[phases]: Use G-exps. Drop trailing #t. Don’t wrap-program as that is done by
the build system. Set $HOME to a writable directory when converting icons to
stop Inkscape complaining.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Timotej Lazar 2022-08-11 12:12:54 +02:00 committed by Mathieu Othacehe
parent a817064947
commit cbbb5aa9d4
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -77,6 +77,7 @@ (define-module (gnu packages admin)
#:use-module (guix build-system meson) #:use-module (guix build-system meson)
#:use-module (guix build-system perl) #:use-module (guix build-system perl)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system qt)
#:use-module (guix build-system ruby) #:use-module (guix build-system ruby)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (guix download) #:use-module (guix download)
@ -2145,34 +2146,30 @@ (define-public wpa-supplicant-gui
;; For icons. ;; For icons.
(modify-inputs (package-native-inputs wpa-supplicant) (modify-inputs (package-native-inputs wpa-supplicant)
(prepend imagemagick inkscape/stable))) (prepend imagemagick inkscape/stable)))
(build-system qt-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list
#:test-target "check"
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir (add-after 'unpack 'chdir
(lambda _ (chdir "wpa_supplicant/wpa_gui-qt4")))
(replace 'configure
(lambda _ (invoke "qmake" "wpa_gui.pro")))
(add-after 'build 'build-icons
(lambda _ (lambda _
(chdir "wpa_supplicant/wpa_gui-qt4") ;; Inkscape complains (but works) without a writable $HOME.
#t)) (setenv "HOME" "/tmp")
(delete 'configure)
(replace 'build
(lambda _
(invoke "qmake" "wpa_gui.pro")
(invoke "make" "-j" (number->string (parallel-job-count)))
(invoke "make" "-C" "icons"))) (invoke "make" "-C" "icons")))
(replace 'install (replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out")) (install-file "wpa_gui" (string-append #$output "/bin"))
(qt '("qtbase" "qtsvg-5")))
(install-file "wpa_gui" (string-append out "/bin"))
(install-file "wpa_gui.desktop" (install-file "wpa_gui.desktop"
(string-append out "/share/applications")) (string-append #$output
"/share/applications"))
(copy-recursively "icons/hicolor" (copy-recursively "icons/hicolor"
(string-append out "/share/icons/hicolor")) (string-append #$output
(wrap-program (string-append out "/bin/wpa_gui") "/share/icons/hicolor")))))))
`("QT_PLUGIN_PATH" ":" prefix
,(map (lambda (label)
(string-append (assoc-ref inputs label)
"/lib/qt5/plugins/"))
qt)))
#t))))))
(synopsis "Graphical user interface for WPA supplicant"))) (synopsis "Graphical user interface for WPA supplicant")))
(define-public hostapd (define-public hostapd