unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/3] gnu: Add kicad.
@ 2016-10-24 21:16 Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
                   ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-24 21:16 UTC (permalink / raw)
  To: guix-devel

Hello guix,

Kicad seems to work fine, though it had some issues in pcbnew with
opengl mode in one of the computers I tested (nouveau related).

I have added Danny Milosavljevic in the copyright notice of
wxwidgets.scm, because I modified the package of wxpython that he posted
in this mailing list.

The package does not contain any libraries yet, I will add them in another
patch (and separate package). Users can use their own until then. I had
to disable the github plugin, because I couldn't get it to work.

Feedback is appreciated.


Theodoros Foradis (3):
      gnu: Add wxwidgets-gtk2.
      gnu: Add python2-wxpython.
      gnu: Add kicad.


 gnu/packages/engineering.scm | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/wxwidgets.scm   | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 186 insertions(+)

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

* [PATCH 1/3] gnu: Add wxwidgets-gtk2.
  2016-10-24 21:16 [PATCH 0/3] gnu: Add kicad Theodoros Foradis
@ 2016-10-24 21:16 ` Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 2/3] gnu: Add python2-wxpython Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 3/3] gnu: Add kicad Theodoros Foradis
  2 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-24 21:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (wxwidgets-gtk2): New variable.
---
 gnu/packages/wxwidgets.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 31da2a9..4efe7a1 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -109,3 +110,11 @@ and many other languages.")
                             (assoc-ref %outputs "out") "/lib"))
        ;; No 'check' target.
        #:tests? #f))))
+
+(define-public wxwidgets-gtk2
+  (package (inherit wxwidgets)
+           (inputs `(("gtk+" ,gtk+-2)
+                     ,@(alist-delete
+                        "gtk+"
+                        (package-inputs wxwidgets))))
+           (name "wxwidgets-gtk2")))
-- 
2.10.1

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

* [PATCH 2/3] gnu: Add python2-wxpython.
  2016-10-24 21:16 [PATCH 0/3] gnu: Add kicad Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-10-24 21:16 ` Theodoros Foradis
  2016-10-25  8:32   ` Hartmut Goebel
  2016-10-25 16:20   ` Efraim Flashner
  2016-10-24 21:16 ` [PATCH 3/3] gnu: Add kicad Theodoros Foradis
  2 siblings, 2 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-24 21:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..e09d813 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,87 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "src/expat")
+                  (delete-file-recursively "src/jpeg")
+                  (delete-file-recursively "src/png")
+                  (delete-file-recursively "src/tiff")
+                  (delete-file-recursively "src/zlib")
+                  (delete-file-recursively "src/msw")
+                  (delete-file-recursively "src/osx")
+                  (delete-file-recursively "src/msdos")
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (setenv "CPPFLAGS" (string-append "-I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/lib/wx/include/gtk2-unicode-release-2.8"
+                                               " -I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/include/wx-3.0"
+                                               " -D_FILE_OFFSET_BITS=64"
+                                               " -DWXUSINGDLL"
+                                               " -D__WXGTK__"))))
+         (replace 'build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (zero?
+              (system* "python" "setup.py" "WXPORT=gtk2" "UNICODE=1" "build")))))))
+    (native-inputs
+     `(("gtk+" ,gtk+-2)
+       ("expat" ,expat)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libtiff" ,libtiff)
+       ("libsm" ,libsm)
+       ("libx11" ,libx11)
+       ("mesa" ,mesa)
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)
+       ("zlib" ,zlib)))
+    (inputs
+     `(("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* [PATCH 3/3] gnu: Add kicad.
  2016-10-24 21:16 [PATCH 0/3] gnu: Add kicad Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-10-24 21:16 ` [PATCH 2/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-24 21:16 ` Theodoros Foradis
  2016-10-25  0:36   ` Leo Famulari
  2016-10-25 12:48   ` Leo Famulari
  2 siblings, 2 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-24 21:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad): New variable.
---
 gnu/packages/engineering.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 829ceb0..e5a48fc 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
@@ -39,6 +41,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
@@ -55,9 +58,14 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
 (define-public librecad
@@ -562,3 +570,84 @@ fundamental, primitive shapes are represented as code in the user-level
 language.")
       (license (list license:lgpl2.1+             ;library
                      license:gpl2+)))))           ;Guile bindings
