194 lines
8.2 KiB
Scheme
194 lines
8.2 KiB
Scheme
;;; GNU Guix --- Functional package management for GNU
|
||
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
|
||
;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
|
||
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
||
;;; Copyright © 2016, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
|
||
;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
|
||
;;; Copyright © 2017 Jonathan Brielmaier <jonathan.brielmaier@web.de>
|
||
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
|
||
;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
||
;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
|
||
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
|
||
;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
|
||
;;;
|
||
;;; This file is part of GNU Guix.
|
||
;;;
|
||
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
||
;;; under the terms of the GNU General Public License as published by
|
||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||
;;; your option) any later version.
|
||
;;;
|
||
;;; GNU Guix is distributed in the hope that it will be useful, but
|
||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
;;; GNU General Public License for more details.
|
||
;;;
|
||
;;; You should have received a copy of the GNU General Public License
|
||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||
|
||
(define-module (ada)
|
||
#:use-module (gnu packages)
|
||
#:use-module (gnu packages base)
|
||
#:use-module (gnu packages bootstrap)
|
||
#:use-module (gnu packages compression)
|
||
#:use-module (gnu packages multiprecision)
|
||
#:use-module (gnu packages gcc)
|
||
#:use-module (gnu packages elf)
|
||
#:use-module (guix build-system copy)
|
||
#:use-module (guix build utils)
|
||
#:use-module ((guix licenses) #:prefix license:)
|
||
#:use-module (guix download)
|
||
#:use-module (guix gexp)
|
||
#:use-module (guix git-download)
|
||
#:use-module (guix packages)
|
||
#:use-module (guix utils)
|
||
#:use-module (ice-9 match)
|
||
#:use-module (ice-9 regex)
|
||
#:use-module (ice-9 popen))
|
||
|
||
(define-public libgnat-bootstrap
|
||
(package
|
||
(name "libgnat-bootstrap")
|
||
(version "10.3.0")
|
||
(source (origin
|
||
(method url-fetch)
|
||
(uri (string-append "http://us.archive.trisquel.info/trisquel/pool/main/g/"
|
||
"gcc-10/libgnat-10_"
|
||
version
|
||
"-15ubuntu1_amd64.deb"))
|
||
(sha256
|
||
(base32
|
||
"1grd7k4qjdclj12lqvrm5iamqixf0f5292zigrp4q9b3r509q13x"))))
|
||
(build-system copy-build-system)
|
||
(arguments
|
||
(list
|
||
#:validate-runpath? #f
|
||
#:phases
|
||
#~(modify-phases %standard-phases
|
||
(replace 'unpack
|
||
(lambda* (#:key source #:allow-other-keys)
|
||
(invoke "ar" "x" source)
|
||
(invoke "tar" "axvf" "data.tar.zst")
|
||
;(invoke "mv" "usr/bin" "bin")
|
||
(invoke "mv" "usr/lib" "lib")
|
||
(invoke "mv" "usr/share" "share")
|
||
;(invoke "mv" "usr/x86_64-linux-gnu" "x86_64-linux-gnu")
|
||
(invoke "rm" "control.tar.zst")
|
||
(invoke "rm" "debian-binary")
|
||
(invoke "rm" "data.tar.zst")
|
||
(invoke "rm" "-r" "usr")
|
||
#t))
|
||
(add-after 'install 'wrap
|
||
(lambda* (#:key outputs #:allow-other-keys)
|
||
(let* ((out (assoc-ref outputs "out"))
|
||
(gnat (string-append out "/bin/gnat")))
|
||
(wrap-program gnat ))))
|
||
;(add-after 'install 'fix-rpath
|
||
; (lambda* (#:key outputs #:allow-other-keys)
|
||
; (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
|
||
; (for-each
|
||
; (lambda (file)
|
||
; (let* ((pipe (open-pipe* OPEN_READ "patchelf"
|
||
; "--print-rpath" file))
|
||
; (line (read-line pipe)))
|
||
; (and (zero? (close-pipe pipe))
|
||
; (invoke "patchelf" "--set-rpath"
|
||
; (string-append libdir ":" line)
|
||
; file))))
|
||
; (find-files libdir ".*\\.so$")))))
|
||
)))
|
||
(inputs
|
||
(list
|
||
libgccjit
|
||
gcc))
|
||
(native-inputs
|
||
(list
|
||
zstd
|
||
patchelf))
|
||
(home-page "https://gnu.org/software/gnat")
|
||
(synopsis "Ada language compiler")
|
||
(description (string-append "GNAT is a compiler for the Ada programming language."
|
||
"It produces optimized code on platforms supported by the GNU"
|
||
"Compiler Collection (GCC). The libgnat library provides runtime"
|
||
"components needed by most applications produced with GNAT."))
|
||
(license license:gpl3)))
|
||
|
||
(define-public gnat-bootstrap
|
||
(package
|
||
(name "gnat-bootstrap")
|
||
(version "10.3.0")
|
||
(source (origin
|
||
(method url-fetch)
|
||
(uri (string-append "http://us.archive.trisquel.info/trisquel/pool/main/g/"
|
||
"gcc-10/gnat-10_"
|
||
version
|
||
"-15ubuntu1_amd64.deb"))
|
||
(sha256
|
||
(base32
|
||
"0b8fmqwbgpg0fy2f27z2gz6lnha4nqil30bbzhrmasai98l4mcpp"))))
|
||
(build-system copy-build-system)
|
||
(arguments
|
||
(list
|
||
#:validate-runpath? #f
|
||
#:phases
|
||
#~(modify-phases %standard-phases
|
||
(replace 'unpack
|
||
(lambda* (#:key source #:allow-other-keys)
|
||
(invoke "ar" "x" source)
|
||
(invoke "tar" "axvf" "data.tar.zst")
|
||
(invoke "mv" "usr/bin" "bin")
|
||
(invoke "mv" "usr/lib" "lib")
|
||
(invoke "mv" "usr/share" "share")
|
||
;(invoke "mv" "usr/x86_64-linux-gnu" "x86_64-linux-gnu")
|
||
(invoke "rm" "control.tar.zst")
|
||
(invoke "rm" "debian-binary")
|
||
(invoke "rm" "data.tar.zst")
|
||
(invoke "rm" "-r" "usr")
|
||
#t))
|
||
(add-after 'install 'input-symlink
|
||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||
;(setenv "CONFIG_SHELL" (which "bash"))
|
||
;(setenv "LD_LIBRARY_PATH"
|
||
;(string-append (assoc-ref inputs "gmp") "/lib"))
|
||
;invoke "patchelf" "--set-interpreter"
|
||
; (search-input-file inputs #$(glibc-dynamic-linker))
|
||
; (string-append (assoc-ref inputs "libgnat-bootstrap")
|
||
; "/lib/x86_64-linux-gnu/libgnarl-10.so"))
|
||
;(invoke "patchelf" "--set-interpreter"
|
||
; (search-input-file inputs #$(glibc-dynamic-linker))
|
||
; (string-append (assoc-ref inputs "libgnat-bootstrap")
|
||
; "/lib/x86_64-linux-gnu/libgnat-10.so"))
|
||
(invoke "echo" (string-append (assoc-ref inputs "libgnat-bootstrap")
|
||
"/lib/x86_64-linux-gnu/libgnarl-10.so"))
|
||
(invoke "echo" (string-append (assoc-ref outputs "out")
|
||
"/lib/x86_64-linux-gnu/libgnarl-10.so"))
|
||
(symlink (string-append (assoc-ref inputs "libgnat-bootstrap")
|
||
"/lib/x86_64-linux-gnu/libgnarl-10.so")
|
||
(string-append (assoc-ref outputs "out")
|
||
"/lib/x86_64-linux-gnu/libgnarl-10.so"))
|
||
|
||
(symlink (string-append (assoc-ref inputs "libgnat-bootstrap")
|
||
"/lib/x86_64-linux-gnu/libgnat-10.so")
|
||
(string-append (assoc-ref outputs "out")
|
||
"/lib/x86_64-linux-gnu/libgnat-10.so"))
|
||
#t)))))
|
||
(inputs
|
||
(list
|
||
libgnat-bootstrap
|
||
elfutils
|
||
gmp
|
||
isl
|
||
mpc
|
||
mpfr
|
||
libgccjit
|
||
zstd
|
||
zlib))
|
||
(native-inputs
|
||
(list
|
||
zstd
|
||
patchelf))
|
||
(home-page "https://gnu.org/software/gnat")
|
||
(synopsis "Ada language compiler")
|
||
(description " GNAT is a compiler for the Ada programming language. It produces optimized code on platforms supported by the GNU Compiler Collection (GCC). The libgnat library provides runtime components needed by most applications produced with GNAT. ")
|
||
(license license:gpl3)))
|