mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: gnome-authenticator: Switch to meson-build-system.
* gnu/packages/gnome.scm (gnome-authenticator) [build-system]: Switch to meson-build-system. [native-inputs]: Add rust, rust:cargo. Add rust-sysroot when cross-compiling. Remove meson, ninja. [inputs]: Use ‘cargo-inputs’. [arguments]: Remove #:install-source?, #:vendor, #:cargo-inputs. <#:imported-modules, #:modules>: Remove explicit inclusion of glib-or-gtk-build-system modules. <#:phases>: Add 'prepare-cargo-build-system before 'configure. Remove 'unpack-rust-crates. Remove added phases that are part of meson-build-system's %standard-phases. * gnu/packages/rust-crates.scm (lookup-cargo-inputs)[gnome-authenticator]: New entry. Change-Id: I98513dfb4ecb8d1ab7f1c808b79cd990d8b4259d
This commit is contained in:
parent
60e58ccfa7
commit
9b0916fbfe
2 changed files with 1055 additions and 91 deletions
|
@ -10558,61 +10558,16 @@ specified duration and save it as a GIF encoded animated image file.")
|
|||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0zavax35n048spx097ymiq31s8b879qwbg8xmcxcx73r6m823mic"))))
|
||||
(build-system cargo-build-system)
|
||||
(build-system meson-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:install-source? #f
|
||||
#:vendor-dir "vendor"
|
||||
#:cargo-inputs
|
||||
(list rust-aes-gcm-0.10
|
||||
rust-anyhow-1
|
||||
rust-async-std-1
|
||||
rust-aperture-0.3
|
||||
rust-ashpd-0.6
|
||||
rust-data-encoding-2
|
||||
rust-diesel-2
|
||||
rust-diesel-migrations-2
|
||||
rust-futures-channel-0.3
|
||||
rust-futures-executor-0.3
|
||||
rust-futures-util-0.3
|
||||
rust-gettext-rs-0.7
|
||||
rust-gtk4-0.7
|
||||
rust-hex-0.4
|
||||
rust-image-0.24
|
||||
rust-libadwaita-0.5
|
||||
rust-oo7-0.2
|
||||
rust-percent-encoding-2
|
||||
rust-prost-0.12
|
||||
rust-qrencode-0.14
|
||||
rust-quick-xml-0.30
|
||||
rust-rand-0.8
|
||||
rust-reqwest-0.11
|
||||
rust-ring-0.17
|
||||
rust-rust-argon2-2
|
||||
rust-scrypt-0.11
|
||||
rust-search-provider-0.6
|
||||
rust-serde-1
|
||||
rust-serde-json-1
|
||||
rust-svg-metadata-0.4
|
||||
rust-tokio-1
|
||||
rust-tracing-0.1
|
||||
rust-tracing-subscriber-0.3
|
||||
rust-url-2
|
||||
rust-uuid-1
|
||||
rust-zbar-rust-0.0.23 ; any 0.0.*
|
||||
rust-zeroize-1)
|
||||
#:imported-modules `(,@%meson-build-system-modules
|
||||
,@%glib-or-gtk-build-system-modules
|
||||
,@%cargo-build-system-modules)
|
||||
#:modules `((guix build cargo-build-system)
|
||||
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
|
||||
((guix build meson-build-system) #:prefix meson:)
|
||||
#:modules `(((guix build cargo-build-system) #:prefix cargo:)
|
||||
(guix build meson-build-system)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
|
||||
(assoc-ref glib-or-gtk:%standard-phases
|
||||
'generate-gdk-pixbuf-loaders-cache-file))
|
||||
(add-after 'unpack 'prepare-for-build
|
||||
(lambda _
|
||||
(substitute* "meson.build"
|
||||
|
@ -10624,51 +10579,43 @@ specified duration and save it as a GIF encoded animated image file.")
|
|||
(substitute* "src/meson.build"
|
||||
(("'test'") "'test', cargo_options"))
|
||||
(delete-file "Cargo.lock")))
|
||||
;; Add meson-configure phase here and not before 'configure because
|
||||
;; the meson 'configure phase changes to a different directory and
|
||||
;; The meson 'configure phase changes to a different directory and
|
||||
;; we need it created before unpacking the crates.
|
||||
(add-before 'unpack-rust-crates 'meson-configure
|
||||
(add-after 'configure 'prepare-cargo-build-system
|
||||
(lambda args
|
||||
(apply (assoc-ref meson:%standard-phases 'configure)
|
||||
#:build-type "debugoptimized"
|
||||
#:configure-flags '()
|
||||
args)))
|
||||
(replace 'build
|
||||
(assoc-ref meson:%standard-phases 'build))
|
||||
(replace 'check
|
||||
(lambda args
|
||||
(apply (assoc-ref meson:%standard-phases 'check)
|
||||
#:test-options '()
|
||||
args)))
|
||||
(replace 'install
|
||||
(assoc-ref meson:%standard-phases 'install))
|
||||
(add-after 'install 'glib-or-gtk-compile-schemas
|
||||
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
|
||||
(add-after 'install 'glib-or-gtk-wrap
|
||||
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
|
||||
(add-after 'glib-or-gtk-wrap 'wrap-extra-paths
|
||||
(lambda _
|
||||
(let ((gst-plugins-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
|
||||
(wrap-program (string-append #$output "/bin/authenticator")
|
||||
`("GST_PLUGIN_SYSTEM_PATH" ":" suffix (,gst-plugins-path))))))
|
||||
(add-after 'strip 'shrink-runpath
|
||||
(assoc-ref meson:%standard-phases 'shrink-runpath)))))
|
||||
(native-inputs (list gettext-minimal
|
||||
`(,glib "bin") ; for glib-compile-schemas
|
||||
meson
|
||||
ninja
|
||||
pkg-config))
|
||||
(inputs (list bash-minimal
|
||||
glib
|
||||
gstreamer
|
||||
gst-plugins-base
|
||||
gst-plugins-bad
|
||||
gtk
|
||||
libadwaita
|
||||
openssl
|
||||
pipewire ; Needed but not listed
|
||||
sqlite
|
||||
zbar))
|
||||
(for-each
|
||||
(lambda (phase)
|
||||
(format #t "Running cargo phase: ~a~%" phase)
|
||||
(apply (assoc-ref cargo:%standard-phases phase)
|
||||
#:vendor-dir "vendor"
|
||||
#:cargo-target #$(cargo-triplet)
|
||||
args))
|
||||
'(unpack-rust-crates
|
||||
configure
|
||||
check-for-pregenerated-files
|
||||
patch-cargo-checksums)))))))
|
||||
(native-inputs
|
||||
(append
|
||||
(list gettext-minimal
|
||||
`(,glib "bin") ; for glib-compile-schemas
|
||||
pkg-config
|
||||
rust
|
||||
`(,rust "cargo"))
|
||||
(or (and=> (%current-target-system)
|
||||
(compose list make-rust-sysroot))
|
||||
'())))
|
||||
(inputs (cons* bash-minimal
|
||||
glib
|
||||
gstreamer
|
||||
gst-plugins-base
|
||||
gst-plugins-bad
|
||||
gtk
|
||||
libadwaita
|
||||
openssl
|
||||
pipewire ; Needed but not listed
|
||||
sqlite
|
||||
zbar
|
||||
(cargo-inputs 'gnome-authenticator)))
|
||||
(home-page "https://apps.gnome.org/Authenticator")
|
||||
(synopsis "Generate two-factor codes")
|
||||
(description "Simple application for generating Two-Factor Authentication
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue