about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/cxxopts/default.nix
blob: 9d3ea6f32de3de2530836ae8398d5636a31123f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib
, stdenv
, fetchFromGitHub
, cmake
, icu
, pkg-config
, enableUnicodeHelp ? true
}:

stdenv.mkDerivation rec {
  name = "cxxopts";
  version = "3.0.0";

  src = fetchFromGitHub {
    owner = "jarro2783";
    repo = name;
    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";
  nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp [ pkg-config ];

  doCheck = true;

  # Conflict on case-insensitive filesystems.
  dontUseCmakeBuildDir = true;

  meta = with lib; {
    homepage = "https://github.com/jarro2783/cxxopts";
    description = "Lightweight C++ GNU-style option parser library";
    license = licenses.mit;
    maintainers = [ maintainers.spease ];
    platforms = platforms.all;
  };
}