summaryrefslogtreecommitdiff
path: root/sci-electronics/kicad
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-electronics/kicad
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-electronics/kicad')
-rw-r--r--sci-electronics/kicad/Manifest22
-rw-r--r--sci-electronics/kicad/files/kicad-4.0.4-boost-context.patch107
-rw-r--r--sci-electronics/kicad/files/kicad-boost-1.61.patch347
-rw-r--r--sci-electronics/kicad/files/kicad-footprints-cmakelists.txt16
-rw-r--r--sci-electronics/kicad/kicad-4.0.4.ebuild204
-rw-r--r--sci-electronics/kicad/kicad-4.0.5-r1.ebuild194
-rw-r--r--sci-electronics/kicad/kicad-4.0.6.ebuild194
-rw-r--r--sci-electronics/kicad/metadata.xml27
8 files changed, 1111 insertions, 0 deletions
diff --git a/sci-electronics/kicad/Manifest b/sci-electronics/kicad/Manifest
new file mode 100644
index 000000000000..368bd85dffdb
--- /dev/null
+++ b/sci-electronics/kicad/Manifest
@@ -0,0 +1,22 @@
+AUX kicad-4.0.4-boost-context.patch 3859 SHA256 dd68fff82500d7114bab94812180e6d9d5fde4dca99601b7f5a24d3467a2665a SHA512 187777139b2c07408ee0fcf62380add34347c56b843d4d6d87fa5934c85b026b7905206fee26c24a6b7607238539fa9c05956970557757876544924ac51e9e22 WHIRLPOOL bbc9dcdd1730f45d49c1e8ee7f272ddaeaf2d2b24c5b8ab2265826bad14bf121479475df1bdc51ef7215232dc734d0521d0bb9e52f5b3e8428992dc300d9f40d
+AUX kicad-boost-1.61.patch 9565 SHA256 04c0d01ad5133048126e4bc45e9955a3a0180251528efa4f87a0535e409b6706 SHA512 a960117a4c08144de5111e76a33f208a9b3fe702d10ec2546afc57faf3de3fccfe19b5a5c62b527953d55687e644ed67c9b560cd3baf8b678d127977f3f30cee WHIRLPOOL f2020d502bee0f87b6a40a3c05997c30ac44462325a9e2027a4f5918f75fff9053c3c5b84918f207ff162d11b522f4ea8cce08249778f3efa8efb28bf9403e42
+AUX kicad-footprints-cmakelists.txt 449 SHA256 2c6b6ec9cb9d1b01c42a634bdfd30c6ccea4fac5e194e235dbceb05c679182ed SHA512 d101e28f8f5f00946a23839193bf83379da121d36bcf67f25b14b02cb5c2a4ff9a392db5b3676687bd26c0d61453313ce704192dd1e4e73834eb9930a07ee822 WHIRLPOOL b48a24ba85dbd02cbf8ae2dd37ff0ee243203e46afb19a0b1cf723790309ea1618d4395880d5f12438f782156fce33216fe9d6bde475d826abbad5aa0bb944c2
+DIST kicad-4.0.4-i18n.tar.gz 2409039 SHA256 aec8121fc64985b150c0843db937a3383afe1805697f339aa73009215c1b92cf SHA512 5fcbf54aeff92c142652908dda9e727e8b076aec4531f2bb4d27aa9fd946e92621141a9709a9469c133010cca019e4e6bc9731366e8c1adbe38078f5a6fcaedf WHIRLPOOL 65c940149ab3357341b41a70f7db35695a598ade462a6fc8e602c4d1b53458fc712706e0effbc8b27b24f95510980a223cb9445b8ca8d54669dd89a65d066a2c
+DIST kicad-4.0.4.tar.xz 10672424 SHA256 6da5d3f7bc63a9c5b4d0f5e4b954411b45d712168596b5af02957343c87eda00 SHA512 230eb10d42e004c51d790db0d21dc08653944ca6cc4b728ad34b506f1a2b009c23369ddae417c8fafd420cb8045900dd4145cd1071867c759ab406dd12be3242 WHIRLPOOL c5e577bebfd11160528e9543d9a421a5814ad70134092e9a0bd759b7a941e730b33cac7059606eba049ad5ffc8e6d44a0079bdbe9446ad1f152fa04ec6150d4c
+DIST kicad-4.0.5-i18n.tar.gz 2464569 SHA256 18538b050f7c85eec0aaf3b2fd0a7a37a4eba139bb3d60be3ef80732e8e4b840 SHA512 ff33051202d3aa50284170ca1b0ebd6279ee60559c4ce88c577248d4fe3d5781bb5b75eea6c165fbbd4abc1fd681357a7d7877339c4413fb3774bc8a55264b81 WHIRLPOOL b63b9b59ddaf21485e8e358c356c694e03608989e6d2e13fc96bc620789cf1df66cf7d4fb051713ebcbd756afe6b43d217746ef2c84b593eeae8909c5e4c781f
+DIST kicad-4.0.5.tar.xz 10626696 SHA256 73f286733bb69b04749279a1848cbedfad908e7dcd1d11363c7fae7677c85331 SHA512 1486a039237e8d97ed21d62905ab74cb953b76c9d15bdfe7edd7380cf93e4c4b9a23aa82c6f523f6d5272e1dbe06ee8853a80eaabb1d0d9db6e304265f53ba7f WHIRLPOOL a7ca4e8183d44423a2076ca81047965166ed5f15504967ac790c18bedd045e61fbce17e197341876eb73aaa4a9a2571242cc5fcc4853abec99a19b3433690c6e
+DIST kicad-4.0.6-i18n.tar.gz 2578341 SHA256 eac9f2d2e4b149bd2bda007faefa1548e538c18be1700a7994829a1e5d0e86ac SHA512 d5a531857ed2699d9bbf583bd0716cef7b39d098e351a8e106d16b0001c592469c4f7a47f0c88e040479e5c515b9de3323b9419dfa17761c3f2cd059af2b0f8c WHIRLPOOL 177367132272d3a340d715c187b2bb3faddfd4c754c674d3a4482b39fe4e1f10cd0be67360c6a3a06f3b3d44865c6faa712b4fd721b1a1a52ef40a94741e5d33
+DIST kicad-4.0.6.tar.xz 10834136 SHA256 e97cacc179839e65f2afa14d8830a3bed549aaa9ed234c988851971bf2a42298 SHA512 f20e5bdb7f4535e8eb9d8d76926a89ad4b69fd727447269f45695556aed9f7ddfdc05f434021bc210490ccb4b5223658eafc275df8cfaae91e22e3b645f2837e WHIRLPOOL b5997b8e25a5624cc366a08e77ee982a8dda71269a2360743621d923b12855ea7d8bd93efece01f633e2999e8773f8fea10fc313a51b2e4b76abde11846dd405
+DIST kicad-footprints-4.0.4.tar.gz 1400434 SHA256 2b23e282c64c7e72d9ad52a6f114c20572b8c0e3fd9895b9b87b7ccacc7b4479 SHA512 7d42eea2c7c84961e05e0e61d6380e3d294d696e1321bb4406391125379fd6a3dc2b38e7ff8be51b684786bed892738452218f4c5a95c547319f1eaafc0cea6e WHIRLPOOL 6f96d7ecbe94c511f99c6022466704742aec83578790685c2945926682a0a2c50f2ff176bf075b06cea4cd60fe7afbfb8c142096b6b7a1d73020f0327d1281a8
+DIST kicad-footprints-4.0.5.tar.gz 2330378 SHA256 50cb02d9eb44b30f8fd68434172a25a93c62cd9a07877091116fd8db8238f9ad SHA512 91122127be4b54bec7b37706d6438853463ed66b1c0c205e8d93709c159744e84ea58f3bf0cb1f4e18df6061f6df3d76f2ff0d6e698c6ba5ce3867d89838d95d WHIRLPOOL 44283efb35c3522e73d36fc51d591bc236cf2f17b8901279d28908b5a227f791597c74c94bff3be904417df42248b5d16e93a9aaa061132809ffe0507911b186
+DIST kicad-footprints-4.0.6.tar.gz 5315435 SHA256 cb515000ff82ef369ab852a056d32b679f4fb7cd4f908d6d736516c01bc4af6e SHA512 808a5a16cabeb3c7ffcffbef9eb8b57b42953ea23e025c283ad8258a7fc07fecbfeaa4ffd6d33dc8fe00b63c45216a3a9fbd81568a2e99c07b6833df7f04e1a9 WHIRLPOOL 7679c05952bcf6e32e475e868c0ecda8b6b52626a30a8aa0e9a53755bbefb8816cb4de323274d3e9464c33ebbc2a056068eab81edd62c146c9bc52665ecddd55
+DIST kicad-libcontext.tar.gz 25599 SHA256 37be6072a6016d402b4341e2ceba719cdd8e279e275ea7275d91e19e813a31a3 SHA512 3b469dcf0e0f4e23f304d0068468a99516e89588d8f36a821af10e751f919cb8a9077d52109fdd43c1c2a443e026b38d0d3aa4774823d05755c9db35742d32d9 WHIRLPOOL d05f43544fa4c9d1fae957445782ad610c07564db81c12491fe6aeaf6948a369b3f55114eacb21916fbc9001f20d0a2c4944c3ab0ccc8e57bf9aa44fea507087
+DIST kicad-library-4.0.4.tar.gz 87947075 SHA256 22c02d151aba7ea90c519fda953a8cd882d8da7e36ec0e68ed90a6e15151cdf3 SHA512 57f905277cf581cfda6ca574d87bbdd3a870cd240a151b2c8faedc7ecbfa2cc122b67937cbdbf028be77727cdf4fac9cdc3512ce5bfe80d0f6cbb4f444ccfd6c WHIRLPOOL 1ee926de02ca13c420535487437a45ecf8ea652e854105f4849612a30091ff9f9098d422e7e1c49ab1a6a2cb36cb94d9587a7267851307d947c76109b863da7b
+DIST kicad-library-4.0.5.tar.gz 91081668 SHA256 7169d1cfa1a55cbe7570252e68dc1242ae91458f16a13f7fc3f7804c504b1af1 SHA512 904d3439d1e76d13fe72a221efe2f9f3b0a4115f8e84e78d44a24d5a727138de0b91eec7733e851b9a6fec138897f203229bdf83b772ea49000a6d828ba6f25f WHIRLPOOL f76975e99d69c3ca36532cd22b05edc7b278dd09d8d810fac5466a84687922b3b013242eca6b1a6ba48bb403fe05d2260bbc60136b718185774923013398e956
+DIST kicad-library-4.0.6.tar.gz 175137480 SHA256 eedc596583a56325f0f518342218a2af809db23d62dcdc7ad3ad0167da3dc499 SHA512 4c35ce045a59c289e54cf8f634b22e59c272d79f4db047a0049085793b70ce659aba7bdba182f03e7081e65d0921af380aa9ca84eff4d3ec8644822d161ba425 WHIRLPOOL 60c682ee721a098e9e0567b07cf748ae1e82cd0b82365ed5dbb3d84c12ab48e742eb8dc01fcec3dae661b805716d101beffe1c3ed2e5da0debf36f0eeb75968a
+EBUILD kicad-4.0.4.ebuild 7378 SHA256 c14405490c7186c46d75453581c1321934c348db96ce784a4f222e72e4edea12 SHA512 e8d4db50215f2a8ee19a3aa57d28f9132277a4f343035e983d1b96dbc98a3931f6e6aac0ecea92eac3bd7d9dd89136db00210622a4648afb247e154f8f3b5ccf WHIRLPOOL ac2f68d4d15c4bb50db2850d1d77fc1d5d95c81ba7c2a99614b2b358f28cb51b3e7b519e13e87c6383d8db2fe9f769bfc489faef134454bd541733d668417da7
+EBUILD kicad-4.0.5-r1.ebuild 6699 SHA256 f7d21160342561006aa639268027ef27d0251d58f205e8b2934a564133aad80b SHA512 f5636852943e2d65d4121395a6fb97fa49a71b6947c8d5d3a66f322c46962aeab06c41aac4770af01eaa98142698843ddf6ca14f8681994a774112b6bdf68b8e WHIRLPOOL 6cef2c21f8fc18e5c22c7eebf38d7124ab76e6d2eb93eaadfd93add742f1b3b8752e3a45ed340e8e0571dddb13fba3d8da355c375feb1ef95d8970e763be050c
+EBUILD kicad-4.0.6.ebuild 6699 SHA256 f7d21160342561006aa639268027ef27d0251d58f205e8b2934a564133aad80b SHA512 f5636852943e2d65d4121395a6fb97fa49a71b6947c8d5d3a66f322c46962aeab06c41aac4770af01eaa98142698843ddf6ca14f8681994a774112b6bdf68b8e WHIRLPOOL 6cef2c21f8fc18e5c22c7eebf38d7124ab76e6d2eb93eaadfd93add742f1b3b8752e3a45ed340e8e0571dddb13fba3d8da355c375feb1ef95d8970e763be050c
+MISC ChangeLog 9567 SHA256 24f34ef15bf5ac683caf6ed4a4c4e60c4919cee14e6b970e448ac95285962f74 SHA512 59537c4bddde4a587a9f0d23c5a6c4215903bfdca317d149053af86896fce09995a0c5f29d1f6ecc55403c63a996c93460c3186f5e4ea30c1dd1160f318dc113 WHIRLPOOL f5a8087fa50222e7a93de3d8ada77102afe2a5bb65d190a1baf7109a3372b459d4aeb38a812ad7e5132d0d0d0a7892411dde603fa3f2c324b60189c31a13c083
+MISC ChangeLog-2015 10504 SHA256 4af75505cebae1e2790cff58d3573fe0990e8d83393a3852dfc08da651883cdf SHA512 e110d84e6e841ca20a58a1f1fe5af0f948eb9500a16d78f45d1382528190b98edc923ef006d77a9785635fc2a322160d5c52ee66ae34336617e419fce6e53218 WHIRLPOOL 33633fb33a4b18335a8e31db621bf6cd11a051107234bd3e763b37e58096cfa32477b25194bd8efa4f59f52c936ff009daeb76a1de5add99f5bfb08ec44d7843
+MISC metadata.xml 1043 SHA256 8b789a593f9a83568e0b70417cfffed5b57437e0562fd770fe516d516473e67e SHA512 3c0b70f293dce39d3866a2b18db93248560c07870f46cb36695541479b392340c26bfcb83e9b494b34a5f2b8c0bb7a91fd187c84fea7fe31d2aef3474261bdb7 WHIRLPOOL 011c7743adb61b06950169e42fae551a09263243c6432786e968e3727f56d37b6aab1daf7cc98998d02c26748a79a67bcda741d703d70864090e2ccd9e5907ea
diff --git a/sci-electronics/kicad/files/kicad-4.0.4-boost-context.patch b/sci-electronics/kicad/files/kicad-4.0.4-boost-context.patch
new file mode 100644
index 000000000000..529a82c018f9
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-4.0.4-boost-context.patch
@@ -0,0 +1,107 @@
+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/sci-electronics/kicad/files/kicad-boost-1.61.patch b/sci-electronics/kicad/files/kicad-boost-1.61.patch
new file mode 100644
index 000000000000..3ca8711b9f0a
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-boost-1.61.patch
@@ -0,0 +1,347 @@
+--- 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/sci-electronics/kicad/files/kicad-footprints-cmakelists.txt b/sci-electronics/kicad/files/kicad-footprints-cmakelists.txt
new file mode 100644
index 000000000000..d024485befd0
--- /dev/null
+++ b/sci-electronics/kicad/files/kicad-footprints-cmakelists.txt
@@ -0,0 +1,16 @@
+project( kicad-footprints )
+
+cmake_minimum_required( VERSION 2.6.1 FATAL_ERROR )
+
+file(GLOB footprint_dirs "*.pretty")
+
+# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
+set( KICAD_DATA share/kicad
+ CACHE PATH "Location of KiCad data files." )
+set( KICAD_MODULES ${KICAD_DATA}/modules )
+
+mark_as_advanced( KICAD_DATA KICAD_MODULES )
+
+install(DIRECTORY ${footprint_dirs}
+ DESTINATION ${KICAD_MODULES}
+ COMPONENT resources)
diff --git a/sci-electronics/kicad/kicad-4.0.4.ebuild b/sci-electronics/kicad/kicad-4.0.4.ebuild
new file mode 100644
index 000000000000..0a61360b4868
--- /dev/null
+++ b/sci-electronics/kicad/kicad-4.0.4.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils flag-o-matic gnome2-utils python-single-r1 wxwidgets vcs-snapshot versionator xdg
+
+DESCRIPTION="Electronic Schematic and PCB design tools."
+HOMEPAGE="http://www.kicad-pcb.org"
+LIBCONTEXT_COMMIT="3d92a1a50f4749b5a92131a957c9615473be85b4"
+
+SERIES=$(get_version_component_range 1-2)
+
+SRC_URI="https://launchpad.net/${PN}/${SERIES}/${PV}/+download/${P}.tar.xz
+ !minimal? (
+ http://downloads.kicad-pcb.org/libraries/${PN}-footprints-${PV}.tar.gz
+ http://downloads.kicad-pcb.org/libraries/kicad-library-${PV}.tar.gz
+ )
+ i18n? ( https://github.com/KiCad/${PN}-i18n/archive/${PV}.tar.gz -> ${P}-i18n.tar.gz )
+ https://github.com/twlostow/libcontext/archive/${LIBCONTEXT_COMMIT}.tar.gz -> ${PN}-libcontext.tar.gz"
+
+LICENSE="GPL-2+ GPL-3+ Boost-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug doc examples github i18n libressl minimal +python"
+LANGS="bg ca cs de el es fi fr hu it ja ko nl pl pt ru sk sl sv zh_CN"
+for lang in ${LANGS} ; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+unset lang
+unset LANGS
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )"
+
+COMMON_DEPEND="x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ python? (
+ dev-python/wxpython:${WX_GTK_VER}[opengl,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ )
+ >=dev-libs/boost-1.56[nls,threads,python?]
+ github? (
+ libressl? ( dev-libs/libressl:0 )
+ !libressl? ( dev-libs/openssl:0 )
+ )
+ media-libs/glew:0=
+ media-libs/freeglut
+ media-libs/mesa
+ sys-libs/zlib
+ x11-libs/cairo"
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ i18n? ( virtual/libintl )
+ python? ( dev-lang/swig:0 )"
+RDEPEND="${COMMON_DEPEND}
+ sci-electronics/electronics-menu"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ xdg_src_prepare
+
+ # Add separated out libcontext files and patch source to use them
+ mkdir -p "${S}/common/system/" || die
+ mkdir -p "${S}/include/system/" || die
+ cp "${WORKDIR}/${PN}-libcontext/libcontext.cpp" "${S}/common/system/libcontext.cpp" || die
+ cp "${WORKDIR}/${PN}-libcontext/libcontext.h" "${S}/include/system/libcontext.h" || die
+ # Path source to use new "built in" libcontext. Also patch libcontext.cpp to have correct include file.
+ # Path must be applied after new libcontext files have been copied to the kicad source directory.
+ epatch "${FILESDIR}/${P}-boost-context.patch"
+
+ # remove all the non unix file endings
+ edos2unix $(find "${S}" -type f -name "*.desktop")
+
+ # Remove cvpcb desktop file while it does nothing
+ rm "${WORKDIR}/${P}/resources/linux/mime/applications/cvpcb.desktop" || die
+
+ # Handle optional minimal install.
+ if use minimal; then
+ # remove templates as they are not needed to run binaries
+ sed -e '/add_subdirectory( template )/d' -i CMakeLists.txt || die
+ else
+ # create a link to the parts library in the main project folder
+ ln -s "${WORKDIR}/kicad-library-${PV}" "${S}/${PN}-library" || die
+ # create a link to the footprints library and add cmake build rule for it
+ ln -s "${WORKDIR}/${PN}-footprints-${PV}" "${S}/${PN}-footprints" || die
+ cp "${FILESDIR}/${PN}-footprints-cmakelists.txt" "${WORKDIR}/${PN}-footprints-${PV}/CMakeLists.txt" || die
+ # add the libraries directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-library )" -i CMakeLists.txt || die
+ # add the footprints directory to cmake as a subproject to build
+ sed "/add_subdirectory( ${PN}-library )/a add_subdirectory( ${PN}-footprints )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the library module
+ sed '/make uninstall/,/# /d' -i ${PN}-library/CMakeLists.txt || die
+ fi
+
+ # Add internationalization for the GUI
+ if use i18n; then
+ # create a link to the translations library in the main project folder
+ ln -s "${WORKDIR}/${P}-i18n" "${S}/${PN}-i18n" || die
+ # Remove unused languages. Project generates only languages specified in the
+ # file in LINGUAS in the subproject folder. By default all languages are added
+ # so we sed out the unused ones based on the user linguas_* settings.
+ local lang
+ for lang in ${LANGS}; do
+ if ! use linguas_${lang}; then
+ sed "/${lang}/d" -i ${PN}-i18n/LINGUAS || die
+ fi
+ done
+ # cmakelists does not respect our build dir variables, so make it point to the right location
+ sed "s|\${CMAKE_BINARY_DIR}|${WORKDIR}/${P}_build|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # we also make from the master project so the source dir is understood incorretly, replace that too
+ sed "s|\${CMAKE_SOURCE_DIR}/\${LANG}|\${CMAKE_SOURCE_DIR}/${PN}-i18n/\${LANG}|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # add the translations directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-i18n )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the translation module
+ sed '/make uninstall/,$d' -i ${PN}-i18n/CMakeLists.txt || die
+ fi
+
+ # Install examples in the right place if requested
+ if use examples; then
+ # install demos into the examples folder too
+ sed -e 's:${KICAD_DATA}/demos:${KICAD_DOCS}/examples:' -i CMakeLists.txt || die
+ else
+ # remove additional demos/examples as its not strictly required to run the binaries
+ sed -e '/add_subdirectory( demos )/d' -i CMakeLists.txt || die
+ fi
+
+ # Add important missing doc files
+ sed -e 's/INSTALL.txt/AUTHORS.txt CHANGELOG.txt README.txt TODO.txt/' -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DPYTHON_DEST="$(python_get_sitedir)"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ -DKICAD_DOCS="/usr/share/doc/${PF}"
+ -DKICAD_HELP="/usr/share/doc/${PF}/help"
+ -DKICAD_REPO_NAME="stable"
+ -DKICAD_BUILD_VERSION="${PV}"
+ -DwxUSE_UNICODE=ON
+ -DKICAD_SKIP_BOOST=ON
+ $(cmake-utils_use github BUILD_GITHUB_PLUGIN)
+ $(cmake-utils_use python KICAD_SCRIPTING)
+ $(cmake-utils_use python KICAD_SCRIPTING_MODULES)
+ $(cmake-utils_use python KICAD_SCRIPTING_WXPYTHON)
+ $(usex i18n "-DKICAD_I18N_UNIX_STRICT_PATH=1" "")
+ )
+ if use debug; then
+ append-cxxflags "-DDEBUG"
+ append-cflags "-DDEBUG"
+ fi
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen Doxyfile || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use python && python_optimize
+ if use doc ; then
+ dodoc uncrustify.cfg
+ cd Documentation || die
+ dodoc -r GUI_Translation_HOWTO.pdf guidelines/UIpolicies.txt doxygen/.
+ fi
+}
+
+pkg_preinst() {
+ xdg_pkg_preinst
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ gnome2_icon_cache_update
+
+ if use minimal ; then
+ ewarn "If the schematic and/or board editors complain about missing libraries when you"
+ ewarn "open old projects, you will have to take one or more of the following actions :"
+ ewarn "- Install the missing libraries manually."
+ ewarn "- Remove the libraries from the 'Libs and Dir' preferences."
+ ewarn "- Fix the libraries' locations in the 'Libs and Dir' preferences."
+ ewarn "- Emerge ${PN} without the 'minimal' USE flag."
+ fi
+ elog ""
+ elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
+ elog "For help and extended documentation emerge app-doc/kicad-doc."
+}
+
+pkg_postrm() {
+ xdg_pkg_postrm
+ gnome2_icon_cache_update
+}
diff --git a/sci-electronics/kicad/kicad-4.0.5-r1.ebuild b/sci-electronics/kicad/kicad-4.0.5-r1.ebuild
new file mode 100644
index 000000000000..da56b49911ba
--- /dev/null
+++ b/sci-electronics/kicad/kicad-4.0.5-r1.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils flag-o-matic gnome2-utils python-single-r1 wxwidgets vcs-snapshot versionator xdg
+
+DESCRIPTION="Electronic Schematic and PCB design tools."
+HOMEPAGE="http://www.kicad-pcb.org"
+
+SERIES=$(get_version_component_range 1-2)
+
+SRC_URI="https://launchpad.net/${PN}/${SERIES}/${PV}/+download/${P}.tar.xz
+ !minimal? (
+ http://downloads.kicad-pcb.org/libraries/${PN}-footprints-${PV}.tar.gz
+ http://downloads.kicad-pcb.org/libraries/kicad-library-${PV}.tar.gz
+ )
+ i18n? ( https://github.com/KiCad/${PN}-i18n/archive/${PV}.tar.gz -> ${P}-i18n.tar.gz )"
+
+LICENSE="GPL-2+ GPL-3+ Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc examples github i18n libressl minimal +python"
+LANGS="bg ca cs de el es fi fr hu it ja ko nl pl pt ru sk sl sv zh-CN"
+for lang in ${LANGS} ; do
+ IUSE="${IUSE} l10n_${lang}"
+done
+unset lang
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )"
+
+COMMON_DEPEND=">=x11-libs/wxGTK-3.0.2:${WX_GTK_VER}[X,opengl]
+ python? (
+ dev-python/wxpython:${WX_GTK_VER}[opengl,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ )
+ >=dev-libs/boost-1.61[context,nls,threads,python?,${PYTHON_USEDEP}]
+ github? (
+ libressl? ( dev-libs/libressl:0= )
+ !libressl? ( dev-libs/openssl:0= )
+ )
+ media-libs/glew:0=
+ media-libs/freeglut
+ media-libs/mesa
+ sys-libs/zlib
+ x11-libs/cairo"
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ i18n? ( virtual/libintl )
+ python? ( dev-lang/swig:0 )"
+RDEPEND="${COMMON_DEPEND}
+ sci-electronics/electronics-menu"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ setup-wxwidgets
+}
+
+src_prepare() {
+ xdg_src_prepare
+
+ # Patch to work with >=boost 1.61
+ eapply "${FILESDIR}/${PN}-boost-1.61.patch"
+
+ # Remove cvpcb desktop file as it does nothing
+ rm "resources/linux/mime/applications/cvpcb.desktop" || die
+
+ # remove all the non unix file endings and fix application categories in desktop files
+ while IFS="" read -d $'\0' -r f; do
+ edos2unix "${f}"
+ sed -i '/Categories/s/Development;//' "${f}"
+ done < <(find "${S}" -type f -name "*.desktop" -print0)
+
+ # Handle optional minimal install.
+ if use minimal; then
+ # remove templates as they are not needed to run binaries
+ sed -e '/add_subdirectory( template )/d' -i CMakeLists.txt || die
+ else
+ # create a link to the parts library in the main project folder
+ ln -s "${WORKDIR}/kicad-library-${PV}" "${S}/${PN}-library" || die
+ # create a link to the footprints library and add cmake build rule for it
+ ln -s "${WORKDIR}/${PN}-footprints-${PV}" "${S}/${PN}-footprints" || die
+ cp "${FILESDIR}/${PN}-footprints-cmakelists.txt" "${WORKDIR}/${PN}-footprints-${PV}/CMakeLists.txt" || die
+ # add the libraries directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-library )" -i CMakeLists.txt || die
+ # add the footprints directory to cmake as a subproject to build
+ sed "/add_subdirectory( ${PN}-library )/a add_subdirectory( ${PN}-footprints )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the library module
+ sed '/make uninstall/,/# /d' -i ${PN}-library/CMakeLists.txt || die
+ fi
+
+ # Add internationalization for the GUI
+ if use i18n; then
+ # create a link to the translations library in the main project folder
+ ln -s "${WORKDIR}/${P}-i18n" "${S}/${PN}-i18n" || die
+ # Remove unused languages. Project generates only languages specified in the
+ # file in LINGUAS in the subproject folder. By default all languages are added
+ # so we sed out the unused ones based on the user l10n_* settings.
+ local lang
+ for lang in ${LANGS}; do
+ if ! use l10n_${lang}; then
+ lang="${lang//-/_}" # Needed to turn zh-CN to zh_CN as KiCad does not follow l10n standard here
+ sed "/${lang}/d" -i ${PN}-i18n/LINGUAS || die
+ fi
+ done
+ # cmakelists does not respect our build dir variables, so make it point to the right location
+ sed "s|\${CMAKE_BINARY_DIR}|${WORKDIR}/${P}_build|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # we also make from the master project so the source dir is understood incorretly, replace that too
+ sed "s|\${CMAKE_SOURCE_DIR}/\${LANG}|\${CMAKE_SOURCE_DIR}/${PN}-i18n/\${LANG}|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # add the translations directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-i18n )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the translation module
+ sed '/make uninstall/,$d' -i ${PN}-i18n/CMakeLists.txt || die
+ fi
+
+ # Install examples if requested
+ use examples || sed -e '/add_subdirectory( demos )/d' -i CMakeLists.txt || die
+
+ # Add important missing doc files
+ sed -e 's/INSTALL.txt/AUTHORS.txt CHANGELOG.txt README.txt TODO.txt/' -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DKICAD_DOCS="/usr/share/doc/${PF}"
+ -DKICAD_HELP="/usr/share/doc/${PF}/help"
+ -DwxUSE_UNICODE=ON
+ -DKICAD_SKIP_BOOST=ON
+ -DBUILD_GITHUB_PLUGIN="$(usex github)"
+ -DKICAD_SCRIPTING="$(usex python)"
+ -DKICAD_SCRIPTING_MODULES="$(usex python)"
+ -DKICAD_SCRIPTING_WXPYTHON="$(usex python)"
+ -DKICAD_I18N_UNIX_STRICT_PATH="$(usex i18n)"
+ -DCMAKE_CXX_FLAGS="-std=c++11"
+ )
+ use python && mycmakeargs+=(
+ -DPYTHON_DEST="$(python_get_sitedir)"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ )
+ if use debug; then
+ append-cxxflags "-DDEBUG"
+ append-cflags "-DDEBUG"
+ fi
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen Doxyfile || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use python && python_optimize
+ if use doc ; then
+ dodoc uncrustify.cfg
+ cd Documentation || die
+ dodoc -r GUI_Translation_HOWTO.pdf guidelines/UIpolicies.txt doxygen/.
+ fi
+}
+
+pkg_preinst() {
+ xdg_pkg_preinst
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ gnome2_icon_cache_update
+
+ if use minimal ; then
+ ewarn "If the schematic and/or board editors complain about missing libraries when you"
+ ewarn "open old projects, you will have to take one or more of the following actions :"
+ ewarn "- Install the missing libraries manually."
+ ewarn "- Remove the libraries from the 'Libs and Dir' preferences."
+ ewarn "- Fix the libraries' locations in the 'Libs and Dir' preferences."
+ ewarn "- Emerge ${PN} without the 'minimal' USE flag."
+ fi
+ elog ""
+ elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
+ elog "For help and extended documentation emerge app-doc/kicad-doc."
+}
+
+pkg_postrm() {
+ xdg_pkg_postrm
+ gnome2_icon_cache_update
+}
diff --git a/sci-electronics/kicad/kicad-4.0.6.ebuild b/sci-electronics/kicad/kicad-4.0.6.ebuild
new file mode 100644
index 000000000000..da56b49911ba
--- /dev/null
+++ b/sci-electronics/kicad/kicad-4.0.6.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils flag-o-matic gnome2-utils python-single-r1 wxwidgets vcs-snapshot versionator xdg
+
+DESCRIPTION="Electronic Schematic and PCB design tools."
+HOMEPAGE="http://www.kicad-pcb.org"
+
+SERIES=$(get_version_component_range 1-2)
+
+SRC_URI="https://launchpad.net/${PN}/${SERIES}/${PV}/+download/${P}.tar.xz
+ !minimal? (
+ http://downloads.kicad-pcb.org/libraries/${PN}-footprints-${PV}.tar.gz
+ http://downloads.kicad-pcb.org/libraries/kicad-library-${PV}.tar.gz
+ )
+ i18n? ( https://github.com/KiCad/${PN}-i18n/archive/${PV}.tar.gz -> ${P}-i18n.tar.gz )"
+
+LICENSE="GPL-2+ GPL-3+ Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc examples github i18n libressl minimal +python"
+LANGS="bg ca cs de el es fi fr hu it ja ko nl pl pt ru sk sl sv zh-CN"
+for lang in ${LANGS} ; do
+ IUSE="${IUSE} l10n_${lang}"
+done
+unset lang
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )"
+
+COMMON_DEPEND=">=x11-libs/wxGTK-3.0.2:${WX_GTK_VER}[X,opengl]
+ python? (
+ dev-python/wxpython:${WX_GTK_VER}[opengl,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ )
+ >=dev-libs/boost-1.61[context,nls,threads,python?,${PYTHON_USEDEP}]
+ github? (
+ libressl? ( dev-libs/libressl:0= )
+ !libressl? ( dev-libs/openssl:0= )
+ )
+ media-libs/glew:0=
+ media-libs/freeglut
+ media-libs/mesa
+ sys-libs/zlib
+ x11-libs/cairo"
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ i18n? ( virtual/libintl )
+ python? ( dev-lang/swig:0 )"
+RDEPEND="${COMMON_DEPEND}
+ sci-electronics/electronics-menu"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ setup-wxwidgets
+}
+
+src_prepare() {
+ xdg_src_prepare
+
+ # Patch to work with >=boost 1.61
+ eapply "${FILESDIR}/${PN}-boost-1.61.patch"
+
+ # Remove cvpcb desktop file as it does nothing
+ rm "resources/linux/mime/applications/cvpcb.desktop" || die
+
+ # remove all the non unix file endings and fix application categories in desktop files
+ while IFS="" read -d $'\0' -r f; do
+ edos2unix "${f}"
+ sed -i '/Categories/s/Development;//' "${f}"
+ done < <(find "${S}" -type f -name "*.desktop" -print0)
+
+ # Handle optional minimal install.
+ if use minimal; then
+ # remove templates as they are not needed to run binaries
+ sed -e '/add_subdirectory( template )/d' -i CMakeLists.txt || die
+ else
+ # create a link to the parts library in the main project folder
+ ln -s "${WORKDIR}/kicad-library-${PV}" "${S}/${PN}-library" || die
+ # create a link to the footprints library and add cmake build rule for it
+ ln -s "${WORKDIR}/${PN}-footprints-${PV}" "${S}/${PN}-footprints" || die
+ cp "${FILESDIR}/${PN}-footprints-cmakelists.txt" "${WORKDIR}/${PN}-footprints-${PV}/CMakeLists.txt" || die
+ # add the libraries directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-library )" -i CMakeLists.txt || die
+ # add the footprints directory to cmake as a subproject to build
+ sed "/add_subdirectory( ${PN}-library )/a add_subdirectory( ${PN}-footprints )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the library module
+ sed '/make uninstall/,/# /d' -i ${PN}-library/CMakeLists.txt || die
+ fi
+
+ # Add internationalization for the GUI
+ if use i18n; then
+ # create a link to the translations library in the main project folder
+ ln -s "${WORKDIR}/${P}-i18n" "${S}/${PN}-i18n" || die
+ # Remove unused languages. Project generates only languages specified in the
+ # file in LINGUAS in the subproject folder. By default all languages are added
+ # so we sed out the unused ones based on the user l10n_* settings.
+ local lang
+ for lang in ${LANGS}; do
+ if ! use l10n_${lang}; then
+ lang="${lang//-/_}" # Needed to turn zh-CN to zh_CN as KiCad does not follow l10n standard here
+ sed "/${lang}/d" -i ${PN}-i18n/LINGUAS || die
+ fi
+ done
+ # cmakelists does not respect our build dir variables, so make it point to the right location
+ sed "s|\${CMAKE_BINARY_DIR}|${WORKDIR}/${P}_build|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # we also make from the master project so the source dir is understood incorretly, replace that too
+ sed "s|\${CMAKE_SOURCE_DIR}/\${LANG}|\${CMAKE_SOURCE_DIR}/${PN}-i18n/\${LANG}|g" -i ${PN}-i18n/CMakeLists.txt || die
+ # add the translations directory to cmake as a subproject to build
+ sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-i18n )" -i CMakeLists.txt || die
+ # remove duplicate uninstall directions for the translation module
+ sed '/make uninstall/,$d' -i ${PN}-i18n/CMakeLists.txt || die
+ fi
+
+ # Install examples if requested
+ use examples || sed -e '/add_subdirectory( demos )/d' -i CMakeLists.txt || die
+
+ # Add important missing doc files
+ sed -e 's/INSTALL.txt/AUTHORS.txt CHANGELOG.txt README.txt TODO.txt/' -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DKICAD_DOCS="/usr/share/doc/${PF}"
+ -DKICAD_HELP="/usr/share/doc/${PF}/help"
+ -DwxUSE_UNICODE=ON
+ -DKICAD_SKIP_BOOST=ON
+ -DBUILD_GITHUB_PLUGIN="$(usex github)"
+ -DKICAD_SCRIPTING="$(usex python)"
+ -DKICAD_SCRIPTING_MODULES="$(usex python)"
+ -DKICAD_SCRIPTING_WXPYTHON="$(usex python)"
+ -DKICAD_I18N_UNIX_STRICT_PATH="$(usex i18n)"
+ -DCMAKE_CXX_FLAGS="-std=c++11"
+ )
+ use python && mycmakeargs+=(
+ -DPYTHON_DEST="$(python_get_sitedir)"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
+ -DPYTHON_LIBRARY="$(python_get_library_path)"
+ )
+ if use debug; then
+ append-cxxflags "-DDEBUG"
+ append-cflags "-DDEBUG"
+ fi
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen Doxyfile || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use python && python_optimize
+ if use doc ; then
+ dodoc uncrustify.cfg
+ cd Documentation || die
+ dodoc -r GUI_Translation_HOWTO.pdf guidelines/UIpolicies.txt doxygen/.
+ fi
+}
+
+pkg_preinst() {
+ xdg_pkg_preinst
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ gnome2_icon_cache_update
+
+ if use minimal ; then
+ ewarn "If the schematic and/or board editors complain about missing libraries when you"
+ ewarn "open old projects, you will have to take one or more of the following actions :"
+ ewarn "- Install the missing libraries manually."
+ ewarn "- Remove the libraries from the 'Libs and Dir' preferences."
+ ewarn "- Fix the libraries' locations in the 'Libs and Dir' preferences."
+ ewarn "- Emerge ${PN} without the 'minimal' USE flag."
+ fi
+ elog ""
+ elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
+ elog "For help and extended documentation emerge app-doc/kicad-doc."
+}
+
+pkg_postrm() {
+ xdg_pkg_postrm
+ gnome2_icon_cache_update
+}
diff --git a/sci-electronics/kicad/metadata.xml b/sci-electronics/kicad/metadata.xml
new file mode 100644
index 000000000000..07f6d7753d0a
--- /dev/null
+++ b/sci-electronics/kicad/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zoltan@sinustrom.info</email>
+ <name>Zoltan Puskas</name>
+ <description>Proxied maintainer. Assign bugs to him.</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="github">Add github support into PCB editor</flag>
+ <flag name="i18n">Allow GUI internationalization through linguas_* use flags</flag>
+ <flag name="minimal">Build only binaries without parts library and examples</flag>
+ <flag name="python">Enable python scripting support</flag>
+ </use>
+ <longdescription>
+ Kicad is an open source (GPL) software for the creation of electronic
+ schematic diagrams and printed circuit board artwork.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">KiCad/kicad-i18n</remote-id>
+ <remote-id type="launchpad">kicad</remote-id>
+ </upstream>
+</pkgmetadata>