guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] gnu: Add kicad.


From: Leo Famulari
Subject: Re: [PATCH 3/3] gnu: Add kicad.
Date: Tue, 25 Oct 2016 08:48:41 -0400
User-agent: Mutt/1.7.0 (2016-08-17)

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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]