From 0ee6c26f638b5df4a111df569581c1b3f21367f4bef362e843feae59f9f358e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sun, 26 Dec 2021 00:48:09 +0000 Subject: [PATCH] Accepting request 942464 from home:StefanBruens:branches:electronics:staging - Update to version 6.0.0 See https://www.kicad.org/blog/2021/12/KiCad-6.0.0-Release/ for details. - Drop no longer necessary kicad-suse-help-path.patch - Add 0001-Use-library-target-install-for-python-module-to-fix-.patch - Adjust disk constraints (now 11G) OBS-URL: https://build.opensuse.org/request/show/942464 OBS-URL: https://build.opensuse.org/package/show/electronics/kicad?expand=0&rev=84 --- ...et-install-for-python-module-to-fix-.patch | 42 +++++++ _constraints | 2 +- kicad-5.1.12.tar.bz2 | 3 - kicad-6.0.0.tar.bz2 | 3 + kicad-suse-help-path.patch | 12 -- kicad.changes | 9 ++ kicad.spec | 110 +++++++----------- 7 files changed, 100 insertions(+), 81 deletions(-) create mode 100644 0001-Use-library-target-install-for-python-module-to-fix-.patch delete mode 100644 kicad-5.1.12.tar.bz2 create mode 100644 kicad-6.0.0.tar.bz2 delete mode 100644 kicad-suse-help-path.patch diff --git a/0001-Use-library-target-install-for-python-module-to-fix-.patch b/0001-Use-library-target-install-for-python-module-to-fix-.patch new file mode 100644 index 0000000..3d9ce11 --- /dev/null +++ b/0001-Use-library-target-install-for-python-module-to-fix-.patch @@ -0,0 +1,42 @@ +From 6baf90fcbce310036feb88ab021c740c5c079c96 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sat, 11 Dec 2021 21:56:31 +0100 +Subject: [PATCH] Use library target install for python module to fix RUNPATH + +When the native python module is copied into the install tree, no special +handling for libraries/modules is triggered. This omits the RUNPATH +adjustments normally done by CMake during installation of binaries, which +is problematic for a number of reasons: +- library lookup can fail when dependencies require non-default RUNPATHs +- reproducible builds can fail when the buildroot contains semi-random + path components + +Install the library target a second time, which is explicitly allowed +by CMake. As RENAME is not supported for `install(TARGETS)`, adjust the +name manually. +--- + pcbnew/CMakeLists.txt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt +index 0ae24f0bd5..85b3cd471e 100644 +--- a/pcbnew/CMakeLists.txt ++++ b/pcbnew/CMakeLists.txt +@@ -817,7 +817,13 @@ elseif( APPLE ) + add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingPythonDirectoryCreation ) + set( PYMOD_EXT "so" ) + else() # only linux remains among supported platforms +- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.kiface DESTINATION ${PYTHON_DEST} COMPONENT binary RENAME "_pcbnew.so" ) ++ install( TARGETS pcbnew_kiface DESTINATION ${PYTHON_DEST} COMPONENT binary ) ++ cmake_policy(SET CMP0087 NEW) ++ install( CODE ++ "file( RENAME ++ \$ENV{DESTDIR}${PYTHON_DEST}/\$ ++ \$ENV{DESTDIR}${PYTHON_DEST}/_pcbnew.so ++ )" ) + set( PYMOD_EXT "so" ) + endif() + +-- +2.34.1 + diff --git a/_constraints b/_constraints index 4324398..742338e 100644 --- a/_constraints +++ b/_constraints @@ -2,7 +2,7 @@ - 9 + 11 8 diff --git a/kicad-5.1.12.tar.bz2 b/kicad-5.1.12.tar.bz2 deleted file mode 100644 index 9d00fab..0000000 --- a/kicad-5.1.12.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:af2a485911566097ca61efa394da6779d3bdf9b7dcbe27f56f4d9fc8b105d78b -size 18581842 diff --git a/kicad-6.0.0.tar.bz2 b/kicad-6.0.0.tar.bz2 new file mode 100644 index 0000000..26d4c83 --- /dev/null +++ b/kicad-6.0.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9738daf54bb536d8264f58340c53fbe3df74eeef45d2b20fc3e6fd8786d76dec +size 33925942 diff --git a/kicad-suse-help-path.patch b/kicad-suse-help-path.patch deleted file mode 100644 index d04b4ba..0000000 --- a/kicad-suse-help-path.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: common/searchhelpfilefullpath.cpp -=================================================================== ---- common/searchhelpfilefullpath.cpp.orig -+++ common/searchhelpfilefullpath.cpp -@@ -107,6 +107,7 @@ wxString SearchHelpFileFullPath( const S - // Below we account for an international subdirectory. - subdirs.Add( "share" ); - subdirs.Add( "doc" ); -+ subdirs.Add( "packages" ); - subdirs.Add( "kicad" ); - subdirs.Add( "help" ); - diff --git a/kicad.changes b/kicad.changes index 6440283..0491259 100644 --- a/kicad.changes +++ b/kicad.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Dec 25 16:56:09 UTC 2021 - Stefan Brüns + +- Update to version 6.0.0 + See https://www.kicad.org/blog/2021/12/KiCad-6.0.0-Release/ for details. +- Drop no longer necessary kicad-suse-help-path.patch +- Add 0001-Use-library-target-install-for-python-module-to-fix-.patch +- Adjust disk constraints (now 11G) + ------------------------------------------------------------------- Thu Nov 18 03:32:50 UTC 2021 - Stefan Brüns diff --git a/kicad.spec b/kicad.spec index 1f060b4..d25a26e 100644 --- a/kicad.spec +++ b/kicad.spec @@ -16,59 +16,42 @@ # -%if %{suse_version} >= 1550 -%bcond_without python3 -%else -%bcond_with python3 -%endif - -# According to upstream, kicad 5.x.y can be used with the footprint and -# symbol libraries from version 5.0.0 -%define compatversion 5.0.0 +# According to upstream, kicad 6.x.y can be used with the footprint and +# symbol libraries from version 6.0.0 +%define compatversion 6.0.0 Name: kicad -Version: 5.1.12 +Version: 6.0.0 +%define file_version 6.0.0 Release: 0 Summary: EDA software suite for the creation of schematics and PCB License: AGPL-3.0-or-later AND GPL-3.0-or-later Group: Productivity/Scientific/Electronics URL: https://www.kicad.org -Source: https://gitlab.com/kicad/code/kicad/-/archive/%{version}/kicad-%{version}.tar.bz2 -# PATCH-FIX-OPENSUSE davejplater@gmail.com -kicad-suse-help-path.patch - kicad looks in /usr/share/doc/kicad for help files and doesn't find them. -# this patch adds packges/ befor kicad and enables help to function. -Patch3: kicad-suse-help-path.patch +Source: https://gitlab.com/kicad/code/kicad/-/archive/%{file_version}/kicad-%{file_version}.tar.bz2 +Patch0: 0001-Use-library-target-install-for-python-module-to-fix-.patch -BuildRequires: cmake -BuildRequires: doxygen +BuildRequires: cmake >= 3.14 BuildRequires: fdupes BuildRequires: gcc-c++ -BuildRequires: glm-devel +BuildRequires: gettext +BuildRequires: glm-devel >= 0.9.8 BuildRequires: libboost_filesystem-devel BuildRequires: libboost_system-devel BuildRequires: libboost_test-devel BuildRequires: libngspice-devel BuildRequires: occt-devel BuildRequires: pkg-config +BuildRequires: python3-pybind11-devel +BuildRequires: python3-wxPython BuildRequires: swig >= 3 BuildRequires: update-desktop-files - -%if %{with python3} -BuildRequires: python3-wxPython BuildRequires: wxGTK3-devel >= 3 -BuildRequires: pkgconfig(python3) -Recommends: python3-wxPython -%else -# Use direct version to avoid problems with wx 3.2 -BuildRequires: python-wxWidgets-3_0-devel >= 3 -BuildRequires: wxWidgets-3_0-devel >= 3 -BuildRequires: pkgconfig(python) -Requires: python-wxWidgets-3_0 >= 3 -%endif - BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(python3) >= 3.6 BuildRequires: pkgconfig(zlib) # Fix directory owner BuildRequires: hicolor-icon-theme @@ -82,14 +65,15 @@ Requires: kicad-symbols = %{compatversion} Requires: kicad-footprints = %{compatversion} # KiCad functions without these packages Recommends: kicad-packages3D = %{compatversion} -Recommends: kicad-i18n = %{version} Recommends: kicad-templates = %{compatversion} +Recommends: python3-wxPython Obsoletes: kicad = 20140120 Provides: kicad = %{compatversion} %description -KiCad is an open source (GPL) software for the creation of electronic schematic -diagrams and printed circuit with up to 32 copper layers and additional techinical layers. +KiCad is an open source (GPL) software for the creation of electronic +schematic diagrams and printed circuit with up to 32 copper layers and +additional technical layers. KiCad includes a project manager and four main independent software tools: - Eeschema: schematic editor. @@ -97,31 +81,21 @@ KiCad includes a project manager and four main independent software tools: - Gerbview: GERBER file viewer (photoplotter documents). - Cvpcb: footprint selector for components association. +%lang_package + %prep -%setup -q -n kicad-%{version} -%patch3 +%autosetup -p1 -n kicad-%{file_version} %build -# -DKICAD_PLUGINS:PATH=%%{_libdir}/kicad/plugins \ -# The above path is for .py scripts and other text files install places these files correctly. -# The KICAD_USER_PLUGIN is for binary plugins. %cmake \ - -DKICAD_VERSION_EXTRA=%{version} \ - -DKICAD_LIB:PATH=%{_libdir} \ - -DKICAD_USER_PLUGIN:PATH=%{_libdir}/kicad/plugins \ - -DKICAD_DOCS:PATH=%{_docdir}/kicad \ - -DKICAD_DATA:PATH=%{_datadir}/kicad \ - -DBUILD_GITHUB_PLUGIN=ON \ - -DKICAD_SCRIPTING=ON \ - -DKICAD_SCRIPTING_MODULES=ON \ - -DKICAD_SCRIPTING_WXPYTHON=ON \ -%if %{with python3} - -DKICAD_SCRIPTING_PYTHON3=ON \ - -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \ -%endif - -DKICAD_USE_OCC:BOOL=ON \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -pie" \ - -DPYTHON_SITE_PACKAGE_PATH=%{python_sitearch} \ + -DKICAD_DOCS:PATH=%{_docdir}/kicad \ + -DPYTHON_SITE_PACKAGE_PATH=%{python3_sitearch} \ + -DKICAD_BUILD_I18N=ON \ + -DKICAD_I18N_UNIX_STRICT_PATH:BOOL=ON \ + -DKICAD_SCRIPTING_WXPYTHON=ON \ + -DKICAD_USE_OCC:BOOL=ON \ + -DKICAD_PCM=ON \ -DKICAD_SPICE=ON %cmake_build @@ -141,43 +115,49 @@ KiCad includes a project manager and four main independent software tools: # Link to library libkicad_3dsg.so.2.0.0 has no use rm -rf %{buildroot}%{_libdir}/libkicad_3dsg.so +# https://gitlab.com/kicad/code/kicad/-/issues/9944 +rm -rf %{buildroot}%{_libdir}/libkicad*.a + # Delete packaging/maintenance scripts rm "%{buildroot}%{_docdir}/kicad/scripts/"{test_kicad_plugin.py,test_plugin.py} # Move remaining standalone scripts to kicad directory mv %{buildroot}%{_docdir}/kicad/scripts %{buildroot}%{_datadir}/kicad/ -%if %{with python3} sed -i '1s@^#!.*python.*@#!/usr/bin/python3@' %{buildroot}%{_datadir}/kicad/scripts/*.py -%else -sed -i '1s@^#!.*python.*@#!/usr/bin/python2@' %{buildroot}%{_datadir}/kicad/scripts/*.py -%endif chmod +x %{buildroot}%{_datadir}/kicad/scripts/*.py # Fix executable bits for scripts executed directly from kicad, remove she-bangs chmod -x %{buildroot}%{_datadir}/kicad/scripting/*/*.py sed -i '1s@^#!.*@@' %{buildroot}%{_datadir}/kicad/scripting/*/*.py -%fdupes -s %{buildroot}%{_datadir}/kicad -%fdupes -s %{buildroot}%{_datadir}/icons/hicolor +%fdupes %{buildroot}%{_datadir}/kicad +%fdupes %{buildroot}%{_datadir}/icons/hicolor # the pcbnew kiface and the python module are actually the same file -cmp --quiet %{buildroot}%{_bindir}/_pcbnew.kiface %{buildroot}%{python_sitearch}/_pcbnew.so && \ - ln -sf %{_bindir}/_pcbnew.kiface %{buildroot}%{python_sitearch}/_pcbnew.so +cmp %{buildroot}%{_bindir}/_pcbnew.kiface %{buildroot}%{python3_sitearch}/_pcbnew.so && \ + ln -sf %{_bindir}/_pcbnew.kiface %{buildroot}%{python3_sitearch}/_pcbnew.so + +%find_lang %{name} + +%check +%ctest %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%doc README.txt Documentation/changelogs -%license LICENSE.GPLv3 LICENSE.AGPLv3 LICENSE.README +%doc README.md Documentation/changelogs +%license LICENSE.* %{_bindir}/* %{_libdir}/kicad/ %{_datadir}/kicad/ -%{python_sitearch}/* -%{_datadir}/appdata/kicad.appdata.xml +%{python3_sitearch}/* +%{_datadir}/metainfo/org.kicad.kicad.metainfo.xml %{_datadir}/applications/*.desktop %{_datadir}/mime/packages/kicad-*.xml %{_datadir}/icons/hicolor/*/mimetypes/application-x-* %{_datadir}/icons/hicolor/*/apps/*.* %{_libdir}/libkicad_3dsg.so.2.0.0 +%files lang -f %{name}.lang + %changelog