Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-electronics/kicad/
Date: Tue, 23 Nov 2021 17:16:03
Message-Id: 1637687734.fe0be9d80aa94b7bfb83bbb4cb363e451dab760d.sam@gentoo
1 commit: fe0be9d80aa94b7bfb83bbb4cb363e451dab760d
2 Author: JonRB <jon.roadleybattin <AT> gmail <DOT> com>
3 AuthorDate: Mon Nov 22 19:02:02 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 23 17:15:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe0be9d8
7
8 sci-electronics/kicad: add 9999 live version
9
10 Signed-off-by: JonRB <jon.roadleybattin <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sci-electronics/kicad/kicad-9999.ebuild | 163 ++++++++++++++++++++++++++++++++
14 1 file changed, 163 insertions(+)
15
16 diff --git a/sci-electronics/kicad/kicad-9999.ebuild b/sci-electronics/kicad/kicad-9999.ebuild
17 new file mode 100644
18 index 000000000000..d28c04025ecf
19 --- /dev/null
20 +++ b/sci-electronics/kicad/kicad-9999.ebuild
21 @@ -0,0 +1,163 @@
22 +# Copyright 1999-2021 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +PYTHON_COMPAT=( python3_{8,9} )
28 +
29 +WX_GTK_VER="3.0-gtk3"
30 +
31 +inherit check-reqs cmake optfeature python-single-r1 toolchain-funcs wxwidgets xdg-utils
32 +
33 +DESCRIPTION="Electronic Schematic and PCB design tools"
34 +HOMEPAGE="https://www.kicad.org"
35 +
36 +if [[ ${PV} == 9999 ]]; then
37 + EGIT_REPO_URI="https://gitlab.com/kicad/code/kicad.git"
38 + inherit git-r3
39 + # x11-misc-util/macros only required on live ebuilds
40 + LIVE_DEPEND=">=x11-misc/util-macros-1.18"
41 +else
42 + MY_PV="${PV/_rc/-rc}"
43 + MY_P="${PN}-${MY_PV}"
44 + SRC_URI="https://gitlab.com/kicad/code/${PN}/-/archive/${MY_PV}/${MY_P}.tar.gz -> ${P}.tar.gz"
45 + S="${WORKDIR}/${PN}-${MY_PV}"
46 + KEYWORDS="~amd64 ~arm64 ~x86"
47 +fi
48 +
49 +LICENSE="GPL-2+ GPL-3+ Boost-1.0"
50 +SLOT="0"
51 +IUSE="doc examples +ngspice openmp +python occ +pcm"
52 +
53 +REQUIRED_USE="
54 + python? ( ${PYTHON_REQUIRED_USE} )
55 +"
56 +
57 +COMMON_DEPEND="
58 + >=dev-libs/boost-1.61:=[context,nls]
59 + media-libs/freeglut
60 + media-libs/glew:0=
61 + >=media-libs/glm-0.9.9.1
62 + media-libs/mesa[X(+)]
63 + >=x11-libs/cairo-1.8.8:=
64 + >=x11-libs/pixman-0.30
65 + x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
66 + ngspice? (
67 + >sci-electronics/ngspice-27[shared]
68 + )
69 + occ? (
70 + >=sci-libs/opencascade-6.8.0:=
71 + )
72 + python? (
73 + $(python_gen_cond_dep '
74 + >=dev-libs/boost-1.61:=[context,nls,python,${PYTHON_MULTI_USEDEP}]
75 + dev-python/wxpython:4.0[${PYTHON_MULTI_USEDEP}]
76 + ')
77 + ${PYTHON_DEPS}
78 + )
79 +"
80 +DEPEND="${COMMON_DEPEND}
81 + python? ( >=dev-lang/swig-3.0:0 )"
82 +RDEPEND="${COMMON_DEPEND}
83 + sci-electronics/electronics-menu
84 +"
85 +BDEPEND="doc? ( app-doc/doxygen )"
86 +CHECKREQS_DISK_BUILD="800M"
87 +
88 +CAS_VERSION=7.5.3
89 +
90 +pkg_setup() {
91 + use python && python-single-r1_pkg_setup
92 + use openmp && tc-check-openmp
93 + setup-wxwidgets
94 + check-reqs_pkg_setup
95 +}
96 +
97 +src_unpack() {
98 + if [[ ${PV} == 9999 ]]; then
99 + git-r3_src_unpack
100 + else
101 + default_src_unpack
102 + fi
103 +}
104 +
105 +src_configure() {
106 + xdg_environment_reset
107 +
108 + local mycmakeargs=(
109 + -DKICAD_DOCS="${EPREFIX}/usr/share/doc/${PF}"
110 + -DKICAD_HELP="${EPREFIX}/usr/share/doc/${PN}-doc-${PV}"
111 + -DKICAD_SCRIPTING="$(usex python)"
112 + -DKICAD_SCRIPTING_MODULES="$(usex python)"
113 + -DKICAD_SCRIPTING_WXPYTHON="$(usex python)"
114 + -DKICAD_SCRIPTING_WXPYTHON_PHOENIX="$(usex python)"
115 + -DKICAD_SCRIPTING_PYTHON3="$(usex python)"
116 + -DKICAD_SCRIPTING_ACTION_MENU="$(usex python)"
117 + -DKICAD_SPICE="$(usex ngspice)"
118 + -DKICAD_PCM="$(usex pcm)"
119 +
120 + -DKICAD_USE_OCC="$(usex occ)"
121 + -DKICAD_INSTALL_DEMOS="$(usex examples)"
122 + -DCMAKE_SKIP_RPATH="ON"
123 + )
124 + use python && mycmakeargs+=(
125 + -DPYTHON_DEST="$(python_get_sitedir)"
126 + -DPYTHON_EXECUTABLE="${PYTHON}"
127 + -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
128 + -DPYTHON_LIBRARY="$(python_get_library_path)"
129 + )
130 + use occ && mycmakeargs+=(
131 + local OCC_P=$(best_version sci-libs/opencascade)
132 + OCC_P=${OCC_P#sci-libs/}
133 + OCC_P=${OCC_P%-r*}
134 + -DOCC_INCLUDE_DIR="${CASROOT}"/include/${OCC_P}"
135 + -DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)/${OCC_P}"
136 +
137 + )
138 +
139 + cmake_src_configure
140 +}
141 +
142 +src_compile() {
143 + cmake_src_compile
144 + if use doc; then
145 + cmake_src_compile dev-docs doxygen-docs
146 + fi
147 +}
148 +
149 +src_install() {
150 + cmake_src_install
151 + use python && python_optimize
152 + if use doc ; then
153 + dodoc uncrustify.cfg
154 + cd Documentation || die
155 + dodoc -r *.txt kicad_doxygen_logo.png notes_about_pcbnew_new_file_format.odt doxygen/. development/doxygen/.
156 + fi
157 +}
158 +
159 +src_test() {
160 + # Test cannot find library in Portage's sandbox. Let's create a link so test can run.
161 + ln -s "${S}_build/eeschema/_eeschema.kiface" "${S}_build/qa/eeschema/_eeschema.kiface" || die
162 +
163 + default
164 +}
165 +
166 +pkg_postinst() {
167 + optfeature "Component symbols library" sci-electronics/kicad-symbols
168 + optfeature "Component footprints library" sci-electronics/kicad-footprints
169 + optfeature "3D models of components " sci-electronics/kicad-packages3d
170 + optfeature "Project templates" sci-electronics/kicad-templates
171 + optfeature "Different languages for GUI" sci-electronics/kicad-i18n
172 + optfeature "Extended documentation" app-doc/kicad-doc
173 + optfeature "Creating 3D models of components" media-gfx/wings
174 +
175 + xdg_desktop_database_update
176 + xdg_mimeinfo_database_update
177 + xdg_icon_cache_update
178 +}
179 +
180 +pkg_postrm() {
181 + xdg_desktop_database_update
182 + xdg_mimeinfo_database_update
183 + xdg_icon_cache_update
184 +}