pkgsrc-WIP-changes archive

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

luv: Build shared library instead of Lua module



Module Name:	pkgsrc-wip
Committed By:	Jonathan Buschmann <jonthn+pkgsrc%pinacea.com@localhost>
Pushed By:	jonthn
Date:		Wed Jan 1 21:47:22 2020 +0800
Changeset:	9deb1193e299578684a65628bfd7db3b34b2f9ae

Modified Files:
	luv/Makefile
	luv/PLIST
	luv/buildlink3.mk
	luv/distinfo
Added Files:
	luv/options.mk
	luv/patches/patch-CMakeLists.txt
Removed Files:
	luv/TODO

Log Message:
luv:  Build shared library instead of Lua module

  A new package wip/lua-luv will provide the Lua module

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9deb1193e299578684a65628bfd7db3b34b2f9ae

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 luv/Makefile                     | 32 +++++++++++++++++++++-----------
 luv/PLIST                        |  9 ++++++++-
 luv/TODO                         |  3 ---
 luv/buildlink3.mk                |  4 ++--
 luv/distinfo                     |  6 ++++++
 luv/options.mk                   | 25 +++++++++++++++++++++++++
 luv/patches/patch-CMakeLists.txt | 14 ++++++++++++++
 7 files changed, 76 insertions(+), 17 deletions(-)

diffs:
diff --git a/luv/Makefile b/luv/Makefile
index b168558907..5e38d770a8 100644
--- a/luv/Makefile
+++ b/luv/Makefile
@@ -1,21 +1,31 @@
 # $NetBSD$
 