+
+;; We use kicad from a git commit, because support for boost 1.61.0
+;; has been recently added.
+(define-public kicad
+  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
+        (hash "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
+    (package
+      (name "kicad")
+      (version (string-append "4.0-" (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.launchpad.net/kicad.git")
+               (commit commit)))
+         (sha256
+          (base32 hash))
+         (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:configure-flags
+           (list "-DKICAD_STABLE_VERSION=ON"
+                 "-DKICAD_REPO_NAME=stable"
+                 "-DKICAD_BUILD_VERSION=4.0"
+                 "-DCMAKE_BUILD_TYPE=Release"
+                 "-DKICAD_SKIP_BOOST=ON"
+                 "-DKICAD_SCRIPTING=ON"
+                 "-DKICAD_SCRIPTING_MODULES=ON"
+                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
+                 ;; Has to be set explicitely, as we don't have the wxPython
+                 ;; headers in the wxwidgets store item, but in wxPython.
+                 (string-append "-DCMAKE_CXX_FLAGS=-I"
+                                (assoc-ref %build-inputs "wxpython")
+                                "/include/wx-3.0")
+                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+                 "-DBUILD_GITHUB_PLUGIN=OFF")
+           #:phases
+             (modify-phases %standard-phases
+               (add-after 'install 'wrap-program ;;Ensure correct python at runtime
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (python (assoc-ref inputs "python"))
+                                   (file (string-append out "/bin/kicad"))
+                                   (path (string-append
+                                          out
+                                          "/lib/python2.7/site-packages:"
+                                          (getenv "PYTHONPATH"))))
+                              (wrap-program file
+                                `("PYTHONPATH" ":" prefix (,path))
+                                `("PATH" ":" prefix
+                                  (,(string-append python "/bin:")))))
+                            #t)))))
+      (native-inputs
+       `(("boost" ,boost)
+         ("gettext" ,gnu-gettext)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)
+         ("zlib" ,zlib)))
+      (inputs
+       `(("cairo" ,cairo)
+         ("curl" ,curl)
+         ("desktop-file-utils" ,desktop-file-utils)
+         ("glew" ,glew)
+         ("glm" ,glm)
+         ("hicolor-icon-theme" ,hicolor-icon-theme)
+         ("libsm" ,libsm)
+         ("mesa" ,mesa)
+         ("openssl" ,openssl)
+         ("python" ,python-2)
+         ("wxwidgets" ,wxwidgets-gtk2)
+         ("wxpython" ,python2-wxpython)))
+      (home-page "http://http://kicad-pcb.org/")
+      (synopsis "Electronics Design Automation Suite")
+      (description
+       "Kicad is created for the formation of printed circuit boards and electrical circuits.
+ The software has a number of programs that perform specific functions, for example,
+ pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
+ files) and others. ")
+      (license license:gpl3+))))
-- 
2.10.1

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

* Re: [PATCH 3/3] gnu: Add kicad.
  2016-10-24 21:16 ` [PATCH 3/3] gnu: Add kicad Theodoros Foradis
@ 2016-10-25  0:36   ` Leo Famulari
  2016-10-25  0:41     ` Leo Famulari
  2016-10-25 12:48   ` Leo Famulari
  1 sibling, 1 reply; 47+ messages in thread
From: Leo Famulari @ 2016-10-25  0:36 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 12:16:58AM +0300, Theodoros Foradis wrote:
> * gnu/packages/engineering.scm (kicad): New variable.

Cool!

> +;; We use kicad from a git commit, because support for boost 1.61.0
> +;; has been recently added.
> +(define-public kicad
> +  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
> +        (hash "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
> +    (package
> +      (name "kicad")
> +      (version (string-append "4.0-" (string-take commit 7)))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://git.launchpad.net/kicad.git")
> +               (commit commit)))

It fails to download the source:

@ build-started /gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv - x86_64-linux /var/log/guix/drvs/z0//771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv.bz2
Cloning into '/gnu/store/dr3kdxp4x9k1s7b40h18xr9lwg320n18-kicad-4.0-4ee344e-checkout'...
fatal: could not read Username for 'https://git.launchpad.net': No such device or address
environment variable `PATH' unset
builder for `/gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv' failed to produce output path `/gnu/store/dr3kdxp4x9k1s7b40h18xr9lwg320n18-kicad-4.0-4ee344e-checkout'
@ build-failed /gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv - 1 builder for `/gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv' failed to produce output path `/gnu/store/dr3kdxp4x9k1s7b40h18xr9lwg320n18-kicad-4.0-4ee344e-checkout'
cannot build derivation `/gnu/store/4903qvi3iaywzyxdlw5rky7s8ydva6bb-kicad-4.0-4ee344e.drv': 1 dependencies couldn't be built
guix build: error: build failed: build of `/gnu/store/4903qvi3iaywzyxdlw5rky7s8ydva6bb-kicad-4.0-4ee344e.drv' failed

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

* Re: [PATCH 3/3] gnu: Add kicad.
  2016-10-25  0:36   ` Leo Famulari
@ 2016-10-25  0:41     ` Leo Famulari
  2016-10-25  8:11       ` Theodoros Foradis
  0 siblings, 1 reply; 47+ messages in thread
From: Leo Famulari @ 2016-10-25  0:41 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Mon, Oct 24, 2016 at 08:36:10PM -0400, Leo Famulari wrote:
> On Tue, Oct 25, 2016 at 12:16:58AM +0300, Theodoros Foradis wrote:
> > * gnu/packages/engineering.scm (kicad): New variable.

> > +         (uri (git-reference
> > +               (url "https://git.launchpad.net/kicad.git")
> > +               (commit commit)))
> 
> It fails to download the source:
> 
> @ build-started /gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv - x86_64-linux /var/log/guix/drvs/z0//771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv.bz2
> Cloning into '/gnu/store/dr3kdxp4x9k1s7b40h18xr9lwg320n18-kicad-4.0-4ee344e-checkout'...
> fatal: could not read Username for 'https://git.launchpad.net': No such device or address

If looks like the correct URL is <https://git.launchpad.net/kicad>,
without the '.git' suffix. The source is downloading with that change.

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

* Re: [PATCH 3/3] gnu: Add kicad.
  2016-10-25  0:41     ` Leo Famulari
@ 2016-10-25  8:11       ` Theodoros Foradis
  0 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25  8:11 UTC (permalink / raw)
  To: Guix-devel


Leo Famulari writes:

> On Mon, Oct 24, 2016 at 08:36:10PM -0400, Leo Famulari wrote:
>> On Tue, Oct 25, 2016 at 12:16:58AM +0300, Theodoros Foradis wrote:
>> > * gnu/packages/engineering.scm (kicad): New variable.
>
>> > +         (uri (git-reference
>> > +               (url "https://git.launchpad.net/kicad.git")
>> > +               (commit commit)))
>> 
>> It fails to download the source:
>> 
>> @ build-started /gnu/store/z0771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv - x86_64-linux /var/log/guix/drvs/z0//771x4jjkcwd1qpak7c5z8n576mifi6-kicad-4.0-4ee344e-checkout.drv.bz2
>> Cloning into '/gnu/store/dr3kdxp4x9k1s7b40h18xr9lwg320n18-kicad-4.0-4ee344e-checkout'...
>> fatal: could not read Username for 'https://git.launchpad.net': No such device or address
>
> If looks like the correct URL is <https://git.launchpad.net/kicad>,
> without the '.git' suffix. The source is downloading with that change.

Thanks for the correction. I added the suffix after I had already
downloaded the source derivation, and it did not output any error in
subsequent builds.
-- 
Theodoros Foradis

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

* Re: [PATCH 2/3] gnu: Add python2-wxpython.
  2016-10-24 21:16 ` [PATCH 2/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25  8:32   ` Hartmut Goebel
  2016-10-25  9:58     ` Theodoros Foradis
  2016-10-25 16:20   ` Efraim Flashner
  1 sibling, 1 reply; 47+ messages in thread
From: Hartmut Goebel @ 2016-10-25  8:32 UTC (permalink / raw)
  To: guix-devel

Am 24.10.2016 um 23:16 schrieb Theodoros Foradis:
> +         (replace 'build
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (zero?
> +              (system* "python" "setup.py" "WXPORT=gtk2" "UNICODE=1" "build")))))))

Please set argument #:make-flags instread of calling setup.yp yourself.
This will break with the upcoming change of the python build system.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH 2/3] gnu: Add python2-wxpython.
  2016-10-25  8:32   ` Hartmut Goebel
@ 2016-10-25  9:58     ` Theodoros Foradis
  0 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25  9:58 UTC (permalink / raw)
  To: guix-devel


Hartmut Goebel writes:

> Am 24.10.2016 um 23:16 schrieb Theodoros Foradis:
>> +         (replace 'build
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (zero?
>> +              (system* "python" "setup.py" "WXPORT=gtk2" "UNICODE=1" "build")))))))
>
> Please set argument #:make-flags instread of calling setup.yp yourself.
> This will break with the upcoming change of the python build system.

Thanks for the hint. I will wait for more input on possible mistakes,
and post a revised patch series, including this change.
-- 
Theodoros Foradis

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

* Re: [PATCH 3/3] gnu: Add kicad.
  2016-10-24 21:16 ` [PATCH 3/3] gnu: Add kicad Theodoros Foradis
  2016-10-25  0:36   ` Leo Famulari
@ 2016-10-25 12:48   ` Leo Famulari
  2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
  1 sibling, 1 reply; 47+ messages in thread
From: Leo Famulari @ 2016-10-25 12:48 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 12:16:58AM +0300, Theodoros Foradis wrote:
> * gnu/packages/engineering.scm (kicad): New variable.

I'm very happy to see this package almost there!

> +;; We use kicad from a git commit, because support for boost 1.61.0
> +;; has been recently added.
> +(define-public kicad
> +  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
> +        (hash "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))

I'd put the source hash in the "normal" place unless it's used later in
the package.

> +    (package
> +      (name "kicad")
> +      (version (string-append "4.0-" (string-take commit 7)))

Please make the version string with a revision number, as shown in the
manual section 7.6.3 Version Numbers. Otherwise, if we update our 4.0
Git-based package, users might not be able to upgrade with `guix package
-u`, since the Git hash not does not increase or decrease reliably.

> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://git.launchpad.net/kicad.git")
> +               (commit commit)))
> +         (sha256
> +          (base32 hash))
> +         (file-name (string-append name "-" version "-checkout"))))
> +      (build-system cmake-build-system)
> +      (arguments
> +       `(#:out-of-source? #t
> +         #:tests? #f ; no tests
> +         #:configure-flags
> +           (list "-DKICAD_STABLE_VERSION=ON"
> +                 "-DKICAD_REPO_NAME=stable"
> +                 "-DKICAD_BUILD_VERSION=4.0"
> +                 "-DCMAKE_BUILD_TYPE=Release"
> +                 "-DKICAD_SKIP_BOOST=ON"

Can you add a comment explaining this flag?

> +                 "-DKICAD_SCRIPTING=ON"
> +                 "-DKICAD_SCRIPTING_MODULES=ON"
> +                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
> +                 ;; Has to be set explicitely, as we don't have the wxPython
> +                 ;; headers in the wxwidgets store item, but in wxPython.
> +                 (string-append "-DCMAKE_CXX_FLAGS=-I"
> +                                (assoc-ref %build-inputs "wxpython")
> +                                "/include/wx-3.0")
> +                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
> +                 "-DBUILD_GITHUB_PLUGIN=OFF")
> +           #:phases
> +             (modify-phases %standard-phases
> +               (add-after 'install 'wrap-program ;;Ensure correct python at runtime
> +                          (lambda* (#:key inputs outputs #:allow-other-keys)
> +                            (let* ((out (assoc-ref outputs "out"))
> +                                   (python (assoc-ref inputs "python"))
> +                                   (file (string-append out "/bin/kicad"))
> +                                   (path (string-append
> +                                          out
> +                                          "/lib/python2.7/site-packages:"
> +                                          (getenv "PYTHONPATH"))))
> +                              (wrap-program file
> +                                `("PYTHONPATH" ":" prefix (,path))
> +                                `("PATH" ":" prefix
> +                                  (,(string-append python "/bin:")))))
> +                            #t)))))
> +      (native-inputs
> +       `(("boost" ,boost)
> +         ("gettext" ,gnu-gettext)
> +         ("pkg-config" ,pkg-config)
> +         ("swig" ,swig)
> +         ("zlib" ,zlib)))
> +      (inputs
> +       `(("cairo" ,cairo)
> +         ("curl" ,curl)
> +         ("desktop-file-utils" ,desktop-file-utils)
> +         ("glew" ,glew)
> +         ("glm" ,glm)
> +         ("hicolor-icon-theme" ,hicolor-icon-theme)
> +         ("libsm" ,libsm)
> +         ("mesa" ,mesa)
> +         ("openssl" ,openssl)
> +         ("python" ,python-2)
> +         ("wxwidgets" ,wxwidgets-gtk2)
> +         ("wxpython" ,python2-wxpython)))

Can you check what packages the output refers to, using `guix gc
--references $(./pre-inst-env guix build kicad)`?

Some of the 'inputs' are not referenced, and so they will be garbage
collected when the user does `guix gc`, breaking the installed package.
I'm not sure exactly how to fix that here. Does anyone have advice?

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

* [PATCH v2 0/3] gnu: Add kicad.
  2016-10-25 12:48   ` Leo Famulari
@ 2016-10-25 16:09     ` Theodoros Foradis
  2016-10-25 16:09       ` [PATCH v2 1/3] gnu: Add python2-wxpython Theodoros Foradis
                         ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:09 UTC (permalink / raw)
  To: guix-devel


Leo Famulari writes:

> On Tue, Oct 25, 2016 at 12:16:58AM +0300, Theodoros Foradis wrote:
>> * gnu/packages/engineering.scm (kicad): New variable.
>
> I'm very happy to see this package almost there!
>
>> +;; We use kicad from a git commit, because support for boost 1.61.0
>> +;; has been recently added.
>> +(define-public kicad
>> +  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
>> +        (hash "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
>
> I'd put the source hash in the "normal" place unless it's used later in
> the package.

>

fixed

>> +    (package
>> +      (name "kicad")
>> +      (version (string-append "4.0-" (string-take commit 7)))
>

fixed

> Please make the version string with a revision number, as shown in the
> manual section 7.6.3 Version Numbers. Otherwise, if we update our 4.0
> Git-based package, users might not be able to upgrade with `guix package
> -u`, since the Git hash not does not increase or decrease reliably.
>
>> +      (source
>> +       (origin
>> +         (method git-fetch)
>> +         (uri (git-reference
>> +               (url "https://git.launchpad.net/kicad.git")
>> +               (commit commit)))
>> +         (sha256
>> +          (base32 hash))
>> +         (file-name (string-append name "-" version "-checkout"))))
>> +      (build-system cmake-build-system)
>> +      (arguments
>> +       `(#:out-of-source? #t
>> +         #:tests? #f ; no tests
>> +         #:configure-flags
>> +           (list "-DKICAD_STABLE_VERSION=ON"
>> +                 "-DKICAD_REPO_NAME=stable"
>> +                 "-DKICAD_BUILD_VERSION=4.0"
>> +                 "-DCMAKE_BUILD_TYPE=Release"
>> +                 "-DKICAD_SKIP_BOOST=ON"
>
> Can you add a comment explaining this flag?
>

comment added

>> +                 "-DKICAD_SCRIPTING=ON"
>> +                 "-DKICAD_SCRIPTING_MODULES=ON"
>> +                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
>> +                 ;; Has to be set explicitely, as we don't have the wxPython
>> +                 ;; headers in the wxwidgets store item, but in wxPython.
>> +                 (string-append "-DCMAKE_CXX_FLAGS=-I"
>> +                                (assoc-ref %build-inputs "wxpython")
>> +                                "/include/wx-3.0")
>> +                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
>> +                 "-DBUILD_GITHUB_PLUGIN=OFF")
>> +           #:phases
>> +             (modify-phases %standard-phases
>> +               (add-after 'install 'wrap-program ;;Ensure correct python at runtime
>> +                          (lambda* (#:key inputs outputs #:allow-other-keys)
>> +                            (let* ((out (assoc-ref outputs "out"))
>> +                                   (python (assoc-ref inputs "python"))
>> +                                   (file (string-append out "/bin/kicad"))
>> +                                   (path (string-append
>> +                                          out
>> +                                          "/lib/python2.7/site-packages:"
>> +                                          (getenv "PYTHONPATH"))))
>> +                              (wrap-program file
>> +                                `("PYTHONPATH" ":" prefix (,path))
>> +                                `("PATH" ":" prefix
>> +                                  (,(string-append python "/bin:")))))
>> +                            #t)))))
>> +      (native-inputs
>> +       `(("boost" ,boost)
>> +         ("gettext" ,gnu-gettext)
>> +         ("pkg-config" ,pkg-config)
>> +         ("swig" ,swig)
>> +         ("zlib" ,zlib)))
>> +      (inputs
>> +       `(("cairo" ,cairo)
>> +         ("curl" ,curl)
>> +         ("desktop-file-utils" ,desktop-file-utils)
>> +         ("glew" ,glew)
>> +         ("glm" ,glm)
>> +         ("hicolor-icon-theme" ,hicolor-icon-theme)
>> +         ("libsm" ,libsm)
>> +         ("mesa" ,mesa)
>> +         ("openssl" ,openssl)
>> +         ("python" ,python-2)
>> +         ("wxwidgets" ,wxwidgets-gtk2)
>> +         ("wxpython" ,python2-wxpython)))
>
> Can you check what packages the output refers to, using `guix gc
> --references $(./pre-inst-env guix build kicad)`?
>
> Some of the 'inputs' are not referenced, and so they will be garbage
> collected when the user does `guix gc`, breaking the installed package.
> I'm not sure exactly how to fix that here. Does anyone have advice?

Using `guix gc --references $(./pre-inst-env guix build kicad)` gives me:
/gnu/store/15108s447dw871hipsy4d5ymj8l4pg9s-wxwidgets-gtk2-3.0.2
/gnu/store/1xfc2pwr7qfjib9kfy3n2hjq56z7jyjx-python-2.7.11
/gnu/store/7nvkh8bb24nlw5ayyz5z292vxqsm38ci-glu-9.0.0
/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib
/gnu/store/fjqm9am7np8dkm30kcgf7d84w4walhv5-glew-2.0.0
/gnu/store/gzcf89jjza5m836sycvi8rvqrjx5dfgc-cairo-1.14.6
/gnu/store/lwa2zd7hcii3b870lp4qm44mzckqnrik-python2-wxpython-3.0.2.0
/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23
/gnu/store/mcnhg4zdfvp50xwlyiq7c1731bjnrjb8-kicad-4.0-1.4ee344e
/gnu/store/r837zajjc1q8z9hph4b6860a9c05blyy-openssl-1.0.2j
/gnu/store/wzbjwqgdl2cn7az984349x7pqh6pkw1y-boost-1.61.0
/gnu/store/x98d057wl2krpja1bvwpi9qbsxjf8n71-glm-0.9.6.3
/gnu/store/xzx126zvlvy3jaj020sdkq9jpxbf04ap-mesa-11.0.9
/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42

Maybe the other inputs are not runtime dependencies? Not sure of this one.

I also got rid of replacing the build phase, as Hartmut Goebel
suggested, for compatibility with the upcoming python build system.

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

* [PATCH v2 1/3] gnu: Add python2-wxpython.
  2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
@ 2016-10-25 16:09       ` Theodoros Foradis
  2016-10-25 16:32         ` Leo Famulari
  2016-10-25 16:09       ` [PATCH v2 2/3] gnu: Add kicad Theodoros Foradis
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:09 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..e09d813 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,87 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "src/expat")
+                  (delete-file-recursively "src/jpeg")
+                  (delete-file-recursively "src/png")
+                  (delete-file-recursively "src/tiff")
+                  (delete-file-recursively "src/zlib")
+                  (delete-file-recursively "src/msw")
+                  (delete-file-recursively "src/osx")
+                  (delete-file-recursively "src/msdos")
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (setenv "CPPFLAGS" (string-append "-I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/lib/wx/include/gtk2-unicode-release-2.8"
+                                               " -I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/include/wx-3.0"
+                                               " -D_FILE_OFFSET_BITS=64"
+                                               " -DWXUSINGDLL"
+                                               " -D__WXGTK__"))))
+         (replace 'build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (zero?
+              (system* "python" "setup.py" "WXPORT=gtk2" "UNICODE=1" "build")))))))
+    (native-inputs
+     `(("gtk+" ,gtk+-2)
+       ("expat" ,expat)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libtiff" ,libtiff)
+       ("libsm" ,libsm)
+       ("libx11" ,libx11)
+       ("mesa" ,mesa)
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)
+       ("zlib" ,zlib)))
+    (inputs
+     `(("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* [PATCH v2 2/3] gnu: Add kicad.
  2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
  2016-10-25 16:09       ` [PATCH v2 1/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25 16:09       ` Theodoros Foradis
  2016-10-25 16:09       ` [PATCH v2 3/3] gnu: Add python2-wxpython Theodoros Foradis
  2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
  3 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:09 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad): New variable.
---
 gnu/packages/engineering.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 829ceb0..e5a48fc 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
@@ -39,6 +41,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
@@ -55,9 +58,14 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
 (define-public librecad
@@ -562,3 +570,84 @@ fundamental, primitive shapes are represented as code in the user-level
 language.")
       (license (list license:lgpl2.1+             ;library
                      license:gpl2+)))))           ;Guile bindings
+
+;; We use kicad from a git commit, because support for boost 1.61.0
+;; has been recently added.
+(define-public kicad
+  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
+        (hash "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
+    (package
+      (name "kicad")
+      (version (string-append "4.0-" (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.launchpad.net/kicad.git")
+               (commit commit)))
+         (sha256
+          (base32 hash))
+         (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:configure-flags
+           (list "-DKICAD_STABLE_VERSION=ON"
+                 "-DKICAD_REPO_NAME=stable"
+                 "-DKICAD_BUILD_VERSION=4.0"
+                 "-DCMAKE_BUILD_TYPE=Release"
+                 "-DKICAD_SKIP_BOOST=ON"
+                 "-DKICAD_SCRIPTING=ON"
+                 "-DKICAD_SCRIPTING_MODULES=ON"
+                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
+                 ;; Has to be set explicitely, as we don't have the wxPython
+                 ;; headers in the wxwidgets store item, but in wxPython.
+                 (string-append "-DCMAKE_CXX_FLAGS=-I"
+                                (assoc-ref %build-inputs "wxpython")
+                                "/include/wx-3.0")
+                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+                 "-DBUILD_GITHUB_PLUGIN=OFF")
+           #:phases
+             (modify-phases %standard-phases
+               (add-after 'install 'wrap-program ;;Ensure correct python at runtime
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (python (assoc-ref inputs "python"))
+                                   (file (string-append out "/bin/kicad"))
+                                   (path (string-append
+                                          out
+                                          "/lib/python2.7/site-packages:"
+                                          (getenv "PYTHONPATH"))))
+                              (wrap-program file
+                                `("PYTHONPATH" ":" prefix (,path))
+                                `("PATH" ":" prefix
+                                  (,(string-append python "/bin:")))))
+                            #t)))))
+      (native-inputs
+       `(("boost" ,boost)
+         ("gettext" ,gnu-gettext)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)
+         ("zlib" ,zlib)))
+      (inputs
+       `(("cairo" ,cairo)
+         ("curl" ,curl)
+         ("desktop-file-utils" ,desktop-file-utils)
+         ("glew" ,glew)
+         ("glm" ,glm)
+         ("hicolor-icon-theme" ,hicolor-icon-theme)
+         ("libsm" ,libsm)
+         ("mesa" ,mesa)
+         ("openssl" ,openssl)
+         ("python" ,python-2)
+         ("wxwidgets" ,wxwidgets-gtk2)
+         ("wxpython" ,python2-wxpython)))
+      (home-page "http://http://kicad-pcb.org/")
+      (synopsis "Electronics Design Automation Suite")
+      (description
+       "Kicad is created for the formation of printed circuit boards and electrical circuits.
+ The software has a number of programs that perform specific functions, for example,
+ pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
+ files) and others. ")
+      (license license:gpl3+))))
-- 
2.10.1

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

* [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
  2016-10-25 16:09       ` [PATCH v2 1/3] gnu: Add python2-wxpython Theodoros Foradis
  2016-10-25 16:09       ` [PATCH v2 2/3] gnu: Add kicad Theodoros Foradis
@ 2016-10-25 16:09       ` Theodoros Foradis
  2016-10-25 16:35         ` Leo Famulari
  2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
  3 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:09 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 84 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..0002b73 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,83 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "src/expat")
+                  (delete-file-recursively "src/jpeg")
+                  (delete-file-recursively "src/png")
+                  (delete-file-recursively "src/tiff")
+                  (delete-file-recursively "src/zlib")
+                  (delete-file-recursively "src/msw")
+                  (delete-file-recursively "src/osx")
+                  (delete-file-recursively "src/msdos")
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (setenv "CPPFLAGS" (string-append "-I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/lib/wx/include/gtk2-unicode-release-2.8"
+                                               " -I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/include/wx-3.0"
+                                               " -D_FILE_OFFSET_BITS=64"
+                                               " -DWXUSINGDLL"
+                                               " -D__WXGTK__")))))))
+    (native-inputs
+     `(("gtk+" ,gtk+-2)
+       ("expat" ,expat)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libtiff" ,libtiff)
+       ("libsm" ,libsm)
+       ("libx11" ,libx11)
+       ("mesa" ,mesa)
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)
+       ("zlib" ,zlib)))
+    (inputs
+     `(("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* Re: [PATCH 2/3] gnu: Add python2-wxpython.
  2016-10-24 21:16 ` [PATCH 2/3] gnu: Add python2-wxpython Theodoros Foradis
  2016-10-25  8:32   ` Hartmut Goebel
@ 2016-10-25 16:20   ` Efraim Flashner
  1 sibling, 0 replies; 47+ messages in thread
From: Efraim Flashner @ 2016-10-25 16:20 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

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

On Tue, Oct 25, 2016 at 12:16:57AM +0300, Theodoros Foradis wrote:
> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
> ---
>  gnu/packages/wxwidgets.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
> 
> diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
> index 4efe7a1..e09d813 100644
> --- a/gnu/packages/wxwidgets.scm
> +++ b/gnu/packages/wxwidgets.scm
> @@ -2,6 +2,7 @@
>  ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
>  ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>  ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
> +;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -23,6 +24,7 @@
>    #:use-module (guix download)
>    #:use-module ((guix licenses) #:prefix l:)
>    #:use-module (guix build-system glib-or-gtk)
> +  #:use-module (guix build-system python)
>    #:use-module (guix build utils)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages compression)
> @@ -32,8 +34,10 @@
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages python)
>    #:use-module (gnu packages sdl)
>    #:use-module (gnu packages webkit)
> +  #:use-module (gnu packages xml)
>    #:use-module (gnu packages xorg))
>  
>  (define-public wxwidgets
> @@ -118,3 +122,87 @@ and many other languages.")
>                          "gtk+"
>                          (package-inputs wxwidgets))))
>             (name "wxwidgets-gtk2")))
> +
> +(define-public python2-wxpython
> +  (package
> +    (name "python2-wxpython")
> +    (version "3.0.2.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
> +                                  version "/wxPython-src-" version ".tar.bz2"))
> +              (sha256
> +               (base32
> +                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               '(begin
> +                  (delete-file-recursively "src/expat")
> +                  (delete-file-recursively "src/jpeg")
> +                  (delete-file-recursively "src/png")
> +                  (delete-file-recursively "src/tiff")
> +                  (delete-file-recursively "src/zlib")
> +                  (delete-file-recursively "src/msw")
> +                  (delete-file-recursively "src/osx")
> +                  (delete-file-recursively "src/msdos")
> +                  (substitute* '("wxPython/setup.py")

I would change this to (untested)
                (lambda (folder)
                  (delete-file-recursively (string-append "src/" folder))
                  '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))

> +                    ;; setup.py tries to keep its own license the same as wxwidget's
> +                    ;; license (which it expects under $WXWIN/docs).
> +                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
> +                    )))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:python ,python-2
> +       #:tests? #f ; tests fail
> +       #:configure-flags (list "WXPORT=gtk2"
> +                               "UNICODE=1")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build 'chdir
> +           (lambda _
> +             (chdir "wxPython")))

            this should return #t

