nixpkgs/pkgs/by-name/gf/gflags/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
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.
2024-11-09 20:04:51 +08:00

42 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake
, enableShared ? !stdenv.hostPlatform.isStatic
}:
stdenv.mkDerivation rec {
pname = "gflags";
version = "2.2.2";
src = fetchFromGitHub {
owner = "gflags";
repo = "gflags";
rev = "v${version}";
sha256 = "147i3md3nxkjlrccqg4mq1kyzc7yrhvqv5902iibc7znkvzdvlp0";
};
nativeBuildInputs = [ cmake ];
# This isn't used by the build and breaks the CMake build on case-insensitive filesystems (e.g., on Darwin)
preConfigure = "rm BUILD";
cmakeFlags = [
"-DGFLAGS_BUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
"-DGFLAGS_BUILD_STATIC_LIBS=ON"
];
doCheck = false;
meta = with lib; {
description = "C++ library that implements commandline flags processing";
mainProgram = "gflags_completions.sh";
longDescription = ''
The gflags package contains a C++ library that implements commandline flags processing.
As such it's a replacement for getopt().
It was owned by Google. google-gflags project has been renamed to gflags and maintained by new community.
'';
homepage = "https://gflags.github.io/gflags/";
license = licenses.bsd3;
maintainers = [ maintainers.linquize ];
platforms = platforms.all;
};
}