123456789101112131415161718192021222324252627282930313233343536373839404142 |
- (define-module (guix build qt-utils)
- #:use-module (guix build utils)
- #:export (wrap-qt-program))
- (define (wrap-qt-program out program inputs)
- (define (suffix env-var path)
- (let ((env-val (getenv env-var)))
- (if env-val (string-append env-val ":" path) path)))
- (let ((qml-path (suffix "QML2_IMPORT_PATH"
- (string-append out "/lib/qt5/qml")))
- (plugin-path (suffix "QT_PLUGIN_PATH"
- (string-append out "/lib/qt5/plugins")))
- (xdg-data-path (suffix "XDG_DATA_DIRS"
- (string-append out "/share")))
- (xdg-config-path (suffix "XDG_CONFIG_DIRS"
- (string-append out "/etc/xdg"))))
- (wrap-program (string-append out "/bin/" program)
- inputs
- `("QML2_IMPORT_PATH" = (,qml-path))
- `("QT_PLUGIN_PATH" = (,plugin-path))
- `("XDG_DATA_DIRS" = (,xdg-data-path))
- `("XDG_CONFIG_DIRS" = (,xdg-config-path)))))
|