1 |
# limit parallel builds on aarch64 |
2 |
%ifarch aarch64 |
3 |
%global _smp_ncpus_max 8 |
4 |
%endif |
5 |
|
6 |
# Wayland EGL support |
7 |
%bcond_with wayland_egl |
8 |
|
9 |
%define Werror_cflags %nil |
10 |
|
11 |
%ifarch x86_64 |
12 |
%define buildarch -DKICAD_BUILD_ARCH_X64:BOOL=ON |
13 |
%endif |
14 |
|
15 |
%ifarch %ix86 |
16 |
%define buildarch -DKICAD_BUILD_ARCH_X86:BOOL=ON |
17 |
%endif |
18 |
|
19 |
%ifarch %arm |
20 |
%define buildarch -DKICAD_BUILD_ARCH_ARM:BOOL=ON |
21 |
%endif |
22 |
|
23 |
%ifarch %arm64 |
24 |
%define buildarch -DKICAD_BUILD_ARCH_ARM64:BOOL=ON |
25 |
%endif |
26 |
|
27 |
Name: kicad |
28 |
Summary: An open source program for the creation of electronic schematic diagrams |
29 |
Epoch: 1 |
30 |
Version: 6.0.1 |
31 |
Release: %mkrel 1 |
32 |
License: GPLv3+ |
33 |
Group: Sciences/Computer science |
34 |
Url: https://www.kicad.org/ |
35 |
Source0: https://gitlab.com/kicad/code/kicad/-/archive/%{version}/%{name}-%{version}.tar.bz2 |
36 |
|
37 |
BuildRequires: wxgtk-devel |
38 |
BuildRequires: mesa-common-devel |
39 |
BuildRequires: imagemagick |
40 |
BuildRequires: boost-devel |
41 |
BuildRequires: glm-devel |
42 |
BuildRequires: opencascade-devel |
43 |
BuildRequires: pkgconfig(ngspice) |
44 |
BuildRequires: EGL-devel |
45 |
BuildRequires: pkgconfig(glew) |
46 |
BuildRequires: pkgconfig(cairo) |
47 |
BuildRequires: pkgconfig(openssl) >= 1.1 |
48 |
BuildRequires: libgomp-devel |
49 |
BuildRequires: pkgconfig(libcurl) |
50 |
BuildRequires: cmake |
51 |
BuildRequires: chrpath |
52 |
BuildRequires: ninja |
53 |
# python scripting |
54 |
BuildRequires: pkgconfig(python3) |
55 |
BuildRequires: python3-wxpython4 |
56 |
BuildRequires: swig |
57 |
|
58 |
BuildRequires: desktop-file-utils |
59 |
|
60 |
Requires: %{name}-doc >= 1:%{version} |
61 |
Requires: %{name}-symbols >= 1:%{version} |
62 |
Recommends: %{name}-packages3d >= 1:%{version} |
63 |
Requires: %{name}-templates >= 1:%{version} |
64 |
Requires: %{name}-footprints >= 1:%{version} |
65 |
Requires: python3-wxpython4 |
66 |
|
67 |
Obsoletes: %{name}-i18n < 1:6.0.0 |
68 |
Obsoletes: %{name}-library < 1:6.0.0 |
69 |
|
70 |
%description |
71 |
Kicad is an open source (GPL) program for the creation of electronic |
72 |
schematic diagrams and printed circuit board artwork. |
73 |
|
74 |
Kicad is a set of four programs and a project manager: |
75 |
|
76 |
* Eeschema: Schematic entry. |
77 |
* Pcbnew: Board editor. |
78 |
* Gerbview: GERBER viewer (photoplotter documents). |
79 |
* Cvpcb: footprint selector for components used in the circuit design. |
80 |
* Kicad: project manager. |
81 |
|
82 |
%prep |
83 |
%autosetup -p1 |
84 |
|
85 |
# install py files to arch specific location |
86 |
sed -i -e 's/plat_specific=0/plat_specific=1/g' CMakeLists.txt |
87 |
|
88 |
%build |
89 |
export LC_ALL=C |
90 |
|
91 |
# Building kicad |
92 |
# Set CMAKE_PREFIX_PATH because of a misconfiguration in opencascade |
93 |
%cmake -GNinja \ |
94 |
-DBUILD_SHARED_LIBS:BOOL=OFF \ |
95 |
-DCMAKE_BUILD_TYPE=Release \ |
96 |
-DKICAD_BUILD_VERSION=%{version} \ |
97 |
%{?buildarch} \ |
98 |
-DKICAD_BUILD_I18N=ON \ |
99 |
-DKICAD_I18N_UNIX_STRICT_PATH:BOOL=ON \ |
100 |
-DBUILD_GITHUB_PLUGIN=ON \ |
101 |
-DKICAD_SPICE=ON \ |
102 |
-DKICAD_USE_OCC=ON \ |
103 |
%if %{with wayland_egl} |
104 |
-DKICAD_USE_EGL=ON \ |
105 |
-DKICAD_USE_BUNDLED_GLEW=OFF \ |
106 |
%endif |
107 |
-DKICAD_SCRIPTING=ON \ |
108 |
-DKICAD_SCRIPTING_MODULES=ON \ |
109 |
-DKICAD_SCRIPTING_WXPYTHON=ON \ |
110 |
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \ |
111 |
-DKICAD_SCRIPTING_PYTHON3=ON \ |
112 |
-DKICAD_SCRIPTING_ACTION_MENU=ON |
113 |
%cmake_build |
114 |
|
115 |
%install |
116 |
%cmake_install |
117 |
|
118 |
%find_lang %{name} |
119 |
|
120 |
# fix shebang |
121 |
%py3_shebang_fix %{buildroot}%{_datadir}/doc/%{name}/scripts/ |
122 |
|
123 |
# drop RPATH |
124 |
chrpath -d %{buildroot}%{python3_sitearch}/_pcbnew.so |
125 |
|
126 |
# create desktop file |
127 |
for i in %{buildroot}%{_datadir}/applications/*.desktop; do |
128 |
desktop-file-edit \ |
129 |
--remove-category='Scientific' \ |
130 |
--add-category='Science;Electronics;Education' \ |
131 |
$i |
132 |
done |
133 |
|
134 |
# remove unwanted devel files |
135 |
rm -r %{buildroot}%{_libdir}/libkicad_3dsg.so |
136 |
|
137 |
%files -f %{name}.lang |
138 |
%license LICENSE* |
139 |
%doc AUTHORS.txt |
140 |
%doc %{_docdir}/%{name}/scripts/ |
141 |
%{_bindir}/* |
142 |
%{_libdir}/libkicad_3dsg.so.* |
143 |
%{_iconsdir}/hicolor/*/{apps,mimetypes}/*.{png,svg} |
144 |
%{_datadir}/applications/org.kicad.*.desktop |
145 |
%{_datadir}/mime/packages/kicad-*.xml |
146 |
%{_metainfodir}/org.kicad.kicad.metainfo.xml |
147 |
%dir %{_datadir}/%{name}/ |
148 |
%{_datadir}/%{name}/demos/ |
149 |
%{_datadir}/%{name}/plugins/ |
150 |
%{_datadir}/%{name}/resources/ |
151 |
%{_datadir}/%{name}/schemas/ |
152 |
%{_datadir}/%{name}/scripting/ |
153 |
%{_datadir}/%{name}/template/ |
154 |
%dir %{_libdir}/%{name}/ |
155 |
%{_libdir}/%{name}/plugins/ |
156 |
|
157 |
%{python3_sitearch}/_pcbnew.so |
158 |
%{python3_sitearch}/pcbnew.* |
159 |
%{python3_sitearch}/__pycache__/* |