> +         (add-after 'chdir 'set-wx-out-dir
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             ;; By default, install phase tries to copy the wxPython headers in
> +             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
> +             ;; to the output directory by setting WXPREFIX.
> +             (substitute* "config.py"
> +               (("= getWxConfigValue\\('--prefix'\\)")
> +                (string-append "= '" (assoc-ref outputs "out") "'")))
> +             (substitute* "wx/build/config.py"
> +               (("= getWxConfigValue\\('--prefix'\\)")
> +                (string-append "= '" (assoc-ref outputs "out") "'")))))

            also return true

> +         (add-after 'set-wx-out-dir 'setenv
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
> +             (setenv "CPPFLAGS" (string-append "-I"
> +                                               (assoc-ref inputs "wxwidgets")
> +                                               "/lib/wx/include/gtk2-unicode-release-2.8"
> +                                               " -I"
> +                                               (assoc-ref inputs "wxwidgets")
> +                                               "/include/wx-3.0"
> +                                               " -D_FILE_OFFSET_BITS=64"
> +                                               " -DWXUSINGDLL"
> +                                               " -D__WXGTK__"))))

            and this one

> +         (replace 'build
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (zero?
> +              (system* "python" "setup.py" "WXPORT=gtk2" "UNICODE=1" "build")))))))
> +    (native-inputs
> +     `(("gtk+" ,gtk+-2)
> +       ("expat" ,expat)
> +       ("libjpeg" ,libjpeg)
> +       ("libpng" ,libpng)
> +       ("libtiff" ,libtiff)
> +       ("libsm" ,libsm)
> +       ("libx11" ,libx11)
> +       ("mesa" ,mesa)
> +       ("pkg-config" ,pkg-config)
> +       ("python2-setuptools" ,python2-setuptools)
> +       ("zlib" ,zlib)))
> +    (inputs
> +     `(("wxwidgets" ,wxwidgets-gtk2)))
> +    (synopsis "Python2 Bindings for wxWidgets")
> +    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
> +    (home-page "http://wxpython.org/")
> +    (license (package-license wxwidgets))))
> -- 
> 2.10.1
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

* Re: [PATCH v2 1/3] gnu: Add python2-wxpython.
  2016-10-25 16:09       ` [PATCH v2 1/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25 16:32         ` Leo Famulari
  0 siblings, 0 replies; 47+ messages in thread
From: Leo Famulari @ 2016-10-25 16:32 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 07:09:05PM +0300, Theodoros Foradis wrote:
> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.

v2 of this patch series seems mixed up. 1/3 and 3/3 are the same patch
and there is no patch adding wxwidgets-gtk2.

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 16:09       ` [PATCH v2 3/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25 16:35         ` Leo Famulari
  2016-10-25 17:13           ` Theodoros Foradis
  2016-10-25 18:05           ` Theodoros Foradis
  0 siblings, 2 replies; 47+ messages in thread
From: Leo Famulari @ 2016-10-25 16:35 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 07:09:07PM +0300, Theodoros Foradis wrote:
> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.

> +       #:tests? #f ; tests fail

We should try to fix this, or at least understand why they are failing.

> +    (native-inputs
> +     `(("gtk+" ,gtk+-2)
> +       ("expat" ,expat)
> +       ("libjpeg" ,libjpeg)
> +       ("libpng" ,libpng)
> +       ("libtiff" ,libtiff)
> +       ("libsm" ,libsm)
> +       ("libx11" ,libx11)
> +       ("mesa" ,mesa)
> +       ("pkg-config" ,pkg-config)
> +       ("python2-setuptools" ,python2-setuptools)
> +       ("zlib" ,zlib)))

To clarify, all these native-inputs are only used while building?
Native inputs typically are not intended to be available once the
package has been built and installed.

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

* [PATCH v3 0/3] gnu: Add kicad.
  2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
                         ` (2 preceding siblings ...)
  2016-10-25 16:09       ` [PATCH v2 3/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25 16:59       ` Theodoros Foradis
  2016-10-25 16:59         ` [PATCH v3 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
                           ` (2 more replies)
  3 siblings, 3 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:59 UTC (permalink / raw)
  To: guix-devel

Patch v2 series was a mistake. This one can be applied on master. My comments on v2,
apply on this patch series. Also, I made the changes that Efraim Flashner proposed.

Excuse me for the spam.

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

* [PATCH v3 1/3] gnu: Add wxwidgets-gtk2.
  2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
@ 2016-10-25 16:59         ` Theodoros Foradis
  2016-11-02  8:15           ` Danny Milosavljevic
  2016-10-25 17:00         ` [PATCH v3 2/2] gnu: Add python2-wxpython Theodoros Foradis
  2016-10-25 17:00         ` [PATCH v3 3/3] gnu: Add kicad Theodoros Foradis
  2 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 16:59 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (wxwidgets-gtk2): New variable.
---
 gnu/packages/wxwidgets.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 31da2a9..4efe7a1 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -109,3 +110,11 @@ and many other languages.")
                             (assoc-ref %outputs "out") "/lib"))
        ;; No 'check' target.
        #:tests? #f))))
