mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 13:53:24 +00:00
Merge pull request #153621 from yl3dy/update_cxxopts
cxxopts: unstable-2020-12-14 -> 3.0.0
This commit is contained in:
commit
bd9e917a8f
@ -1,21 +1,29 @@
|
||||
{ cmake, fetchFromGitHub, icu, lib, pkg-config, stdenv, enableUnicodeHelp ? true }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, icu
|
||||
, pkg-config
|
||||
, enableUnicodeHelp ? true
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "cxxopts";
|
||||
version = "unstable-2020-12-14";
|
||||
version = "3.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jarro2783";
|
||||
repo = name;
|
||||
rev = "2d8e17c4f88efce80e274cb03eeb902e055a91d3";
|
||||
sha256 = "0pwrac81zfqjs17g3hx8r3ds2xf04npb6mz111qjy4bx17314ib7";
|
||||
rev = "v${version}";
|
||||
sha256 = "08x7j168l1xwj0r3rv89cgghmfhsx98lpq35r3vkh504m1pd55a6";
|
||||
};
|
||||
|
||||
# CMake does not set CMAKE_LIBRARY_ARCHITECTURE variable in Nix, which breaks architecture-independent library path generation
|
||||
patches = [ ./fix-install-path.patch ];
|
||||
|
||||
buildInputs = lib.optional enableUnicodeHelp [ icu.dev ];
|
||||
cmakeFlags = [ "-DCXXOPTS_BUILD_EXAMPLES=OFF" ]
|
||||
++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"
|
||||
# Due to -Wsuggest-override, remove when cxxopts is updated
|
||||
++ lib.optional stdenv.isDarwin "-DCXXOPTS_ENABLE_WARNINGS=OFF";
|
||||
++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE";
|
||||
nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp [ pkg-config ];
|
||||
|
||||
doCheck = true;
|
||||
|
18
pkgs/development/libraries/cxxopts/fix-install-path.patch
Normal file
18
pkgs/development/libraries/cxxopts/fix-install-path.patch
Normal file
@ -0,0 +1,18 @@
|
||||
diff --git a/cmake/cxxopts.cmake b/cmake/cxxopts.cmake
|
||||
index 46e87ba..0ead543 100644
|
||||
--- a/cmake/cxxopts.cmake
|
||||
+++ b/cmake/cxxopts.cmake
|
||||
@@ -87,7 +87,12 @@ endfunction()
|
||||
|
||||
# Helper function to ecapsulate install logic
|
||||
function(cxxopts_install_logic)
|
||||
- string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
|
||||
+ if(CMAKE_LIBRARY_ARCHITECTURE)
|
||||
+ string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
|
||||
+ else()
|
||||
+ # On some systems (e.g. NixOS), `CMAKE_LIBRARY_ARCHITECTURE` can be empty
|
||||
+ set(CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
|
||||
+ endif()
|
||||
set(CXXOPTS_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR_ARCHIND}/cmake/cxxopts" CACHE STRING "Installation directory for cmake files, relative to ${CMAKE_INSTALL_PREFIX}.")
|
||||
set(version_config "${PROJECT_BINARY_DIR}/cxxopts-config-version.cmake")
|
||||
set(project_config "${PROJECT_BINARY_DIR}/cxxopts-config.cmake")
|
Loading…
Reference in New Issue
Block a user