summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Sergey Kvachonok <ravenexp@gmail.com> 2017-07-07 08:46:48 +0300
committerAvatar Heiko Becker <heirecka@exherbo.org> 2017-07-20 12:30:41 +0200
commit9026ff3dd10c287b4f3621aa6bfcee05fb6ff4ac (patch)
tree1b843f159c81e78a7b7359e1d0d85c752faa50f3
parente1507404f419722a8d948e65934a63ba3c9fd6fa (diff)
downloadscientific-9026ff3dd10c287b4f3621aa6bfcee05fb6ff4ac.tar.gz
scientific-9026ff3dd10c287b4f3621aa6bfcee05fb6ff4ac.tar.xz
kicad: Add upstream boost[>=1.61] patch
Remove older boost::context hacks. Change-Id: I9eb7e68b69e49f24d4de6834b28905722bf57afa Reviewed-on: https://galileo.mailstation.de/gerrit/9512 Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Heiko Becker <heirecka@exherbo.org>
-rw-r--r--packages/sci-electronics/kicad/files/boost-1.61.patch351
-rw-r--r--packages/sci-electronics/kicad/files/kicad-4.0.6-boost-context.patch111
-rw-r--r--packages/sci-electronics/kicad/files/libcontext.cpp608
-rw-r--r--packages/sci-electronics/kicad/files/libcontext.h85
-rw-r--r--packages/sci-electronics/kicad/kicad-4.0.6.exheres-014
-rw-r--r--packages/sci-electronics/kicad/kicad-scm.exheres-014
-rw-r--r--packages/sci-electronics/kicad/kicad.exlib7
7 files changed, 358 insertions, 832 deletions
diff --git a/packages/sci-electronics/kicad/files/boost-1.61.patch b/packages/sci-electronics/kicad/files/boost-1.61.patch
new file mode 100644
index 0000000..e3b0ff5
--- /dev/null
+++ b/packages/sci-electronics/kicad/files/boost-1.61.patch
@@ -0,0 +1,351 @@
+Source: http://kicad-pcb.org/boost-1.61.patch
+Upstream: yes (v5.0)
+Reason: KiCad 4.0.5 and 4.0.6 cannot be compiled with boost 1.61 and higher
+
+--- a/common/tool/tool_manager.cpp
++++ b/common/tool/tool_manager.cpp
+@@ -532,11 +532,11 @@
+ if( st->cofunc )
+ st->Push();
+
++ st->cofunc = new COROUTINE<int, const TOOL_EVENT&>( tr.second );
++
+ // as the state changes, the transition table has to be set up again
+ st->transitions.clear();
+
+- st->cofunc = new COROUTINE<int, const TOOL_EVENT&>( tr.second );
+-
+ // got match? Run the handler.
+ st->cofunc->Call( aEvent );
+
+--- a/include/tool/coroutine.h
++++ b/include/tool/coroutine.h
+@@ -27,10 +28,15 @@
+
+ #include <cstdlib>
+
+-#include <boost/context/fcontext.hpp>
+ #include <boost/version.hpp>
++#include <type_traits>
+
+-#include "delegate.h"
++#if BOOST_VERSION <= 106000
++#include <boost/context/fcontext.hpp>
++#else
++#include <boost/context/execution_context.hpp>
++#include <boost/context/protected_fixedsize_stack.hpp>
++#endif
+
+ /**
+ * Class COROUNTINE.
+@@ -53,13 +59,12 @@
+ * See coroutine_example.cpp for sample code.
+ */
+
+-template <class ReturnType, class ArgType>
++template <typename ReturnType, typename ArgType>
+ class COROUTINE
+ {
+ public:
+ COROUTINE() :
+- m_saved( NULL ), m_self( NULL ), m_stack( NULL ), m_stackSize( c_defaultStackSize ),
+- m_running( false )
++ COROUTINE( nullptr )
+ {
+ }
+
+@@ -69,8 +74,7 @@
+ */
+ template <class T>
+ COROUTINE( T* object, ReturnType(T::* ptr)( ArgType ) ) :
+- m_func( object, ptr ), m_self( NULL ), m_saved( NULL ), m_stack( NULL ),
+- m_stackSize( c_defaultStackSize ), m_running( false )
++ COROUTINE( std::bind( ptr, object, std::placeholders::_1 ) )
+ {
+ }
+
+@@ -78,9 +82,15 @@
+ * Constructor
+ * Creates a coroutine from a delegate object
+ */
+- COROUTINE( DELEGATE<ReturnType, ArgType> aEntry ) :
+- m_func( aEntry ), m_saved( NULL ), m_self( NULL ), m_stack( NULL ),
+- m_stackSize( c_defaultStackSize ), m_running( false )
++ COROUTINE( std::function<ReturnType(ArgType)> aEntry ) :
++ m_func( std::move( aEntry ) ),
++ m_running( false ),
++#if BOOST_VERSION <= 106000
++ m_stack( nullptr ),
++ m_stackSize( c_defaultStackSize ),
++#endif
++ m_caller( nullptr ),
++ m_callee( nullptr )
+ {
+ // Avoid not initialized members, and make static analysers quiet
+ m_args = 0;
+@@ -89,18 +99,26 @@
+
+ ~COROUTINE()
+ {
+- if( m_saved )
+- delete m_saved;
+-
+ #if BOOST_VERSION >= 105600
+- if( m_self )
+- delete m_self;
++ delete m_callee;
+ #endif
+
++#if BOOST_VERSION <= 106000
++ delete m_caller;
++
+ if( m_stack )
+ free( m_stack );
++#endif
+ }
+
++private:
++#if BOOST_VERSION <= 106000
++ using context_type = boost::context::fcontext_t;
++#else
++ using context_type = boost::context::execution_context<COROUTINE*>;
++#endif
++
++public:
+ /**
+ * Function Yield()
+ *
+@@ -110,7 +128,12 @@
+ */
+ void Yield()
+ {
+- jump( m_self, m_saved, 0 );
++#if BOOST_VERSION <= 106000
++ jump( m_callee, m_caller, false );
++#else
++ auto result = (*m_caller)( this );
++ *m_caller = std::move( std::get<0>( result ) );
++#endif
+ }
+
+ /**
+@@ -122,7 +145,11 @@
+ void Yield( ReturnType& aRetVal )
+ {
+ m_retVal = aRetVal;
+- jump( m_self, m_saved, 0 );
++#if BOOST_VERSION <= 106000
++ jump( m_callee, m_caller, false );
++#else
++ m_caller( this );
++#endif
+ }
+
+ /**
+@@ -130,9 +157,9 @@
+ *
+ * Defines the entry point for the coroutine, if not set in the constructor.
+ */
+- void SetEntry( DELEGATE<ReturnType, ArgType> aEntry )
++ void SetEntry( std::function<ReturnType(ArgType)> aEntry )
+ {
+- m_func = aEntry;
++ m_func = std::move( aEntry );
+ }
+
+ /* Function Call()
+@@ -143,6 +170,10 @@
+ */
+ bool Call( ArgType aArgs )
+ {
++ assert( m_callee == NULL );
++ assert( m_caller == NULL );
++
++#if BOOST_VERSION <= 106000
+ // fixme: Clean up stack stuff. Add a guard
+ m_stack = malloc( c_defaultStackSize );
+
+@@ -151,22 +182,32 @@
+
+ // correct the stack size
+ m_stackSize -= ( (size_t) m_stack + m_stackSize - (size_t) sp );
+-
+- assert( m_self == NULL );
+- assert( m_saved == NULL );
++#endif
+
+ m_args = &aArgs;
+-#if BOOST_VERSION >= 105600
+- m_self = new boost::context::fcontext_t();
+- *m_self = boost::context::make_fcontext( sp, m_stackSize, callerStub );
++
++#if BOOST_VERSION < 105600
++ m_callee = boost::context::make_fcontext( sp, m_stackSize, callerStub );
++#elif BOOST_VERSION <= 106000
++ m_callee = new context_type( boost::context::make_fcontext( sp, m_stackSize, callerStub ) );
+ #else
+- m_self = boost::context::make_fcontext( sp, m_stackSize, callerStub );
++ m_callee = new context_type( std::allocator_arg_t(),
++ boost::context::protected_fixedsize_stack( c_defaultStackSize ), &COROUTINE::callerStub );
++#endif
++
++#if BOOST_VERSION <= 106000
++ m_caller = new context_type();
+ #endif
+- m_saved = new boost::context::fcontext_t();
+
+ m_running = true;
++
+ // off we go!
+- jump( m_saved, m_self, reinterpret_cast<intptr_t>( this ) );
++#if BOOST_VERSION <= 106000
++ jump( m_caller, m_callee, reinterpret_cast<intptr_t>( this ) );
++#else
++ auto result = (*m_callee)( this );
++ *m_callee = std::move( std::get<0>( result ) );
++#endif
+ return m_running;
+ }
+
+@@ -179,7 +220,12 @@
+ */
+ bool Resume()
+ {
+- jump( m_saved, m_self, 0 );
++#if BOOST_VERSION <= 106000
++ jump( m_caller, m_callee, false );
++#else
++ auto result = (*m_callee)( this );
++ *m_callee = std::move( std::get<0>( result ) );
++#endif
+
+ return m_running;
+ }
+@@ -208,61 +254,66 @@
+ static const int c_defaultStackSize = 2000000; // fixme: make configurable
+
+ /* real entry point of the coroutine */
++#if BOOST_VERSION <= 106000
+ static void callerStub( intptr_t aData )
++#else
++ static context_type callerStub( context_type caller, COROUTINE* cor )
++#endif
+ {
+ // get pointer to self
++#if BOOST_VERSION <= 106000
+ COROUTINE<ReturnType, ArgType>* cor = reinterpret_cast<COROUTINE<ReturnType, ArgType>*>( aData );
++#else
++ cor->m_caller = &caller;
++#endif
+
+ // call the coroutine method
+- cor->m_retVal = cor->m_func( *cor->m_args );
++ cor->m_retVal = cor->m_func( *( cor->m_args ) );
+ cor->m_running = false;
+
+ // go back to wherever we came from.
+- jump( cor->m_self, cor->m_saved, 0 ); // reinterpret_cast<intptr_t>( this ));
++#if BOOST_VERSION <= 106000
++ jump( cor->m_callee, cor->m_caller, 0 );
++#else
++ return caller;
++#endif
+ }
+
+ ///> Wrapper for jump_fcontext to assure compatibility between different boost versions
+- static inline intptr_t jump(boost::context::fcontext_t* aOld, boost::context::fcontext_t* aNew,
++#if BOOST_VERSION <= 106000
++ static inline intptr_t jump( context_type* aOld, context_type* aNew,
+ intptr_t aP, bool aPreserveFPU = true )
+ {
+-#if BOOST_VERSION >= 105600
+- return boost::context::jump_fcontext( aOld, *aNew, aP, aPreserveFPU );
+-#else
++#if BOOST_VERSION < 105600
+ return boost::context::jump_fcontext( aOld, aNew, aP, aPreserveFPU );
++#else
++ return boost::context::jump_fcontext( aOld, *aNew, aP, aPreserveFPU );
+ #endif
+ }
++#endif
+
+- template <typename T>
+- struct strip_ref
+- {
+- typedef T result;
+- };
++ std::function<ReturnType(ArgType)> m_func;
+
+- template <typename T>
+- struct strip_ref<T&>
+- {
+- typedef T result;
+- };
++ bool m_running;
+
+- DELEGATE<ReturnType, ArgType> m_func;
++#if BOOST_VERSION <= 106000
++ ///< coroutine stack
++ void* m_stack;
++
++ size_t m_stackSize;
++#endif
+
+ ///< pointer to coroutine entry arguments. Stripped of references
+ ///< to avoid compiler errors.
+- typename strip_ref<ArgType>::result* m_args;
++ typename std::remove_reference<ArgType>::type* m_args;
++
+ ReturnType m_retVal;
+
+ ///< saved caller context
+- boost::context::fcontext_t* m_saved;
++ context_type* m_caller;
+
+ ///< saved coroutine context
+- boost::context::fcontext_t* m_self;
+-
+- ///< coroutine stack
+- void* m_stack;
+-
+- size_t m_stackSize;
+-
+- bool m_running;
++ context_type* m_callee;
+ };
+
+ #endif
+--- a/include/tool/tool_base.h
++++ b/include/tool/tool_base.h
+@@ -31,7 +32,7 @@
+ #include <tool/tool_event.h>
+ #include <tool/tool_settings.h>
+
+-#include <tool/delegate.h>
++#include <functional>
+
+ class EDA_ITEM;
+ class TOOL_MANAGER;
+@@ -53,7 +54,9 @@
+
+ /// Unique identifier for tools
+ typedef int TOOL_ID;
+-typedef DELEGATE<int, const TOOL_EVENT&> TOOL_STATE_FUNC;
++
++using TOOL_STATE_FUNC = std::function<int(const TOOL_EVENT&)>;
++
+
+ /**
+ * Class TOOL_BASE
+--- a/include/tool/tool_interactive.h
++++ b/include/tool/tool_interactive.h
+@@ -113,7 +114,7 @@
+ void TOOL_INTERACTIVE::Go( int (T::* aStateFunc)( const TOOL_EVENT& ),
+ const TOOL_EVENT_LIST& aConditions )
+ {
+- TOOL_STATE_FUNC sptr( static_cast<T*>( this ), aStateFunc );
++ TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
+
+ goInternal( sptr, aConditions );
+ }
+
diff --git a/packages/sci-electronics/kicad/files/kicad-4.0.6-boost-context.patch b/packages/sci-electronics/kicad/files/kicad-4.0.6-boost-context.patch
deleted file mode 100644
index 1677e10..0000000
--- a/packages/sci-electronics/kicad/files/kicad-4.0.6-boost-context.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-Source: from Gentoo
-Upstream: no (in the master branch they got rid of boost::context altogether)
-Reason: boost[>=1.61] removed boost::context
-
-diff -Naur kicad-4.0.2-orig/common/system/libcontext.cpp kicad-4.0.2/common/system/libcontext.cpp
---- kicad-4.0.2-orig/common/system/libcontext.cpp 2016-06-16 22:30:58.000000000 -0700
-+++ kicad-4.0.2/common/system/libcontext.cpp 2016-06-16 22:35:46.654719468 -0700
-@@ -13,7 +13,7 @@
- http://www.boost.org/LICENSE_1_0.txt)
-
- */
--#include "libcontext.h"
-+#include <system/libcontext.h>
- #if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
- __asm (
- ".text\n"
-diff -Naur kicad-4.0.2-orig/CMakeLists.txt kicad-4.0.2/CMakeLists.txt
---- kicad-4.0.2-orig/CMakeLists.txt 2016-02-13 13:14:42.000000000 -0800
-+++ kicad-4.0.2/CMakeLists.txt 2016-06-11 01:11:25.623484908 -0700
-@@ -561,7 +561,7 @@
- # Download boost and possibly build parts of it
- #################################################
- if( KICAD_SKIP_BOOST )
-- find_package( Boost 1.54.0 REQUIRED COMPONENTS context date_time filesystem iostreams locale
-+ find_package( Boost 1.54.0 REQUIRED COMPONENTS date_time filesystem iostreams locale
- program_options regex system thread )
-
- if( NOT Boost_FOUND )
-diff -Naur kicad-4.0.2-orig/common/CMakeLists.txt kicad-4.0.2/common/CMakeLists.txt
---- kicad-4.0.2-orig/common/CMakeLists.txt 2016-02-13 13:14:42.000000000 -0800
-+++ kicad-4.0.2/common/CMakeLists.txt 2016-06-11 01:10:04.886830434 -0700
-@@ -256,6 +256,8 @@
- view/view_item.cpp
- view/view_group.cpp
-
-+ system/libcontext.cpp
-+
- math/math_util.cpp
-
- tool/tool_action.cpp
-diff -Naur kicad-4.0.2-orig/include/tool/coroutine.h kicad-4.0.2/include/tool/coroutine.h
---- kicad-4.0.2-orig/include/tool/coroutine.h 2016-02-13 13:14:42.000000000 -0800
-+++ kicad-4.0.2/include/tool/coroutine.h 2016-06-11 01:07:06.035378422 -0700
-@@ -27,8 +27,7 @@
-
- #include <cstdlib>
-
--#include <boost/context/fcontext.hpp>
--#include <boost/version.hpp>
-+#include <system/libcontext.h>
-
- #include "delegate.h"
-
-@@ -92,10 +91,8 @@
- if( m_saved )
- delete m_saved;
-
--#if BOOST_VERSION >= 105600
- if( m_self )
- delete m_self;
--#endif
-
- if( m_stack )
- free( m_stack );
-@@ -156,13 +153,9 @@
- assert( m_saved == NULL );
-
- m_args = &aArgs;
--#if BOOST_VERSION >= 105600
-- m_self = new boost::context::fcontext_t();
-- *m_self = boost::context::make_fcontext( sp, m_stackSize, callerStub );
--#else
-- m_self = boost::context::make_fcontext( sp, m_stackSize, callerStub );
--#endif
-- m_saved = new boost::context::fcontext_t();
-+ m_self = new fcontext_t();
-+ *m_self = make_fcontext( sp, m_stackSize, callerStub );
-+ m_saved = new fcontext_t();
-
- m_running = true;
- // off we go!
-@@ -222,14 +215,10 @@
- }
-
- ///> Wrapper for jump_fcontext to assure compatibility between different boost versions
-- static inline intptr_t jump(boost::context::fcontext_t* aOld, boost::context::fcontext_t* aNew,
-+ static inline intptr_t jump(fcontext_t* aOld, fcontext_t* aNew,
- intptr_t aP, bool aPreserveFPU = true )
- {
--#if BOOST_VERSION >= 105600
-- return boost::context::jump_fcontext( aOld, *aNew, aP, aPreserveFPU );
--#else
-- return boost::context::jump_fcontext( aOld, aNew, aP, aPreserveFPU );
--#endif
-+ return jump_fcontext( aOld, *aNew, aP, aPreserveFPU );
- }
-
- template <typename T>
-@@ -252,10 +241,10 @@
- ReturnType m_retVal;
-
- ///< saved caller context
-- boost::context::fcontext_t* m_saved;
-+ fcontext_t* m_saved;
-
- ///< saved coroutine context
-- boost::context::fcontext_t* m_self;
-+ fcontext_t* m_self;
-
- ///< coroutine stack
- void* m_stack;
diff --git a/packages/sci-electronics/kicad/files/libcontext.cpp b/packages/sci-electronics/kicad/files/libcontext.cpp
deleted file mode 100644
index 5364a0b..0000000
--- a/packages/sci-electronics/kicad/files/libcontext.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
-
- auto-generated file, do not modify!
- libcontext - a slightly more portable version of boost::context
- Copyright Martin Husemann 2013.
- Copyright Oliver Kowalke 2009.
- Copyright Sergue E. Leontiev 2013
- Copyright Thomas Sailer 2013.
- Minor modifications by Tomasz Wlostowski 2016.
-
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
-
-*/
-#include "libcontext.h"
-#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl _jump_fcontext\n"
-".def _jump_fcontext; .scl 2; .type 32; .endef\n"
-"_jump_fcontext:\n"
-" mov 0x10(%esp),%ecx\n"
-" push %ebp\n"
-" push %ebx\n"
-" push %esi\n"
-" push %edi\n"
-" mov %fs:0x18,%edx\n"
-" mov (%edx),%eax\n"
-" push %eax\n"
-" mov 0x4(%edx),%eax\n"
-" push %eax\n"
-" mov 0x8(%edx),%eax\n"
-" push %eax\n"
-" mov 0xe0c(%edx),%eax\n"
-" push %eax\n"
-" mov 0x10(%edx),%eax\n"
-" push %eax\n"
-" lea -0x8(%esp),%esp\n"
-" test %ecx,%ecx\n"
-" je nxt1\n"
-" stmxcsr (%esp)\n"
-" fnstcw 0x4(%esp)\n"
-"nxt1:\n"
-" mov 0x30(%esp),%eax\n"
-" mov %esp,(%eax)\n"
-" mov 0x34(%esp),%edx\n"
-" mov 0x38(%esp),%eax\n"
-" mov %edx,%esp\n"
-" test %ecx,%ecx\n"
-" je nxt2\n"
-" ldmxcsr (%esp)\n"
-" fldcw 0x4(%esp)\n"
-"nxt2:\n"
-" lea 0x8(%esp),%esp\n"
-" mov %fs:0x18,%edx\n"
-" pop %ecx\n"
-" mov %ecx,0x10(%edx)\n"
-" pop %ecx\n"
-" mov %ecx,0xe0c(%edx)\n"
-" pop %ecx\n"
-" mov %ecx,0x8(%edx)\n"
-" pop %ecx\n"
-" mov %ecx,0x4(%edx)\n"
-" pop %ecx\n"
-" mov %ecx,(%edx)\n"
-" pop %edi\n"
-" pop %esi\n"
-" pop %ebx\n"
-" pop %ebp\n"
-" pop %edx\n"
-" mov %eax,0x4(%esp)\n"
-" jmp *%edx\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl _make_fcontext\n"
-".def _make_fcontext; .scl 2; .type 32; .endef\n"
-"_make_fcontext:\n"
-"mov 0x4(%esp),%eax\n"
-"lea -0x8(%eax),%eax\n"
-"and $0xfffffff0,%eax\n"
-"lea -0x3c(%eax),%eax\n"
-"mov 0x4(%esp),%ecx\n"
-"mov %ecx,0x14(%eax)\n"
-"mov 0x8(%esp),%edx\n"
-"neg %edx\n"
-"lea (%ecx,%edx,1),%ecx\n"
-"mov %ecx,0x10(%eax)\n"
-"mov %ecx,0xc(%eax)\n"
-"mov 0xc(%esp),%ecx\n"
-"mov %ecx,0x2c(%eax)\n"
-"stmxcsr (%eax)\n"
-"fnstcw 0x4(%eax)\n"
-"mov $finish,%ecx\n"
-"mov %ecx,0x30(%eax)\n"
-"mov %fs:0x0,%ecx\n"
-"walk:\n"
-"mov (%ecx),%edx\n"
-"inc %edx\n"
-"je found\n"
-"dec %edx\n"
-"xchg %edx,%ecx\n"
-"jmp walk\n"
-"found:\n"
-"mov 0x4(%ecx),%ecx\n"
-"mov %ecx,0x3c(%eax)\n"
-"mov $0xffffffff,%ecx\n"
-"mov %ecx,0x38(%eax)\n"
-"lea 0x38(%eax),%ecx\n"
-"mov %ecx,0x18(%eax)\n"
-"ret\n"
-"finish:\n"
-"xor %eax,%eax\n"
-"mov %eax,(%esp)\n"
-"call _exit\n"
-"hlt\n"
-".def __exit; .scl 2; .type 32; .endef \n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl jump_fcontext\n"
-".def jump_fcontext; .scl 2; .type 32; .endef\n"
-".seh_proc jump_fcontext\n"
-"jump_fcontext:\n"
-".seh_endprologue\n"
-" push %rbp\n"
-" push %rbx\n"
-" push %rsi\n"
-" push %rdi\n"
-" push %r15\n"
-" push %r14\n"
-" push %r13\n"
-" push %r12\n"
-" mov %gs:0x30,%r10\n"
-" mov 0x8(%r10),%rax\n"
-" push %rax\n"
-" mov 0x10(%r10),%rax\n"
-" push %rax\n"
-" mov 0x1478(%r10),%rax\n"
-" push %rax\n"
-" mov 0x18(%r10),%rax\n"
-" push %rax\n"
-" lea -0xa8(%rsp),%rsp\n"
-" test %r9,%r9\n"
-" je nxt1\n"
-" stmxcsr 0xa0(%rsp)\n"
-" fnstcw 0xa4(%rsp)\n"
-" movaps %xmm6,(%rsp)\n"
-" movaps %xmm7,0x10(%rsp)\n"
-" movaps %xmm8,0x20(%rsp)\n"
-" movaps %xmm9,0x30(%rsp)\n"
-" movaps %xmm10,0x40(%rsp)\n"
-" movaps %xmm11,0x50(%rsp)\n"
-" movaps %xmm12,0x60(%rsp)\n"
-" movaps %xmm13,0x70(%rsp)\n"
-" movaps %xmm14,0x80(%rsp)\n"
-" movaps %xmm15,0x90(%rsp)\n"
-"nxt1:\n"
-" xor %r10,%r10\n"
-" push %r10\n"
-" mov %rsp,(%rcx)\n"
-" mov %rdx,%rsp\n"
-" pop %r10\n"
-" test %r9,%r9\n"
-" je nxt2\n"
-" ldmxcsr 0xa0(%rsp)\n"
-" fldcw 0xa4(%rsp)\n"
-" movaps (%rsp),%xmm6\n"
-" movaps 0x10(%rsp),%xmm7\n"
-" movaps 0x20(%rsp),%xmm8\n"
-" movaps 0x30(%rsp),%xmm9\n"
-" movaps 0x40(%rsp),%xmm10\n"
-" movaps 0x50(%rsp),%xmm11\n"
-" movaps 0x60(%rsp),%xmm12\n"
-" movaps 0x70(%rsp),%xmm13\n"
-" movaps 0x80(%rsp),%xmm14\n"
-" movaps 0x90(%rsp),%xmm15\n"
-"nxt2:\n"
-" mov $0xa8,%rcx\n"
-" test %r10,%r10\n"
-" je nxt3\n"
-" add $0x8,%rcx\n"
-"nxt3:\n"
-" lea (%rsp,%rcx,1),%rsp\n"
-" mov %gs:0x30,%r10\n"
-" pop %rax\n"
-" mov %rax,0x18(%r10)\n"
-" pop %rax\n"
-" mov %rax,0x1478(%r10)\n"
-" pop %rax\n"
-" mov %rax,0x10(%r10)\n"
-" pop %rax\n"
-" mov %rax,0x8(%r10)\n"
-" pop %r12\n"
-" pop %r13\n"
-" pop %r14\n"
-" pop %r15\n"
-" pop %rdi\n"
-" pop %rsi\n"
-" pop %rbx\n"
-" pop %rbp\n"
-" pop %r10\n"
-" mov %r8,%rax\n"
-" mov %r8,%rcx\n"
-" jmpq *%r10\n"
-".seh_endproc\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl make_fcontext\n"
-".def make_fcontext; .scl 2; .type 32; .endef\n"
-".seh_proc make_fcontext\n"
-"make_fcontext:\n"
-".seh_endprologue\n"
-"mov %rcx,%rax\n"
-"sub $0x28,%rax\n"
-"and $0xfffffffffffffff0,%rax\n"
-"sub $0x128,%rax\n"
-"mov %r8,0x118(%rax)\n"
-"mov %rcx,0xd0(%rax)\n"
-"neg %rdx\n"
-"lea (%rcx,%rdx,1),%rcx\n"
-"mov %rcx,0xc8(%rax)\n"
-"mov %rcx,0xc0(%rax)\n"
-"stmxcsr 0xa8(%rax)\n"
-"fnstcw 0xac(%rax)\n"
-"leaq finish(%rip), %rcx\n"
-"mov %rcx,0x120(%rax)\n"
-"mov $0x1,%rcx\n"
-"mov %rcx,(%rax)\n"
-"retq\n"
-"finish:\n"
-"xor %rcx,%rcx\n"
-"callq 0x63\n"
-"hlt\n"
-" .seh_endproc\n"
-".def _exit; .scl 2; .type 32; .endef \n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".type jump_fcontext,@function\n"
-"jump_fcontext:\n"
-" movl 0x10(%esp), %ecx\n"
-" pushl %ebp \n"
-" pushl %ebx \n"
-" pushl %esi \n"
-" pushl %edi \n"
-" leal -0x8(%esp), %esp\n"
-" test %ecx, %ecx\n"
-" je 1f\n"
-" stmxcsr (%esp)\n"
-" fnstcw 0x4(%esp)\n"
-"1:\n"
-" movl 0x1c(%esp), %eax\n"
-" movl %esp, (%eax)\n"
-" movl 0x20(%esp), %edx\n"
-" movl 0x24(%esp), %eax\n"
-" movl %edx, %esp\n"
-" test %ecx, %ecx\n"
-" je 2f\n"
-" ldmxcsr (%esp)\n"
-" fldcw 0x4(%esp)\n"
-"2:\n"
-" leal 0x8(%esp), %esp\n"
-" popl %edi \n"
-" popl %esi \n"
-" popl %ebx \n"
-" popl %ebp \n"
-" popl %edx\n"
-" movl %eax, 0x4(%esp)\n"
-" jmp *%edx\n"
-".size jump_fcontext,.-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".type make_fcontext,@function\n"
-"make_fcontext:\n"
-" movl 0x4(%esp), %eax\n"
-" leal -0x8(%eax), %eax\n"
-" andl $-16, %eax\n"
-" leal -0x20(%eax), %eax\n"
-" movl 0xc(%esp), %edx\n"
-" movl %edx, 0x18(%eax)\n"
-" stmxcsr (%eax)\n"
-" fnstcw 0x4(%eax)\n"
-" call 1f\n"
-"1: popl %ecx\n"
-" addl $finish-1b, %ecx\n"
-" movl %ecx, 0x1c(%eax)\n"
-" ret \n"
-"finish:\n"
-" call 2f\n"
-"2: popl %ebx\n"
-" addl $_GLOBAL_OFFSET_TABLE_+[.-2b], %ebx\n"
-" xorl %eax, %eax\n"
-" movl %eax, (%esp)\n"
-" call _exit@PLT\n"
-" hlt\n"
-".size make_fcontext,.-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".type jump_fcontext,@function\n"
-".align 16\n"
-"jump_fcontext:\n"
-" pushq %rbp \n"
-" pushq %rbx \n"
-" pushq %r15 \n"
-" pushq %r14 \n"
-" pushq %r13 \n"
-" pushq %r12 \n"
-" leaq -0x8(%rsp), %rsp\n"
-" cmp $0, %rcx\n"
-" je 1f\n"
-" stmxcsr (%rsp)\n"
-" fnstcw 0x4(%rsp)\n"
-"1:\n"
-" movq %rsp, (%rdi)\n"
-" movq %rsi, %rsp\n"
-" cmp $0, %rcx\n"
-" je 2f\n"
-" ldmxcsr (%rsp)\n"
-" fldcw 0x4(%rsp)\n"
-"2:\n"
-" leaq 0x8(%rsp), %rsp\n"
-" popq %r12 \n"
-" popq %r13 \n"
-" popq %r14 \n"
-" popq %r15 \n"
-" popq %rbx \n"
-" popq %rbp \n"
-" popq %r8\n"
-" movq %rdx, %rax\n"
-" movq %rdx, %rdi\n"
-" jmp *%r8\n"
-".size jump_fcontext,.-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".type make_fcontext,@function\n"
-".align 16\n"
-"make_fcontext:\n"
-" movq %rdi, %rax\n"
-" andq $-16, %rax\n"
-" leaq -0x48(%rax), %rax\n"
-" movq %rdx, 0x38(%rax)\n"
-" stmxcsr (%rax)\n"
-" fnstcw 0x4(%rax)\n"
-" leaq finish(%rip), %rcx\n"
-" movq %rcx, 0x40(%rax)\n"
-" ret \n"
-"finish:\n"
-" xorq %rdi, %rdi\n"
-" call _exit@PLT\n"
-" hlt\n"
-".size make_fcontext,.-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _jump_fcontext\n"
-".align 8\n"
-"_jump_fcontext:\n"
-" pushq %rbp \n"
-" pushq %rbx \n"
-" pushq %r15 \n"
-" pushq %r14 \n"
-" pushq %r13 \n"
-" pushq %r12 \n"
-" leaq -0x8(%rsp), %rsp\n"
-" cmp $0, %rcx\n"
-" je 1f\n"
-" stmxcsr (%rsp)\n"
-" fnstcw 0x4(%rsp)\n"
-"1:\n"
-" movq %rsp, (%rdi)\n"
-" movq %rsi, %rsp\n"
-" cmp $0, %rcx\n"
-" je 2f\n"
-" ldmxcsr (%rsp)\n"
-" fldcw 0x4(%rsp)\n"
-"2:\n"
-" leaq 0x8(%rsp), %rsp\n"
-" popq %r12 \n"
-" popq %r13 \n"
-" popq %r14 \n"
-" popq %r15 \n"
-" popq %rbx \n"
-" popq %rbp \n"
-" popq %r8\n"
-" movq %rdx, %rax\n"
-" movq %rdx, %rdi\n"
-" jmp *%r8\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _make_fcontext\n"
-".align 8\n"
-"_make_fcontext:\n"
-" movq %rdi, %rax\n"
-" movabs $-16, %r8\n"
-" andq %r8, %rax\n"
-" leaq -0x48(%rax), %rax\n"
-" movq %rdx, 0x38(%rax)\n"
-" stmxcsr (%rax)\n"
-" fnstcw 0x4(%rax)\n"
-" leaq finish(%rip), %rcx\n"
-" movq %rcx, 0x40(%rax)\n"
-" ret \n"
-"finish:\n"
-" xorq %rdi, %rdi\n"
-" call __exit\n"
-" hlt\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _jump_fcontext\n"
-".align 2\n"
-"_jump_fcontext:\n"
-" movl 0x10(%esp), %ecx\n"
-" pushl %ebp \n"
-" pushl %ebx \n"
-" pushl %esi \n"
-" pushl %edi \n"
-" leal -0x8(%esp), %esp\n"
-" test %ecx, %ecx\n"
-" je 1f\n"
-" stmxcsr (%esp)\n"
-" fnstcw 0x4(%esp)\n"
-"1:\n"
-" movl 0x1c(%esp), %eax\n"
-" movl %esp, (%eax)\n"
-" movl 0x20(%esp), %edx\n"
-" movl 0x24(%esp), %eax\n"
-" movl %edx, %esp\n"
-" test %ecx, %ecx\n"
-" je 2f\n"
-" ldmxcsr (%esp)\n"
-" fldcw 0x4(%esp)\n"
-"2:\n"
-" leal 0x8(%esp), %esp\n"
-" popl %edi \n"
-" popl %esi \n"
-" popl %ebx \n"
-" popl %ebp \n"
-" popl %edx\n"
-" movl %eax, 0x4(%esp)\n"
-" jmp *%edx\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _make_fcontext\n"
-".align 2\n"
-"_make_fcontext:\n"
-" movl 0x4(%esp), %eax\n"
-" leal -0x8(%eax), %eax\n"
-" andl $-16, %eax\n"
-" leal -0x20(%eax), %eax\n"
-" movl 0xc(%esp), %edx\n"
-" movl %edx, 0x18(%eax)\n"
-" stmxcsr (%eax)\n"
-" fnstcw 0x4(%eax)\n"
-" call 1f\n"
-"1: popl %ecx\n"
-" addl $finish-1b, %ecx\n"
-" movl %ecx, 0x1c(%eax)\n"
-" ret \n"
-"finish:\n"
-" xorl %eax, %eax\n"
-" movl %eax, (%esp)\n"
-" call __exit\n"
-" hlt\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".type jump_fcontext,%function\n"
-"jump_fcontext:\n"
-" @ save LR as PC\n"
-" push {lr}\n"
-" @ save V1-V8,LR\n"
-" push {v1-v8,lr}\n"
-" @ prepare stack for FPU\n"
-" sub sp, sp, #64\n"
-" @ test if fpu env should be preserved\n"
-" cmp a4, #0\n"
-" beq 1f\n"
-" @ save S16-S31\n"
-" vstmia sp, {d8-d15}\n"
-"1:\n"
-" @ store RSP (pointing to context-data) in A1\n"
-" str sp, [a1]\n"
-" @ restore RSP (pointing to context-data) from A2\n"
-" mov sp, a2\n"
-" @ test if fpu env should be preserved\n"
-" cmp a4, #0\n"
-" beq 2f\n"
-" @ restore S16-S31\n"
-" vldmia sp, {d8-d15}\n"
-"2:\n"
-" @ prepare stack for FPU\n"
-" add sp, sp, #64\n"
-" @ use third arg as return value after jump\n"
-" @ and as first arg in context function\n"
-" mov a1, a3\n"
-" @ restore v1-V8,LR,PC\n"
-" pop {v1-v8,lr,pc}\n"
-".size jump_fcontext,.-jump_fcontext\n"
-"@ Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".type make_fcontext,%function\n"
-"make_fcontext:\n"
-" @ shift address in A1 to lower 16 byte boundary\n"
-" bic a1, a1, #15\n"
-" @ reserve space for context-data on context-stack\n"
-" sub a1, a1, #104\n"
-" @ third arg of make_fcontext() == address of context-function\n"
-" str a3, [a1,#100]\n"
-" @ compute abs address of label finish\n"
-" adr a2, finish\n"
-" @ save address of finish as return-address for context-function\n"
-" @ will be entered after context-function returns\n"
-" str a2, [a1,#96]\n"
-" bx lr @ return pointer to context-data\n"
-"finish:\n"
-" @ exit code is zero\n"
-" mov a1, #0\n"
-" @ exit application\n"
-" bl _exit@PLT\n"
-".size make_fcontext,.-make_fcontext\n"
-"@ Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
diff --git a/packages/sci-electronics/kicad/files/libcontext.h b/packages/sci-electronics/kicad/files/libcontext.h
deleted file mode 100644
index 0dded6d..0000000
--- a/packages/sci-electronics/kicad/files/libcontext.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-
- libcontext - a slightly more portable version of boost::context
-
- Copyright Martin Husemann 2013.
- Copyright Oliver Kowalke 2009.
- Copyright Sergue E. Leontiev 2013.
- Copyright Thomas Sailer 2013.
- Minor modifications by Tomasz Wlostowski 2016.
-
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
-
-*/
-
-#ifndef __LIBCONTEXT_H
-#define __LIBCONTEXT_H
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stddef.h>
-
-
-#if defined(__GNUC__) || defined(__APPLE__)
-
- #define LIBCONTEXT_COMPILER_gcc
-
- #if defined(__linux__)
- #ifdef __x86_64__
- #define LIBCONTEXT_PLATFORM_linux_x86_64
- #define LIBCONTEXT_CALL_CONVENTION
-
- #elif __i386__
- #define LIBCONTEXT_PLATFORM_linux_i386
- #define LIBCONTEXT_CALL_CONVENTION
- #elif __arm__
- #define LIBCONTEXT_PLATFORM_linux_arm32
- #define LIBCONTEXT_CALL_CONVENTION
- #endif
-
- #elif defined(__MINGW32__) || defined (__MINGW64__)
- #if defined(__x86_64__)
- #define LIBCONTEXT_COMPILER_gcc
- #define LIBCONTEXT_PLATFORM_windows_x86_64
- #define LIBCONTEXT_CALL_CONVENTION
- #endif
-
- #if defined(__i386__)
- #define LIBCONTEXT_COMPILER_gcc
- #define LIBCONTEXT_PLATFORM_windows_i386
- #define LIBCONTEXT_CALL_CONVENTION __cdecl
- #endif
- #elif defined(__APPLE__) && defined(__MACH__)
- #if defined (__i386__)
- #define LIBCONTEXT_PLATFORM_apple_i386
- #define LIBCONTEXT_CALL_CONVENTION
- #elif defined (__x86_64__)
- #define LIBCONTEXT_PLATFORM_apple_x86_64
- #define LIBCONTEXT_CALL_CONVENTION
- #endif
- #endif
-#endif
-
-
-#if defined(_WIN32_WCE)
-typedef int intptr_t;
-#endif
-
-typedef void* fcontext_t;
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-intptr_t LIBCONTEXT_CALL_CONVENTION jump_fcontext( fcontext_t * ofc, fcontext_t nfc,
- intptr_t vp, bool preserve_fpu = false);
-fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext( void * sp, size_t size, void (* fn)( intptr_t) );
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
diff --git a/packages/sci-electronics/kicad/kicad-4.0.6.exheres-0 b/packages/sci-electronics/kicad/kicad-4.0.6.exheres-0
index 080c019..85c97d4 100644
--- a/packages/sci-electronics/kicad/kicad-4.0.6.exheres-0
+++ b/packages/sci-electronics/kicad/kicad-4.0.6.exheres-0
@@ -7,22 +7,10 @@ require kicad
PLATFORMS="~amd64 ~x86"
DEFAULT_SRC_PREPARE_PATCHES+=(
- "${FILES}"/${PNV}-boost-context.patch
+ "${FILES}"/boost-1.61.patch
)
CMAKE_SRC_CONFIGURE_PARAMS+=(
'-DKICAD_SKIP_BOOST:BOOL=TRUE'
)
-src_prepare() {
- edo cd "${CMAKE_SOURCE}"
-
- # Install libcontext sources as a replacement for removed boost::context
- # From https://github.com/twlostow/libcontext
- edo mkdir -p common/system include/system
- edo cp "${FILES}"/libcontext.cpp common/system/
- edo cp "${FILES}"/libcontext.h include/system/
-
- kicad_src_prepare
-}
-
diff --git a/packages/sci-electronics/kicad/kicad-scm.exheres-0 b/packages/sci-electronics/kicad/kicad-scm.exheres-0
index 1806e48..ab6a3fd 100644
--- a/packages/sci-electronics/kicad/kicad-scm.exheres-0
+++ b/packages/sci-electronics/kicad/kicad-scm.exheres-0
@@ -6,19 +6,5 @@ SCM_REPOSITORY="https://github.com/KiCad/kicad-source-mirror.git"
require scm-git kicad
-DOWNLOADS=""
-
PLATFORMS="~amd64"
-DEPENDENCIES+="
- build+run:
- dev-libs/glm[>=0.9.5.1]
- net-misc/curl
- x11-libs/cairo[>=1.8.8]
-"
-
-src_prepare() {
- edo cd "${CMAKE_SOURCE}"
- kicad_src_prepare
-}
-
diff --git a/packages/sci-electronics/kicad/kicad.exlib b/packages/sci-electronics/kicad/kicad.exlib
index d62c9dd..1e4c13a 100644
--- a/packages/sci-electronics/kicad/kicad.exlib
+++ b/packages/sci-electronics/kicad/kicad.exlib
@@ -8,7 +8,7 @@
require launchpad [ suffix=tar.xz ]
require cmake [ api=2 ]
-export_exlib_phases src_prepare src_compile src_install
+export_exlib_phases src_prepare src_configure src_compile src_install
SUMMARY="KiCad GPL PCB suite"
DESCRIPTION="
@@ -97,6 +97,11 @@ kicad_src_prepare() {
edo sed -e '/install( FILES INSTALL.txt/,/COMPONENT resources )/d' -i CMakeLists.txt
}
+kicad_src_configure() {
+ CXXFLAGS+=" -std=gnu++14"
+ cmake_src_configure
+}
+
kicad_src_compile() {
default
option doc && emake doxygen-docs