+
+(define-public wxwidgets-gtk2
+  (package (inherit wxwidgets)
+           (inputs `(("gtk+" ,gtk+-2)
+                     ,@(alist-delete
+                        "gtk+"
+                        (package-inputs wxwidgets))))
+           (name "wxwidgets-gtk2")))
-- 
2.10.1

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

* [PATCH v3 2/2] gnu: Add python2-wxpython.
  2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
  2016-10-25 16:59         ` [PATCH v3 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-10-25 17:00         ` Theodoros Foradis
  2016-11-02  7:57           ` Danny Milosavljevic
  2016-10-25 17:00         ` [PATCH v3 3/3] gnu: Add kicad Theodoros Foradis
  2 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 17:00 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 82 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..07f0d7b 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,81 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (lambda (folder)
+                    (delete-file-recursively (string-append "src/" folder))
+                    '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")
+             #t))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             #t))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (setenv "CPPFLAGS" (string-append "-I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/lib/wx/include/gtk2-unicode-release-2.8"
+                                               " -I"
+                                               (assoc-ref inputs "wxwidgets")
+                                               "/include/wx-3.0"
+                                               " -D_FILE_OFFSET_BITS=64"
+                                               " -DWXUSINGDLL"
+                                               " -D__WXGTK__"))
+             #t)))))
+    (native-inputs
+     `(("gtk+" ,gtk+-2)
+       ("expat" ,expat)
+       ("libjpeg" ,libjpeg)
+       ("libpng" ,libpng)
+       ("libtiff" ,libtiff)
+       ("libsm" ,libsm)
+       ("libx11" ,libx11)
+       ("mesa" ,mesa)
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)
+       ("zlib" ,zlib)))
+    (inputs
+     `(("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* [PATCH v3 3/3] gnu: Add kicad.
  2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
  2016-10-25 16:59         ` [PATCH v3 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-10-25 17:00         ` [PATCH v3 2/2] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-10-25 17:00         ` Theodoros Foradis
  2016-10-30  0:18           ` Leo Famulari
  2 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 17:00 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad): New variable.
---
 gnu/packages/engineering.scm | 90 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 829ceb0..7ecd64e 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
@@ -39,6 +41,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
@@ -55,9 +58,14 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
 (define-public librecad
@@ -562,3 +570,85 @@ fundamental, primitive shapes are represented as code in the user-level
 language.")
       (license (list license:lgpl2.1+             ;library
                      license:gpl2+)))))           ;Guile bindings
+
+;; We use kicad from a git commit, because support for boost 1.61.0
+;; has been recently added.
+(define-public kicad
+  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
+        (revision "1"))
+    (package
+      (name "kicad")
+      (version (string-append "4.0-" revision "."
+                              (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.launchpad.net/kicad.git")
+               (commit commit)))
+         (sha256
+          (base32 "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
+         (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:configure-flags
+           (list "-DKICAD_STABLE_VERSION=ON"
+                 "-DKICAD_REPO_NAME=stable"
+                 "-DKICAD_BUILD_VERSION=4.0"
+                 "-DCMAKE_BUILD_TYPE=Release"
+                 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library
+                 "-DKICAD_SCRIPTING=ON"
+                 "-DKICAD_SCRIPTING_MODULES=ON"
+                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
+                 ;; Has to be set explicitely, as we don't have the wxPython
+                 ;; headers in the wxwidgets store item, but in wxPython.
+                 (string-append "-DCMAKE_CXX_FLAGS=-I"
+                                (assoc-ref %build-inputs "wxpython")
+                                "/include/wx-3.0")
+                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+                 "-DBUILD_GITHUB_PLUGIN=OFF")
+           #:phases
+             (modify-phases %standard-phases
+               (add-after 'install 'wrap-program ;;Ensure correct python at runtime
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (python (assoc-ref inputs "python"))
+                                   (file (string-append out "/bin/kicad"))
+                                   (path (string-append
+                                          out
+                                          "/lib/python2.7/site-packages:"
+                                          (getenv "PYTHONPATH"))))
+                              (wrap-program file
+                                `("PYTHONPATH" ":" prefix (,path))
+                                `("PATH" ":" prefix
+                                  (,(string-append python "/bin:")))))
+                            #t)))))
+      (native-inputs
+       `(("boost" ,boost)
+         ("gettext" ,gnu-gettext)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)
+         ("zlib" ,zlib)))
+      (inputs
+       `(("cairo" ,cairo)
+         ("curl" ,curl)
+         ("desktop-file-utils" ,desktop-file-utils)
+         ("glew" ,glew)
+         ("glm" ,glm)
+         ("hicolor-icon-theme" ,hicolor-icon-theme)
+         ("libsm" ,libsm)
+         ("mesa" ,mesa)
+         ("openssl" ,openssl)
+         ("python" ,python-2)
+         ("wxwidgets" ,wxwidgets-gtk2)
+         ("wxpython" ,python2-wxpython)))
+      (home-page "http://http://kicad-pcb.org/")
+      (synopsis "Electronics Design Automation Suite")
+      (description
+       "Kicad is created for the formation of printed circuit boards and electrical circuits.
+ The software has a number of programs that perform specific functions, for example,
+ pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
+ files) and others. ")
+      (license license:gpl3+))))
-- 
2.10.1

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 16:35         ` Leo Famulari
@ 2016-10-25 17:13           ` Theodoros Foradis
  2016-10-30  0:13             ` Leo Famulari
  2016-10-25 18:05           ` Theodoros Foradis
  1 sibling, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 17:13 UTC (permalink / raw)
  To: guix-devel


Leo Famulari writes:

> On Tue, Oct 25, 2016 at 07:09:07PM +0300, Theodoros Foradis wrote:
>> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
>
>> +       #:tests? #f ; tests fail
>

I'll try to give this one a second look.

> We should try to fix this, or at least understand why they are failing.
>
>> +    (native-inputs
>> +     `(("gtk+" ,gtk+-2)
>> +       ("expat" ,expat)
>> +       ("libjpeg" ,libjpeg)
>> +       ("libpng" ,libpng)
>> +       ("libtiff" ,libtiff)
>> +       ("libsm" ,libsm)
>> +       ("libx11" ,libx11)
>> +       ("mesa" ,mesa)
>> +       ("pkg-config" ,pkg-config)
>> +       ("python2-setuptools" ,python2-setuptools)
>> +       ("zlib" ,zlib)))
>
> To clarify, all these native-inputs are only used while building?
> Native inputs typically are not intended to be available once the
> package has been built and installed.

To quote Danny Milosavljevic, whose original patch of python2-wxpython I
modified:
> I added gtk, opengl etc as native inputs instead of regular inputs because from the point of view of Python they are not direct inputs.

I guess this applies to gtk+,opengl,mesa and expat(?) (the others are
intented to be native-inputs for sure). I am unsure if they are intended
to be available at runtime. I assumed they were not, based on the
previous comment. If they, they should be moved to inputs.

How could I figure that out?
-- 
Theodoros Foradis

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 16:35         ` Leo Famulari
  2016-10-25 17:13           ` Theodoros Foradis
@ 2016-10-25 18:05           ` Theodoros Foradis
  2016-10-25 18:28             ` Leo Famulari
  1 sibling, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-10-25 18:05 UTC (permalink / raw)
  To: guix-devel


Leo Famulari writes:

> On Tue, Oct 25, 2016 at 07:09:07PM +0300, Theodoros Foradis wrote:
>> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
>
>> +       #:tests? #f ; tests fail
>
> We should try to fix this, or at least understand why they are failing.

I tried building the package with #:tests #t and I get the following
output:

starting phase `check'
running "python setup.py" with command "test" and parameters ()
Found wx-config: /gnu/store/s1a3a7nn1hx10ryai3dvpbcsdbjcylb1-wxwidgets-gtk2-3.0.2/bin/wx-config
    Using flags:  --toolkit=gtk2 --unicode=yes --version=3.0
Preparing CORE...
Preparing STC...
Preparing GLCANVAS...
Preparing GIZMOS...
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'test'
phase `check' failed after 3.3 seconds


In my understanding, there seem to be no tests after all. If so, the
comment should be changed to '; no tests'.

-- 
Theodoros Foradis

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 18:05           ` Theodoros Foradis
@ 2016-10-25 18:28             ` Leo Famulari
  0 siblings, 0 replies; 47+ messages in thread
From: Leo Famulari @ 2016-10-25 18:28 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 09:05:44PM +0300, Theodoros Foradis wrote:
> 
> Leo Famulari writes:
> 
> > On Tue, Oct 25, 2016 at 07:09:07PM +0300, Theodoros Foradis wrote:
> >> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
> >
> >> +       #:tests? #f ; tests fail
> >
> > We should try to fix this, or at least understand why they are failing.
> 
> I tried building the package with #:tests #t and I get the following
> output:
> 
> starting phase `check'
> running "python setup.py" with command "test" and parameters ()
> Found wx-config: /gnu/store/s1a3a7nn1hx10ryai3dvpbcsdbjcylb1-wxwidgets-gtk2-3.0.2/bin/wx-config
>     Using flags:  --toolkit=gtk2 --unicode=yes --version=3.0
> Preparing CORE...
> Preparing STC...
> Preparing GLCANVAS...
> Preparing GIZMOS...
> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>    or: setup.py --help [cmd1 cmd2 ...]
>    or: setup.py --help-commands
>    or: setup.py cmd --help
> 
> error: invalid command 'test'
> phase `check' failed after 3.3 seconds
> 
> 
> In my understanding, there seem to be no tests after all. If so, the
> comment should be changed to '; no tests'.

`find . -iname "*test*"` does not show any promising results, so I guess
you are right that there are no tests.

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-25 17:13           ` Theodoros Foradis
@ 2016-10-30  0:13             ` Leo Famulari
  2016-10-30 10:13               ` Hartmut Goebel
  2016-10-31 10:42               ` Danny Milosavljevic
  0 siblings, 2 replies; 47+ messages in thread
From: Leo Famulari @ 2016-10-30  0:13 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 08:13:55PM +0300, Theodoros Foradis wrote:
> Leo Famulari writes:
> >> +    (native-inputs
> >> +     `(("gtk+" ,gtk+-2)
> >> +       ("expat" ,expat)
> >> +       ("libjpeg" ,libjpeg)
> >> +       ("libpng" ,libpng)
> >> +       ("libtiff" ,libtiff)
> >> +       ("libsm" ,libsm)
> >> +       ("libx11" ,libx11)
> >> +       ("mesa" ,mesa)
> >> +       ("pkg-config" ,pkg-config)
> >> +       ("python2-setuptools" ,python2-setuptools)
> >> +       ("zlib" ,zlib)))
> >
> > To clarify, all these native-inputs are only used while building?
> > Native inputs typically are not intended to be available once the
> > package has been built and installed.
> 
> To quote Danny Milosavljevic, whose original patch of python2-wxpython I
> modified:
> > I added gtk, opengl etc as native inputs instead of regular inputs
> > because from the point of view of Python they are not direct inputs.

I'm not sure what that means in this case.

> I guess this applies to gtk+,opengl,mesa and expat(?) (the others are
> intented to be native-inputs for sure). I am unsure if they are intended
> to be available at runtime. I assumed they were not, based on the
> previous comment. If they, they should be moved to inputs.

I checked the references of the built package like this:

$ guix gc --references $(./pre-inst-env guix build python2-wxpython)
/gnu/store/1xfc2pwr7qfjib9kfy3n2hjq56z7jyjx-python-2.7.11
/gnu/store/6njycb0nzbczqbzvcyn1vw5sg7xsaanr-python2-setuptools-18.3.1
/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib
/gnu/store/a5xcl27fflh6ppysf5wrsfnn3ly2gyhy-python2-wxpython-3.0.2.0
/gnu/store/fdlind5y49q37m1g1wsvx840q2scrp6x-wxwidgets-gtk2-3.0.2
/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23
/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42

As you can see, many of the package's inputs not referred to by the
built package. This means that those inputs will by deleted by the next
`guix gc` (unless some other installed package refers to them). That's
fine for native-inputs, which are supposed to be used only while
building.

As for whether or not the packages are required at run-time, I don't
know. wxPython's documentation should explain what the software does and
what libraries it wants to use.

Hartmut, assuming that wxPython needs these packages at run-time, do you
have any recommendations for how to keep references to them? I ask based
on your recent work on Python packaging.

Otherwise this package looks good, minus some minor cosmetic nits.

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

* Re: [PATCH v3 3/3] gnu: Add kicad.
  2016-10-25 17:00         ` [PATCH v3 3/3] gnu: Add kicad Theodoros Foradis
@ 2016-10-30  0:18           ` Leo Famulari
  2016-11-02 15:42             ` Theodoros Foradis
  0 siblings, 1 reply; 47+ messages in thread
From: Leo Famulari @ 2016-10-30  0:18 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Tue, Oct 25, 2016 at 08:00:01PM +0300, Theodoros Foradis wrote:
> * gnu/packages/engineering.scm (kicad): New variable.

Looks pretty good to me. Below are some things I would investigate and
potentially fix on my own before pushing to Savannah; no need to send a
new patch.

Now we are just waiting to learn more about python2-wxpython...

> +;; We use kicad from a git commit, because support for boost 1.61.0
> +;; has been recently added.
> +(define-public kicad
> +  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
> +        (revision "1"))
> +    (package
> +      (name "kicad")
> +      (version (string-append "4.0-" revision "."
> +                              (string-take commit 7)))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://git.launchpad.net/kicad.git")

Please use the correct URL here :)

> +         #:configure-flags
> +           (list "-DKICAD_STABLE_VERSION=ON"
> +                 "-DKICAD_REPO_NAME=stable"
> +                 "-DKICAD_BUILD_VERSION=4.0"

If possible, we should use our package's version string here. We aren't
really packaging KiCad 4.0, but rather 4.0 plus some extra Git commits,
right?

> +                 "-DCMAKE_BUILD_TYPE=Release"
> +                 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library
> +                 "-DKICAD_SCRIPTING=ON"
> +                 "-DKICAD_SCRIPTING_MODULES=ON"
> +                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
> +                 ;; Has to be set explicitely, as we don't have the wxPython
> +                 ;; headers in the wxwidgets store item, but in wxPython.
> +                 (string-append "-DCMAKE_CXX_FLAGS=-I"
> +                                (assoc-ref %build-inputs "wxpython")
> +                                "/include/wx-3.0")
> +                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
> +                 "-DBUILD_GITHUB_PLUGIN=OFF")

I would try building with this on. Does it require some unpackaged
dependencies?

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-30  0:13             ` Leo Famulari
@ 2016-10-30 10:13               ` Hartmut Goebel
  2016-10-31 10:42               ` Danny Milosavljevic
  1 sibling, 0 replies; 47+ messages in thread
From: Hartmut Goebel @ 2016-10-30 10:13 UTC (permalink / raw)
  To: Leo Famulari, Theodoros Foradis; +Cc: guix-devel

Am 30.10.2016 um 02:13 schrieb Leo Famulari:
> As for whether or not the packages are required at run-time, I don't
> know. wxPython's documentation should explain what the software does and
> what libraries it wants to use.
>
> Hartmut, assuming that wxPython needs these packages at run-time, do you
> have any recommendations for how to keep references to them? I ask based
> on your recent work on Python packaging.

You are talking about the ones listed in the "guix gc --references"
output, I assume. The only python package listed there is
python2-setuptools, which I assume to be *not* used at run-time and thus
needs to be a native input.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-30  0:13             ` Leo Famulari
  2016-10-30 10:13               ` Hartmut Goebel
@ 2016-10-31 10:42               ` Danny Milosavljevic
  2016-10-31 15:38                 ` Danny Milosavljevic
  1 sibling, 1 reply; 47+ messages in thread
From: Danny Milosavljevic @ 2016-10-31 10:42 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hi,

wxPython bundles wxwidgets. That's why we cd to "wxPython/wxPython" in order to avoid building it.

So wxPython as we build it requires wxwidgets as input.

But wxwidgets has multiple backends it supports, among them gtk. It should work to just leave off the gtk dependency on wxPython - since wxPython itself shouldn't require gtk.

The intention is that wxwidgets provides a backend-independent interface. I think the same should be true about wxPython. I'll check it some more.

wxPython seems to use SWIG in order to generate Python bindings to the C++ classes of wxwidgets.

> I checked the references of the built package like this:
> 
> $ guix gc --references $(./pre-inst-env guix build python2-wxpython)
> /gnu/store/1xfc2pwr7qfjib9kfy3n2hjq56z7jyjx-python-2.7.11
> /gnu/store/6njycb0nzbczqbzvcyn1vw5sg7xsaanr-python2-setuptools-18.3.1
> /gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib
> /gnu/store/a5xcl27fflh6ppysf5wrsfnn3ly2gyhy-python2-wxpython-3.0.2.0
> /gnu/store/fdlind5y49q37m1g1wsvx840q2scrp6x-wxwidgets-gtk2-3.0.2
> /gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23
> /gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42
> 
> assuming that wxPython needs these packages at run-time, 

I think it doesn't.

It's easy to test it in a container which provides wxpython and python by writing a small test program in it.

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

* Re: [PATCH v2 3/3] gnu: Add python2-wxpython.
  2016-10-31 10:42               ` Danny Milosavljevic
@ 2016-10-31 15:38                 ` Danny Milosavljevic
  0 siblings, 0 replies; 47+ messages in thread
From: Danny Milosavljevic @ 2016-10-31 15:38 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hi,

because of wxPython/src/helpers.cpp directly accessing a Gtk (gdk) structure (in macro GetXWindow) wxpython also requires gtk as regular input.

I've tested it in

$ guix environment --pure --ad-hoc python2-wxpython python-2 -- python

using:

import wxversion
wxversion.select("3.0")
import wx, wx.html
from wx import glcanvas
import wx.lib.fancytext
import sys
app = wx.App(redirect=True)   # Error messages go to popup window
top = wx.Frame(None)
box = wx.BoxSizer(wx.VERTICAL)
top.SetSizer(box)
#panel = wx.Panel(top)
canvas = glcanvas.GLCanvas(top)
box.Add(canvas)
canvas.Show()
top.Show()
app.MainLoop()

app = wx.App(redirect=True)
top = wx.Frame(None, title="Hello World", size=(300,200))
top.Show()
app.MainLoop()

#from wx import glcanvas
#from OpenGL.GL import *
#frame = GLFrame(None, -1, 'GL Window')
#frame.Show()
#app.MainLoop()
#app.Destroy()

The wxpython inputs I used were:

    (native-inputs
     `(("mesa" ,mesa) ; for glcanvas
       ("pkg-config" ,pkg-config)
       ("python2-setuptools" ,python2-setuptools)))
    (inputs
     `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
       ("wxwidgets" ,wxwidgets-gtk2)))

If we even built the X11 backend of wxwidgets, we would require an input "libx11" - otherwise not.

While wxpython glcanvas isn't very useful without mesa, it doesn't really require it. As you can see above it can still be imported without mesa.

Therefore, I think the above is the final version of the inputs we should use for wxpython.

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

* Re: [PATCH v3 2/2] gnu: Add python2-wxpython.
  2016-10-25 17:00         ` [PATCH v3 2/2] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-11-02  7:57           ` Danny Milosavljevic
  2016-11-02 13:53             ` Theodoros Foradis
  0 siblings, 1 reply; 47+ messages in thread
From: Danny Milosavljevic @ 2016-11-02  7:57 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

Hi,

On Tue, 25 Oct 2016 20:00:00 +0300
Theodoros Foradis <theodoros.for@openmailbox.org> wrote:
> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
> ---
>  gnu/packages/wxwidgets.scm | 82 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 82 insertions(+)
> 
> diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
> index 4efe7a1..07f0d7b 100644
> --- a/gnu/packages/wxwidgets.scm
> +++ b/gnu/packages/wxwidgets.scm
> @@ -2,6 +2,7 @@
>  ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
>  ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>  ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
> +;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -23,6 +24,7 @@
>    #:use-module (guix download)
>    #:use-module ((guix licenses) #:prefix l:)
>    #:use-module (guix build-system glib-or-gtk)
> +  #:use-module (guix build-system python)
>    #:use-module (guix build utils)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages compression)
> @@ -32,8 +34,10 @@
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages python)
>    #:use-module (gnu packages sdl)
>    #:use-module (gnu packages webkit)
> +  #:use-module (gnu packages xml)
>    #:use-module (gnu packages xorg))
>  
>  (define-public wxwidgets
> @@ -118,3 +122,81 @@ and many other languages.")
>                          "gtk+"
>                          (package-inputs wxwidgets))))
>             (name "wxwidgets-gtk2")))
> +
> +(define-public python2-wxpython
> +  (package
> +    (name "python2-wxpython")
> +    (version "3.0.2.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
> +                                  version "/wxPython-src-" version ".tar.bz2"))
> +              (sha256
> +               (base32
> +                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               '(begin
> +                  (lambda (folder)
> +                    (delete-file-recursively (string-append "src/" folder))
> +                    '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
> +                  (substitute* '("wxPython/setup.py")
> +                    ;; setup.py tries to keep its own license the same as wxwidget's
> +                    ;; license (which it expects under $WXWIN/docs).
> +                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
> +                    )))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:python ,python-2
> +       #:tests? #f ; tests fail
> +       #:configure-flags (list "WXPORT=gtk2"
> +                               "UNICODE=1")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build 'chdir
> +           (lambda _
> +             (chdir "wxPython")
> +             #t))
> +         (add-after 'chdir 'set-wx-out-dir
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             ;; By default, install phase tries to copy the wxPython headers in
> +             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
> +             ;; to the output directory by setting WXPREFIX.
> +             (substitute* "config.py"
> +               (("= getWxConfigValue\\('--prefix'\\)")
> +                (string-append "= '" (assoc-ref outputs "out") "'")))
> +             (substitute* "wx/build/config.py"
> +               (("= getWxConfigValue\\('--prefix'\\)")
> +                (string-append "= '" (assoc-ref outputs "out") "'")))
> +             #t))
> +         (add-after 'set-wx-out-dir 'setenv
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))


> +             (setenv "CPPFLAGS" (string-append "-I"
> +                                               (assoc-ref inputs "wxwidgets")
> +                                               "/lib/wx/include/gtk2-unicode-release-2.8"
> +                                               " -I"
> +                                               (assoc-ref inputs "wxwidgets")
> +                                               "/include/wx-3.0"
> +                                               " -D_FILE_OFFSET_BITS=64"
> +                                               " -DWXUSINGDLL"
> +                                               " -D__WXGTK__"))

It would be better for future maintainability to call "wx-config --cppflags" there instead:

(use-modules (ice-9 popen) (ice-9 rdelim))
(let ((port (open-pipe* OPEN_READ (string-append (assoc-ref inputs "wxwidgets") "/bin/wx-config") "--cppflags")))
  (setenv "CPPFLAGS" (read-string port))
  (close-pipe port))

> +             #t)))))
> +    (native-inputs
> +     `(("gtk+" ,gtk+-2)
> +       ("expat" ,expat)
> +       ("libjpeg" ,libjpeg)
> +       ("libpng" ,libpng)
> +       ("libtiff" ,libtiff)
> +       ("libsm" ,libsm)
> +       ("libx11" ,libx11)
> +       ("mesa" ,mesa)
> +       ("pkg-config" ,pkg-config)
> +       ("python2-setuptools" ,python2-setuptools)
> +       ("zlib" ,zlib)))
> +    (inputs
> +     `(("wxwidgets" ,wxwidgets-gtk2)))

This can be reduced to:

    (native-inputs
     `(("mesa" ,mesa) ; for glcanvas
       ("pkg-config" ,pkg-config)
       ("python2-setuptools" ,python2-setuptools)))
    (inputs
     `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
       ("wxwidgets" ,wxwidgets-gtk2)))

... without loss of functionality.

> +    (synopsis "Python2 Bindings for wxWidgets")
> +    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
> +    (home-page "http://wxpython.org/")
> +    (license (package-license wxwidgets))))

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

