# limit parallel builds on aarch64 %ifarch aarch64 %global _smp_ncpus_max 4 %endif # Turn off the brp-python-bytecompile automagic %global _python_bytecompile_extra 0 %define Werror_cflags %nil %define docname kicad-doc %define symname kicad-symbols %define p3dname kicad-packages3D %define templname kicad-templates %define fpname kicad-footprints %define i18nname kicad-i18n Name: kicad Summary: An open source program for the creation of electronic schematic diagrams Epoch: 1 Version: 5.1.6 Release: %mkrel 1 License: GPLv3+ Group: Sciences/Computer science Url: http://kicad-pcb.org/ Source0: https://gitlab.com/kicad/code/kicad/-/archive/%{version}/%{name}-%{version}.tar.bz2 Source1: https://gitlab.com/kicad/services/%{docname}/-/archive/%{version}/%{docname}-%{version}.tar.bz2 Source2: https://github.com/KiCad/%{symname}/archive/%{version}/%{symname}-%{version}.tar.gz Source3: https://github.com/KiCad/%{p3dname}/archive/%{version}/%{p3dname}-%{version}.tar.gz Source4: https://github.com/KiCad/%{templname}/archive/%{version}/%{templname}-%{version}.tar.gz Source5: https://github.com/KiCad/%{fpname}/archive/%{version}/%{fpname}-%{version}.tar.gz Source6: https://gitlab.com/kicad/code/%{i18nname}/-/archive/%{version}/%{i18nname}-%{version}.tar.bz2 # This needs to be aligned with kicad-library-*/template/fp-lib-table.for-pretty Patch1: 0001-Do-not-strip-executables.patch Patch2: 0002-Include-algorithm-header-in-lib_tree_model.patch BuildRequires: wxgtk3.0-devel BuildRequires: mesa-common-devel BuildRequires: imagemagick BuildRequires: boost-devel BuildRequires: glm-devel BuildRequires: opencascade-devel BuildRequires: ngspice-devel BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(openssl) >= 1.1 BuildRequires: libgomp-devel BuildRequires: pkgconfig(libcurl) BuildRequires: cmake # doc BuildRequires: dblatex BuildRequires: po4a BuildRequires: asciidoc BuildRequires: git BuildRequires: perl(Unicode::LineBreak) BuildRequires: source-highlight # python scripting BuildRequires: pkgconfig(python3) BuildRequires: python3-wxpython4 BuildRequires: swig BuildRequires: desktop-file-utils Requires: %{name}-library Requires: %{docname} Requires: %{i18nname} Requires: python3-wxpython4 %description Kicad is an open source (GPL) program for the creation of electronic schematic diagrams and printed circuit board artwork. Kicad is a set of four programs and a project manager: * Eeschema: Schematic entry. * Pcbnew: Board editor. * Gerbview: GERBER viewer (photoplotter documents). * Cvpcb: footprint selector for components used in the circuit design. * Kicad: project manager. %package doc Summary: Documentation for kicad (creation of electronic schematic diagrams) Requires: %{name} BuildArch: noarch %description doc Kicad is an open source (GPL) program for the creation of electronic schematic diagrams and printed circuit board artwork. Kicad-doc is the documentation for kicad. %package i18n Summary: Kicad locales Requires: %{name} BuildArch: noarch Obsoletes: kicad-locales-ca Obsoletes: kicad-locales-cs Obsoletes: kicad-locales-de Obsoletes: kicad-locales-en Obsoletes: kicad-locales-es Obsoletes: kicad-locales-fi Obsoletes: kicad-locales-fr Obsoletes: kicad-locales-hu Obsoletes: kicad-locales-it Obsoletes: kicad-locales-ja Obsoletes: kicad-locales-ko Obsoletes: kicad-locales-lt Obsoletes: kicad-locales-nl Obsoletes: kicad-locales-pl Obsoletes: kicad-locales-pt Obsoletes: kicad-locales-ru Obsoletes: kicad-locales-sl Obsoletes: kicad-locales-sv Obsoletes: kicad-locales-zh-cn %description i18n Kicad is an open source (GPL) program for the creation of electronic schematic diagrams and printed circuit board artwork. Kicad-i18n provides locales for kicad. %package library Summary: Library for kicad (creation of electronic schematic diagrams) License: LGPLv2 Requires: %{name} BuildArch: noarch %description library Kicad is an open source (GPL) program for the creation of electronic schematic diagrams and printed circuit board artwork. Kicad-library is a set of libraries needed by kicad. %prep %setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 %autopatch -p1 %build export LC_ALL=C # Building kicad # Set CMAKE_PREFIX_PATH because of a misconfiguration in opencascade %cmake \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DKICAD_BUILD_VERSION=%{version} \ -DBUILD_GITHUB_PLUGIN=ON \ -DKICAD_SCRIPTING=ON \ -DKICAD_SCRIPTING_MODULES=ON \ -DKICAD_SCRIPTING_WXPYTHON=ON \ -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \ -DKICAD_SCRIPTING_PYTHON3=ON \ -DKICAD_SCRIPTING_ACTION_MENU=ON \ -DCPACK_DO_STRIP=OFF %cmake_build # for %%cmake: # Building kicad-doc pushd %{docname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_FORMATS=html %cmake_build popd # Building kicad-symbols pushd %{symname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release %cmake_build popd # Building kicad-packages3D pushd %{p3dname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release %cmake_build popd # Building kicad-templates pushd %{templname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release %cmake_build popd # Building kicad-footprints pushd %{fpname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release %cmake_build popd # Building kicad-i18n pushd %{i18nname}-%{version} %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DKICAD_I18N_UNIX_STRICT_PATH=ON %cmake_build popd %install pushd %{docname}-%{version} # Installing kicad-doc %cmake_install popd # Installing kicad-symbols pushd %{symname}-%{version} %cmake_install popd # Installing kicad-packages3D pushd %{p3dname}-%{version} %cmake_install popd # Installing kicad-templates pushd %{templname}-%{version} %cmake_install popd # Installing kicad-footprints pushd %{fpname}-%{version} %cmake_install popd # Installing kicad-i18n pushd %{i18nname}-%{version} %cmake_install popd %find_lang %{name} # Installing kicad %cmake_install # create desktop file desktop-file-install --vendor='' \ --remove-category='Scientific' \ --add-category='Science;Electronics;Education' \ --dir=%buildroot%{_datadir}/applications \ %buildroot%{_datadir}/applications/*.desktop # remove unwanted devel files rm -r %{buildroot}%{_libdir}/libkicad_3dsg.so %files %{_bindir}/* %{_libdir}/libkicad_3dsg.so.* %{_iconsdir}/*/*/* %{python3_sitelib}/_pcbnew.so %{python3_sitelib}/pcbnew.* %{python3_sitelib}/__pycache__/* %{_datadir}/%{name}/demos/ %{_datadir}/%{name}/template/ %{_datadir}/applications/*.desktop %{_datadir}/mime/packages/kicad-*.xml %{_datadir}/appdata/kicad.*.xml %{_libdir}/%{name}/plugins/ %{_datadir}/%{name}/plugins/ %{_datadir}/%{name}/scripting/ %dir %{_libdir}/%{name} %dir %{_datadir}/%{name} %files doc %doc %{_docdir}/%{name}/ %files i18n -f %{name}.lang %files library %{_datadir}/%{name}/library %{_datadir}/%{name}/modules