From patchwork Sun Feb 16 21:28:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 20285 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0FFDF17B9F; Sun, 16 Feb 2020 21:29:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5093717B9D for ; Sun, 16 Feb 2020 21:29:19 +0000 (GMT) Received: from localhost ([::1]:36646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3RTa-0000GX-S4 for patchwork@mira.cbaines.net; Sun, 16 Feb 2020 16:29:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45909) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3RTO-0008S7-3j for guix-patches@gnu.org; Sun, 16 Feb 2020 16:29:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3RTM-00030R-Fj for guix-patches@gnu.org; Sun, 16 Feb 2020 16:29:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60065) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3RTM-00030E-CH for guix-patches@gnu.org; Sun, 16 Feb 2020 16:29:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3RTM-00087Y-A2 for guix-patches@gnu.org; Sun, 16 Feb 2020 16:29:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39636] [PATCH 6/6] gnu: kicad: Add translations and search paths. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Feb 2020 21:29:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39636 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39636@debbugs.gnu.org Received: via spool by 39636-submit@debbugs.gnu.org id=B39636.158188853731154 (code B ref 39636); Sun, 16 Feb 2020 21:29:04 +0000 Received: (at 39636) by debbugs.gnu.org; 16 Feb 2020 21:28:57 +0000 Received: from localhost ([127.0.0.1]:37798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3RTE-00086Q-Nw for submit@debbugs.gnu.org; Sun, 16 Feb 2020 16:28:57 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3RTC-00086I-PX for 39636@debbugs.gnu.org; Sun, 16 Feb 2020 16:28:55 -0500 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6D015FF806 for <39636@debbugs.gnu.org>; Sun, 16 Feb 2020 21:28:53 +0000 (UTC) From: Brice Waegeneire Date: Sun, 16 Feb 2020 22:28:34 +0100 Message-Id: <20200216212834.3862-6-brice@waegenei.re> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200216212621.3063-1-brice@waegenei.re> References: <20200216212621.3063-1-brice@waegenei.re> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (kicad)[arguments]: Add phase install-translations. [native-search-paths]: Add specification for KICAD_TEMPLATE_DIR, KICAD_SYMBOL_DIR, KISYSMOD and KISYS3DMOD. [native-inputs]: Add desktop-file-utils and kicad-i18l. [inputs]: Remove desktop-file-utils and replace python by python-wrapper. (kicad-i18l): Add variable. --- gnu/packages/engineering.scm | 179 ++++++++++++++++++++++------------- 1 file changed, 113 insertions(+), 66 deletions(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 477a1642c0..da882a19f6 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -793,76 +793,123 @@ language.") (define-public ao (deprecated-package "ao-cad" libfive)) +;; TODO Add doc https://gitlab.com/kicad/services/kicad-doc/-/tree/master (define-public kicad - (package - (name "kicad") - (version "5.1.5") - (source - (origin - (method url-fetch) - (file-name (string-append name "-" version ".tar.xz")) - (uri (string-append - "https://launchpad.net/kicad/" (version-major version) - ".0/" version "/+download/kicad-" version ".tar.xz")) - (sha256 - (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0")))) - (build-system cmake-build-system) - (arguments - `(#:out-of-source? #t - #:tests? #f ; no tests - #:build-type "Release" - #:configure-flags - (list "-DKICAD_SCRIPTING_PYTHON3=ON" - "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON" - "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") - #: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/python" - ,(version-major+minor - (package-version python)) - "/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) - ("libngspice" ,libngspice) - ("libsm" ,libsm) - ("mesa" ,mesa) - ("opencascade-oce" ,opencascade-oce) - ("openssl" ,openssl) - ("python" ,python) - ("wxwidgets" ,wxwidgets) - ("wxpython" ,python-wxpython))) - (home-page "https://kicad-pcb.org/") - (synopsis "Electronics Design Automation Suite") - (description "Kicad is a program for the formation of printed circuit + (package + (name "kicad") + (version "5.1.5") + (source + (origin + (method url-fetch) + (file-name (string-append name "-" version ".tar.xz")) + (uri (string-append + "https://launchpad.net/kicad/" (version-major version) + ".0/" version "/+download/kicad-" version ".tar.xz")) + (sha256 + (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #t + #:tests? #f ; no tests + #:build-type "Release" + #:configure-flags + (list "-DKICAD_SCRIPTING_PYTHON3=ON" + "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON" + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-translations + (lambda* (#:key inputs outputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "kicad-i18l") + (assoc-ref outputs "out")) + #t)) + (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/python" + ,(version-major+minor + (package-version python)) + "/site-packages:" + (getenv "PYTHONPATH")))) + (wrap-program file + `("PYTHONPATH" ":" prefix (,path)) + `("PATH" ":" prefix + (,(string-append python "/bin:"))))) + #t))))) + (native-search-paths + (list (search-path-specification + (variable "KICAD_TEMPLATE_DIR") + (files '("share/kicad/template"))) + (search-path-specification + (variable "KICAD_SYMBOL_DIR") ; symbol path + (files '("share/kicad/library"))) + (search-path-specification + (variable "KISYSMOD") ; footprint path + (files '("share/kicad/modules"))) + (search-path-specification + (variable "KISYS3DMOD") ; 3D model path + (files '("share/kicad/modules/packages3d"))))) + (native-inputs + `(("boost" ,boost) + ("desktop-file-utils" ,desktop-file-utils) + ("gettext" ,gnu-gettext) + ("kicad-i18l" ,kicad-i18l) + ("pkg-config" ,pkg-config) + ("swig" ,swig) + ("zlib" ,zlib))) + (inputs + `(("cairo" ,cairo) + ("curl" ,curl) + ("glew" ,glew) + ("glm" ,glm) + ("hicolor-icon-theme" ,hicolor-icon-theme) + ("libngspice" ,libngspice) + ("libsm" ,libsm) + ("mesa" ,mesa) + ("opencascade-oce" ,opencascade-oce) + ("openssl" ,openssl) + ("python" ,python-wrapper) + ("wxwidgets" ,wxwidgets) + ("wxpython" ,python-wxpython))) + (home-page "https://kicad-pcb.org/") + (synopsis "Electronics Design Automation Suite") + (description "Kicad is a program 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+))) + (license license:gpl3+))) + +(define kicad-i18l + (package + (name "kicad-i18l") + (version "5.1.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/kicad/code/kicad-i18n.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3")))) + (build-system cmake-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'build) + (delete 'check)))) + (native-inputs + `(("gettext" ,gnu-gettext))) + (home-page "https://kicad-pcb.org/") + (synopsis "KiCad GUI translations") + (description "This package contains the po files that is used for the GUI +translations for KiCad.") + (license license:gpl3+))) (define-public kicad-symbols (package