* Re: [PATCH v3 1/3] gnu: Add wxwidgets-gtk2.
  2016-10-25 16:59         ` [PATCH v3 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-11-02  8:15           ` Danny Milosavljevic
  0 siblings, 0 replies; 47+ messages in thread
From: Danny Milosavljevic @ 2016-11-02  8:15 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

Looks good to me.

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

* Re: [PATCH v3 2/2] gnu: Add python2-wxpython.
  2016-11-02  7:57           ` Danny Milosavljevic
@ 2016-11-02 13:53             ` Theodoros Foradis
  0 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-02 13:53 UTC (permalink / raw)
  To: Guix-devel

Hello,

Danny Milosavljevic writes:

> Hi,
>
> On Tue, 25 Oct 2016 20:00:00 +0300
> Theodoros Foradis <theodoros.for@openmailbox.org> wrote:
>> * gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
>> ---
>>  gnu/packages/wxwidgets.scm | 82 ++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 82 insertions(+)
>> 
>> diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
>> index 4efe7a1..07f0d7b 100644
>> --- a/gnu/packages/wxwidgets.scm
>> +++ b/gnu/packages/wxwidgets.scm
>> @@ -2,6 +2,7 @@
>>  ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
>>  ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>>  ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
>> +;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -23,6 +24,7 @@
>>    #:use-module (guix download)
>>    #:use-module ((guix licenses) #:prefix l:)
>>    #:use-module (guix build-system glib-or-gtk)
>> +  #:use-module (guix build-system python)
>>    #:use-module (guix build utils)
>>    #:use-module (gnu packages)
>>    #:use-module (gnu packages compression)
>> @@ -32,8 +34,10 @@
>>    #:use-module (gnu packages gtk)
>>    #:use-module (gnu packages image)
>>    #:use-module (gnu packages pkg-config)
>> +  #:use-module (gnu packages python)
>>    #:use-module (gnu packages sdl)
>>    #:use-module (gnu packages webkit)
>> +  #:use-module (gnu packages xml)
>>    #:use-module (gnu packages xorg))
>>  
>>  (define-public wxwidgets
>> @@ -118,3 +122,81 @@ and many other languages.")
>>                          "gtk+"
>>                          (package-inputs wxwidgets))))
>>             (name "wxwidgets-gtk2")))
>> +
>> +(define-public python2-wxpython
>> +  (package
>> +    (name "python2-wxpython")
>> +    (version "3.0.2.0")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
>> +                                  version "/wxPython-src-" version ".tar.bz2"))
>> +              (sha256
>> +               (base32
>> +                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
>> +              (modules '((guix build utils)))
>> +              (snippet
>> +               '(begin
>> +                  (lambda (folder)
>> +                    (delete-file-recursively (string-append "src/" folder))
>> +                    '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
>> +                  (substitute* '("wxPython/setup.py")
>> +                    ;; setup.py tries to keep its own license the same as wxwidget's
>> +                    ;; license (which it expects under $WXWIN/docs).
>> +                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
>> +                    )))))
>> +    (build-system python-build-system)
>> +    (arguments
>> +     `(#:python ,python-2
>> +       #:tests? #f ; tests fail
>> +       #:configure-flags (list "WXPORT=gtk2"
>> +                               "UNICODE=1")
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'build 'chdir
>> +           (lambda _
>> +             (chdir "wxPython")
>> +             #t))
>> +         (add-after 'chdir 'set-wx-out-dir
>> +           (lambda* (#:key outputs #:allow-other-keys)
>> +             ;; By default, install phase tries to copy the wxPython headers in
>> +             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
>> +             ;; to the output directory by setting WXPREFIX.
>> +             (substitute* "config.py"
>> +               (("= getWxConfigValue\\('--prefix'\\)")
>> +                (string-append "= '" (assoc-ref outputs "out") "'")))
>> +             (substitute* "wx/build/config.py"
>> +               (("= getWxConfigValue\\('--prefix'\\)")
>> +                (string-append "= '" (assoc-ref outputs "out") "'")))
>> +             #t))
>> +         (add-after 'set-wx-out-dir 'setenv
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
>
>
>> +             (setenv "CPPFLAGS" (string-append "-I"
>> +                                               (assoc-ref inputs "wxwidgets")
>> +                                               "/lib/wx/include/gtk2-unicode-release-2.8"
>> +                                               " -I"
>> +                                               (assoc-ref inputs "wxwidgets")
>> +                                               "/include/wx-3.0"
>> +                                               " -D_FILE_OFFSET_BITS=64"
>> +                                               " -DWXUSINGDLL"
>> +                                               " -D__WXGTK__"))
>
> It would be better for future maintainability to call "wx-config --cppflags" there instead:
>
> (use-modules (ice-9 popen) (ice-9 rdelim))
> (let ((port (open-pipe* OPEN_READ (string-append (assoc-ref inputs "wxwidgets") "/bin/wx-config") "--cppflags")))
>   (setenv "CPPFLAGS" (read-string port))
>   (close-pipe port))
>

This works correctly.

>> +             #t)))))
>> +    (native-inputs
>> +     `(("gtk+" ,gtk+-2)
>> +       ("expat" ,expat)
>> +       ("libjpeg" ,libjpeg)
>> +       ("libpng" ,libpng)
>> +       ("libtiff" ,libtiff)
>> +       ("libsm" ,libsm)
>> +       ("libx11" ,libx11)
>> +       ("mesa" ,mesa)
>> +       ("pkg-config" ,pkg-config)
>> +       ("python2-setuptools" ,python2-setuptools)
>> +       ("zlib" ,zlib)))
>> +    (inputs
>> +     `(("wxwidgets" ,wxwidgets-gtk2)))
>
> This can be reduced to:
>
>     (native-inputs
>      `(("mesa" ,mesa) ; for glcanvas
>        ("pkg-config" ,pkg-config)
>        ("python2-setuptools" ,python2-setuptools)))
>     (inputs
>      `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
>        ("wxwidgets" ,wxwidgets-gtk2)))
>
> ... without loss of functionality.
>

Correct, and tested to be working, thanks! Kicad builds on top of those
changes as is.

>> +    (synopsis "Python2 Bindings for wxWidgets")
>> +    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
>> +    (home-page "http://wxpython.org/")
>> +    (license (package-license wxwidgets))))


-- 
Theodoros Foradis

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

* Re: [PATCH v3 3/3] gnu: Add kicad.
  2016-10-30  0:18           ` Leo Famulari
@ 2016-11-02 15:42             ` Theodoros Foradis
  2016-11-05 18:41               ` Leo Famulari
  0 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-02 15:42 UTC (permalink / raw)
  To: Guix-devel


Leo Famulari writes:

> On Tue, Oct 25, 2016 at 08:00:01PM +0300, Theodoros Foradis wrote:
>> * gnu/packages/engineering.scm (kicad): New variable.
>
> Looks pretty good to me. Below are some things I would investigate and
> potentially fix on my own before pushing to Savannah; no need to send a
> new patch.
>
> Now we are just waiting to learn more about python2-wxpython...
>
>> +;; We use kicad from a git commit, because support for boost 1.61.0
>> +;; has been recently added.
>> +(define-public kicad
>> +  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
>> +        (revision "1"))
>> +    (package
>> +      (name "kicad")
>> +      (version (string-append "4.0-" revision "."
>> +                              (string-take commit 7)))
>> +      (source
>> +       (origin
>> +         (method git-fetch)
>> +         (uri (git-reference
>> +               (url "https://git.launchpad.net/kicad.git")
>
> Please use the correct URL here :)
>

Right. Is it normal that the url is not checked again, after having the
source in store? 

>> +         #:configure-flags
>> +           (list "-DKICAD_STABLE_VERSION=ON"
>> +                 "-DKICAD_REPO_NAME=stable"
>> +                 "-DKICAD_BUILD_VERSION=4.0"
>
> If possible, we should use our package's version string here. We aren't
> really packaging KiCad 4.0, but rather 4.0 plus some extra Git commits,
> right?
>

Right.

>> +                 "-DCMAKE_BUILD_TYPE=Release"
>> +                 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library
>> +                 "-DKICAD_SCRIPTING=ON"
>> +                 "-DKICAD_SCRIPTING_MODULES=ON"
>> +                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
>> +                 ;; Has to be set explicitely, as we don't have the wxPython
>> +                 ;; headers in the wxwidgets store item, but in wxPython.
>> +                 (string-append "-DCMAKE_CXX_FLAGS=-I"
>> +                                (assoc-ref %build-inputs "wxpython")
>> +                                "/include/wx-3.0")
>> +                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
>> +                 "-DBUILD_GITHUB_PLUGIN=OFF")
>
> I would try building with this on. Does it require some unpackaged
> dependencies?

It builds with this on, without extra dependencies, but the plugin
doesn't work due to CA certificates errors:

Reason: 'IO_ERROR: curl_easy_perform()=60: Peer certificate cannot be
authenticated with given CA certificates from kicad_curl_easy.cpp :
Perform() line:92'

I tried setting the SSL_CERT_FILE environment variable, but still
doesn't work.

This plugin will most likely be unneeded anyway, after I package the
libraries and footprint for guix, which should not take long. Feedback
is most welcome.

Regards,
-- 
Theodoros Foradis

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

* Re: [PATCH v3 3/3] gnu: Add kicad.
  2016-11-02 15:42             ` Theodoros Foradis
@ 2016-11-05 18:41               ` Leo Famulari
  2016-11-07 18:16                 ` [PATCH v4 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-11-07 21:04                 ` [PATCH v3 " Ricardo Wurmus
  0 siblings, 2 replies; 47+ messages in thread
From: Leo Famulari @ 2016-11-05 18:41 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: Guix-devel

On Wed, Nov 02, 2016 at 05:42:01PM +0200, Theodoros Foradis wrote:
> Right. Is it normal that the url is not checked again, after having the
> source in store? 

Yes, Guix finds the file named by the source hash in /gnu/store and so
it doesn't try downloading it. You can check for this mistake with `guix
build foo -S --check --no-substitutes`.

> >> +                 "-DBUILD_GITHUB_PLUGIN=OFF")
> >
> > I would try building with this on. Does it require some unpackaged
> > dependencies?
> 
> It builds with this on, without extra dependencies, but the plugin
> doesn't work due to CA certificates errors:
> 
> Reason: 'IO_ERROR: curl_easy_perform()=60: Peer certificate cannot be
> authenticated with given CA certificates from kicad_curl_easy.cpp :
> Perform() line:92'
> 
> I tried setting the SSL_CERT_FILE environment variable, but still
> doesn't work.

I've had trouble with other packages that use curl not being able to
find the CA certificates. Let's mark this as TODO :)

Can you send an updated patch series addressing the most recent (and I
hope final) round of comments?

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

* [PATCH v4 1/3] gnu: Add wxwidgets-gtk2.
  2016-11-05 18:41               ` Leo Famulari
@ 2016-11-07 18:16                 ` Theodoros Foradis
  2016-11-07 18:16                   ` [PATCH v4 2/3] gnu: Add python2-wxpython Theodoros Foradis
  2016-11-07 18:16                   ` [PATCH v4 3/3] gnu: Add kicad Theodoros Foradis
  2016-11-07 21:04                 ` [PATCH v3 " Ricardo Wurmus
  1 sibling, 2 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-07 18:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (wxwidgets-gtk2): New variable.
---
 gnu/packages/wxwidgets.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 31da2a9..4efe7a1 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -109,3 +110,11 @@ and many other languages.")
                             (assoc-ref %outputs "out") "/lib"))
        ;; No 'check' target.
        #:tests? #f))))
+
+(define-public wxwidgets-gtk2
+  (package (inherit wxwidgets)
+           (inputs `(("gtk+" ,gtk+-2)
+                     ,@(alist-delete
+                        "gtk+"
+                        (package-inputs wxwidgets))))
+           (name "wxwidgets-gtk2")))
-- 
2.10.1

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

* [PATCH v4 2/3] gnu: Add python2-wxpython.
  2016-11-07 18:16                 ` [PATCH v4 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-11-07 18:16                   ` Theodoros Foradis
  2016-11-07 22:38                     ` Danny Milosavljevic
  2016-11-07 18:16                   ` [PATCH v4 3/3] gnu: Add kicad Theodoros Foradis
  1 sibling, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-07 18:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 72 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..69216b5 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,71 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (lambda (folder)
+                    (delete-file-recursively (string-append "src/" folder))
+                    '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")
+             #t))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             #t))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (use-modules (ice-9 popen) (ice-9 rdelim))
+             (let ((port (open-pipe* OPEN_READ
+                                     (string-append (assoc-ref inputs "wxwidgets")
+                                                    "/bin/wx-config") "--cppflags")))
+               (setenv "CPPFLAGS" (read-string port))
+               (close-pipe port))
+             #t)))))
+    (native-inputs
+     `(("mesa" ,mesa) ; for glcanvas
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)))
+    (inputs
+     `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
+       ("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* [PATCH v4 3/3] gnu: Add kicad.
  2016-11-07 18:16                 ` [PATCH v4 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-11-07 18:16                   ` [PATCH v4 2/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-11-07 18:16                   ` Theodoros Foradis
  2016-11-07 18:47                     ` Efraim Flashner
  2016-11-15 19:26                     ` [PATCH v4 3/3] gnu: Add kicad Leo Famulari
  1 sibling, 2 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-07 18:16 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad): New variable.
---
 gnu/packages/engineering.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 829ceb0..3d7c6ce 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
@@ -39,6 +41,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
@@ -55,9 +58,14 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
 (define-public librecad
@@ -562,3 +570,87 @@ fundamental, primitive shapes are represented as code in the user-level
 language.")
       (license (list license:lgpl2.1+             ;library
                      license:gpl2+)))))           ;Guile bindings
+
+;; We use kicad from a git commit, because support for boost 1.61.0
+;; has been recently added.
+(define-public kicad
+  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
+        (revision "1"))
+    (package
+      (name "kicad")
+      (version (string-append "4.0-" revision "."
+                              (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.launchpad.net/kicad")
+               (commit commit)))
+         (sha256
+          (base32 "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
+         (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:configure-flags
+           (list "-DKICAD_STABLE_VERSION=ON"
+                 "-DKICAD_REPO_NAME=stable"
+                 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
+                                 (string-take commit 7))
+                 "-DCMAKE_BUILD_TYPE=Release"
+                 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library
+                 "-DKICAD_SCRIPTING=ON"
+                 "-DKICAD_SCRIPTING_MODULES=ON"
+                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
+                 ;; Has to be set explicitely, as we don't have the wxPython
+                 ;; headers in the wxwidgets store item, but in wxPython.
+                 (string-append "-DCMAKE_CXX_FLAGS=-I"
+                                (assoc-ref %build-inputs "wxpython")
+                                "/include/wx-3.0")
+                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+                 ;; TODO: enable this when CA certs are working with curl
+                 "-DBUILD_GITHUB_PLUGIN=OFF")
+           #:phases
+             (modify-phases %standard-phases
+               (add-after 'install 'wrap-program ; Ensure correct python at runtime
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (python (assoc-ref inputs "python"))
+                                   (file (string-append out "/bin/kicad"))
+                                   (path (string-append
+                                          out
+                                          "/lib/python2.7/site-packages:"
+                                          (getenv "PYTHONPATH"))))
+                              (wrap-program file
+                                `("PYTHONPATH" ":" prefix (,path))
+                                `("PATH" ":" prefix
+                                  (,(string-append python "/bin:")))))
+                            #t)))))
+      (native-inputs
+       `(("boost" ,boost)
+         ("gettext" ,gnu-gettext)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)
+         ("zlib" ,zlib)))
+      (inputs
+       `(("cairo" ,cairo)
+         ("curl" ,curl)
+         ("desktop-file-utils" ,desktop-file-utils)
+         ("glew" ,glew)
+         ("glm" ,glm)
+         ("hicolor-icon-theme" ,hicolor-icon-theme)
+         ("libsm" ,libsm)
+         ("mesa" ,mesa)
+         ("openssl" ,openssl)
+         ("python" ,python-2)
+         ("wxwidgets" ,wxwidgets-gtk2)
+         ("wxpython" ,python2-wxpython)))
+      (home-page "http://http://kicad-pcb.org/")
+      (synopsis "Electronics Design Automation Suite")
+      (description
+       "Kicad is created for the formation of printed circuit boards and electrical circuits.
+ The software has a number of programs that perform specific functions, for example,
+ pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
+ files) and others. ")
+      (license license:gpl3+))))
-- 
2.10.1

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

* Re: [PATCH v4 3/3] gnu: Add kicad.
  2016-11-07 18:16                   ` [PATCH v4 3/3] gnu: Add kicad Theodoros Foradis
@ 2016-11-07 18:47                     ` Efraim Flashner
  2016-11-15 20:53                       ` [PATCH v5 1/4] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-11-15 19:26                     ` [PATCH v4 3/3] gnu: Add kicad Leo Famulari
  1 sibling, 1 reply; 47+ messages in thread
From: Efraim Flashner @ 2016-11-07 18:47 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

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

On Mon, Nov 07, 2016 at 08:16:28PM +0200, Theodoros Foradis wrote:
> * gnu/packages/engineering.scm (kicad): New variable.
> ---
>  gnu/packages/engineering.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 92 insertions(+)
> 
> +         ("wxpython" ,python2-wxpython)))
> +      (home-page "http://http://kicad-pcb.org/")

You might want to double-check that url :)

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

* Re: [PATCH v3 3/3] gnu: Add kicad.
  2016-11-05 18:41               ` Leo Famulari
  2016-11-07 18:16                 ` [PATCH v4 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-11-07 21:04                 ` Ricardo Wurmus
  1 sibling, 0 replies; 47+ messages in thread
From: Ricardo Wurmus @ 2016-11-07 21:04 UTC (permalink / raw)
  To: Leo Famulari; +Cc: Guix-devel


Leo Famulari <leo@famulari.name> writes:

> On Wed, Nov 02, 2016 at 05:42:01PM +0200, Theodoros Foradis wrote:
>> Right. Is it normal that the url is not checked again, after having the
>> source in store? 
>
> Yes, Guix finds the file named by the source hash in /gnu/store and so
> it doesn't try downloading it. You can check for this mistake with `guix
> build foo -S --check --no-substitutes`.
>
>> >> +                 "-DBUILD_GITHUB_PLUGIN=OFF")
>> >
>> > I would try building with this on. Does it require some unpackaged
>> > dependencies?
>> 
>> It builds with this on, without extra dependencies, but the plugin
>> doesn't work due to CA certificates errors:
>> 
>> Reason: 'IO_ERROR: curl_easy_perform()=60: Peer certificate cannot be
>> authenticated with given CA certificates from kicad_curl_easy.cpp :
>> Perform() line:92'
>> 
>> I tried setting the SSL_CERT_FILE environment variable, but still
>> doesn't work.
>
> I've had trouble with other packages that use curl not being able to
> find the CA certificates. Let's mark this as TODO :)
>
> Can you send an updated patch series addressing the most recent (and I
> hope final) round of comments?

This requires a patch to libcurl, which I hope to send for the next
core-updates cycle.

~~ Ricardo

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

* Re: [PATCH v4 2/3] gnu: Add python2-wxpython.
  2016-11-07 18:16                   ` [PATCH v4 2/3] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-11-07 22:38                     ` Danny Milosavljevic
  0 siblings, 0 replies; 47+ messages in thread
From: Danny Milosavljevic @ 2016-11-07 22:38 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

Hi,

> +  #:use-module (gnu packages xml)

It's now not necessary anymore to import the "xml" module.

Not importing it cuts down on the number of module references and potential reference cycles in the future.

Otherwise LGTM!

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

* Re: [PATCH v4 3/3] gnu: Add kicad.
  2016-11-07 18:16                   ` [PATCH v4 3/3] gnu: Add kicad Theodoros Foradis
  2016-11-07 18:47                     ` Efraim Flashner
@ 2016-11-15 19:26                     ` Leo Famulari
  2016-11-22 19:46                       ` Theodoros Foradis
  1 sibling, 1 reply; 47+ messages in thread
From: Leo Famulari @ 2016-11-15 19:26 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: guix-devel

On Mon, Nov 07, 2016 at 08:16:28PM +0200, Theodoros Foradis wrote:
> * gnu/packages/engineering.scm (kicad): New variable.

There are some comments about minor issues on this version 3 of the
patch series. I can address these myself before pushing if there are no
more comments. I will read the patches one more time, test the build,
and push tomorrow if there are no more comments.

Thanks to everyone who was worked on this! It's a big group :)

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

* [PATCH v5 1/4] gnu: Add wxwidgets-gtk2.
  2016-11-07 18:47                     ` Efraim Flashner
@ 2016-11-15 20:53                       ` Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 2/4] gnu: Add python2-wxpython Theodoros Foradis
                                           ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-15 20:53 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (wxwidgets-gtk2): New variable.
---
 gnu/packages/wxwidgets.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 31da2a9..4efe7a1 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -109,3 +110,11 @@ and many other languages.")
                             (assoc-ref %outputs "out") "/lib"))
        ;; No 'check' target.
        #:tests? #f))))
+
+(define-public wxwidgets-gtk2
+  (package (inherit wxwidgets)
+           (inputs `(("gtk+" ,gtk+-2)
+                     ,@(alist-delete
+                        "gtk+"
+                        (package-inputs wxwidgets))))
+           (name "wxwidgets-gtk2")))
-- 
2.10.1

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

* [PATCH v5 2/4] gnu: Add python2-wxpython.
  2016-11-15 20:53                       ` [PATCH v5 1/4] gnu: Add wxwidgets-gtk2 Theodoros Foradis
@ 2016-11-15 20:53                         ` Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 3/4] gnu: Add kicad Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 4/4] gnu: Add kicad-library Theodoros Foradis
  2 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-15 20:53 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/wxwidgets.scm (python2-wxpython): New variable.
---
 gnu/packages/wxwidgets.scm | 72 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 4efe7a1..69216b5 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
@@ -32,8 +34,10 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public wxwidgets
@@ -118,3 +122,71 @@ and many other languages.")
                         "gtk+"
                         (package-inputs wxwidgets))))
            (name "wxwidgets-gtk2")))
