unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/3] Add xdot and update yosys
@ 2016-11-26 14:27 Theodoros Foradis
  2016-11-26 14:27 ` [PATCH 1/3] gnu: Add xdot Theodoros Foradis
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Theodoros Foradis @ 2016-11-26 14:27 UTC (permalink / raw)
  To: guix-devel


Hello guix,

This patch adds xdot, a viewer for graphviz graphs, and adds support for
it in yosys(it was a TODO item).

Functionality can be tested following the examples in this webpage:
http://www.clifford.at/yosys/screenshots.html
The diagrams at each step, can be previewed with xdot, issuing the
command 'show counter'.

Also, yosys is updated to the latest release, 0.7.

Regards,
-- 
Theodoros Foradis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] gnu: Add xdot.
  2016-11-26 14:27 [PATCH 0/3] Add xdot and update yosys Theodoros Foradis
@ 2016-11-26 14:27 ` Theodoros Foradis
  2016-11-27 21:55   ` Kei Kebreau
  2016-11-26 14:27 ` [PATCH 2/3] gnu: yosys: Add xdot functionality Theodoros Foradis
  2016-11-26 14:27 ` [PATCH 3/3] gnu: yosys: Update to 0.7 Theodoros Foradis
  2 siblings, 1 reply; 9+ messages in thread
From: Theodoros Foradis @ 2016-11-26 14:27 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/graphviz.scm (xdot): New variable.
---
 gnu/packages/graphviz.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index 610bd16..a336183 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (gnu packages graphviz)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gtk)
@@ -30,11 +32,14 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages swig)
-  #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0)))
+  #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0 lgpl3+)))
 
 (define-public graphviz
   (package
@@ -148,3 +153,48 @@ interfaces for other technical domains.")
      "Library intended to provide a set of useful functions to deal with
 3D surfaces meshed with interconnected triangles.")
     (license lgpl2.0+)))
+
+(define-public xdot
+  (package
+    (name "xdot")
+    (version "0.7")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (pypi-uri "xdot" version))
+      (sha256
+       (base32
+        "1q0f3pskb09saw1qkd2s6vmk80rq5zjhq8l93dfr2x6r04r0q46j"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot")
+               `("GI_TYPELIB_PATH" ":" prefix
+                 (,(string-append
+                    (assoc-ref inputs "gtk+") "/lib/girepository-1.0"
+                    ":" (assoc-ref inputs "pango") "/lib/girepository-1.0"
+                    ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
+                    ":" (assoc-ref inputs "atk") "/lib/girepository-1.0")))
+               `("PATH" ":" prefix
+                 (,(string-append (assoc-ref inputs "graphviz") "/bin"))))
+             #t)))))
+    (inputs
+     `(("atk" ,atk)
+       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("graphviz" ,graphviz)
+       ("gtk+" ,gtk+)
+       ("python-pycairo" ,python-pycairo)
+       ("python-pygobject" ,python-pygobject)))
+    (home-page "https://pypi.python.org/pypi/xdot")
+    (synopsis
+     "Interactive viewer for graphviz dot files")
+    (description
+     "Xdot is an interactive viewer for graphs written in @code{graphviz}’s dot language.
+  It uses internally the xdot output format as an intermediate format,and @code{gtk} and
+@code{cairo} for rendering.  Xdot can be used either as a standalone application, or as
+a python library.")
+    (license lgpl3+)))
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] gnu: yosys: Add xdot functionality.
  2016-11-26 14:27 [PATCH 0/3] Add xdot and update yosys Theodoros Foradis
  2016-11-26 14:27 ` [PATCH 1/3] gnu: Add xdot Theodoros Foradis
@ 2016-11-26 14:27 ` Theodoros Foradis
  2016-11-29  0:25   ` Danny Milosavljevic
  2016-11-26 14:27 ` [PATCH 3/3] gnu: yosys: Update to 0.7 Theodoros Foradis
  2 siblings, 1 reply; 9+ messages in thread
From: Theodoros Foradis @ 2016-11-26 14:27 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/fpga.scm (yosys)[inputs]: Add xdot, graphviz and psmisc.
  [arguments]Add phase that patches paths.
---
 gnu/packages/fpga.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
