all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: Guix-devel <guix-devel@gnu.org>
Subject: [PATCH] gnu: Add pycparser.
Date: Mon, 8 Dec 2014 10:12:04 +0100	[thread overview]
Message-ID: <CAKrPhPMNKs-R5adK4k9Su7T_O8TeXpn81VSM8EF-UwFtm0E2cw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

Please find attached a package definition for pycparser.

Fede

[-- Attachment #2: 0001-gnu-Add-pycparser.patch --]
[-- Type: text/x-patch, Size: 2923 bytes --]

From 79bd66d0af6d4402b83122c67b6ce44401a37f7f Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Mon, 8 Dec 2014 10:08:00 +0100
Subject: [PATCH] gnu: Add pycparser.

* gnu/packages/python.scm (python-pycparser, python2-pycparser): New variables.
---
 gnu/packages/python.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c9f9b16..45f49ac 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -2449,3 +2449,57 @@ a general image processing tool.")
 (define-public python2-pillow
   (package-with-python2 python-pillow))
 
+(define-public python-pycparser
+  (package
+    (name "python-pycparser")
+    (version "2.10")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://pypi.python.org/packages/source/p/"
+                          "pycparser/pycparser-" version ".tar.gz"))
+      (sha256
+       (base32
+        "0v5qfq03yvd1pi0dwlgfai0p3dh9bq94pydn19c4pdn0c6v9hzcm"))))
+    (outputs '("out" "doc"))
+    (build-system python-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python-setuptools" ,python-setuptools)))
+    (arguments
+     `(#:phases 
+       (alist-replace
+        'check
+        (lambda _
+          (with-directory-excursion "tests"
+            (zero? (system* "python" "all_tests.py"))))
+        (alist-cons-after
+         'install 'install-doc
+         (lambda* (#:key outputs #:allow-other-keys)
+           (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                  (doc (string-append data "/doc/" ,name "-" ,version))
+                  (examples (string-append doc "/examples")))
+             (mkdir-p examples)
+             (for-each (lambda (file)
+                         (copy-file (string-append "." file)
+                                    (string-append doc file)))
+                       '("/README.rst" "/CHANGES" "/LICENSE"))
+             (with-directory-excursion "examples"
+               (map (lambda (file)
+                      (let* ((dir (dirname file))
+                             (tgt-dir (string-append examples "/" dir)))
+                        (unless (equal? "." dir)
+                          (mkdir-p tgt-dir))
+                        (copy-file file (string-append examples "/" file))))
+                    (find-files "." ".*")))))
+         %standard-phases))))
+    (home-page "https://github.com/eliben/pycparser")
+    (synopsis "C parser in Python")
+    (description
+     "Pycparser is a complete parser of the C language, written in pure Python
+using the PLY parsing library.  It parses C code into an AST and can serve as
+a front-end for C compilers or analysis tools.")
+    (license bsd-3)))
+
+(define-public python2-pycparser
+  (package-with-python2 python-pycparser))
-- 
1.8.4


             reply	other threads:[~2014-12-08  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08  9:12 Federico Beffa [this message]
2014-12-09 12:18 ` [PATCH] gnu: Add pycparser Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKrPhPMNKs-R5adK4k9Su7T_O8TeXpn81VSM8EF-UwFtm0E2cw@mail.gmail.com \
    --to=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.