From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH 3/3] gnu: Add kicad. Date: Tue, 25 Oct 2016 08:48:41 -0400 Message-ID: <20161025124841.GA887@jasmine> References: <20161024211658.13087-1-theodoros.for@openmailbox.org> <20161024211658.13087-4-theodoros.for@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz19u-0003rX-TA for guix-devel@gnu.org; Tue, 25 Oct 2016 08:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz19p-0003vr-RB for guix-devel@gnu.org; Tue, 25 Oct 2016 08:48:50 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54065) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bz19p-0003uV-LT for guix-devel@gnu.org; Tue, 25 Oct 2016 08:48:45 -0400 Content-Disposition: inline In-Reply-To: <20161024211658.13087-4-theodoros.for@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Theodoros Foradis Cc: guix-devel@gnu.org 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?