-PKGNAME=	luv-${GIT_TAG.luv:S/-/./g}
+DISTNAME=	lua-luv-1.32.0
+PKGNAME=	${DISTNAME:S/lua-//}
 CATEGORIES=	devel
-LICENSE=	apache-2.0
-
-GIT_REPOSITORIES+=	luv
-GIT_REPO.luv=		https://github.com/luvit/luv.git
-GIT_TAG.luv=		1.9.1-1
+MASTER_SITES=	${MASTER_SITE_GITHUB:=luvit/}
+GITHUB_PROJECT=	luv
+GITHUB_TAG=	${PKGVERSION_NOREV}-0
 
-COMMENT=	Bare libuv bindings for Lua
-MAINTAINER=	cfkoch%edgebsd.org@localhost
 HOMEPAGE=	https://github.com/luvit/luv/
+COMMENT=	Bare libuv bindings for Lua
+LICENSE=	apache-2.0
 
 USE_CMAKE=	yes
 
-WRKSRC=	${WRKDIR}/luv
+# should follow the LuaJIT API compatibility as those are the 2 options
+LUA_VERSIONS_ACCEPTED=	51
+
+CMAKE_ARGS+=	-DWITH_SHARED_LIBUV=ON
+CMAKE_ARGS+=	-DBUILD_SHARED_LIBS=ON
+CMAKE_ARGS+=	-DBUILD_MODULE=OFF
+CMAKE_ARGS+=	-DLUA_BUILD_TYPE=System
+CMAKE_ARGS+=	-DLUA_COMPAT53_DIR=${PREFIX}/${LUA_LDIR}/compat53/
+CMAKE_ARGS+=	-DCMAKE_C_FLAGS="-I${PREFIX}/${LUA_INCDIR} -I${PREFIX}/${LUA_LDIR}/compat53"
+
+.include "options.mk"
 
-.include "../../lang/LuaJIT2/buildlink3.mk"
-.include "../../wip/mk/git-package.mk"
+.include "../../wip/lua-compat53/buildlink3.mk"
+.include "../../devel/libuv/buildlink3.mk"
+.include "../../lang/lua/module.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/luv/PLIST b/luv/PLIST
index 024fe79f5f..ef74f104a1 100644
--- a/luv/PLIST
+++ b/luv/PLIST
@@ -1,2 +1,9 @@
 @comment $NetBSD$
-lib/lua/luv.so
+include/luv/lhandle.h
+include/luv/lreq.h
+include/luv/luv.h
+include/luv/util.h
+lib/libluv.${PKGVERSION}.dylib
+lib/libluv.1.dylib
+lib/libluv.dylib
+lib/pkgconfig/libluv.pc
diff --git a/luv/TODO b/luv/TODO
deleted file mode 100644
index 232c23ba13..0000000000
--- a/luv/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
-- The source code "vendors" Lua, LuaJIT and libuv as Git submodules --
-  should we just use them, or try to coerce this packge to use those as
-  dependiences?
diff --git a/luv/buildlink3.mk b/luv/buildlink3.mk
index 50526feb32..bd5f6d1718 100644
--- a/luv/buildlink3.mk
+++ b/luv/buildlink3.mk
@@ -5,8 +5,8 @@ BUILDLINK_TREE+=	luv
 .if !defined(LUV_BUILDLINK3_MK)
 LUV_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.luv+=	luv>=1.9.1
-BUILDLINK_ABI_DEPENDS.luv+=	luv>=1.9.1
+BUILDLINK_API_DEPENDS.luv+=	luv>=1.32.0
+BUILDLINK_ABI_DEPENDS.luv+=	luv>=1.32.0
 BUILDLINK_PKGSRCDIR.luv?=	../../wip/luv
 
 .endif # LUV_BUILDLINK3_MK
diff --git a/luv/distinfo b/luv/distinfo
index c641c554c2..6ad24ea117 100644
--- a/luv/distinfo
+++ b/luv/distinfo
@@ -1 +1,7 @@
 $NetBSD$
+
+SHA1 (lua-luv-1.32.0.tar.gz) = 1dc5e61c3ad14b1a261afddf72ba6e92aa828d57
+RMD160 (lua-luv-1.32.0.tar.gz) = 725f6a429dfcd697b6b3d10d431227ada8dc8558
+SHA512 (lua-luv-1.32.0.tar.gz) = 7db52afc1ca79052e349be7a37deb67066ee9005f8d7f7d0dae62bd83a93b4140103ee6dddeca2e02a3fc37b3880a5c18904429886af1d441f8de0cfabf5bd8c
+Size (lua-luv-1.32.0.tar.gz) = 91349 bytes
+SHA1 (patch-CMakeLists.txt) = 8307bdeed66cfd677a847943f3cc5c4403e0c244
diff --git a/luv/options.mk b/luv/options.mk
new file mode 100644
index 0000000000..4b9ef9a337
--- /dev/null
+++ b/luv/options.mk
@@ -0,0 +1,25 @@
+# $NetBSD$
+# $NetBSD $
+
+PKG_OPTIONS_VAR=		PKG_OPTIONS.luv
+PKG_OPTIONS_REQUIRED_GROUPS=	lua
+PKG_OPTIONS_GROUP.lua=		lua luajit
+PKG_SUGGESTED_OPTIONS=		lua
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Use lua (add dependency)
+###
+.if !empty(PKG_OPTIONS:Mlua)
+.include "../../lang/lua/buildlink3.mk"
+CMAKE_ARGS+=	-DWITH_LUA_ENGINE=Lua
+.endif
+
+###
+### Use luajit (add dependency)
+###
+.if !empty(PKG_OPTIONS:Mluajit)
+.include "../../lang/LuaJIT2/buildlink3.mk"
+CMAKE_ARGS+=	-DWITH_LUA_ENGINE=LuaJIT
+.endif
diff --git a/luv/patches/patch-CMakeLists.txt b/luv/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..60256b3ad1
--- /dev/null
+++ b/luv/patches/patch-CMakeLists.txt
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- CMakeLists.txt.orig	2019-12-31 14:38:46.000000000 +0000
++++ CMakeLists.txt
+@@ -136,6 +136,9 @@ else (BUILD_MODULE)
+   if (BUILD_SHARED_LIBS)
+     set_target_properties(luv
+       PROPERTIES VERSION ${LUV_VERSION} SOVERSION ${LUV_VERSION_MAJOR})
++    if(APPLE)
++      target_link_libraries(luv "-undefined dynamic_lookup")
++    endif()
+   endif (BUILD_SHARED_LIBS)
+ endif (BUILD_MODULE)
+ 


Home | Main Index | Thread Index | Old Index