pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/57416: editors/neovim fix build on macOS



>Number:         57416
>Category:       pkg
>Synopsis:       editors/neovim fix build on macOS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 17 15:05:00 +0000 2023
>Originator:     jonathan buschmann
>Release:        pkgsrc trunk / HEAD
>Organization:
>Environment:
sw_vers
ProductName:    macOS
ProductVersion: 12.6.5
BuildVersion:   21G531

Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

XCode 14.2
>Description:
neovim relies on libvterm but on macOS dynamic libraries are using the extension .dylib and not .so

second problem is in the PLIST, as the `nvim.desktop` file is not installed on macOS
>How-To-Repeat:

>Fix:
- Fix for libvterm is to use `pkg-config`
- Fix for PLIST is to use a PLIST_VAR

diff --git c/editors/neovim/Makefile i/editors/neovim/Makefile
index 0d1f605030d..e7068293510 100644
--- c/editors/neovim/Makefile
+++ i/editors/neovim/Makefile
@@ -16,8 +16,6 @@ USE_TOOLS+=	pkg-config xgettext
 USE_LANGUAGES=	c c++
 
 CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
-CMAKE_ARGS+=	-DLIBVTERM_LIBRARY=${BUILDLINK_PREFIX.libvterm03}/lib/libvterm03/libvterm.so
-CMAKE_ARGS+=	-DLIBVTERM_INCLUDE_DIR=${BUILDLINK_PREFIX.libvterm03}/include/libvterm03
 
 CONFIGURE_DIRS=		${WRKDIR}/build
 CMAKE_ARG_PATH=		${WRKSRC}
@@ -42,6 +40,12 @@ DEPENDS+=	${LUA_PKGPREFIX}-BitOp-[0-9]*:../../devel/lua-BitOp
 post-extract:
 	${MKDIR} ${WRKDIR}/build
 
+PLIST_VARS+=	not_macos
+
+.if ${OPSYS} != "Darwin"
+PLIST.not_macos=	yes
+.endif
+
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"
 .include "../../devel/gperf/buildlink3.mk"
diff --git c/editors/neovim/PLIST i/editors/neovim/PLIST
index a70ce821f03..01cc69f57de 100644
--- c/editors/neovim/PLIST
+++ i/editors/neovim/PLIST
@@ -1,7 +1,7 @@
 @comment $NetBSD: PLIST,v 1.4 2023/04/25 23:36:19 nikita Exp $
 bin/nvim
 man/man1/nvim.1
-share/applications/nvim.desktop
+${PLIST.not_macos}share/applications/nvim.desktop
 share/icons/hicolor/128x128/apps/nvim.png
 share/locale/af/LC_MESSAGES/nvim.mo
 share/locale/ca/LC_MESSAGES/nvim.mo
diff --git c/editors/neovim/distinfo i/editors/neovim/distinfo
index 5e2917140e5..265f9cbcfa5 100644
--- c/editors/neovim/distinfo
+++ i/editors/neovim/distinfo
@@ -3,4 +3,5 @@ $NetBSD: distinfo,v 1.6 2023/04/25 23:36:19 nikita Exp $
 BLAKE2s (neovim-0.9.0.tar.gz) = aa77d586bc61cddc5a22ddb311a8a1f9e2760e7dc6dc920b7fa7c75c0bf37407
 SHA512 (neovim-0.9.0.tar.gz) = e42f09f408b83fc34e8f169321e0349d1f851e67a998265c53d2ddb1a4792c3f4777fabe32baf2c7eff7d3745ff60d4a07da542ccd272883f7f4e080b2c9c1bf
 Size (neovim-0.9.0.tar.gz) = 11549103 bytes
+SHA1 (patch-cmake_FindLibvterm.cmake) = d06796a1f65eb0579c86e5b09a1bd96c9cac6442
 SHA1 (patch-src_nvim_CMakeLists.txt) = 8f9e94bde4ca1359354b4bc82a245a776b118431
diff --git c/editors/neovim/patches/patch-cmake_FindLibvterm.cmake i/editors/neovim/patches/patch-cmake_FindLibvterm.cmake
new file mode 100644
index 00000000000..f3aec259570
--- /dev/null
+++ i/editors/neovim/patches/patch-cmake_FindLibvterm.cmake
@@ -0,0 +1,27 @@
+
+Help CMake to find libvterm03 in pkgsrc's prefix
+
+--- cmake/FindLibvterm.cmake	2023-04-07 19:26:29.000000000 +0800
++++ cmake/FindLibvterm.cmake	2023-05-17 16:48:00.000000000 +0800
+@@ -1,3 +1,15 @@
++include(CMakePrintHelpers)
++find_package(PkgConfig)
++pkg_check_modules(VTERM03 vterm03)
++
++if(VTERM03_FOUND)
++
++add_library(libvterm INTERFACE)
++target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${VTERM03_INCLUDE_DIRS})
++target_link_libraries(libvterm INTERFACE ${VTERM03_LIBRARIES})
++
++else()
++
+ find_path(LIBVTERM_INCLUDE_DIR vterm.h)
+ find_library(LIBVTERM_LIBRARY vterm)
+ 
+@@ -20,3 +32,5 @@
+ target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY})
+ 
+ mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
++
++endif()



Home | Main Index | Thread Index | Old Index