generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9be1a0d
commit 56bb9c6
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 0a29446..5adf5bd 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -44,3 +44,56 @@ if(BUS_INCLUDE_TESTS) | ||
include(CTest) | ||
add_subdirectory(test) | ||
endif() | ||
+ | ||
+if(PROJECT_IS_TOP_LEVEL) | ||
+ include(CPack) | ||
+endif() | ||
+ | ||
+# install rules | ||
+if(PROJECT_IS_TOP_LEVEL) | ||
+ set(CMAKE_INSTALL_INCLUDEDIR include/boost CACHE PATH "") | ||
+endif() | ||
+ | ||
+include(CMakePackageConfigHelpers) | ||
+include(GNUInstallDirs) | ||
+# Allow package maintainers to freely override the path for the configs | ||
+set(package boost_unordered) | ||
+ | ||
+install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT boost_unordered_Development) | ||
+install(TARGETS boost_unordered EXPORT boost_unorderedTargets INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
+ | ||
+write_basic_package_version_file( | ||
+ "${package}ConfigVersion.cmake" | ||
+ COMPATIBILITY SameMajorVersion | ||
+ ARCH_INDEPENDENT | ||
+) | ||
+ | ||
+set( | ||
+ boost_unordered_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}" | ||
+ CACHE PATH "CMake package config location relative to the install prefix" | ||
+) | ||
+mark_as_advanced(boost_unordered_INSTALL_CMAKEDIR) | ||
+ | ||
+write_file( | ||
+ "${PROJECT_BINARY_DIR}/${package}Config.cmake" | ||
+ "include(\"${CMAKE_CURRENT_LIST_DIR}/${package}Targets.cmake\")" | ||
+) | ||
+ | ||
+install( | ||
+ FILES "${PROJECT_BINARY_DIR}/${package}Config.cmake" | ||
+ DESTINATION "${boost_unordered_INSTALL_CMAKEDIR}" | ||
+ COMPONENT boost_unordered_Development | ||
+) | ||
+ | ||
+install( | ||
+ FILES "${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake" | ||
+ DESTINATION "${boost_unordered_INSTALL_CMAKEDIR}" | ||
+ COMPONENT boost_unordered_Development | ||
+) | ||
+ | ||
+install( | ||
+ EXPORT boost_unorderedTargets | ||
+ NAMESPACE boost_unordered:: | ||
+ DESTINATION "${boost_unordered_INSTALL_CMAKEDIR}" | ||
+ COMPONENT boost_unordered_Development | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ lib, stdenv, fetchFromGitHub, cmake }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "boost_unordered"; | ||
version = "1.85.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "MikePopoloski"; | ||
repo = "boost_unordered"; | ||
rev = "v${version}"; | ||
hash = "sha256-II3LhaZTAmqn0xcWuSF01czy/IGobvpiGAgZ4EjJ6aY="; | ||
}; | ||
|
||
nativeBuildInputs = [ cmake ]; | ||
|
||
cmakeFlags = [ "-DBUS_INCLUDE_TESTS=OFF" ]; | ||
|
||
patches = [ ./cmake_install_rules.patch ]; | ||
|
||
meta = with lib; { | ||
description = "Standalone version of the boost::unordered library"; | ||
homepage = "https://github.com/MikePopoloski/boost_unordered"; | ||
license = licenses.boost; | ||
platforms = platforms.all; | ||
#maintainers = with maintainers; [ foolnotion ]; | ||
}; | ||
} |