gnu: libftdi: Build Python bindings.
* gnu/packages/libftdi.scm (libftdi)[outputs]: Add "python". [arguments]<#:phases>: Add with "install-python-binding" phase. [native-inputs]: Add python, swig. Signed-off-by: Ludovic Courtès <ludo@gnu.org>master
parent
fce3d00cdb
commit
856eeedcbc
|
@ -1,6 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
|
;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
|
||||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
|
;;; Copyright © 2023 Simon South <simon@simonsouth.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -18,15 +19,19 @@
|
||||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (gnu packages libftdi)
|
(define-module (gnu packages libftdi)
|
||||||
|
#:use-module (guix build utils)
|
||||||
#:use-module (guix build-system cmake)
|
#:use-module (guix build-system cmake)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module ((guix licenses) #:prefix license:)
|
#:use-module ((guix licenses) #:prefix license:)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
|
#:use-module (guix utils)
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (gnu packages boost)
|
#:use-module (gnu packages boost)
|
||||||
#:use-module (gnu packages libusb)
|
#:use-module (gnu packages libusb)
|
||||||
#:use-module (gnu packages pkg-config)
|
#:use-module (gnu packages pkg-config)
|
||||||
|
#:use-module (gnu packages python)
|
||||||
|
#:use-module (gnu packages swig)
|
||||||
#:use-module (gnu packages textutils))
|
#:use-module (gnu packages textutils))
|
||||||
|
|
||||||
(define-public libftdi
|
(define-public libftdi
|
||||||
|
@ -42,6 +47,7 @@
|
||||||
(base32
|
(base32
|
||||||
"0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc"))))
|
"0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc"))))
|
||||||
(build-system cmake-build-system)
|
(build-system cmake-build-system)
|
||||||
|
(outputs '("out" "python"))
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
|
@ -49,10 +55,26 @@
|
||||||
#$output "/share/doc/" #$name "-" #$version)
|
#$output "/share/doc/" #$name "-" #$version)
|
||||||
"-DEXAMPLES=OFF"
|
"-DEXAMPLES=OFF"
|
||||||
"-DLIB_SUFFIX=''") ; place libraries in /lib, not /lib64
|
"-DLIB_SUFFIX=''") ; place libraries in /lib, not /lib64
|
||||||
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
|
(add-after 'install 'install-python-binding
|
||||||
|
(lambda _
|
||||||
|
(let* ((python-version
|
||||||
|
#$(version-major+minor (package-version python)))
|
||||||
|
(python-lib-path
|
||||||
|
(string-append "/lib/python" python-version)))
|
||||||
|
(mkdir-p (string-append #$output:python "/lib"))
|
||||||
|
(mkdir-p (string-append #$output:python "/share/libftdi"))
|
||||||
|
(rename-file (string-append #$output python-lib-path)
|
||||||
|
(string-append #$output:python python-lib-path))
|
||||||
|
(rename-file (string-append #$output
|
||||||
|
"/share/libftdi/examples")
|
||||||
|
(string-append #$output:python
|
||||||
|
"/share/libftdi/examples"))))))
|
||||||
#:test-target "check"
|
#:test-target "check"
|
||||||
#:tests? #f)) ; tests fail without access to USB
|
#:tests? #f)) ; tests fail without access to USB
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list pkg-config))
|
(list pkg-config python swig))
|
||||||
(inputs
|
(inputs
|
||||||
(list boost libconfuse))
|
(list boost libconfuse))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
|
|
Reference in New Issue