gnu: bluez: Install 'org.bluez.obex.service' and fix '97-hid2hci.rules'.

* gnu/packages/linux.scm (bluez)[arguments]: Add 'post-install' phase.
This commit is contained in:
宋文武 2016-06-17 20:35:21 +08:00
parent c80920462e
commit 87a16de744
No known key found for this signature in database
GPG key ID: 26525665AE727D37

View file

@ -2429,7 +2429,28 @@ (define-public bluez
"--disable-systemd" "--disable-systemd"
;; Install dbus/udev files to the correct location. ;; Install dbus/udev files to the correct location.
(string-append "--with-dbusconfdir=" out "/etc") (string-append "--with-dbusconfdir=" out "/etc")
(string-append "--with-udevdir=" out "/lib/udev"))))) (string-append "--with-udevdir=" out "/lib/udev")))
#:phases
(modify-phases %standard-phases
(add-after 'install 'post-install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(servicedir (string-append out "/share/dbus-1/services"))
(service "obexd/src/org.bluez.obex.service")
(rule (string-append
out "/lib/udev/rules.d/97-hid2hci.rules")))
;; Install the obex dbus service file.
(substitute* service
(("/bin/false")
(string-append out "/libexec/bluetooth/obexd")))
(install-file service servicedir)
;; Fix paths in the udev rule.
(substitute* rule
(("hid2hci --method")
(string-append out "/lib/udev/hid2hci --method"))
(("/sbin/udevadm")
(string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
#t))))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config) `(("pkg-config" ,pkg-config)
("gettext" ,gnu-gettext))) ("gettext" ,gnu-gettext)))