2021-07-18 08:24:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-02-16 13:21:54 +00:00
|
|
|
, fetchpatch
|
2021-07-18 08:24:21 +00:00
|
|
|
, cmake
|
|
|
|
, gtest
|
|
|
|
, pkg-config
|
2017-11-27 07:39:29 +00:00
|
|
|
}:
|
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
|
|
|
|
2019-05-03 19:29:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Microsoft";
|
|
|
|
repo = "GSL";
|
2019-05-03 08:00:21 +00:00
|
|
|
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";
|
|
|
|
|
2024-02-16 13:21:54 +00:00
|
|
|
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
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-05-24 09:24:11 +00:00
|
|
|
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.
|
2019-05-24 09:24:11 +00:00
|
|
|
'';
|
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
|
|
|
};
|
|
|
|
}
|