+
+(define-public python2-wxpython
+  (package
+    (name "python2-wxpython")
+    (version "3.0.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
+                                  version "/wxPython-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (lambda (folder)
+                    (delete-file-recursively (string-append "src/" folder))
+                    '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
+                  (substitute* '("wxPython/setup.py")
+                    ;; setup.py tries to keep its own license the same as wxwidget's
+                    ;; license (which it expects under $WXWIN/docs).
+                    (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") "")
+                    )))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; tests fail
+       #:configure-flags (list "WXPORT=gtk2"
+                               "UNICODE=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "wxPython")
+             #t))
+         (add-after 'chdir 'set-wx-out-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; By default, install phase tries to copy the wxPython headers in
+             ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are redirected
+             ;; to the output directory by setting WXPREFIX.
+             (substitute* "config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             (substitute* "wx/build/config.py"
+               (("= getWxConfigValue\\('--prefix'\\)")
+                (string-append "= '" (assoc-ref outputs "out") "'")))
+             #t))
+         (add-after 'set-wx-out-dir 'setenv
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
+             (use-modules (ice-9 popen) (ice-9 rdelim))
+             (let ((port (open-pipe* OPEN_READ
+                                     (string-append (assoc-ref inputs "wxwidgets")
+                                                    "/bin/wx-config") "--cppflags")))
+               (setenv "CPPFLAGS" (read-string port))
+               (close-pipe port))
+             #t)))))
+    (native-inputs
+     `(("mesa" ,mesa) ; for glcanvas
+       ("pkg-config" ,pkg-config)
+       ("python2-setuptools" ,python2-setuptools)))
+    (inputs
+     `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
+       ("wxwidgets" ,wxwidgets-gtk2)))
+    (synopsis "Python2 Bindings for wxWidgets")
+    (description "@code{wxpython} are Python2 bindings for wxWidgets.")
+    (home-page "http://wxpython.org/")
+    (license (package-license wxwidgets))))
-- 
2.10.1

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

* [PATCH v5 3/4] gnu: Add kicad.
  2016-11-15 20:53                       ` [PATCH v5 1/4] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 2/4] gnu: Add python2-wxpython Theodoros Foradis
@ 2016-11-15 20:53                         ` Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 4/4] gnu: Add kicad-library Theodoros Foradis
  2 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-15 20:53 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad): New variable.
