nixpkgs/pkgs/by-name/mi/microsoft-gsl/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.4 KiB
Nix
Raw Normal View History

2021-07-18 08:24:21 +00:00
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
2021-07-18 08:24:21 +00:00
, cmake
, gtest
, pkg-config
}:
2017-02-15 23:11:38 +00:00
stdenv.mkDerivation rec {
2023-05-19 10:43:57 +00:00
pname = "microsoft-gsl";
version = "4.0.0";
2017-02-15 23:11:38 +00:00
src = fetchFromGitHub {
owner = "Microsoft";
repo = "GSL";
rev = "v${version}";
2023-05-19 10:43:57 +00:00
hash = "sha256-cXDFqt2KgMFGfdh6NGE+JmP4R0Wm9LNHM0eIblYe6zU=";
2017-02-15 23:11:38 +00:00
};
2021-07-18 08:24:21 +00:00
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ gtest ];
2019-09-13 09:35:50 +00:00
2023-10-27 21:39:19 +00:00
# error: unsafe buffer access
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unsafe-buffer-usage";
patches = [
# nvcc doesn't recognize the "gsl" attribute namespace (microsoft/onnxruntime#13573)
# only affects nvcc
(fetchpatch {
url = "https://raw.githubusercontent.com/microsoft/onnxruntime/4bfa69def85476b33ccfaf68cf070f3fb65d39f7/cmake/patches/gsl/1064.patch";
hash = "sha256-0jESA+VENWQms9HGE0jRiZZuWLJehBlbArxSaQbYOrM=";
})
];
2021-07-18 08:24:21 +00:00
doCheck = true;
2017-02-15 23:11:38 +00:00
meta = with lib; {
description = "C++ Core Guideline support library";
longDescription = ''
2021-07-18 08:24:21 +00:00
The Guideline Support Library (GSL) contains functions and types that are suggested for
use by the C++ Core Guidelines maintained by the Standard C++ Foundation.
This package contains Microsoft's implementation of GSL.
'';
2021-07-18 08:24:21 +00:00
homepage = "https://github.com/Microsoft/GSL";
license = licenses.mit;
platforms = platforms.all;
2021-08-08 17:11:45 +00:00
maintainers = with maintainers; [ thoughtpolice yuriaisaka ];
2017-02-15 23:11:38 +00:00
};
}