nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl }:
2
3if stdenv.hostPlatform != stdenv.targetPlatform
4then builtins.throw "gnatboot can't cross-compile"
5else
6
7stdenv.mkDerivation {
8 pname = "gentoo-gnatboot";
9 version = "4.1";
10
11 src = if stdenv.hostPlatform.system == "i686-linux" then
12 fetchurl {
13 url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2";
14 sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr";
15 }
16 else if stdenv.hostPlatform.system == "x86_64-linux" then
17 fetchurl {
18 url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2";
19 sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4";
20 }
21 else
22 throw "Platform not supported";
23
24 dontStrip = 1;
25
26 installPhase = ''
27 mkdir -p $out
28 cp -R * $out
29
30 set +e
31 for a in $out/bin/* ; do
32 patchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
33 --set-rpath $(cat $NIX_CC/nix-support/orig-libc)/lib:$(cat $NIX_CC/nix-support/orig-cc)/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib $a
34 done
35 set -e
36
37 mv $out/bin/gnatgcc_2wrap $out/bin/gnatgcc
38 ln -s $out/bin/gnatgcc $out/bin/gcc
39 '';
40
41 passthru = {
42 langC = true; # TRICK for gcc-wrapper to wrap it
43 langCC = false;
44 langFortran = false;
45 langAda = true;
46 };
47
48 meta = with lib; {
49 homepage = "https://gentoo.org";
50 license = licenses.gpl3Plus;
51 maintainers = [ maintainers.lucus16 ];
52
53 platforms = platforms.linux;
54 };
55}