---
 gnu/packages/engineering.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f720906..fceea70 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
@@ -39,6 +41,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
@@ -55,9 +58,14 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
 (define-public librecad
@@ -588,3 +596,87 @@ fundamental, primitive shapes are represented as code in the user-level
 language.")
       (license (list license:lgpl2.1+             ;library
                      license:gpl2+)))))           ;Guile bindings
+
+;; We use kicad from a git commit, because support for boost 1.61.0
+;; has been recently added.
+(define-public kicad
+  (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
+        (revision "1"))
+    (package
+      (name "kicad")
+      (version (string-append "4.0-" revision "."
+                              (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.launchpad.net/kicad")
+               (commit commit)))
+         (sha256
+          (base32 "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
+         (file-name (string-append name "-" version "-checkout"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:configure-flags
+           (list "-DKICAD_STABLE_VERSION=ON"
+                 "-DKICAD_REPO_NAME=stable"
+                 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
+                                 (string-take commit 7))
+                 "-DCMAKE_BUILD_TYPE=Release"
+                 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library
+                 "-DKICAD_SCRIPTING=ON"
+                 "-DKICAD_SCRIPTING_MODULES=ON"
+                 "-DKICAD_SCRIPTING_WXPYTHON=ON"
+                 ;; Has to be set explicitely, as we don't have the wxPython
+                 ;; headers in the wxwidgets store item, but in wxPython.
+                 (string-append "-DCMAKE_CXX_FLAGS=-I"
+                                (assoc-ref %build-inputs "wxpython")
+                                "/include/wx-3.0")
+                 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+                 ;; TODO: enable this when CA certs are working with curl
+                 "-DBUILD_GITHUB_PLUGIN=OFF")
+           #:phases
+             (modify-phases %standard-phases
+               (add-after 'install 'wrap-program ; Ensure correct python at runtime
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (python (assoc-ref inputs "python"))
+                                   (file (string-append out "/bin/kicad"))
+                                   (path (string-append
+                                          out
+                                          "/lib/python2.7/site-packages:"
+                                          (getenv "PYTHONPATH"))))
+                              (wrap-program file
+                                `("PYTHONPATH" ":" prefix (,path))
+                                `("PATH" ":" prefix
+                                  (,(string-append python "/bin:")))))
+                            #t)))))
+      (native-inputs
+       `(("boost" ,boost)
+         ("gettext" ,gnu-gettext)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)
+         ("zlib" ,zlib)))
+      (inputs
+       `(("cairo" ,cairo)
+         ("curl" ,curl)
+         ("desktop-file-utils" ,desktop-file-utils)
+         ("glew" ,glew)
+         ("glm" ,glm)
+         ("hicolor-icon-theme" ,hicolor-icon-theme)
+         ("libsm" ,libsm)
+         ("mesa" ,mesa)
+         ("openssl" ,openssl)
+         ("python" ,python-2)
+         ("wxwidgets" ,wxwidgets-gtk2)
+         ("wxpython" ,python2-wxpython)))
+      (home-page "http://kicad-pcb.org/")
+      (synopsis "Electronics Design Automation Suite")
+      (description
+       "Kicad is created for the formation of printed circuit boards and electrical circuits.
+ The software has a number of programs that perform specific functions, for example,
+ pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
+ files) and others.")
+      (license license:gpl3+))))
-- 
2.10.1

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

* [PATCH v5 4/4] gnu: Add kicad-library.
  2016-11-15 20:53                       ` [PATCH v5 1/4] gnu: Add wxwidgets-gtk2 Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 2/4] gnu: Add python2-wxpython Theodoros Foradis
  2016-11-15 20:53                         ` [PATCH v5 3/4] gnu: Add kicad Theodoros Foradis
@ 2016-11-15 20:53                         ` Theodoros Foradis
  2 siblings, 0 replies; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-15 20:53 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/engineering.scm (kicad-library): New variable.
---
 gnu/packages/engineering.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index fceea70..8326c87 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -680,3 +680,65 @@ language.")
  pcbnew (Editing PCB), eeschema (editing electrical diagrams), gerbview (viewing Gerber
  files) and others.")
       (license license:gpl3+))))
+
+(define-public kicad-library
+  (let ((version "4.0.4"))
+    (package
+      (name "kicad-library")
+      (version version)
+      (source (origin
+                (method url-fetch)
+                (uri (string-append
+                      "http://downloads.kicad-pcb.org/libraries/kicad-library-"
+                      version ".tar.gz"))
+                (sha256
+                 (base32
+                  "1wyda58y39lhxml0xv1ngvddi0nqihx9bnlza46ajzms38ajvh12"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:out-of-source? #t
+         #:tests? #f ; no tests
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'install 'install-footprints ; from footprints tarball
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (zero? (system* "tar" "xvf"
+                               (assoc-ref inputs "kicad-footprints")
+                               "-C" (string-append (assoc-ref outputs "out")
+                                                   "/share/kicad/modules")
+                               "--strip-components=1"))))
+           ;; We change the default global footprint file, which is generated if
+           ;; it doesn't exist in user's home directory, from the one using the
+           ;; github plugin, to the one using the KISYSMOD environment path.
+           (add-after 'install-footprints 'use-pretty-footprint-table
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (template-dir (string-append out "/share/kicad/template"))
+                      (fp-lib-table (string-append template-dir "/fp-lib-table")))
+                 (delete-file fp-lib-table)
+                 (copy-file (string-append fp-lib-table ".for-pretty")
+                              fp-lib-table))
+               #t)))))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "KISYSMOD") ; footprint path
+              (files '("share/kicad/modules")))
+             (search-path-specification
+              (variable "KISYS3DMOD") ; 3D model path
+              (files '("share/kicad/modules/packages3d")))))
+      ;; Kicad distributes footprints in a separate tarball
+      (native-inputs
+       `(("kicad-footprints"
+          ,(origin
+             (method url-fetch)
+             (uri (string-append
+                   "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
+                   version ".tar.gz"))
+             (sha256
+              (base32
+               "0ya4gg6clz3vp2wrb67xwg0bhwh5q8ag39jjmpcp4zjcqs1f48rb"))))))
+      (home-page "http://kicad-pcb.org/")
+      (synopsis "Libraries for kicad")
+      (description
+       "Kicad component, footprint and 3D render model libraries.")
+    (license license:lgpl2.0+))))
-- 
2.10.1

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

