2021-07-18 08:24:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, gtest
|
2022-05-12 21:48:35 +00:00
|
|
|
, fetchpatch
|
2021-07-18 08:24:21 +00:00
|
|
|
, pkg-config
|
2017-11-27 07:39:29 +00:00
|
|
|
}:
|
2017-02-15 23:11:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "microsoft_gsl";
|
2021-07-18 08:24:21 +00:00
|
|
|
version = "3.1.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}";
|
2021-07-18 08:24:21 +00:00
|
|
|
sha256 = "sha256-gIpyuNlp3mvR8r1Azs2r76ElEodykRLGAwMN4BDJez0=";
|
2017-02-15 23:11:38 +00:00
|
|
|
};
|
|
|
|
|
2021-07-18 08:24:21 +00:00
|
|
|
patches = [
|
|
|
|
# Search for GoogleTest via pkg-config first, ref: https://github.com/NixOS/nixpkgs/pull/130525
|
2022-05-12 21:48:35 +00:00
|
|
|
(fetchpatch {
|
2021-07-18 08:24:21 +00:00
|
|
|
url = "https://github.com/microsoft/GSL/commit/f5cf01083baf7e8dc8318db3648bc6098dc32d67.patch";
|
2022-05-12 21:48:35 +00:00
|
|
|
sha256 = "sha256-HJxG87nVFo1CGNivCqt/JhjTj2xLzQe8bF5Km7/KG+Y=";
|
2021-07-18 08:24:21 +00:00
|
|
|
})
|
|
|
|
];
|
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
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|