From f70a1bfc721336d4fc7dfb711c2f518a6b18cf16 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 30 Sep 2020 17:27:54 +0100 Subject: gentoo resync : 30.09.2020 --- app-editors/neovim/Manifest | 9 +- .../neovim/files/neovim-0.4.3-gcc-10-fix.patch | 225 +++++++++++++++++++++ app-editors/neovim/metadata.xml | 1 + app-editors/neovim/neovim-0.4.3.ebuild | 4 +- app-editors/neovim/neovim-0.4.4.ebuild | 99 +++++++++ app-editors/neovim/neovim-9999.ebuild | 22 +- 6 files changed, 348 insertions(+), 12 deletions(-) create mode 100644 app-editors/neovim/files/neovim-0.4.3-gcc-10-fix.patch create mode 100644 app-editors/neovim/neovim-0.4.4.ebuild (limited to 'app-editors/neovim') diff --git a/app-editors/neovim/Manifest b/app-editors/neovim/Manifest index d3c3c2d1d381..91afaca295a3 100644 --- a/app-editors/neovim/Manifest +++ b/app-editors/neovim/Manifest @@ -1,5 +1,8 @@ +AUX neovim-0.4.3-gcc-10-fix.patch 7417 BLAKE2B 5632a2427337e7b4d1b793381a074d2d7f0822aecb99a83123e8ec4fa4a35a975816a4854d2b596ae1aa63ecb876399c843454b6bd12b759889384d49fb8f0bf SHA512 e29c65e8075972e44ab056fd721208c62d77591a91cc12987bc07339bb2f6373cbf308719d9fa3f7919ec064112475993af64572fad851152da2fc8f0f39d2a4 AUX sysinit.vim 3408 BLAKE2B 50da5ecb83fb38af20d484dbc5f3e417efc083cde339070b07ff4c2fa4ebd080189f975478d82fa977bc763d5e8d7f29c7703a515ecf6fff62772be4ef160170 SHA512 79b574ef42fbdd9c7fe26cffb1fadea3c31becf22f4be441acbdc75068a00f809a23f3a886e1cb6e30bb92c780bd04aea7b94f655f5c9f0d10c547fb10dd6e8a DIST neovim-0.4.3.tar.gz 9556199 BLAKE2B 831f4d4950f4fa2cd9c7393824bbb5eb571ae5759d13af9f320e0fa351fa155413a5be580f010f2c7ab43ca7bc10c569ccf6e3ba29efc7f5a035576b030b216d SHA512 e13853fa296eda8618f389c71b6cbbd6f01d561615e80cc92959131dd10e395b1c6732a7d9ef6dbb9fe3ea9da4c11485b464547e2d46b22e59b8a20214e861f5 -EBUILD neovim-0.4.3.ebuild 1848 BLAKE2B 5d34e6c00564c40ebbf638d94e4cecc79ec7f5d715b8e1509fbecc6b93abd3dfd9dd3b84f76b18cee7ecd61c45e0ac4a43b1bc3121b6ddf67770c63aaeb2f8c6 SHA512 fa4c6705036b50d096fb61ad685c5fe5fd8d6f74ff56887f1bfc94bebc5015fff4736232770ee973723b7f49434635335d3b1ca0839d0309f0ead800b4866c9f -EBUILD neovim-9999.ebuild 1865 BLAKE2B 7a179dcb2aada0a8e059c4db391b15c3b23ef177506bfcb7d8ec42524100a33087e79895d6ff9eef2fba9e28df32245eb4b5309b2a753db89ecea21cae796b9a SHA512 8e782617caa8d3ee930eb2580e14317c30121967a83ade08b102a2be809dffdc016513a3fc0421d7c5759c2341e95b5be594cd1fb2edf9701ae9a38dd2c40d9c -MISC metadata.xml 469 BLAKE2B d0ddf9873870f4578e59c5473cb4cbd1a1aa105d704dabe52f29ff4db51eb988174a3d258b9575a876669716de46f217fb23978a9c4bbe1adfd8a84d4e082399 SHA512 11ee9fc96bcbc2cf131737a4f274d4dae5620d8ff9a27cf9fc6765b7dada8750e220e79ac305161313496c3d1cd499c34d28aaa5f63d6b4776cb8aa4f8af8c1a +DIST neovim-0.4.4.tar.gz 9558246 BLAKE2B b1d44898bb1e1ab40a7e1d7fb4448076c991ebe1a0956674548de82fe7a931d9eaffbf35ba03cf9c88466dcd628a55f1d7bf9e7a13f3dad74424d6d653ded60c SHA512 ca5c2fe1784ac7b0d2117948ba2e9ae5d94e36d22ff9e0967047e1e03e605537672d85543897af335103215ad462c86962f25267d352a77d61bc3d1cafb3c183 +EBUILD neovim-0.4.3.ebuild 1895 BLAKE2B ceb2d111b6d52d10592ab2da6dd507ac5050420b56443a57356d18e5220a081204d5a0331ce788187bb2494ad8f68cae95fc24e36eb57bdf7a892ab93e64d195 SHA512 074b04fa5ae321a293382f1ba21677374352788cb2b166fea99dd9369d07a3af62ded6b7b6f9bb735d9573d95e2bf870d15c9a4acaaba750fe3c1f37f8d99c6a +EBUILD neovim-0.4.4.ebuild 2348 BLAKE2B 58b011421a7cae8fd3c09d214a4bba0acd3eda43d5a08353170bc3c7268da080ae6fd8f891b36be77cadc1430506282e13d3e50dd4d6119014c0d1b43265f6ef SHA512 8106a227003985d3c35eca795abf2b587cd8e27b115e2e50c064a45e406605c6fa21eaee35eb85e3de5422ddd91a62745f6907f6b92904788c3c24b742890955 +EBUILD neovim-9999.ebuild 2372 BLAKE2B eefb333a5041d8bd4cc131c92aad6292a3928ecccb6c1afae5ac67608697085016af5c7928944d877a73fc26fdce5ac2fe14cbde397611a3e7e8b94f6e728a99 SHA512 109c49c8b12258d7e4cb7cde1b4ece99c8fb0faf362fab0df719609f9693c250241f30cf54764a7406ad6f5df2f0c471a13332447f6a6b1ee2659a52eaf535f3 +MISC metadata.xml 535 BLAKE2B 7cebdc1b7adafafdcc2fe266f8696ad0dff927e8a9383ee34ac66e2c8910d3863d1f7603f2a82dec75f586ab22814d7268475ae3ce02fc3dca12a665e1e8ce5e SHA512 71fcf593a1b9587e6af0e30e851fb17e8552568a4e8bd38341c150ada7dbf72f962250f3306403c0be2d334932f63fe183850efe1c67d515ba79577cdf7aa561 diff --git a/app-editors/neovim/files/neovim-0.4.3-gcc-10-fix.patch b/app-editors/neovim/files/neovim-0.4.3-gcc-10-fix.patch new file mode 100644 index 000000000000..5826d62ce6c1 --- /dev/null +++ b/app-editors/neovim/files/neovim-0.4.3-gcc-10-fix.patch @@ -0,0 +1,225 @@ +From ebcde1de42588e697e0f4eaed9f6f0ea6a77a2cd Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:33:55 +0100 +Subject: [PATCH 1/6] nvim:eval: Fix enum declaration for ListLenSpecials + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/eval/typval.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h +index 008453b87f2f..5afdedff751b 100644 +--- a/src/nvim/eval/typval.h ++++ b/src/nvim/eval/typval.h +@@ -33,7 +33,7 @@ typedef double float_T; + enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; + + /// Additional values for tv_list_alloc() len argument +-enum { ++enum ListLenSpecials { + /// List length is not known in advance + /// + /// To be used when there is neither a way to know how many elements will be +@@ -49,7 +49,7 @@ enum { + /// + /// To be used when it looks impractical to determine list length. + kListLenMayKnow = -3, +-} ListLenSpecials; ++}; + + /// Maximal possible value of varnumber_T variable + #define VARNUMBER_MAX INT64_MAX + +From b87b4a61476bb65e9200bd2ee93b8a98ca4db84e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:17:37 +0100 +Subject: [PATCH 2/6] nvim:viml: Fix enum declaration of ExprParserFlags + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/viml/parser/expressions.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h +index 23e172da75b2..838a74227182 100644 +--- a/src/nvim/viml/parser/expressions.h ++++ b/src/nvim/viml/parser/expressions.h +@@ -326,7 +326,7 @@ struct expr_ast_node { + } data; + }; + +-enum { ++enum ExprParserFlags { + /// Allow multiple expressions in a row: e.g. for :echo + /// + /// Parser will still parse only one of them though. +@@ -345,7 +345,7 @@ enum { + // viml_expressions_parser.c, nvim_parse_expression() flags parsing + // alongside with its documentation and flag sets in check_parsing() + // function in expressions parser functional and unit tests. +-} ExprParserFlags; ++}; + + /// AST error definition + typedef struct { + +From 986db1adb491b5cb5936d2369816236847af26da Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:36:21 +0100 +Subject: [PATCH 3/6] nvim: Fix enum declaration of RemapValues + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/getchar.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h +index 01f60ccf4945..f0b52079aad1 100644 +--- a/src/nvim/getchar.h ++++ b/src/nvim/getchar.h +@@ -10,12 +10,12 @@ + /// Values for "noremap" argument of ins_typebuf() + /// + /// Also used for map->m_noremap and menu->noremap[]. +-enum { ++enum RemapValues { + REMAP_YES = 0, ///< Allow remapping. + REMAP_NONE = -1, ///< No remapping. + REMAP_SCRIPT = -2, ///< Remap script-local mappings only. + REMAP_SKIP = -3, ///< No remapping for first char. +-} RemapValues; ++}; + + // Argument for flush_buffers(). + typedef enum { + +From 517bf15603aba37014b62553eb008e26f2a1db48 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:40:37 +0100 +Subject: [PATCH 4/6] nvim:msgpack: Correctly set up global + ch_before_blocking_events + +gcc10 builds with -fno-common by default. This mean you can't define +a global variable with the same name twice. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/msgpack_rpc/channel.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h +index 9ff5abdc5f55..90e1c7d48b4c 100644 +--- a/src/nvim/msgpack_rpc/channel.h ++++ b/src/nvim/msgpack_rpc/channel.h +@@ -15,7 +15,7 @@ + /// HACK: os/input.c drains this queue immediately before blocking for input. + /// Events on this queue are async-safe, but they need the resolved state + /// of os_inchar(), so they are processed "just-in-time". +-MultiQueue *ch_before_blocking_events; ++EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); + + + #ifdef INCLUDE_GENERATED_DECLARATIONS + +From 823b2104c3e579e8c3db8baab263dca0aa9d48bc Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:29:12 +0100 +Subject: [PATCH 5/6] nvim: Correctly setup global channels + +As gcc10 uses -fno-common by default, global variables declared with the +same name more than once is not allowed anymore revealing this issue. + +We need to define it as extern to access it. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/channel.c | 1 - + src/nvim/channel.h | 2 +- + src/nvim/main.c | 1 + + 3 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/channel.c b/src/nvim/channel.c +index c66a0682e351..5eb29a7290c2 100644 +--- a/src/nvim/channel.c ++++ b/src/nvim/channel.c +@@ -19,7 +19,6 @@ + #include "nvim/ascii.h" + + static bool did_stdio = false; +-PMap(uint64_t) *channels = NULL; + + /// next free id for a job or rpc channel + /// 1 is reserved for stdio channel +diff --git a/src/nvim/channel.h b/src/nvim/channel.h +index c733e276bef2..9d26852ce532 100644 +--- a/src/nvim/channel.h ++++ b/src/nvim/channel.h +@@ -85,7 +85,7 @@ struct Channel { + bool callback_scheduled; + }; + +-EXTERN PMap(uint64_t) *channels; ++EXTERN PMap(uint64_t) *channels INIT(= NULL); + + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "channel.h.generated.h" +diff --git a/src/nvim/main.c b/src/nvim/main.c +index 56d9030a7f42..4a9f2371a298 100644 +--- a/src/nvim/main.c ++++ b/src/nvim/main.c +@@ -10,6 +10,7 @@ + #include + + #include "nvim/ascii.h" ++#include "nvim/channel.h" + #include "nvim/vim.h" + #include "nvim/main.h" + #include "nvim/aucmd.h" + +From 0504f2f88dac9a4cf1fe1052a1e00ab203e9cf8e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 18:04:01 +0100 +Subject: [PATCH 6/6] cmake: Check for -fno-common and use it if available + +--- + CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index de530bb4f7da..74e161d98907 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -308,6 +308,11 @@ if(UNIX) + endif() + endif() + ++check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) ++if (HAVE_FNO_COMMON) ++ add_compile_options(-fno-common) ++endif() ++ + check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) + if(HAS_DIAG_COLOR_FLAG) + if(CMAKE_GENERATOR MATCHES "Ninja") diff --git a/app-editors/neovim/metadata.xml b/app-editors/neovim/metadata.xml index 73806d95e8a1..b263ac237703 100644 --- a/app-editors/neovim/metadata.xml +++ b/app-editors/neovim/metadata.xml @@ -6,6 +6,7 @@ Gentoo Vim Project + Build with Link Time Optimization (LTO) Install nvimpager symlink to less.sh macro Build the neovim unix tui diff --git a/app-editors/neovim/neovim-0.4.3.ebuild b/app-editors/neovim/neovim-0.4.3.ebuild index 34583324d168..b6a404f65c14 100644 --- a/app-editors/neovim/neovim-0.4.3.ebuild +++ b/app-editors/neovim/neovim-0.4.3.ebuild @@ -26,7 +26,6 @@ BDEPEND=" virtual/libintl virtual/pkgconfig " - DEPEND=" dev-libs/libuv:0= >=dev-libs/libvterm-0.1.2 @@ -45,7 +44,6 @@ DEPEND=" >=dev-libs/unibilium-2.0.0:0= ) " - RDEPEND=" ${DEPEND} app-eselect/eselect-vi @@ -53,6 +51,8 @@ RDEPEND=" CMAKE_BUILD_TYPE=Release +PATCHES=( "${FILESDIR}"/${P}-gcc-10-fix.patch ) + src_prepare() { # use our system vim dir sed -e "/^# define SYS_VIMRC_FILE/s|\$VIM|${EPREFIX}/etc/vim|" \ diff --git a/app-editors/neovim/neovim-0.4.4.ebuild b/app-editors/neovim/neovim-0.4.4.ebuild new file mode 100644 index 000000000000..d10522f3c6b7 --- /dev/null +++ b/app-editors/neovim/neovim-0.4.4.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake optfeature xdg + +DESCRIPTION="Vim-fork focused on extensibility and agility." +HOMEPAGE="https://neovim.io" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/neovim/neovim.git" +else + SRC_URI="https://github.com/neovim/neovim/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~x86" +fi + +LICENSE="Apache-2.0 vim" +SLOT="0" +IUSE="+lto +luajit +nvimpager +tui" +# Upstream say the test library needs LuaJIT +# https://github.com/neovim/neovim/blob/91109ffda23d0ce61cec245b1f4ffb99e7591b62/CMakeLists.txt#L377 +#REQUIRED_USE="test? ( luajit )" +#RESTRICT="!test? ( test )" + +BDEPEND=" + dev-util/gperf + virtual/libiconv + virtual/libintl + virtual/pkgconfig +" +# Once dev-lua/busted has luajit support, we can add tests. +# bug #584694 +DEPEND=" + dev-libs/libuv:0= + >=dev-libs/libvterm-0.1.2 + dev-libs/msgpack:0= + dev-lua/lpeg[luajit=] + dev-lua/luv[luajit=] + dev-lua/mpack[luajit=] + net-libs/libnsl + luajit? ( dev-lang/luajit:2 ) + !luajit? ( + dev-lang/lua:= + dev-lua/LuaBitOp + ) + tui? ( + dev-libs/libtermkey + >=dev-libs/unibilium-2.0.0:0= + ) +" +RDEPEND=" + ${DEPEND} + app-eselect/eselect-vi +" + +src_prepare() { + # use our system vim dir + sed -e "/^# define SYS_VIMRC_FILE/s|\$VIM|${EPREFIX}/etc/vim|" \ + -i src/nvim/globals.h || die + + cmake_src_prepare +} + +src_configure() { + # Upstream default to LTO on non-debug builds + # Let's expose it as a USE flag because upstream + # have preferences for how we should use LTO + # if we want it on (not just -flto) + # ... but allow turning it off. + local mycmakeargs=( + -DENABLE_LTO=$(usex lto) + -DFEAT_TUI=$(usex tui) + -DPREFER_LUA=$(usex luajit no yes) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + + # install a default configuration file + insinto /etc/vim + doins "${FILESDIR}"/sysinit.vim + + # conditionally install a symlink for nvimpager + if use nvimpager; then + dosym ../share/nvim/runtime/macros/less.sh /usr/bin/nvimpager + fi +} + +pkg_postinst() { + xdg_pkg_postinst + optfeature "clipboard support" x11-misc/xsel x11-misc/xclip gui-apps/wl-clipboard + optfeature "Python plugin support" dev-python/pynvim + optfeature "Ruby plugin support" dev-ruby/neovim-ruby-client + optfeature "remote/nvr support" dev-python/neovim-remote +} diff --git a/app-editors/neovim/neovim-9999.ebuild b/app-editors/neovim/neovim-9999.ebuild index 6944c0791a40..ae758e6e27bd 100644 --- a/app-editors/neovim/neovim-9999.ebuild +++ b/app-editors/neovim/neovim-9999.ebuild @@ -13,12 +13,16 @@ if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://github.com/neovim/neovim.git" else SRC_URI="https://github.com/neovim/neovim/archive/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm ~x86" + KEYWORDS="~amd64 ~arm ~arm64 ~x86" fi LICENSE="Apache-2.0 vim" SLOT="0" -IUSE="+luajit +nvimpager +tui" +IUSE="+lto +luajit +nvimpager +tui" +# Upstream say the test library needs LuaJIT +# https://github.com/neovim/neovim/blob/91109ffda23d0ce61cec245b1f4ffb99e7591b62/CMakeLists.txt#L377 +#REQUIRED_USE="test? ( luajit )" +#RESTRICT="!test? ( test )" BDEPEND=" dev-util/gperf @@ -26,11 +30,12 @@ BDEPEND=" virtual/libintl virtual/pkgconfig " - +# Once dev-lua/busted has luajit support, we can add tests. +# bug #584694 DEPEND=" dev-libs/libutf8proc:= dev-libs/libuv:0= - >=dev-libs/libvterm-0.1 + >=dev-libs/libvterm-0.1.2 dev-libs/msgpack:0= dev-lua/lpeg[luajit=] dev-lua/luv[luajit=] @@ -46,14 +51,11 @@ DEPEND=" >=dev-libs/unibilium-2.0.0:0= ) " - RDEPEND=" ${DEPEND} app-eselect/eselect-vi " -CMAKE_BUILD_TYPE=Release - src_prepare() { # use our system vim dir sed -e "/^# define SYS_VIMRC_FILE/s|\$VIM|${EPREFIX}/etc/vim|" \ @@ -63,7 +65,13 @@ src_prepare() { } src_configure() { + # Upstream default to LTO on non-debug builds + # Let's expose it as a USE flag because upstream + # have preferences for how we should use LTO + # if we want it on (not just -flto) + # ... but allow turning it off. local mycmakeargs=( + -DENABLE_LTO=$(usex lto) -DFEAT_TUI=$(usex tui) -DPREFER_LUA=$(usex luajit no yes) ) -- cgit v1.2.3