From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5z41-0002ja-F0 for guix-patches@gnu.org; Sat, 21 Oct 2017 15:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5z3y-00057m-6r for guix-patches@gnu.org; Sat, 21 Oct 2017 15:04:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5z3y-000578-3h for guix-patches@gnu.org; Sat, 21 Oct 2017 15:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e5z3x-0006uv-Pn for guix-patches@gnu.org; Sat, 21 Oct 2017 15:04:01 -0400 Subject: [bug#28928] [PATCH] gnu: Add python2-libmpsse. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5z3B-0002hZ-Qj for guix-patches@gnu.org; Sat, 21 Oct 2017 15:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5z38-0003jp-LF for guix-patches@gnu.org; Sat, 21 Oct 2017 15:03:13 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:49264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5z38-0003go-EX for guix-patches@gnu.org; Sat, 21 Oct 2017 15:03:10 -0400 From: Danny Milosavljevic Date: Sat, 21 Oct 2017 21:03:03 +0200 Message-Id: <20171021190303.30463-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28928@debbugs.gnu.org * gnu/packages/embedded.scm: Add imports. (python2-libmpsse): New variable. --- gnu/packages/embedded.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index e89f5570b..e74db51ed 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -42,6 +42,8 @@ #:use-module (gnu packages libusb) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages swig) #:use-module (gnu packages texinfo) #:use-module (srfi srfi-1)) @@ -867,3 +869,65 @@ the Raspberry Pi chip.") (synopsis "GCC for VC4") (description "This package provides @code{gcc} for VideoCore IV, the Raspberry Pi chip.")))) + +(define-public python2-libmpsse + (package + (name "python2-libmpsse") + (version "1.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://storage.googleapis.com/" + "google-code-archive-downloads/v2/" + "code.google.com/libmpsse/" + "libmpsse-" version ".tar.gz")) + (sha256 + (base32 + "0jq7nhqq3na8675jnpfcar3pd3dp3adhhc4lw900swkla01a1wh8")))) + (build-system gnu-build-system) + (inputs + `(("libftdi" ,libftdi) + ("python" ,python-2))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("swig" ,swig) + ("which" ,base:which))) + (arguments + `(#:tests? #f ; No tests exist. + #:make-flags + (list (string-append "CFLAGS=-Wall -fPIC -fno-strict-aliasing -g -O2 " + "$(shell pkg-config --cflags libftdi1)")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'set-environment-up + (lambda* (#:key inputs outputs #:allow-other-keys) + (chdir "src") + (setenv "PYDEV" (string-append (assoc-ref inputs "python") + "/include/python2.7")) + #t)) + (add-after 'unpack 'patch-global-variable + (lambda _ + ;; fast_rw_buf was defined in a header file which was making + ;; the build not reproducible. + (substitute* "src/fast.c" + (("^int fast_build_block_buffer") " + +unsigned char fast_rw_buf[SPI_RW_SIZE + CMD_SIZE]; +int fast_build_block_buffer")) + (substitute* "src/mpsse.h" + (("unsigned char fast_rw_buf.*") " +")) + #t)) + (replace 'install + (lambda* (#:key outputs make-flags #:allow-other-keys #:rest args) + (let* ((out (assoc-ref outputs "out")) + (out-python (string-append out + "/lib/python2.7/site-packages")) + (install (assoc-ref %standard-phases 'install))) + (install #:make-flags (cons (string-append "PYLIB=" out-python) + make-flags)))))))) + (home-page "https://code.google.com/archive/p/libmpsse/") + (synopsis "Python library for MPSSE SPI I2C JTAG adapter by FTDI") + (description "This package provides a library in order to support the +MPSSE adapter by FTDI that can do SPI, I2C, JTAG.") + (license license:gpl2+)))