blob: 319b295d58fdcf3f550f1b47ccd9aec4e5283038 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
{ stdenv
, lib
, fetchFromGitHub
, gnat
, gnatcoll-core
, gprbuild
, python3
, ocamlPackages
, makeWrapper
}:
let
gnat_version = lib.versions.major gnat.version;
fetchSpark2014 = { rev, sha256 } : fetchFromGitHub {
owner = "AdaCore";
repo = "spark2014";
fetchSubmodules = true;
inherit rev sha256;
};
spark2014 = {
"12" = {
src = fetchSpark2014 {
rev = "ab34e07080a769b63beacc141707b5885c49d375"; # branch fsf-12
sha256 = "sha256-7pe3eWitpxmqzjW6qEIEuN0qr2IR+kJ7Ssc9pTBcCD8=";
};
commit_date = "2022-05-25";
};
"13" = {
src = fetchSpark2014 {
rev = "12db22e854defa9d1c993ef904af1e72330a68ca"; # branch fsf-13
sha256 = "sha256-mZWP9yF1O4knCiXx8CqolnS+93bM+hTQy40cd0HZmwI=";
};
commit_date = "2023-01-05";
};
};
thisSpark = spark2014.${gnat_version} or
(builtins.throw "GNATprove depend on a specific GNAT version and can't be built using GNAT ${gnat_version}.");
in
stdenv.mkDerivation rec {
pname = "gnatprove";
version = "fsf-${gnat_version}_${thisSpark.commit_date}";
src = thisSpark.src;
nativeBuildInputs = [
gnat
gprbuild
python3
ocamlPackages.ocaml
makeWrapper
];
buildInputs = [
gnatcoll-core
ocamlPackages.camlzip
ocamlPackages.findlib
ocamlPackages.menhir
ocamlPackages.menhirLib
ocamlPackages.num
ocamlPackages.yojson
ocamlPackages.zarith
];
propagatedBuildInputs = [
gprbuild
];
postPatch = ''
# gnat2why/gnat_src points to the GNAT sources
tar xf ${gnat.cc.src} gcc-${gnat.cc.version}/gcc/ada
mv gcc-${gnat.cc.version}/gcc/ada gnat2why/gnat_src
'';
configurePhase = ''
make setup
'';
installPhase = ''
make install-all
cp -a ./install/. $out
mkdir $out/share/gpr
ln -s $out/lib/gnat/* $out/share/gpr/
'';
meta = with lib; {
description = "Software development technology specifically designed for engineering high-reliability applications";
homepage = "https://github.com/AdaCore/spark2014";
maintainers = [ maintainers.jiegec ];
license = licenses.gpl3;
platforms = platforms.all;
};
}
|