index bb19909..a344e8e 100644
--- a/gnu/packages/fpga.scm
+++ b/gnu/packages/fpga.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,7 +32,9 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages zip)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages ghostscript)
@@ -136,6 +139,13 @@ For synthesis, the compiler generates netlists in the desired format.")
                           (string-append "PREFIX=" %output))
        #:phases
        (modify-phases %standard-phases
+         (add-before 'configure 'fix-paths
+           (lambda _
+             (substitute* "./passes/cmds/show.cc"
+               (("exec xdot") (string-append "exec " (which "xdot")))
+               (("dot -") (string-append (which "dot") " -"))
+               (("fuser") (which "fuser")))
+             #t))
          (replace 'configure
            (lambda* (#:key inputs (make-flags '()) #:allow-other-keys)
              (zero? (apply system* "make" "config-gcc" make-flags))))
@@ -172,7 +182,6 @@ For synthesis, the compiler generates netlists in the desired format.")
                         (("iverilog_bin=\".*\"") (string-append "iverilog_bin=\""
                                                                 iverilog "\"")))
                      #t))))))
-    ;; TODO add xdot [patch the path to it here] as soon as I find out where it is.
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("python" ,python)
@@ -185,6 +194,9 @@ For synthesis, the compiler generates netlists in the desired format.")
      `(("tcl" ,tcl)
        ("readline" ,readline)
        ("libffi" ,libffi)
+       ("graphviz" ,graphviz)
+       ("psmisc" ,psmisc)
+       ("xdot" ,xdot)
        ("abc" ,abc)))
     (home-page "http://www.clifford.at/yosys/")
     (synopsis "FPGA Verilog RTL synthesizer")
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] gnu: yosys: Update to 0.7.
  2016-11-26 14:27 [PATCH 0/3] Add xdot and update yosys Theodoros Foradis
  2016-11-26 14:27 ` [PATCH 1/3] gnu: Add xdot Theodoros Foradis
  2016-11-26 14:27 ` [PATCH 2/3] gnu: yosys: Add xdot functionality Theodoros Foradis
@ 2016-11-26 14:27 ` Theodoros Foradis
  2 siblings, 0 replies; 9+ messages in thread
From: Theodoros Foradis @ 2016-11-26 14:27 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/fpga.scm (yosys): Update to 0.7.
---
 gnu/packages/fpga.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
index a344e8e..f65eae8 100644
--- a/gnu/packages/fpga.scm
+++ b/gnu/packages/fpga.scm
@@ -117,7 +117,7 @@ For synthesis, the compiler generates netlists in the desired format.")
 (define-public yosys
   (package
     (name "yosys")
-    (version "0.6")
+    (version "0.7")
     (source (origin
               (method url-fetch)
               (uri
@@ -125,7 +125,7 @@ For synthesis, the compiler generates netlists in the desired format.")
                               name "-" version ".tar.gz"))
               (sha256
                 (base32
-                   "02j0c0m9dfyjccynalf0aggj6gy20k7iphpkg5cn6sdirlkv8gmx"))
+                   "0vkfdn4phvkjqlnpqlr6q5f97bgjc3312vj5jf0vf85zqv88dy9x"))
               (file-name (string-append name "-" version "-checkout.tar.gz"))
               (modules '((guix build utils)))
               (snippet
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] gnu: Add xdot.
  2016-11-26 14:27 ` [PATCH 1/3] gnu: Add xdot Theodoros Foradis
@ 2016-11-27 21:55   ` Kei Kebreau
  2016-12-09 14:21     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Kei Kebreau @ 2016-11-27 21:55 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

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

Theodoros Foradis <theodoros.for@openmailbox.org> writes:

> * gnu/packages/graphviz.scm (xdot): New variable.
> ---
>  gnu/packages/graphviz.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 51 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
> index 610bd16..a336183 100644
> --- a/gnu/packages/graphviz.scm
> +++ b/gnu/packages/graphviz.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
>  ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
> +;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -20,6 +21,7 @@
>  (define-module (gnu packages graphviz)
>    #:use-module (guix packages)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system python)
>    #:use-module (guix download)
>    #:use-module (gnu packages xorg)
>    #:use-module (gnu packages gtk)
> @@ -30,11 +32,14 @@
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages glib)
> +  #:use-module (gnu packages gtk)
> +  #:use-module (gnu packages gnome)
>    #:use-module (gnu packages fontutils)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages gd)
>    #:use-module (gnu packages swig)
> -  #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0)))
> +  #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0 lgpl3+)))
>  
>  (define-public graphviz
>    (package
> @@ -148,3 +153,48 @@ interfaces for other technical domains.")
>       "Library intended to provide a set of useful functions to deal with
>  3D surfaces meshed with interconnected triangles.")
>      (license lgpl2.0+)))
> +
> +(define-public xdot
> +  (package
> +    (name "xdot")
> +    (version "0.7")
> +    (source
> +     (origin
> +      (method url-fetch)
> +      (uri (pypi-uri "xdot" version))
> +      (sha256
> +       (base32
> +        "1q0f3pskb09saw1qkd2s6vmk80rq5zjhq8l93dfr2x6r04r0q46j"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
> +         (add-after 'install 'wrap
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot")
> +               `("GI_TYPELIB_PATH" ":" prefix
> +                 (,(string-append
> +                    (assoc-ref inputs "gtk+") "/lib/girepository-1.0"
> +                    ":" (assoc-ref inputs "pango") "/lib/girepository-1.0"
> +                    ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
> +                    ":" (assoc-ref inputs "atk") "/lib/girepository-1.0")))
> +               `("PATH" ":" prefix
> +                 (,(string-append (assoc-ref inputs "graphviz") "/bin"))))
> +             #t)))))

Adding #:configure-flags '("--single-version-externally-managed"
"--root=/") to the arguments list makes xdot's handling of the .egg
files reproducible.

> +    (inputs
> +     `(("atk" ,atk)
> +       ("gdk-pixbuf" ,gdk-pixbuf+svg)
> +       ("graphviz" ,graphviz)
> +       ("gtk+" ,gtk+)
> +       ("python-pycairo" ,python-pycairo)
> +       ("python-pygobject" ,python-pygobject)))
> +    (home-page "https://pypi.python.org/pypi/xdot")
> +    (synopsis
> +     "Interactive viewer for graphviz dot files")
> +    (description
> +     "Xdot is an interactive viewer for graphs written in @code{graphviz}’s dot language.
> +  It uses internally the xdot output format as an intermediate format,and @code{gtk} and
> +@code{cairo} for rendering.  Xdot can be used either as a standalone application, or as
> +a python library.")
> +    (license lgpl3+)))

Other than the comment above, LGTM. Is there someone more experienced
with Python packages who can double check this?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] gnu: yosys: Add xdot functionality.
  2016-11-26 14:27 ` [PATCH 2/3] gnu: yosys: Add xdot functionality Theodoros Foradis
@ 2016-11-29  0:25   ` Danny Milosavljevic
  0 siblings, 0 replies; 9+ messages in thread
From: Danny Milosavljevic @ 2016-11-29  0:25 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

LGTM.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] gnu: Add xdot.
  2016-11-27 21:55   ` Kei Kebreau
@ 2016-12-09 14:21     ` Ludovic Courtès
  2017-01-01 18:44       ` Theodoros Foradis
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2016-12-09 14:21 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

Kei Kebreau <kei@openmailbox.org> skribis:

> Theodoros Foradis <theodoros.for@openmailbox.org> writes:
>
>> * gnu/packages/graphviz.scm (xdot): New variable.

[...]

> Other than the comment above, LGTM. Is there someone more experienced
> with Python packages who can double check this?

If it builds and passes ‘guix lint’ and looks good to you, please push,
Kei.

We can always modify it later if we find a problem.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] gnu: Add xdot.
  2016-12-09 14:21     ` Ludovic Courtès
@ 2017-01-01 18:44       ` Theodoros Foradis
  2017-01-02  1:09         ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Theodoros Foradis @ 2017-01-01 18:44 UTC (permalink / raw)
  To: guix-devel


Ludovic Courtès writes:

> Kei Kebreau <kei@openmailbox.org> skribis:
>
>> Theodoros Foradis <theodoros.for@openmailbox.org> writes:
>>
>>> * gnu/packages/graphviz.scm (xdot): New variable.
>
> [...]
>
>> Other than the comment above, LGTM. Is there someone more experienced
>> with Python packages who can double check this?
>
> If it builds and passes ‘guix lint’ and looks good to you, please push,
> Kei.
>
> We can always modify it later if we find a problem.
>
> Thanks!
>
> Ludo’.

Hello,

I see that the patch series has not been pushed yet. Do I need to post an
updated patch, including the extra configure flag that was suggested?

Regards,
-- 
Theodoros Foradis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] gnu: Add xdot.
  2017-01-01 18:44       ` Theodoros Foradis
@ 2017-01-02  1:09         ` Leo Famulari
  0 siblings, 0 replies; 9+ messages in thread
From: Leo Famulari @ 2017-01-02  1:09 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Sun, Jan 01, 2017 at 08:44:16PM +0200, Theodoros Foradis wrote:
> 
> Ludovic Courtès writes:
> 
> > Kei Kebreau <kei@openmailbox.org> skribis:
> >
> >> Theodoros Foradis <theodoros.for@openmailbox.org> writes:
> >>
> >>> * gnu/packages/graphviz.scm (xdot): New variable.
> >
> > [...]
> >
> >> Other than the comment above, LGTM. Is there someone more experienced
> >> with Python packages who can double check this?
> >
> > If it builds and passes ‘guix lint’ and looks good to you, please push,
> > Kei.
> >
> > We can always modify it later if we find a problem.
> >
> > Thanks!
> >
> > Ludo’.
> 
> Hello,
> 
> I see that the patch series has not been pushed yet. Do I need to post an
> updated patch, including the extra configure flag that was suggested?

Hi,

I just pushed all 3 patches with some minor edits to the commit messages
and the description of xdot.

I'm sorry these fell through the cracks! Thank you for reminding us :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-02  1:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-26 14:27 [PATCH 0/3] Add xdot and update yosys Theodoros Foradis
2016-11-26 14:27 ` [PATCH 1/3] gnu: Add xdot Theodoros Foradis
2016-11-27 21:55   ` Kei Kebreau
2016-12-09 14:21     ` Ludovic Courtès
2017-01-01 18:44       ` Theodoros Foradis
2017-01-02  1:09         ` Leo Famulari
2016-11-26 14:27 ` [PATCH 2/3] gnu: yosys: Add xdot functionality Theodoros Foradis
2016-11-29  0:25   ` Danny Milosavljevic
2016-11-26 14:27 ` [PATCH 3/3] gnu: yosys: Update to 0.7 Theodoros Foradis

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).