* Re: [PATCH v4 3/3] gnu: Add kicad.
  2016-11-15 19:26                     ` [PATCH v4 3/3] gnu: Add kicad Leo Famulari
@ 2016-11-22 19:46                       ` Theodoros Foradis
  2016-11-25  5:40                         ` Leo Famulari
  0 siblings, 1 reply; 47+ messages in thread
From: Theodoros Foradis @ 2016-11-22 19:46 UTC (permalink / raw)
  To: Guix-devel


Leo Famulari writes:

> On Mon, Nov 07, 2016 at 08:16:28PM +0200, Theodoros Foradis wrote:
>> * gnu/packages/engineering.scm (kicad): New variable.
>
> There are some comments about minor issues on this version 3 of the
> patch series. I can address these myself before pushing if there are no
> more comments. I will read the patches one more time, test the build,
> and push tomorrow if there are no more comments.
>
> Thanks to everyone who was worked on this! It's a big group :)

Hello,

I have posted a version 5 of the patch series, which I have not
commented on. It (hopefully) includes the fixes, based on the comments
on previous patch series.

It contains an extra patch, with the kicad-library package, which
includes components, footprints and 3D models for kicad.

Regards,
-- 
Theodoros Foradis

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

* Re: [PATCH v4 3/3] gnu: Add kicad.
  2016-11-22 19:46                       ` Theodoros Foradis
@ 2016-11-25  5:40                         ` Leo Famulari
  0 siblings, 0 replies; 47+ messages in thread
From: Leo Famulari @ 2016-11-25  5:40 UTC (permalink / raw)
  To: Theodoros Foradis; +Cc: Guix-devel

On Tue, Nov 22, 2016 at 09:46:17PM +0200, Theodoros Foradis wrote:
> 
> Leo Famulari writes:
> 
> > On Mon, Nov 07, 2016 at 08:16:28PM +0200, Theodoros Foradis wrote:
> >> * gnu/packages/engineering.scm (kicad): New variable.
> >
> > There are some comments about minor issues on this version 3 of the
> > patch series. I can address these myself before pushing if there are no
> > more comments. I will read the patches one more time, test the build,
> > and push tomorrow if there are no more comments.
> >
> > Thanks to everyone who was worked on this! It's a big group :)
> 
> Hello,
> 
> I have posted a version 5 of the patch series, which I have not
> commented on. It (hopefully) includes the fixes, based on the comments
> on previous patch series.
> 
> It contains an extra patch, with the kicad-library package, which
> includes components, footprints and 3D models for kicad.

I fixed some minor cosmetic issues (long lines, indentation, etc) and
also made some minor edits to descriptions and comments, and pushed the
v5 patch series, ending with 8f528bd4426fdb3e6e571316b185e70d30485c7e.

Thanks a lot everyone!

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

end of thread, other threads:[~2016-11-25  5:41 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 21:16 [PATCH 0/3] gnu: Add kicad Theodoros Foradis
2016-10-24 21:16 ` [PATCH 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
2016-10-24 21:16 ` [PATCH 2/3] gnu: Add python2-wxpython Theodoros Foradis
2016-10-25  8:32   ` Hartmut Goebel
2016-10-25  9:58     ` Theodoros Foradis
2016-10-25 16:20   ` Efraim Flashner
2016-10-24 21:16 ` [PATCH 3/3] gnu: Add kicad Theodoros Foradis
2016-10-25  0:36   ` Leo Famulari
2016-10-25  0:41     ` Leo Famulari
2016-10-25  8:11       ` Theodoros Foradis
2016-10-25 12:48   ` Leo Famulari
2016-10-25 16:09     ` [PATCH v2 0/3] " Theodoros Foradis
2016-10-25 16:09       ` [PATCH v2 1/3] gnu: Add python2-wxpython Theodoros Foradis
2016-10-25 16:32         ` Leo Famulari
2016-10-25 16:09       ` [PATCH v2 2/3] gnu: Add kicad Theodoros Foradis
2016-10-25 16:09       ` [PATCH v2 3/3] gnu: Add python2-wxpython Theodoros Foradis
2016-10-25 16:35         ` Leo Famulari
2016-10-25 17:13           ` Theodoros Foradis
2016-10-30  0:13             ` Leo Famulari
2016-10-30 10:13               ` Hartmut Goebel
2016-10-31 10:42               ` Danny Milosavljevic
2016-10-31 15:38                 ` Danny Milosavljevic
2016-10-25 18:05           ` Theodoros Foradis
2016-10-25 18:28             ` Leo Famulari
2016-10-25 16:59       ` [PATCH v3 0/3] gnu: Add kicad Theodoros Foradis
2016-10-25 16:59         ` [PATCH v3 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
2016-11-02  8:15           ` Danny Milosavljevic
2016-10-25 17:00         ` [PATCH v3 2/2] gnu: Add python2-wxpython Theodoros Foradis
2016-11-02  7:57           ` Danny Milosavljevic
2016-11-02 13:53             ` Theodoros Foradis
2016-10-25 17:00         ` [PATCH v3 3/3] gnu: Add kicad Theodoros Foradis
2016-10-30  0:18           ` Leo Famulari
2016-11-02 15:42             ` Theodoros Foradis
2016-11-05 18:41               ` Leo Famulari
2016-11-07 18:16                 ` [PATCH v4 1/3] gnu: Add wxwidgets-gtk2 Theodoros Foradis
2016-11-07 18:16                   ` [PATCH v4 2/3] gnu: Add python2-wxpython Theodoros Foradis
2016-11-07 22:38                     ` Danny Milosavljevic
2016-11-07 18:16                   ` [PATCH v4 3/3] gnu: Add kicad Theodoros Foradis
2016-11-07 18:47                     ` Efraim Flashner
2016-11-15 20:53                       ` [PATCH v5 1/4] gnu: Add wxwidgets-gtk2 Theodoros Foradis
2016-11-15 20:53                         ` [PATCH v5 2/4] gnu: Add python2-wxpython Theodoros Foradis
2016-11-15 20:53                         ` [PATCH v5 3/4] gnu: Add kicad Theodoros Foradis
2016-11-15 20:53                         ` [PATCH v5 4/4] gnu: Add kicad-library Theodoros Foradis
2016-11-15 19:26                     ` [PATCH v4 3/3] gnu: Add kicad Leo Famulari
2016-11-22 19:46                       ` Theodoros Foradis
2016-11-25  5:40                         ` Leo Famulari
2016-11-07 21:04                 ` [PATCH v3 " Ricardo Wurmus

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).