|
2 | 2 | lib, |
3 | 3 | stdenv, |
4 | 4 | fetchFromGitHub, |
5 | | - fetchpatch, |
6 | 5 | cmake, |
7 | 6 | ninja, |
8 | 7 | installCompatHeader ? false, |
9 | 8 | installLegacyHeaders ? false, |
10 | 9 | }: |
11 | | - |
12 | | -stdenv.mkDerivation rec { |
| 10 | +stdenv.mkDerivation (finalAttrs: { |
13 | 11 | pname = "gsl-lite"; |
14 | | - version = "0.41.0"; |
| 12 | + version = "0.42.0"; |
15 | 13 |
|
16 | 14 | src = fetchFromGitHub { |
17 | 15 | owner = "gsl-lite"; |
18 | 16 | repo = "gsl-lite"; |
19 | | - rev = "v${version}"; |
20 | | - hash = "sha256-cuuix302bVA7dWa7EJoxJ+otf1rSzjWQK8DHJsVkQio="; |
| 17 | + tag = "v${finalAttrs.version}"; |
| 18 | + hash = "sha256-4CQG+sX/UTQ4zICmDR6YBfapuh0hSqkWk5skZAVAy2o="; |
21 | 19 | }; |
22 | 20 |
|
23 | | - patches = [ |
24 | | - (fetchpatch { |
25 | | - name = "type-limits-cast-fix.patch"; |
26 | | - url = "https://github.com/gsl-lite/gsl-lite/commit/13475be0e5bf5f464c398f4a07ef5c7684bc57c5.patch"; |
27 | | - hash = "sha256-rSz7OBmgQ3KcQ971tS3Z3QNC+U4XmrPjgmuOyG7J6Bo="; |
28 | | - }) |
29 | | - ]; |
30 | | - |
31 | 21 | nativeBuildInputs = [ |
32 | 22 | cmake |
33 | 23 | ninja |
34 | 24 | ]; |
35 | 25 |
|
36 | | - cmakeFlags = |
37 | | - lib.mapAttrsToList (name: value: ''-DGSL_LITE_OPT_${name}:BOOL=${if value then "ON" else "OFF"}'') |
38 | | - { |
39 | | - INSTALL_COMPAT_HEADER = installCompatHeader; |
40 | | - INSTALL_LEGACY_HEADERS = installLegacyHeaders; |
41 | | - BUILD_TESTS = doCheck; |
42 | | - }; |
| 26 | + cmakeFlags = [ |
| 27 | + (lib.cmakeBool "GSL_LITE_OPT_BUILD_TESTS" finalAttrs.doCheck) |
| 28 | + (lib.cmakeBool "GSL_LITE_OPT_INSTALL_COMPAT_HEADER" installCompatHeader) |
| 29 | + (lib.cmakeBool "GSL_LITE_OPT_INSTALL_LEGACY_HEADERS" installLegacyHeaders) |
| 30 | + ]; |
43 | 31 |
|
44 | 32 | # Building tests is broken on Darwin. |
45 | 33 | doCheck = !stdenv.hostPlatform.isDarwin; |
46 | 34 |
|
47 | | - meta = with lib; { |
48 | | - description = '' |
49 | | - A single-file header-only version of ISO C++ Guidelines Support Library |
50 | | - (GSL) for C++98, C++11, and later |
51 | | - ''; |
| 35 | + meta = { |
| 36 | + description = "Single-file header-only version of ISO C++ GSL"; |
52 | 37 | longDescription = '' |
53 | 38 | gsl-lite is a single-file header-only implementation of the C++ Core |
54 | 39 | Guidelines Support Library originally based on Microsoft GSL and adapted |
55 | 40 | for C++98, C++03. It also works when compiled as C++11, C++14, C++17, |
56 | 41 | C++20. |
57 | 42 | ''; |
58 | 43 | homepage = "https://github.com/gsl-lite/gsl-lite"; |
59 | | - changelog = "https://github.com/gsl-lite/gsl-lite/blob/${src.rev}/CHANGES.txt"; |
60 | | - license = licenses.mit; |
61 | | - maintainers = with maintainers; [ azahi ]; |
62 | | - platforms = platforms.all; |
| 44 | + changelog = "https://github.com/gsl-lite/gsl-lite/blob/${finalAttrs.src.rev}/CHANGES.txt"; |
| 45 | + license = lib.licenses.mit; |
| 46 | + maintainers = [ lib.maintainers.azahi ]; |
| 47 | + platforms = lib.platforms.all; |
63 | 48 | }; |
64 | | -} |
| 49 | +}) |
0 commit comments