gnu: kicad: Add translations and search paths.

* gnu/packages/engineering.scm (kicad)[arguments]<#:phases>[install-translations]: New phase.
[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.  Replace python by
python-wrapper.
(kicad-i18l): New variable.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Brice Waegeneire 2020-02-16 22:28:34 +01:00 committed by Danny Milosavljevic
parent badc3c6783
commit e7075353e0
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -794,76 +794,123 @@ language.")
(define-public ao (define-public ao
(deprecated-package "ao-cad" libfive)) (deprecated-package "ao-cad" libfive))
;; TODO Add doc https://gitlab.com/kicad/services/kicad-doc/-/tree/master
(define-public kicad (define-public kicad
(package (package
(name "kicad") (name "kicad")
(version "5.1.5") (version "5.1.5")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(file-name (string-append name "-" version ".tar.xz")) (file-name (string-append name "-" version ".tar.xz"))
(uri (string-append (uri (string-append
"https://launchpad.net/kicad/" (version-major version) "https://launchpad.net/kicad/" (version-major version)
".0/" version "/+download/kicad-" version ".tar.xz")) ".0/" version "/+download/kicad-" version ".tar.xz"))
(sha256 (sha256
(base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0")))) (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:out-of-source? #t `(#:out-of-source? #t
#:tests? #f ; no tests #:tests? #f ; no tests
#:build-type "Release" #:build-type "Release"
#:configure-flags #:configure-flags
(list "-DKICAD_SCRIPTING_PYTHON3=ON" (list "-DKICAD_SCRIPTING_PYTHON3=ON"
"-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON" "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'install 'wrap-program (add-after 'install 'install-translations
;; Ensure correct Python at runtime. (lambda* (#:key inputs outputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys) (copy-recursively (assoc-ref inputs "kicad-i18l")
(let* ((out (assoc-ref outputs "out")) (assoc-ref outputs "out"))
(python (assoc-ref inputs "python")) #t))
(file (string-append out "/bin/kicad")) (add-after 'install 'wrap-program
(path (string-append ;; Ensure correct Python at runtime.
out (lambda* (#:key inputs outputs #:allow-other-keys)
"/lib/python" (let* ((out (assoc-ref outputs "out"))
,(version-major+minor (python (assoc-ref inputs "python"))
(package-version python)) (file (string-append out "/bin/kicad"))
"/site-packages:" (path (string-append
(getenv "PYTHONPATH")))) out
(wrap-program file "/lib/python"
`("PYTHONPATH" ":" prefix (,path)) ,(version-major+minor
`("PATH" ":" prefix (package-version python))
(,(string-append python "/bin:"))))) "/site-packages:"
#t))))) (getenv "PYTHONPATH"))))
(native-inputs (wrap-program file
`(("boost" ,boost) `("PYTHONPATH" ":" prefix (,path))
("gettext" ,gnu-gettext) `("PATH" ":" prefix
("pkg-config" ,pkg-config) (,(string-append python "/bin:")))))
("swig" ,swig) #t)))))
("zlib" ,zlib))) (native-search-paths
(inputs (list (search-path-specification
`(("cairo" ,cairo) (variable "KICAD_TEMPLATE_DIR")
("curl" ,curl) (files '("share/kicad/template")))
("desktop-file-utils" ,desktop-file-utils) (search-path-specification
("glew" ,glew) (variable "KICAD_SYMBOL_DIR") ; symbol path
("glm" ,glm) (files '("share/kicad/library")))
("hicolor-icon-theme" ,hicolor-icon-theme) (search-path-specification
("libngspice" ,libngspice) (variable "KISYSMOD") ; footprint path
("libsm" ,libsm) (files '("share/kicad/modules")))
("mesa" ,mesa) (search-path-specification
("opencascade-oce" ,opencascade-oce) (variable "KISYS3DMOD") ; 3D model path
("openssl" ,openssl) (files '("share/kicad/modules/packages3d")))))
("python" ,python) (native-inputs
("wxwidgets" ,wxwidgets) `(("boost" ,boost)
("wxpython" ,python-wxpython))) ("desktop-file-utils" ,desktop-file-utils)
(home-page "https://kicad-pcb.org/") ("gettext" ,gnu-gettext)
(synopsis "Electronics Design Automation Suite") ("kicad-i18l" ,kicad-i18l)
(description "Kicad is a program for the formation of printed circuit ("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 boards and electrical circuits. The software has a number of programs that
perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
electrical diagrams), gerbview (viewing Gerber files) and others.") 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 are used for the GUI
translations for KiCad.")
(license license:gpl3+)))
(define-public kicad-symbols (define-public kicad-symbols
(package (package