Skip to content

Commit

Permalink
Remove libuuid Dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Jul 24, 2024
1 parent 1928164 commit 5e6dc1d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
uses: johnwason/vcpkg-action@v6
id: vcpkg
with:
pkgs: curl gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl
pkgs: curl gettext-libintl glib gtest jsoncpp libsecret maddy openssl
triplet: x64-linux
revision: ee1093857f3d16b007065542bbb2229369c70c2e
revision: 6062c8fe02d38b10d5291411bc235ae4d02cfe6c
token: ${{ secrets.GITHUB_TOKEN }}
github-binarycache: true
- name: "Build"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
pkgs: curl gettext-libintl glib gtest jsoncpp maddy openssl
triplet: arm64-osx
revision: 5f502b165027bbede86ff2c5316334e3398bc519
revision: 6062c8fe02d38b10d5291411bc235ae4d02cfe6c
token: ${{ secrets.GITHUB_TOKEN }}
github-binarycache: true
- name: "Build"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
pkgs: curl gettext-libintl gtest jsoncpp maddy sqlcipher
triplet: x64-windows
revision: ee1093857f3d16b007065542bbb2229369c70c2e
revision: 6062c8fe02d38b10d5291411bc235ae4d02cfe6c
token: ${{ secrets.GITHUB_TOKEN }}
github-binarycache: true
- name: "Build"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2024.7.3 (next)
### Breaking Changes
- Removed the dependency on `libuuid`
#### Database
- Non-constructor methods will no longer throw exceptions but return true or false upon success.
#### Network
Expand Down
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ elseif(LINUX)
pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0)
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1)
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret)
if(USING_VCPKG)
find_package(unofficial-libuuid CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC unofficial::UUID::uuid)
else()
find_package(Libuuid REQUIRED)
if(Libuuid_FOUND)
target_include_directories(${PROJECT_NAME} INTERFACE ${Libuuid_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} INTERFACE ${Libuuid_LIBRARIES})
endif()
endif()
elseif(APPLE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_library(CF_LIBRARY CoreFoundation)
Expand All @@ -143,7 +133,7 @@ install(TARGETS ${PROJECT_NAME} EXPORT "${PROJECT_NAME}Targets" LIBRARY DESTINAT
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(EXPORT "${PROJECT_NAME}Targets" FILE "${PROJECT_NAME}Targets.cmake" NAMESPACE ${PROJECT_NAME}:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" "${CMAKE_SOURCE_DIR}/cmake/FindLibuuid.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
export(EXPORT "${PROJECT_NAME}Targets" FILE "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Targets.cmake" NAMESPACE ${PROJECT_NAME}::)

#libnick Test
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ The above dependencies must be installed, *plus* the following for Windows syste
The above dependencies must be installed, *plus* the following for Linux systems:
- glib
- libsecret
- libuuid
- openssl
- Used for sqlcipher, as libnick manually builds sqlcipher on Linux as the vcpkg port is broken.

Expand Down Expand Up @@ -66,7 +65,7 @@ A C++20 compiler is also required to build libnick.
1. Run `vcpkg install curl gettext-libintl gtest jsoncpp maddy sqlcipher`
#### Linux
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-linux`
1. Run `vcpkg install curl gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl`
1. Run `vcpkg install curl gettext-libintl glib gtest jsoncpp libsecret maddy openssl`
#### macOS (Intel)
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-osx`
1. Run `vcpkg install curl gettext-libintl glib gtest jsoncpp libsecret maddy openssl`
Expand Down
17 changes: 0 additions & 17 deletions cmake/FindLibuuid.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ elseif(LINUX)
pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0)
pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0)
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1)
if(USING_VCPKG)
find_dependency(unofficial-libuuid CONFIG REQUIRED)
else()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
find_dependency(Libuuid REQUIRED)
endif()
elseif(APPLE)
find_library(CF_LIBRARY CoreFoundation)
find_library(CS_LIBRARY CoreServices)
Expand Down
8 changes: 7 additions & 1 deletion manual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ libnick provides Nickvision apps with a common set of cross-platform APIs for ma

## 2024.7.3 (next)
### Breaking Changes
- Removed the dependency on `libuuid`
#### Database
- Non-constructor methods will no longer throw exceptions but return true or false upon success.
#### Network
- Non-constructor methods will no longer throw exceptions but return true or false upon success.
- Removed `Nickvision::Network::WebClient` class
### New APIs
#### Events
- Added `Nickvision::Events::Event::count()` method
- Added `Nickvision::Events::Event::operator bool()` method
#### Helpers
- Added `Nickvision::Helpers::StringHelpers::newUuid()` method
#### Network
- Added `Nickvision::Network::DNS` namespace
- Added `Nickvision::Network::IPv4Address` class
- Added `Nickvision::Network::MacAddress` class
- Added `Nickvision::Network::Web` class
### Fixes
None
#### Helpers
- Improved GUID/UUID generation in `Nickvision::Helpers::StringHelpers`

## Dependencies
The following are a list of dependencies used by libnick.
Expand Down

0 comments on commit 5e6dc1d

Please sign in to comment.