summaryrefslogtreecommitdiff
path: root/sci-electronics/kicad/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
commit21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch)
treee1810a4b135afce04b34862ef0fab2bfaeb8aeca /sci-electronics/kicad/files
parent7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff)
gentoo resync : 15.01.2020
Diffstat (limited to 'sci-electronics/kicad/files')
-rw-r--r--sci-electronics/kicad/files/kicad-5.1.5-help.patch117
-rw-r--r--sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch45
-rw-r--r--sci-electronics/kicad/files/ldflags.patch17
3 files changed, 179 insertions, 0 deletions
diff --git a/sci-electronics/kicad/files/kicad-5.1.5-help.patch b/sci-electronics/kicad/files/kicad-5.1.5-help.patch
new file mode 100644
index 000000000000..1b37e3013c1e
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-5.1.5-help.patch
@@ -0,0 +1,117 @@
+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 2019-12-15 03:41:57.574995996 -0800
+@@ -442,6 +442,10 @@
+ set( KIFACE_PREFIX "_" )
+ #message( STATUS "KIFACE_SUFFIX:${KIFACE_SUFFIX} KIFACE_PREFIX:${KIFACE_PREFIX}" )
+
++# KICAD_HELP is the location of the help files accessed from the UI
++# (usually provided via kicad-doc package)
++set ( KICAD_HELP share/doc/kicad
++ CACHE PATH "Alternative location of KiCad help files.")
+
+ #================================================
+ # Locations for install targets.
+diff -Naur kicad-5.1.5-orig/CMakeModules/config.h.cmake kicad-5.1.5/CMakeModules/config.h.cmake
+--- kicad-5.1.5-orig/CMakeModules/config.h.cmake 2019-11-14 09:09:45.000000000 -0800
++++ kicad-5.1.5/CMakeModules/config.h.cmake 2019-12-15 03:42:00.368013375 -0800
+@@ -59,6 +59,10 @@
+ /// The install prefix defined during CMake configuration or fall back to CMAKE_INSTALL_PREFIX.
+ #define DEFAULT_INSTALL_PATH "@DEFAULT_INSTALL_PATH@"
+
++/// KiCad help files path can be different on some systems allow adding alternative,
++/// search path for them. Defaults to CMAKE_INSTALL_PREFIX/share/doc/kicad
++#define KICAD_HELP "@KICAD_HELP@"
++
+ /// The wxPython version found during configuration.
+ #if defined( KICAD_SCRIPTING_WXPYTHON )
+ #define WXPYTHON_VERSION "@WXPYTHON_VERSION@"
+diff -Naur kicad-5.1.5-orig/common/searchhelpfilefullpath.cpp kicad-5.1.5/common/searchhelpfilefullpath.cpp
+--- kicad-5.1.5-orig/common/searchhelpfilefullpath.cpp 2019-11-14 09:09:45.000000000 -0800
++++ kicad-5.1.5/common/searchhelpfilefullpath.cpp 2019-12-15 03:42:03.168030796 -0800
+@@ -25,7 +25,7 @@
+
+ #include <pgm_base.h>
+ #include <common.h>
+-#include <config.h> // to define DEFAULT_INSTALL_PATH
++#include <config.h> // to define DEFAULT_INSTALL_PATH and KICAD_HELP
+ #include <macros.h>
+ #include <trace_helpers.h>
+
+@@ -69,6 +69,10 @@
+ wxArrayString subdirs;
+ wxArrayString altsubdirs;
+ SEARCH_STACK ss = aSStack;
++#if ! defined(__WXMAC__) // && defined(__linux__)
++ SEARCH_STACK altss;
++ wxArrayString moresubdirs;
++#endif
+
+ // It might already be in aSStack, but why depend on other code
+ // far away when it's so easy to add it again (to our copy) as the first place to look.
+@@ -76,6 +80,7 @@
+ // This is CMAKE_INSTALL_PREFIX unless DEFAULT_INSTALL_PATH was defined during
+ // build configuration:
+ ss.AddPaths( wxT( DEFAULT_INSTALL_PATH ), 0 );
++ altss.AddPaths( wxT( KICAD_HELP ), 0 );
+
+ #if defined(__WXMAC__)
+ ss.AddPaths( GetOSXKicadMachineDataDir() );
+@@ -104,16 +109,17 @@
+
+ // Based on kicad-doc.bzr/CMakeLists.txt, line 20, the help files are
+ // installed into "<CMAKE_INSTALL_PREFIX>/share/doc/kicad/help" for linux.
+- // This is ${KICAD_HELP} var in that CMakeLists.txt file.
+ // Below we account for an international subdirectory.
+ subdirs.Add( "share" );
+ subdirs.Add( "doc" );
+ subdirs.Add( "kicad" );
+ subdirs.Add( "help" );
+
++ // For custom help path installations via ${KICAD_HELP}
++ moresubdirs.Add( "help" );
++
+ // Based on kicad-doc.bzr/CMakeLists.txt, line 35, the help files are
+ // installed into "<CMAKE_INSTALL_PREFIX>/doc/help" for Windows.
+- // This is ${KICAD_HELP} var in that CMakeLists.txt file.
+ // Below we account for an international subdirectory.
+ altsubdirs.Add( "doc" );
+ altsubdirs.Add( "help" );
+@@ -159,6 +165,9 @@
+ {
+ subdirs.Add( locale_name_dirs[ii] );
+ altsubdirs.Add( locale_name_dirs[ii] );
++#if ! defined(__WXMAC__) // && defined(__linux__)
++ moresubdirs.Add( locale_name_dirs[ii] );
++#endif
+
+ fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".html" ), &altsubdirs );
+
+@@ -188,8 +197,27 @@
+ if( !fn.IsEmpty() )
+ break;
+
++#if ! defined(__WXMAC__) // && defined(__linux__)
++ fn = FindFileInSearchPaths( altss, aBaseName + wxT( ".html" ), &moresubdirs );
++
++ if( !fn.IsEmpty() )
++ {
++ // Prepend URI protocol since we will open in a browser
++ fn = wxT( "file://" ) + fn;
++ break;
++ }
++
++ fn = FindFileInSearchPaths( altss, aBaseName + wxT( ".pdf" ), &moresubdirs );
++
++ if( !fn.IsEmpty() )
++ break;
++#endif
++
+ subdirs.RemoveAt( subdirs.GetCount() - 1 );
+ altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 );
++#if ! defined(__WXMAC__) // && defined(__linux__)
++ moresubdirs.RemoveAt( altsubdirs.GetCount() - 1 );
++#endif
+ }
+
+ return fn;
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
new file mode 100644
index 000000000000..3aac927b5bd2
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-5.1.5-ninja-build.patch
@@ -0,0 +1,45 @@
+diff -Naur kicad-5.1.5-orig/pcbnew/CMakeLists.txt kicad-5.1.5/pcbnew/CMakeLists.txt
+--- kicad-5.1.5-orig/pcbnew/CMakeLists.txt 2019-11-14 09:09:45.000000000 -0800
++++ kicad-5.1.5/pcbnew/CMakeLists.txt 2019-12-15 03:47:03.479894245 -0800
+@@ -808,11 +808,7 @@
+ add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingWxpythonCopy )
+ set( PYMOD_EXT "so" )
+ else() # only linux remains among supported platforms
+- add_library( pcbnew_python MODULE $<TARGET_OBJECTS:pcbnew_kiface_objects> )
+- target_link_libraries( pcbnew_python ${PCBNEW_KIFACE_LIBRARIES} )
+- set_target_properties( pcbnew_python PROPERTIES OUTPUT_NAME pcbnew PREFIX "_" SUFFIX ".so" )
+- install( TARGETS pcbnew_python DESTINATION ${PYTHON_DEST} COMPONENT binary )
+-
++ 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 @@
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
+ )
+ else()
+-
+-
+- # For phase 1, copy _pcbnew.kiface to the python module.
+- add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
+- DEPENDS pcbnew_kiface
+- COMMAND ${CMAKE_COMMAND} -E copy _pcbnew.kiface _pcbnew.${PYMOD_EXT}
+- COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use."
+- )
+- add_custom_target(
+- pcbnew_python_module ALL
+- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
+- )
++ # For phase 1, copy _pcbnew.kiface to the python module.
++ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
++ DEPENDS pcbnew_kiface
++ COMMAND ${CMAKE_COMMAND} -E copy _pcbnew.kiface _pcbnew.${PYMOD_EXT}
++ COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use."
++ )
++ add_custom_target(
++ pcbnew_python_module ALL
++ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
++ )
+ endif()
+
+ endif()
diff --git a/sci-electronics/kicad/files/ldflags.patch b/sci-electronics/kicad/files/ldflags.patch
new file mode 100644
index 000000000000..1495037b1b72
--- /dev/null
+++ b/sci-electronics/kicad/files/ldflags.patch
@@ -0,0 +1,17 @@
+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 2019-11-19 02:08:32.309282631 -0800
+@@ -355,10 +355,10 @@
+
+ elseif( NOT APPLE )
+ # Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it)
+- set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
+- set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
++ set( CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS} -Wl,--no-undefined" )
++ set( CMAKE_MODULE_LINKER_FLAGS "$ENV{LDFLAGS} -Wl,--no-undefined" )
+
+- set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
++ set( CMAKE_EXE_LINKER_FLAGS_RELEASE "$ENV{LDFLAGS} -s" )
+
+ # Defeat ELF's ability to use the GOT to replace locally implemented functions
+ # with ones from another module.