From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodoros Foradis Subject: [PATCH v5 4/4] gnu: Add kicad-library. Date: Tue, 15 Nov 2016 22:53:24 +0200 Message-ID: <20161115205324.29738-4-theodoros.for@openmailbox.org> References: <20161107184733.GB2348@macbook42.flashner.co.il> <20161115205324.29738-1-theodoros.for@openmailbox.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6knv-0005Rs-5g for guix-devel@gnu.org; Tue, 15 Nov 2016 15:58:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6knq-0007XB-JX for guix-devel@gnu.org; Tue, 15 Nov 2016 15:58:07 -0500 Received: from smtp28.openmailbox.org ([62.4.1.62]:41002 helo=smtp13.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6knq-0007WS-Aq for guix-devel@gnu.org; Tue, 15 Nov 2016 15:58:02 -0500 In-Reply-To: <20161115205324.29738-1-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: guix-devel@gnu.org * 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