571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, icu
|
|
, pkg-config
|
|
, enableUnicodeHelp ? true
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "cxxopts";
|
|
version = "3.2.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jarro2783";
|
|
repo = "cxxopts";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-aOF3owz7SIV4trJY0PnMtIcwqoUpDbB3tNxZcsl9dzM=";
|
|
};
|
|
|
|
buildInputs = lib.optionals enableUnicodeHelp [ icu.dev ];
|
|
cmakeFlags = [ "-DCXXOPTS_BUILD_EXAMPLES=OFF" ]
|
|
++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE";
|
|
nativeBuildInputs = [ cmake ] ++ lib.optionals enableUnicodeHelp [ pkg-config ];
|
|
|
|
doCheck = true;
|
|
|
|
# Conflict on case-insensitive filesystems.
|
|
dontUseCmakeBuildDir = true;
|
|
|
|
# https://github.com/jarro2783/cxxopts/issues/332
|
|
postPatch = ''
|
|
substituteInPlace packaging/pkgconfig.pc.in \
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|