Import libcrossguid-0.2.3.20211002
OK sthen@ Init port from Brad Comment: minimal and cross platform C++ GUID library Description: CrossGuid is a minimal, cross platform, C++ GUID library. It uses the best native GUID/UUID generator on the given platform and had a generic class for parsing, stringifying, and comparing IDs. Maintainer: The OpenBSD ports mailing-list <ports@openbsd.org> WWW: https://github.com/graeme-hill/crossguid
This commit is contained in:
parent
0a9a9b5231
commit
ecad480520
28
devel/libcrossguid/Makefile
Normal file
28
devel/libcrossguid/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
BROKEN-sparc64= SIBGUS in std::_Hashtable
|
||||
|
||||
COMMENT= minimal and cross platform C++ GUID library
|
||||
|
||||
DISTNAME= libcrossguid-0.2.3.20211002
|
||||
GH_ACCOUNT= graeme-hill
|
||||
GH_PROJECT= crossguid
|
||||
GH_COMMIT= ca1bf4b810e2d188d04cb6286f957008ee1b7681
|
||||
CATEGORIES= devel
|
||||
|
||||
SHARED_LIBS= crossguid 0.0
|
||||
|
||||
# MIT
|
||||
PERMIT_PACKAGE= Yes
|
||||
|
||||
WANTLIB= ${COMPILER_LIBCXX} c m
|
||||
|
||||
MODULES= devel/cmake
|
||||
|
||||
# C++17
|
||||
COMPILER= base-clang ports-gcc
|
||||
|
||||
CONFIGURE_ARGS+=-DBUILD_SHARED_LIBS=On
|
||||
|
||||
do-test:
|
||||
${WRKBUILD}/crossguid-test
|
||||
|
||||
.include <bsd.port.mk>
|
2
devel/libcrossguid/distinfo
Normal file
2
devel/libcrossguid/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
SHA256 (libcrossguid-0.2.3.20211002-ca1bf4b8.tar.gz) = a+J+CzpJB/DNPPrewlXuG5JVaeG9BuZ6TS9CZymbacQ=
|
||||
SIZE (libcrossguid-0.2.3.20211002-ca1bf4b8.tar.gz) = 141660
|
23
devel/libcrossguid/patches/patch-CMakeLists_txt
Normal file
23
devel/libcrossguid/patches/patch-CMakeLists_txt
Normal file
@ -0,0 +1,23 @@
|
||||
Index: CMakeLists.txt
|
||||
--- CMakeLists.txt.orig
|
||||
+++ CMakeLists.txt
|
||||
@@ -22,6 +22,8 @@ target_include_directories(crossguid PUBLIC
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(crossguid PRIVATE GUID_WINDOWS)
|
||||
+elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
+ target_compile_definitions(crossguid PRIVATE GUID_DCE)
|
||||
elseif(APPLE)
|
||||
find_library(CFLIB CoreFoundation)
|
||||
target_link_libraries(crossguid ${CFLIB})
|
||||
@@ -64,8 +66,8 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURC
|
||||
set(CROSSGUID_ARCHIVE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(CROSSGUID_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
- set(CROSSGUID_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/crossguid/cmake")
|
||||
- set(CROSSGUID_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/crossguid")
|
||||
+ set(CROSSGUID_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/crossguid")
|
||||
+ set(CROSSGUID_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/doc/crossguid")
|
||||
|
||||
# Install target
|
||||
install(TARGETS crossguid EXPORT crossguidTargets
|
32
devel/libcrossguid/patches/patch-src_guid_cpp
Normal file
32
devel/libcrossguid/patches/patch-src_guid_cpp
Normal file
@ -0,0 +1,32 @@
|
||||
Index: src/guid.cpp
|
||||
--- src/guid.cpp.orig
|
||||
+++ src/guid.cpp
|
||||
@@ -42,6 +42,10 @@ THE SOFTWARE.
|
||||
#include <cassert>
|
||||
#endif
|
||||
|
||||
+#ifdef GUID_DCE
|
||||
+#include <uuid.h>
|
||||
+#endif
|
||||
+
|
||||
BEGIN_XG_NAMESPACE
|
||||
|
||||
#ifdef GUID_ANDROID
|
||||
@@ -275,6 +279,17 @@ Guid newGuid()
|
||||
std::array<unsigned char, 16> data;
|
||||
static_assert(std::is_same<unsigned char[16], uuid_t>::value, "Wrong type!");
|
||||
uuid_generate(data.data());
|
||||
+ return Guid{std::move(data)};
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#ifdef GUID_DCE
|
||||
+Guid newGuid()
|
||||
+{
|
||||
+ uuid_t uuid;
|
||||
+ std::array<unsigned char, 16> data;
|
||||
+ uuid_create(&uuid, NULL);
|
||||
+ uuid_enc_be(&data, &uuid);
|
||||
return Guid{std::move(data)};
|
||||
}
|
||||
#endif
|
3
devel/libcrossguid/pkg/DESCR
Normal file
3
devel/libcrossguid/pkg/DESCR
Normal file
@ -0,0 +1,3 @@
|
||||
CrossGuid is a minimal, cross platform, C++ GUID library. It uses the
|
||||
best native GUID/UUID generator on the given platform and had a generic
|
||||
class for parsing, stringifying, and comparing IDs.
|
11
devel/libcrossguid/pkg/PLIST
Normal file
11
devel/libcrossguid/pkg/PLIST
Normal file
@ -0,0 +1,11 @@
|
||||
include/crossguid/
|
||||
include/crossguid/guid.hpp
|
||||
lib/cmake/
|
||||
lib/cmake/crossguid/
|
||||
lib/cmake/crossguid/crossguid-config${MODCMAKE_BUILD_SUFFIX}
|
||||
lib/cmake/crossguid/crossguid-config.cmake
|
||||
@lib lib/libcrossguid.so.${LIBcrossguid_VERSION}
|
||||
lib/pkgconfig/crossguid.pc
|
||||
share/doc/crossguid/
|
||||
share/doc/crossguid/LICENSE
|
||||
share/doc/crossguid/README.md
|
Loading…
x
Reference in New Issue
Block a user