summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Puskas <zoltan@sinustrom.info>2019-12-19 02:26:24 -0800
committerAlexey Shvetsov <alexxy@gentoo.org>2020-05-14 13:34:07 +0300
commit0eea69141f8a758b5205b69a1495332aff9e78e9 (patch)
tree4db6b92795963ed5deb5aaf6e5d9e0b543120526 /sci-electronics/kicad
parentdev-python/bpython: Remove old (diff)
downloadgentoo-0eea69141f8a758b5205b69a1495332aff9e78e9.tar.gz
gentoo-0eea69141f8a758b5205b69a1495332aff9e78e9.tar.bz2
gentoo-0eea69141f8a758b5205b69a1495332aff9e78e9.zip
sci-electronics/kicad: Fix build failure and QA
Fix recent build failure in KiCAD. Also apply backported patches from upstream to address QA issues that remained since introducing this version of the ebuild. Package-Manager: Portage-2.3.80, Repoman-2.3.19 Signed-off-by: Zoltan Puskas <zoltan@sinustrom.info> Closes: https://bugs.gentoo.org/682480 Closes: https://bugs.gentoo.org/722288 Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'sci-electronics/kicad')
-rw-r--r--sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch6
-rw-r--r--sci-electronics/kicad/files/kicad-5.1.5-strict-aliasing.patch25
-rw-r--r--sci-electronics/kicad/files/kicad-algorithm-header.patch11
-rw-r--r--sci-electronics/kicad/files/kicad-metainfo.patch12
-rw-r--r--sci-electronics/kicad/kicad-5.1.5-r2.ebuild (renamed from sci-electronics/kicad/kicad-5.1.5-r1.ebuild)17
5 files changed, 67 insertions, 4 deletions
diff --git a/sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch b/sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch
index 3aac927b5bd..3b4b6a4d2fe 100644
--- a/sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch
+++ b/sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch
@@ -13,8 +13,8 @@ diff -Naur kicad-5.1.5-orig/pcbnew/CMakeLists.txt kicad-5.1.5/pcbnew/CMakeLists.
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.kiface DESTINATION ${PYTHON_DEST} COMPONENT binary RENAME "_pcbnew.so" )
set( PYMOD_EXT "so" )
endif()
-
-@@ -827,18 +823,16 @@
+
+@@ -792,18 +788,16 @@ if( KICAD_SCRIPTING_MODULES )
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
)
else()
@@ -41,5 +41,5 @@ diff -Naur kicad-5.1.5-orig/pcbnew/CMakeLists.txt kicad-5.1.5/pcbnew/CMakeLists.
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
+ )
endif()
-
+
endif()
diff --git a/sci-electronics/kicad/files/kicad-5.1.5-strict-aliasing.patch b/sci-electronics/kicad/files/kicad-5.1.5-strict-aliasing.patch
new file mode 100644
index 00000000000..b01a6b7d79f
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-5.1.5-strict-aliasing.patch
@@ -0,0 +1,25 @@
+diff --git a/eeschema/dialogs/dialog_spice_model.cpp b/eeschema/dialogs/dialog_spice_model.cpp
+index b265e2363..eb1187d86 100644
+--- a/eeschema/dialogs/dialog_spice_model.cpp
++++ b/eeschema/dialogs/dialog_spice_model.cpp
+@@ -34,6 +34,7 @@
+ #include <wx/wupdlock.h>
+
+ #include <cctype>
++#include <cstring>
+
+ // Helper function to shorten conditions
+ static bool empty( const wxTextCtrl* aCtrl )
+@@ -804,9 +804,11 @@ bool DIALOG_SPICE_MODEL::addPwlValue( const wxString& aTime, const wxString& aVa
+ float timeF;
+ m_pwlTime->GetValue().ToDouble( &timeD );
+ timeF = timeD;
++ long data;
++ std::memcpy( &data, &timeF, sizeof( timeF ) );
+
+ // Store the time value, so the entries can be sorted
+- m_pwlValList->SetItemData( idx, *reinterpret_cast<long*>( &timeF ) );
++ m_pwlValList->SetItemData( idx, data );
+
+ // Sort items by timestamp
+ m_pwlValList->SortItems( comparePwlValues, -1 );
diff --git a/sci-electronics/kicad/files/kicad-algorithm-header.patch b/sci-electronics/kicad/files/kicad-algorithm-header.patch
new file mode 100644
index 00000000000..aa118ea6f86
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-algorithm-header.patch
@@ -0,0 +1,11 @@
+diff -Naur kicad-5.1.5-orig/common/lib_tree_model.cpp kicad-5.1.5/common/lib_tree_model.cpp
+--- kicad-5.1.5-orig/common/lib_tree_model.cpp 2020-05-11 00:36:36.568301297 +0200
++++ kicad-5.1.5/common/lib_tree_model.cpp 2020-05-11 00:37:50.472359703 +0200
+@@ -21,6 +21,7 @@
+
+ #include <lib_tree_model.h>
+
++#include <algorithm>
+ #include <eda_pattern_match.h>
+ #include <lib_tree_item.h>
+ #include <make_unique.h>
diff --git a/sci-electronics/kicad/files/kicad-metainfo.patch b/sci-electronics/kicad/files/kicad-metainfo.patch
new file mode 100644
index 00000000000..48a5ef5be50
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-metainfo.patch
@@ -0,0 +1,12 @@
+diff -Naur kicad-5.1.5-orig/CMakeLists.txt kicad-5.1.5/CMakeLists.txt
+--- kicad-5.1.5-orig/CMakeLists.txt 2019-11-14 09:09:45.000000000 -0800
++++ kicad-5.1.5/CMakeLists.txt 2020-05-11 23:51:52.122093410 -0700
+@@ -919,7 +919,7 @@
+ set( UNIX_MIME_FILES ${UNIX_MIME_DIR}/mime )
+ set( UNIX_ICON_FILES ${UNIX_MIME_DIR}/icons )
+ set( UNIX_APPLICATIONS_FILES ${UNIX_MIME_DIR}/applications )
+- set( UNIX_APPDATA_FILES resources/linux/appdata )
++ set( UNIX_APPDATA_FILES resources/linux/metainfo )
+
+ # Install Mime directory
+ install( DIRECTORY ${UNIX_ICON_FILES}
diff --git a/sci-electronics/kicad/kicad-5.1.5-r1.ebuild b/sci-electronics/kicad/kicad-5.1.5-r2.ebuild
index aaf6a6bf350..8dbca2a8ae4 100644
--- a/sci-electronics/kicad/kicad-5.1.5-r1.ebuild
+++ b/sci-electronics/kicad/kicad-5.1.5-r2.ebuild
@@ -57,6 +57,9 @@ CHECKREQS_DISK_BUILD="800M"
PATCHES=(
"${FILESDIR}"/"${PN}-5.1.5-help.patch"
"${FILESDIR}"/"${PN}-5.1.5-ninja-build.patch"
+ "${FILESDIR}"/"${PN}-5.1.5-strict-aliasing.patch"
+ "${FILESDIR}"/"${PN}-algorithm-header.patch"
+ "${FILESDIR}"/"${PN}-metainfo.patch"
"${FILESDIR}"/"ldflags.patch"
)
@@ -67,11 +70,22 @@ pkg_setup() {
check-reqs_pkg_setup
}
+src_unpack() {
+ default_src_unpack
+ # For the metainfo patch to work the kicad.appdata.xml has to be moved to
+ # avoid QA issue. This is needed because /usr/share/appdata location is
+ # deprecated, it should not be used anymore by new software.
+ # Appdata/Metainfo files should be installed into /usr/share/metainfo
+ # directory. as per
+ # https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html
+ mv "${S}/resources/linux/appdata" "${S}/resources/linux/metainfo" || die "Appdata move failed"
+}
+
src_configure() {
xdg_environment_reset
local mycmakeargs=(
- -DKICAD_DOCS="${EPREFIX}/usr/share/doc/${P}"
+ -DKICAD_DOCS="${EPREFIX}/usr/share/doc/${PF}"
-DKICAD_HELP="${EPREFIX}/usr/share/doc/${PN}-doc-${PV}"
-DBUILD_GITHUB_PLUGIN="$(usex github)"
-DKICAD_SCRIPTING="$(usex python)"
@@ -84,6 +98,7 @@ src_configure() {
-DKICAD_USE_OCC="$(usex occ)"
-DKICAD_USE_OCE="$(usex oce)"
-DKICAD_INSTALL_DEMOS="$(usex examples)"
+ -DCMAKE_SKIP_RPATH="ON"
)
use python && mycmakeargs+=(
-DPYTHON_DEST="$(python_get_sitedir)"