File mingw32-kicad.spec of Package mingw32-kicad

#
# spec file for package mingw32-kicad
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%global _mingw32_find_requires_exclude wintrust

%define with_doc 0
%define with_gost 0
%define file_version 6.0.11
# with_gost variable sets technical standard:
# 0 - international
# 1 - GOST
# it is sole difference between kicad.spec and kicad-gost.spec
%if 0%{?with_gost}
Name:           mingw32-kicad-gost
%else
Name:           mingw32-kicad
%endif
Version:        6.0.11
Release:        0
%if 0%{?with_gost}
Summary:        EDA software suite for the creation of schematics and PCB with GOST support
License:        GPL-2.0-or-later
Group:          Productivity/Scientific/Electronics
%else
Summary:        EDA software suite for the creation of schematics and PCB
License:        GPL-2.0-or-later
Group:          Productivity/Scientific/Electronics
%endif
Url:            http://kicad-pcb.org
Source:         https://gitlab.com/kicad/code/kicad/-/archive/%{file_version}/kicad-%{file_version}.tar.bz2
Patch0:         kicad-6.0.9-msw-filename-case.patch
Patch1:         kicad-6.0.9-fix-mingw-build.patch
Patch2:         kicad-6.0.9-use-native-python.patch
Patch3:         kicad-6.0.9-fix-installed-python-path.patch
Patch4:         kicad-6.0.9-fix-3dsg-install-path.patch
BuildRequires:  ccache
BuildRequires:  mingw32-cross-cmake
%if 0%{?with_doc}
BuildRequires:  doxygen
BuildRequires:  graphviz
%endif
BuildRequires:  gettext
BuildRequires:  mingw32-boost-devel
BuildRequires:  mingw32-cairo-devel
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-wine
BuildRequires:  mingw32-glew-devel
BuildRequires:  mingw32-glm-devel
BuildRequires:  mingw32-ngspice
BuildRequires:  mingw32-libcurl-devel
BuildRequires:  mingw32-libngspice-devel
BuildRequires:  mingw32-libopenssl-devel
BuildRequires:  mingw32-occt-devel
BuildRequires:  mingw32-python3-devel
BuildRequires:  mingw32-wxWidgets-3_0-devel
BuildRequires:  mingw32-zlib-devel
BuildRequires:  python3-base
BuildRequires:  swig
BuildRequires:  update-desktop-files
%_mingw32_package_header_debug
BuildArch:      noarch

%if 0%{?with_gost}
Conflicts:      otherproviders(mingw32-kicad)
Provides:       mingw32-kicad = %{version}
%endif

%description
Kicad is an open source (GPL) software for the creation of electronic schematic
diagrams and printed circuit board artwork up to 16 layers.
Kicad is a set of four softwares 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

%_mingw32_debug_package

%prep
%autosetup -p1 -n kicad-%{version}

%build
%_mingw32_cross_wine_init

P=$(pwd)
MINGW32_CXXFLAGS="%_mingw32_cxxflags -fno-permissive"
%_mingw32_cmake \
    -DBUILD_GITHUB_PLUGIN=ON \
%if 0%{?with_doc}
    -DDOXYGEN_EXECUTABLE=/usr/bin/doxygen \
    -DDOT_EXECUTABLE=/usr/bin/dot \
%endif
    -DKICAD_BUILD_I18N=ON \
    -DKICAD_BUILD_VERSION=%{version} \
%if 0%{?with_gost}
    -DKICAD_GOST=ON \
%endif
    -DKICAD_LIB:PATH=%{_mingw32_libdir} \
    -DKICAD_REPO_NAME=stable \
    -DKICAD_SKIP_BOOST=OFF \
    -DKICAD_SCRIPTING=ON \
    -DKICAD_SCRIPTING_MODULES=ON \
    -DKICAD_SCRIPTING_WXPYTHON=OFF \
    -DKICAD_STABLE_VERSION=ON \
    -DKICAD_USE_OCC=ON \
    -DKICAD_USER_PLUGIN:PATH=%{_mingw32_libdir}/kicad/plugins \
    -DOCC_INCLUDE_DIR=%{_mingw32_includedir}/opencascade \
    -DOCC_LIBRARY_DIR=%{_mingw32_libdir} \
    -DPYTHON_EXECUTABLE=%{_mingw32_python3_interpreter} \
    -DPYTHON_INCLUDE_DIRS=%{_mingw32_includedir} \
    -DPYTHON_NATIVE_EXECUTABLE=/usr/bin/python3 \
    -DPYTHON_SITE_PACKAGE_PATH=%{_mingw32_python3_sitelib} \
    -DS3DSG_VERSION_FILE=$P/include/plugins/3dapi/sg_version.h \
    -DUSE_CCACHE=1 \
    -Dpybind11_INCLUDE_DIRS=$P/thirdparty/pybind11/include:%{_mingw32_includedir} \
    -DwxWidgets_USE_STATIC=OFF \
    -DwxUSE_UNICODE=ON \
    .
%_mingw32_cmake_build
%if 0%{?with_doc}
%_mingw32_cmake_build doxygen-docs
%endif

%install
%_mingw32_cmake_install

# install docs
%if 0%{?with_doc}
mkdir -p %{buildroot}%_mingw32_datadir/doc/kicad/
cp -a Documentation/doxygen/html/ %{buildroot}%_mingw32_datadir/doc/kicad/
%endif

%files
%defattr(-,root,root)
%_mingw32_bindir/*.exe
%_mingw32_bindir/*.dll
%_mingw32_bindir/scripting
%dir %_mingw32_libdir/kicad/
%dir %_mingw32_libdir/kicad/plugins
%dir %_mingw32_libdir/kicad/plugins/3d
%_mingw32_libdir/kicad/plugins/*/*.dll
%_mingw32_datadir/kicad/
%dir %_mingw32_python3_platlibdir
%dir %_mingw32_python3_sitelib
%_mingw32_python3_sitelib/*.py
%_mingw32_python3_sitelib/*.pyd
%if 0%{?with_doc}
%_mingw32_datadir/doc/kicad/
%endif

%changelog
openSUSE Build Service is sponsored by