You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1047 lines
45 KiB

Synchronize package descriptions with the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/freeipmi.scm, gnu/packages/gawk.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/gdb.scm, gnu/packages/gdbm.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/global.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/gv.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/lightning.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/ocrad.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/plotutils.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/rush.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm, gnu/packages/xnee.scm, gnu/packages/zile.scm: Change value of the 'description' field to that of the Womb.
8 years ago
gnu: All snippets report errors using exceptions, else return #t. * gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t.
4 years ago
gnu: All snippets report errors using exceptions, else return #t. * gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t.
4 years ago
gnu: All snippets report errors using exceptions, else return #t. * gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t.
4 years ago
gnu: Some cleanup based on lint checkers. * gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm, gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm, gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm, gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm, gnu/packages/libdaemon.scm, gnu/packages/libevent.scm, gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm, gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm, gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pkg-config.scm, gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm, gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm, gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm, gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm, gnu/packages/valgrind.scm, gnu/packages/version-control.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm, gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm, gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust according to lint checkers. * gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri. * /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
7 years ago
gnu: Some cleanup based on lint checkers. * gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm, gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm, gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm, gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm, gnu/packages/libdaemon.scm, gnu/packages/libevent.scm, gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm, gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm, gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pkg-config.scm, gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm, gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm, gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm, gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm, gnu/packages/valgrind.scm, gnu/packages/version-control.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm, gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm, gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust according to lint checkers. * gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri. * /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
7 years ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
  5. ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
  6. ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
  8. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
  10. ;;; Copyright © 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
  11. ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
  12. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  27. (define-module (gnu packages gcc)
  28. #:use-module ((guix licenses)
  29. #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages bootstrap)
  32. #:use-module (gnu packages compression)
  33. #:use-module (gnu packages multiprecision)
  34. #:use-module (gnu packages texinfo)
  35. #:use-module (gnu packages dejagnu)
  36. #:use-module (gnu packages documentation)
  37. #:use-module (gnu packages xml)
  38. #:use-module (gnu packages docbook)
  39. #:use-module (gnu packages graphviz)
  40. #:use-module (gnu packages elf)
  41. #:use-module (gnu packages perl)
  42. #:use-module (guix packages)
  43. #:use-module (guix download)
  44. #:use-module (guix build-system gnu)
  45. #:use-module (guix build-system trivial)
  46. #:use-module (guix utils)
  47. #:use-module (srfi srfi-1)
  48. #:use-module (ice-9 regex))
  49. (define %gcc-infrastructure
  50. ;; Base URL for GCC's infrastructure.
  51. "mirror://gcc/infrastructure/")
  52. (define (gcc-configure-flags-for-triplet target)
  53. "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
  54. The purpose of this procedure is to translate extended GNU triplets---e.g.,
  55. where the OS part is overloaded to denote a specific ABI---into GCC
  56. `configure' options. We take extended GNU triplets that glibc recognizes."
  57. (cond ((string-match "^mips64el.*gnuabin?64$" target)
  58. ;; Triplets recognized by glibc as denoting the N64 ABI; see
  59. ;; ports/sysdeps/mips/preconfigure.
  60. '("--with-abi=64"))
  61. ((string-match "^arm.*-gnueabihf$" target)
  62. '("--with-arch=armv7-a"
  63. "--with-float=hard"
  64. "--with-mode=thumb"
  65. "--with-fpu=neon"))
  66. ((and (string-suffix? "-gnu" target)
  67. (not (string-contains target "-linux")))
  68. ;; Cross-compilation of libcilkrts in GCC 5.5.0 to GNU/Hurd fails
  69. ;; with:
  70. ;; libcilkrts/runtime/os-unix.c:388:2: error: #error "Unknown architecture"
  71. ;; Cilk has been removed from GCC 8 anyway.
  72. '("--disable-libcilkrts"))
  73. (else
  74. ;; TODO: Add `arm.*-gnueabi', etc.
  75. '())))
  76. (define-public gcc-4.7
  77. (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
  78. (maybe-target-tools
  79. (lambda ()
  80. ;; Return the `_FOR_TARGET' variables that are needed when
  81. ;; cross-compiling GCC.
  82. (let ((target (%current-target-system)))
  83. (if target
  84. (map (lambda (var tool)
  85. (string-append (string-append var "_FOR_TARGET")
  86. "=" target "-" tool))
  87. '("CC" "CXX" "LD" "AR" "NM" "OBJDUMP" "RANLIB" "STRIP")
  88. '("gcc" "g++" "ld" "ar" "nm" "objdump" "ranlib" "strip"))
  89. '()))))
  90. (libdir
  91. (let ((base '(or (assoc-ref outputs "lib")
  92. (assoc-ref outputs "out"))))
  93. (lambda ()
  94. ;; Return the directory that contains lib/libgcc_s.so et al.
  95. (if (%current-target-system)
  96. `(string-append ,base "/" ,(%current-target-system))
  97. base))))
  98. (configure-flags
  99. (lambda ()
  100. ;; This is terrible. Since we have two levels of quasiquotation,
  101. ;; we have to do this convoluted thing just so we can insert the
  102. ;; contents of (maybe-target-tools).
  103. (list 'quasiquote
  104. (append
  105. '("--enable-plugin"
  106. "--enable-languages=c,c++"
  107. "--disable-multilib"
  108. "--with-system-zlib"
  109. ;; No pre-compiled libstdc++ headers, to save space.
  110. "--disable-libstdcxx-pch"
  111. "--with-local-prefix=/no-gcc-local-prefix"
  112. ;; With a separate "lib" output, the build system
  113. ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
  114. ;; it. (Don't use a versioned sub-directory, that's
  115. ;; unnecessary.)
  116. ,(string-append "--with-gxx-include-dir="
  117. (assoc-ref %outputs "out")
  118. "/include/c++")
  119. ,(let ((libc (assoc-ref %build-inputs "libc")))
  120. (if libc
  121. (string-append "--with-native-system-header-dir=" libc
  122. "/include")
  123. "--without-headers")))
  124. ;; Pass the right options for the target triplet.
  125. (let ((triplet
  126. (or (%current-target-system)
  127. (nix-system->gnu-triplet (%current-system)))))
  128. (gcc-configure-flags-for-triplet triplet))
  129. (maybe-target-tools))))))
  130. (hidden-package
  131. (package
  132. (name "gcc")
  133. (version "4.7.4")
  134. (source (origin
  135. (method url-fetch)
  136. (uri (string-append "mirror://gnu/gcc/gcc-"
  137. version "/gcc-" version ".tar.bz2"))
  138. (sha256
  139. (base32
  140. "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
  141. (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
  142. "gcc-fix-texi2pod.patch"))))
  143. (build-system gnu-build-system)
  144. ;; Separate out the run-time support libraries because all the
  145. ;; dynamic-linked objects depend on it.
  146. (outputs '("out" ;commands, etc. (60+ MiB)
  147. "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
  148. "debug")) ;debug symbols of run-time libraries
  149. (inputs `(("gmp" ,gmp)
  150. ("mpfr" ,mpfr)
  151. ("mpc" ,mpc)
  152. ("libelf" ,libelf)
  153. ("zlib" ,zlib)))
  154. ;; GCC < 5 is one of the few packages that doesn't ship .info files.
  155. ;; Newer texinfos fail to build the manual, so we use an older one.
  156. (native-inputs `(("perl" ,perl) ;for manpages
  157. ("texinfo" ,texinfo-5)))
  158. (arguments
  159. `(#:out-of-source? #t
  160. #:configure-flags ,(configure-flags)
  161. #:make-flags
  162. ;; None of the flags below are needed when doing a Canadian cross.
  163. ;; TODO: Simplify this.
  164. ,(if (%current-target-system)
  165. (if stripped?
  166. ''("CFLAGS=-g0 -O2")
  167. ''())
  168. `(let* ((libc (assoc-ref %build-inputs "libc"))
  169. (libc-native (or (assoc-ref %build-inputs "libc-native")
  170. libc)))
  171. `(,@(if libc
  172. (list (string-append "LDFLAGS_FOR_TARGET="
  173. "-B" libc "/lib "
  174. "-Wl,-dynamic-linker "
  175. "-Wl," libc
  176. ,(glibc-dynamic-linker)))
  177. '())
  178. ;; Native programs like 'genhooks' also need that right.
  179. ,(string-append "LDFLAGS="
  180. "-Wl,-rpath=" libc-native "/lib "
  181. "-Wl,-dynamic-linker "
  182. "-Wl," libc-native ,(glibc-dynamic-linker))
  183. ,(string-append "BOOT_CFLAGS=-O2 "
  184. ,(if stripped? "-g0" "-g")))))
  185. #:tests? #f
  186. #:phases
  187. (modify-phases %standard-phases
  188. (add-before 'configure 'pre-configure
  189. (lambda* (#:key inputs outputs #:allow-other-keys)
  190. (let ((libdir ,(libdir))
  191. (libc (assoc-ref inputs "libc")))
  192. (when libc
  193. ;; The following is not performed for `--without-headers'
  194. ;; cross-compiler builds.
  195. ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
  196. ;; single line, to allow the next step to work properly.
  197. (for-each
  198. (lambda (x)
  199. (substitute* (find-files "gcc/config"
  200. "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
  201. (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
  202. line)))
  203. '(1 2 3))
  204. ;; Fix the dynamic linker's file name.
  205. (substitute* (find-files "gcc/config"
  206. "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
  207. (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
  208. _ gnu-user suffix)
  209. (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
  210. gnu-user suffix
  211. (string-append libc ,(glibc-dynamic-linker)))))
  212. ;; Tell where to find libstdc++, libc, and `?crt*.o', except
  213. ;; `crt{begin,end}.o', which come with GCC.
  214. (substitute* (find-files "gcc/config"
  215. "^gnu-user.*\\.h$")
  216. (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
  217. ;; Help libgcc_s.so be found (see also below.) Always use
  218. ;; '-lgcc_s' so that libgcc_s.so is always found by those
  219. ;; programs that use 'pthread_cancel' (glibc dlopens
  220. ;; libgcc_s.so when pthread_cancel support is needed, but
  221. ;; having it in the application's RUNPATH isn't enough; see
  222. ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
  223. ;;
  224. ;; NOTE: The '-lgcc_s' added below needs to be removed in a
  225. ;; later phase of %gcc-static. If you change the string
  226. ;; below, make sure to update the relevant code in
  227. ;; %gcc-static package as needed.
  228. (format #f "#define GNU_USER_TARGET_LIB_SPEC \
  229. \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
  230. libc libc libdir suffix))
  231. (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
  232. (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
  233. #define STANDARD_STARTFILE_PREFIX_2 \"\"
  234. ~a"
  235. libc line)))
  236. ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
  237. ;; GNU_USER_* defines. Do the above for this case.
  238. (substitute*
  239. "gcc/config/rs6000/sysv4.h"
  240. (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
  241. (format #f "#define LIB_LINUX_SPEC \
  242. \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
  243. libc libc libdir suffix))
  244. (("#define STARTFILE_LINUX_SPEC.*$" line)
  245. (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
  246. #define STANDARD_STARTFILE_PREFIX_2 \"\"
  247. ~a"
  248. libc line))))
  249. ;; Don't retain a dependency on the build-time sed.
  250. (substitute* "fixincludes/fixincl.x"
  251. (("static char const sed_cmd_z\\[\\] =.*;")
  252. "static char const sed_cmd_z[] = \"sed\";"))
  253. ;; Aarch64 support didn't land in GCC until the 4.8 series.
  254. (when (file-exists? "gcc/config/aarch64")
  255. ;; Force Aarch64 libdir to be /lib and not /lib64
  256. (substitute* "gcc/config/aarch64/t-aarch64-linux"
  257. (("lib64") "lib")))
  258. (when (file-exists? "libbacktrace")
  259. ;; GCC 4.8+ comes with libbacktrace. By default it builds
  260. ;; with -Werror, which fails with a -Wcast-qual error in glibc
  261. ;; 2.21's stdlib-bsearch.h. Remove -Werror.
  262. (substitute* "libbacktrace/configure"
  263. (("WARN_FLAGS=(.*)-Werror" _ flags)
  264. (string-append "WARN_FLAGS=" flags)))
  265. (when (file-exists? "libsanitizer/libbacktrace")
  266. ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
  267. (substitute* "libsanitizer/libbacktrace/Makefile.in"
  268. (("-Werror")
  269. ""))))
  270. ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
  271. ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
  272. ;; and <http://bugs.gnu.org/20358>.
  273. (substitute* "libstdc++-v3/src/Makefile.in"
  274. (("^OPT_LDFLAGS = ")
  275. "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
  276. ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
  277. ;; circularity between "out" and "lib". (Note:
  278. ;; --with-python-dir is useless because it imposes $(prefix) as
  279. ;; the parent directory.)
  280. (substitute* "libstdc++-v3/python/Makefile.in"
  281. (("pythondir = .*$")
  282. (string-append "pythondir = " libdir "/share"
  283. "/gcc-$(gcc_version)/python\n")))
  284. ;; Avoid another circularity between the outputs: this #define
  285. ;; ends up in auto-host.h in the "lib" output, referring to
  286. ;; "out". (This variable is used to augment cpp's search path,
  287. ;; but there's nothing useful to look for here.)
  288. (substitute* "gcc/config.in"
  289. (("PREFIX_INCLUDE_DIR")
  290. "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
  291. #t)))
  292. (add-after 'configure 'post-configure
  293. (lambda _
  294. ;; Don't store configure flags, to avoid retaining references to
  295. ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
  296. (substitute* "Makefile"
  297. (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
  298. "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
  299. #t)))))
  300. (native-search-paths
  301. ;; Use the language-specific variables rather than 'CPATH' because they
  302. ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
  303. ;; The intent is to allow headers that are in the search path to be
  304. ;; treated as "system headers" (headers exempt from warnings) just like
  305. ;; the typical /usr/include headers on an FHS system.
  306. (list (search-path-specification
  307. (variable "C_INCLUDE_PATH")
  308. (files '("include")))
  309. (search-path-specification
  310. (variable "CPLUS_INCLUDE_PATH")
  311. ;; Add 'include/c++' here so that <cstdlib>'s "#include_next
  312. ;; <stdlib.h>" finds GCC's <stdlib.h>, not libc's.
  313. (files '("include/c++" "include")))
  314. (search-path-specification
  315. (variable "LIBRARY_PATH")
  316. (files '("lib" "lib64")))))
  317. (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
  318. (synopsis "GNU Compiler Collection")
  319. (description
  320. "GCC is the GNU Compiler Collection. It provides compiler front-ends
  321. for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
  322. Go. It also includes runtime support libraries for these languages.")
  323. (license gpl3+)
  324. (supported-systems (delete "aarch64-linux" %supported-systems))
  325. (home-page "https://gcc.gnu.org/")))))
  326. (define-public gcc-4.8
  327. (package (inherit gcc-4.7)
  328. (version "4.8.5")
  329. (source (origin
  330. (method url-fetch)
  331. (uri (string-append "mirror://gnu/gcc/gcc-"
  332. version "/gcc-" version ".tar.bz2"))
  333. (sha256
  334. (base32
  335. "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
  336. (patches (search-patches "gcc-arm-link-spec-fix.patch"
  337. "gcc-4.8-libsanitizer-fix.patch"
  338. "gcc-asan-missing-include.patch"
  339. "gcc-fix-texi2pod.patch"))
  340. (modules '((guix build utils)))
  341. ;; This is required for building with glibc-2.26.
  342. ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
  343. (snippet
  344. '(begin
  345. (for-each
  346. (lambda (dir)
  347. (substitute* (string-append "libgcc/config/"
  348. dir "/linux-unwind.h")
  349. (("struct ucontext") "ucontext_t")))
  350. '("aarch64" "alpha" "bfin" "i386" "m68k"
  351. "pa" "sh" "tilepro" "xtensa"))
  352. #t))))
  353. (supported-systems %supported-systems)
  354. (inputs
  355. `(("isl" ,isl-0.11)
  356. ("cloog" ,cloog)
  357. ,@(package-inputs gcc-4.7)))))
  358. (define-public gcc-4.9
  359. (package (inherit gcc-4.8)
  360. (version "4.9.4")
  361. (source (origin
  362. (method url-fetch)
  363. (uri (string-append "mirror://gnu/gcc/gcc-"
  364. version "/gcc-" version ".tar.bz2"))
  365. (sha256
  366. (base32
  367. "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
  368. (patches (search-patches "gcc-4.9-libsanitizer-fix.patch"
  369. "gcc-4.9-libsanitizer-ustat.patch"
  370. "gcc-4.9-libsanitizer-mode-size.patch"
  371. "gcc-arm-bug-71399.patch"
  372. "gcc-asan-missing-include.patch"
  373. "gcc-libvtv-runpath.patch"
  374. "gcc-fix-texi2pod.patch"))
  375. (modules '((guix build utils)))
  376. ;; This is required for building with glibc-2.26.
  377. ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
  378. (snippet
  379. '(begin
  380. (for-each
  381. (lambda (dir)
  382. (substitute* (string-append "libgcc/config/"
  383. dir "/linux-unwind.h")
  384. (("struct ucontext") "ucontext_t")))
  385. '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
  386. "pa" "sh" "tilepro" "xtensa"))
  387. #t))))
  388. ;; Override inherited texinfo-5 with latest version.
  389. (native-inputs `(("perl" ,perl) ;for manpages
  390. ("texinfo" ,texinfo)))
  391. (arguments
  392. (if (%current-target-system)
  393. (package-arguments gcc-4.8)
  394. ;; For native builds of GCC 4.9 and GCC 5, the C++ include path needs
  395. ;; to be adjusted so it does not interfere with GCC's own build processes.
  396. (substitute-keyword-arguments (package-arguments gcc-4.8)
  397. ((#:modules modules %gnu-build-system-modules)
  398. `((srfi srfi-1)
  399. ,@modules))
  400. ((#:phases phases)
  401. `(modify-phases ,phases
  402. (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
  403. (lambda* (#:key inputs #:allow-other-keys)
  404. (let ((libc (assoc-ref inputs "libc"))
  405. (gcc (assoc-ref inputs "gcc")))
  406. (setenv "CPLUS_INCLUDE_PATH"
  407. (string-join (fold delete
  408. (string-split (getenv "CPLUS_INCLUDE_PATH")
  409. #\:)
  410. (list (string-append libc "/include")
  411. (string-append gcc "/include/c++")))
  412. ":"))
  413. (format #t
  414. "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
  415. (getenv "CPLUS_INCLUDE_PATH"))
  416. #t))))))))))
  417. (define-public gcc-5
  418. ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
  419. ;; them in a VPATH build.
  420. (package (inherit gcc-4.9)
  421. (version "5.5.0")
  422. (source (origin
  423. (method url-fetch)
  424. (uri (string-append "mirror://gnu/gcc/gcc-"
  425. version "/gcc-" version ".tar.xz"))
  426. (sha256
  427. (base32
  428. "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k"))
  429. (patches (search-patches "gcc-arm-bug-71399.patch"
  430. "gcc-libsanitizer-ustat.patch"
  431. "gcc-strmov-store-file-names.patch"
  432. "gcc-5.0-libvtv-runpath.patch"
  433. "gcc-5-source-date-epoch-1.patch"
  434. "gcc-5-source-date-epoch-2.patch"
  435. "gcc-6-libsanitizer-mode-size.patch"
  436. "gcc-fix-texi2pod.patch"
  437. "gcc-5-hurd.patch"))
  438. (modules '((guix build utils)))
  439. (snippet
  440. ;; Fix 'libcc1/configure' error when cross-compiling GCC.
  441. ;; Without that, 'libcc1/configure' wrongfully determines that
  442. ;; '-rdynamic' support is missing because $gcc_cv_objdump is
  443. ;; empty:
  444. ;;
  445. ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67590
  446. ;; http://cgit.openembedded.org/openembedded-core/commit/?id=f6e47aa9b12f9ab61530c40e0343f451699d9077
  447. '(begin
  448. (substitute* "libcc1/configure"
  449. (("\\$gcc_cv_objdump -T")
  450. "$OBJDUMP_FOR_TARGET -T"))
  451. #t))))
  452. (inputs
  453. `(;; GCC5 needs <isl/band.h> which is removed in later versions.
  454. ("isl" ,isl-0.18)
  455. ,@(package-inputs gcc-4.7)))))
  456. (define-public gcc-6
  457. (package
  458. (inherit gcc-5)
  459. (version "6.5.0")
  460. (source (origin
  461. (method url-fetch)
  462. (uri (string-append "mirror://gnu/gcc/gcc-"
  463. version "/gcc-" version ".tar.xz"))
  464. (sha256
  465. (base32
  466. "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby"))
  467. (patches (search-patches "gcc-strmov-store-file-names.patch"
  468. "gcc-6-libsanitizer-mode-size.patch"
  469. "gcc-6-source-date-epoch-1.patch"
  470. "gcc-6-source-date-epoch-2.patch"
  471. "gcc-5.0-libvtv-runpath.patch"))))
  472. ;; GCC 4.9 and 5 has a workaround that is not needed for GCC 6 and later.
  473. (arguments (package-arguments gcc-4.8))
  474. (inputs
  475. `(("isl" ,isl)
  476. ,@(package-inputs gcc-4.7)))))
  477. (define-public gcc-7
  478. (package
  479. (inherit gcc-6)
  480. (version "7.5.0")
  481. (source (origin
  482. (method url-fetch)
  483. (uri (string-append "mirror://gnu/gcc/gcc-"
  484. version "/gcc-" version ".tar.xz"))
  485. (sha256
  486. (base32
  487. "0qg6kqc5l72hpnj4vr6l0p69qav0rh4anlkk3y55540zy3klc6dq"))
  488. (patches (search-patches "gcc-strmov-store-file-names.patch"
  489. "gcc-7-libsanitizer-mode-size.patch"
  490. "gcc-5.0-libvtv-runpath.patch"))))
  491. (description
  492. "GCC is the GNU Compiler Collection. It provides compiler front-ends
  493. for several languages, including C, C++, Objective-C, Fortran, Ada, and Go.
  494. It also includes runtime support libraries for these languages.")))
  495. (define-public gcc-8
  496. (package
  497. (inherit gcc-7)
  498. (version "8.4.0")
  499. (source (origin
  500. (method url-fetch)
  501. (uri (string-append "mirror://gnu/gcc/gcc-"
  502. version "/gcc-" version ".tar.xz"))
  503. (sha256
  504. (base32
  505. "1m1d3gfix56w4aq8myazzfffkl8bqcrx4jhhapnjf7qfs596w2p3"))
  506. (patches (search-patches "gcc-8-strmov-store-file-names.patch"
  507. "gcc-5.0-libvtv-runpath.patch"))))))
  508. (define-public gcc-9
  509. (package
  510. (inherit gcc-8)
  511. (version "9.3.0")
  512. (source (origin
  513. (method url-fetch)
  514. (uri (string-append "mirror://gnu/gcc/gcc-"
  515. version "/gcc-" version ".tar.xz"))
  516. (sha256
  517. (base32
  518. "1la2yy27ziasyf0jvzk58y1i5b5bq2h176qil550bxhifs39gqbi"))
  519. (patches (search-patches "gcc-9-strmov-store-file-names.patch"
  520. "gcc-9-asan-fix-limits-include.patch"
  521. "gcc-5.0-libvtv-runpath.patch"))))))
  522. (define-public gcc-10
  523. (package
  524. (inherit gcc-8)
  525. (version "10.2.0")
  526. (source (origin
  527. (method url-fetch)
  528. (uri (string-append "mirror://gnu/gcc/gcc-"
  529. version "/gcc-" version ".tar.xz"))
  530. (sha256
  531. (base32
  532. "130xdkhmz1bc2kzx061s3sfwk36xah1fw5w332c0nzwwpdl47pdq"))
  533. (patches (search-patches "gcc-9-strmov-store-file-names.patch"
  534. "gcc-5.0-libvtv-runpath.patch"))))))
  535. ;; Note: When changing the default gcc version, update
  536. ;; the gcc-toolchain-* definitions and the gfortran definition
  537. ;; accordingly.
  538. (define-public gcc gcc-7)
  539. (define-public (make-libstdc++ gcc)
  540. "Return a libstdc++ package based on GCC. The primary use case is when
  541. using compilers other than GCC."
  542. (package
  543. (inherit gcc)
  544. (name "libstdc++")
  545. (arguments
  546. `(#:out-of-source? #t
  547. #:phases (alist-cons-before
  548. 'configure 'chdir
  549. (lambda _
  550. (chdir "libstdc++-v3")
  551. #t)
  552. %standard-phases)
  553. #:configure-flags `("--disable-libstdcxx-pch"
  554. ,(string-append "--with-gxx-include-dir="
  555. (assoc-ref %outputs "out")
  556. "/include"))))
  557. (outputs '("out" "debug"))
  558. (inputs '())
  559. (native-inputs '())
  560. (propagated-inputs '())
  561. (synopsis "GNU C++ standard library")))
  562. (define-public libstdc++-4.9
  563. (make-libstdc++ gcc-4.9))
  564. (define (make-libiberty gcc)
  565. "Return a libiberty package based on GCC."
  566. (package
  567. (inherit gcc)
  568. (name "libiberty")
  569. (arguments
  570. `(#:out-of-source? #t
  571. #:phases
  572. (modify-phases %standard-phases
  573. (add-before 'configure 'chdir
  574. (lambda _
  575. (chdir "libiberty")
  576. #t))
  577. (replace 'install
  578. (lambda* (#:key outputs #:allow-other-keys)
  579. (let* ((out (assoc-ref outputs "out"))
  580. (lib (string-append out "/lib/"))
  581. (include (string-append out "/include/")))
  582. (install-file "libiberty.a" lib)
  583. (install-file "../include/libiberty.h" include))
  584. #t)))))
  585. (inputs '())
  586. (outputs '("out"))
  587. (native-inputs '())
  588. (propagated-inputs '())
  589. (properties '())
  590. (synopsis "Collection of subroutines used by various GNU programs")))
  591. (define-public libiberty
  592. (make-libiberty gcc))
  593. (define* (custom-gcc gcc name languages
  594. #:optional
  595. (search-paths (package-native-search-paths gcc))
  596. #:key (separate-lib-output? #t))
  597. "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
  598. as the 'native-search-paths' field."
  599. (package (inherit gcc)
  600. (name name)
  601. (outputs (if separate-lib-output?
  602. (package-outputs gcc)
  603. (delete "lib" (package-outputs gcc))))
  604. (native-search-paths search-paths)
  605. (properties (alist-delete 'hidden? (package-properties gcc)))
  606. (arguments
  607. (substitute-keyword-arguments (package-arguments gcc)
  608. ((#:modules modules %gnu-build-system-modules)
  609. `(,@modules
  610. (srfi srfi-1)
  611. (srfi srfi-26)
  612. (ice-9 regex)))
  613. ((#:configure-flags flags)
  614. `(cons (string-append "--enable-languages="
  615. ,(string-join languages ","))
  616. (remove (cut string-match "--enable-languages.*" <>)
  617. ,flags)))
  618. ((#:phases phases)
  619. `(modify-phases ,phases
  620. (add-after 'install 'remove-broken-or-conflicting-files
  621. (lambda* (#:key outputs #:allow-other-keys)
  622. (for-each delete-file
  623. (find-files (string-append (assoc-ref outputs "out") "/bin")
  624. ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
  625. #t))))))))
  626. (define %generic-search-paths
  627. ;; This is the language-neutral search path for GCC. Entries in $CPATH are
  628. ;; not considered "system headers", which means GCC can raise warnings for
  629. ;; issues in those headers. 'CPATH' is the only one that works for
  630. ;; front-ends not in the C family.
  631. (list (search-path-specification
  632. (variable "CPATH")
  633. (files '("include")))
  634. (search-path-specification
  635. (variable "LIBRARY_PATH")
  636. (files '("lib" "lib64")))))
  637. (define-public gfortran
  638. (hidden-package
  639. (custom-gcc gcc "gfortran" '("fortran")
  640. %generic-search-paths)))
  641. (define-public gdc-10
  642. (hidden-package
  643. (custom-gcc gcc-10 "gdc" '("d")
  644. %generic-search-paths)))
  645. (define-public libgccjit
  646. (package
  647. (inherit gcc-9)
  648. (name "libgccjit")
  649. (outputs (delete "lib" (package-outputs gcc)))
  650. (properties (alist-delete 'hidden? (package-properties gcc)))
  651. (arguments
  652. (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
  653. (guix build utils)
  654. (ice-9 regex)
  655. (srfi srfi-1)
  656. (srfi srfi-26))
  657. ,@(package-arguments gcc))
  658. ((#:configure-flags flags)
  659. `(append `("--enable-host-shared"
  660. ,(string-append "--enable-languages=jit"))
  661. (remove (cut string-match "--enable-languages.*" <>)
  662. ,flags)))
  663. ((#:phases phases)
  664. `(modify-phases ,phases
  665. (add-after 'install 'remove-broken-or-conflicting-files
  666. (lambda* (#:key outputs #:allow-other-keys)
  667. (for-each delete-file
  668. (find-files (string-append (assoc-ref outputs "out") "/bin")
  669. ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
  670. #t))))))))
  671. (define-public gccgo-4.9
  672. (custom-gcc gcc-4.9 "gccgo" '("go")
  673. %generic-search-paths
  674. ;; Suppress the separate "lib" output, because otherwise the
  675. ;; "lib" and "out" outputs would refer to each other, creating
  676. ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
  677. #:separate-lib-output? #f))
  678. (define %objc-search-paths
  679. (list (search-path-specification
  680. (variable "OBJC_INCLUDE_PATH")
  681. (files '("include")))
  682. (search-path-specification
  683. (variable "LIBRARY_PATH")
  684. (files '("lib" "lib64")))))
  685. (define-public gcc-objc-4.8
  686. (custom-gcc gcc-4.8 "gcc-objc" '("objc")
  687. %objc-search-paths))
  688. (define-public gcc-objc-4.9
  689. (custom-gcc gcc-4.9 "gcc-objc" '("objc")
  690. %objc-search-paths))
  691. (define-public gcc-objc-5
  692. (custom-gcc gcc-5 "gcc-objc" '("objc")
  693. %objc-search-paths))
  694. (define-public gcc-objc-6
  695. (custom-gcc gcc-6 "gcc-objc" '("objc")
  696. %objc-search-paths))
  697. (define-public gcc-objc-7
  698. (custom-gcc gcc-7 "gcc-objc" '("objc")
  699. %objc-search-paths))
  700. (define-public gcc-objc-8
  701. (custom-gcc gcc-8 "gcc-objc" '("objc")
  702. %objc-search-paths))
  703. (define-public gcc-objc-9
  704. (custom-gcc gcc-9 "gcc-objc" '("objc")
  705. %objc-search-paths))
  706. (define-public gcc-objc-10
  707. (custom-gcc gcc-10 "gcc-objc" '("objc")
  708. %objc-search-paths))
  709. (define-public gcc-objc gcc-objc-7)
  710. (define %objc++-search-paths
  711. (list (search-path-specification
  712. (variable "OBJCPLUS_INCLUDE_PATH")
  713. (files '("include")))
  714. (search-path-specification
  715. (variable "LIBRARY_PATH")
  716. (files '("lib" "lib64")))))
  717. (define-public gcc-objc++-4.8
  718. (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
  719. %objc++-search-paths))
  720. (define-public gcc-objc++-4.9
  721. (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
  722. %objc++-search-paths))
  723. (define-public gcc-objc++-5
  724. (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
  725. %objc++-search-paths))
  726. (define-public gcc-objc++-6
  727. (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
  728. %objc++-search-paths))
  729. (define-public gcc-objc++-7
  730. (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
  731. %objc++-search-paths))
  732. (define-public gcc-objc++-8
  733. (custom-gcc gcc-8 "gcc-objc++" '("obj-c++")
  734. %objc++-search-paths))
  735. (define-public gcc-objc++-9
  736. (custom-gcc gcc-9 "gcc-objc++" '("obj-c++")
  737. %objc++-search-paths))
  738. (define-public gcc-objc++-10
  739. (custom-gcc gcc-10 "gcc-objc++" '("obj-c++")
  740. %objc++-search-paths))
  741. (define-public gcc-objc++ gcc-objc++-7)
  742. (define (make-libstdc++-doc gcc)
  743. "Return a package with the libstdc++ documentation for GCC."
  744. (package
  745. (inherit gcc)
  746. (name "libstdc++-doc")
  747. (version (package-version gcc))
  748. (synopsis "GNU libstdc++ documentation")
  749. (outputs '("out"))
  750. (native-inputs `(("doxygen" ,doxygen)
  751. ("texinfo" ,texinfo)
  752. ("libxml2" ,libxml2)
  753. ("libxslt" ,libxslt)
  754. ("docbook-xml" ,docbook-xml)
  755. ("docbook-xsl" ,docbook-xsl)
  756. ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
  757. (inputs '())
  758. (propagated-inputs '())
  759. (arguments
  760. '(#:out-of-source? #t
  761. #:tests? #f ;it's just documentation
  762. #:phases (modify-phases %standard-phases
  763. (add-before 'configure 'chdir
  764. (lambda _
  765. (chdir "libstdc++-v3")
  766. #t))
  767. (add-before 'configure 'set-xsl-directory
  768. (lambda* (#:key inputs #:allow-other-keys)
  769. (let ((docbook (assoc-ref inputs "docbook-xsl")))
  770. (substitute* (find-files "doc"
  771. "^Makefile\\.in$")
  772. (("@XSL_STYLE_DIR@")
  773. (string-append
  774. docbook "/xml/xsl/"
  775. (strip-store-file-name docbook))))
  776. #t)))
  777. (replace 'build
  778. (lambda _
  779. ;; XXX: There's also a 'doc-info' target, but it
  780. ;; relies on docbook2X, which itself relies on
  781. ;; DocBook 4.1.2, which is not really usable
  782. ;; (lacks a catalog.xml.)
  783. (invoke "make"
  784. "doc-html"
  785. "doc-man")))
  786. (replace 'install
  787. (lambda* (#:key outputs #:allow-other-keys)
  788. (let ((out (assoc-ref outputs "out")))
  789. (invoke "make"
  790. "doc-install-html"
  791. "doc-install-man")))))))
  792. (properties (alist-delete 'hidden? (package-properties gcc)))))
  793. (define-public libstdc++-doc-5
  794. (make-libstdc++-doc gcc-5))
  795. (define-public libstdc++-doc-9
  796. (make-libstdc++-doc gcc-9))
  797. (define-public isl
  798. (package
  799. (name "isl")
  800. (version "0.22.1")
  801. (source (origin
  802. (method url-fetch)
  803. (uri (list (string-append
  804. "http://isl.gforge.inria.fr/isl-"
  805. version
  806. ".tar.bz2")
  807. (string-append %gcc-infrastructure
  808. name "-" version ".tar.bz2")))
  809. (sha256
  810. (base32
  811. "1kf54jib0nind1pvakblnfhimmwzm0y1llz8470ag0di5vwqwrhs"))))
  812. (build-system gnu-build-system)
  813. (outputs '("out" "static"))
  814. (arguments
  815. '(#:phases (modify-phases %standard-phases
  816. (add-after 'install 'move-static-library
  817. (lambda* (#:key outputs #:allow-other-keys)
  818. (let* ((out (assoc-ref outputs "out"))
  819. (static (assoc-ref outputs "static"))
  820. (source (string-append out "/lib/libisl.a"))
  821. (target (string-append static "/lib/libisl.a")))
  822. (mkdir-p (dirname target))
  823. (link source target)
  824. (delete-file source)
  825. ;; Remove reference to libisl.a from the .la file so
  826. ;; libtool looks for it in the usual locations.
  827. (substitute* (string-append out "/lib/libisl.la")
  828. (("^old_library=.*")
  829. "old_library=''\n"))
  830. #t))))))
  831. (inputs `(("gmp" ,gmp)))
  832. (home-page "http://isl.gforge.inria.fr/")
  833. (synopsis
  834. "Manipulating sets and relations of integer points \
  835. bounded by linear constraints")
  836. (description
  837. "isl is a library for manipulating sets and relations of integer points
  838. bounded by linear constraints. Supported operations on sets include
  839. intersection, union, set difference, emptiness check, convex hull, (integer)
  840. affine hull, integer projection, computing the lexicographic minimum using
  841. parametric integer programming, coalescing and parametric vertex
  842. enumeration. It also includes an ILP solver based on generalized basis
  843. reduction, transitive closures on maps (which may encode infinite graphs),
  844. dependence analysis and bounds on piecewise step-polynomials.")
  845. (license lgpl2.1+)))
  846. (define-public isl-0.18
  847. (package
  848. (inherit isl)
  849. (version "0.18")
  850. (source (origin
  851. (method url-fetch)
  852. (uri (list (string-append "http://isl.gforge.inria.fr/isl-"
  853. version ".tar.bz2")
  854. (string-append %gcc-infrastructure
  855. "isl-" version ".tar.bz2")))
  856. (sha256
  857. (base32
  858. "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))))
  859. (define-public isl-0.11
  860. (package
  861. (inherit isl)
  862. (name "isl")
  863. (version "0.11.1")
  864. (source (origin
  865. (method url-fetch)
  866. (uri (list (string-append
  867. "http://isl.gforge.inria.fr/isl-"
  868. version
  869. ".tar.bz2")
  870. (string-append %gcc-infrastructure
  871. name "-" version ".tar.bz2")))
  872. (sha256
  873. (base32
  874. "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
  875. (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))))
  876. (define-public cloog
  877. (package
  878. (name "cloog")
  879. (version "0.18.0")
  880. (source
  881. (origin
  882. (method url-fetch)
  883. (uri (list (string-append
  884. "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
  885. version
  886. ".tar.gz")
  887. (string-append %gcc-infrastructure
  888. name "-" version ".tar.gz")))
  889. (sha256
  890. (base32
  891. "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
  892. (file-name (string-append name "-" version ".tar.gz"))))
  893. (build-system gnu-build-system)
  894. (inputs `(("gmp" ,gmp)
  895. ("isl" ,isl-0.11)))
  896. (arguments '(#:configure-flags '("--with-isl=system")))
  897. (home-page "http://www.cloog.org/")
  898. (synopsis "Library to generate code for scanning Z-polyhedra")
  899. (description
  900. "CLooG is a free software library to generate code for scanning
  901. Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
  902. reaches each integral point of one or more parameterized polyhedra.
  903. CLooG has been originally written to solve the code generation problem
  904. for optimizing compilers based on the polytope model. Nevertheless it
  905. is used now in various area e.g., to build control automata for
  906. high-level synthesis or to find the best polynomial approximation of a
  907. function. CLooG may help in any situation where scanning polyhedra
  908. matters. While the user has full control on generated code quality,
  909. CLooG is designed to avoid control overhead and to produce a very
  910. effective code.")
  911. (license gpl2+)))
  912. (define-public gnu-c-manual
  913. (package
  914. (name "gnu-c-manual")
  915. (version "0.2.5")
  916. (source (origin
  917. (method url-fetch)
  918. (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
  919. version ".tar.gz"))
  920. (sha256
  921. (base32
  922. "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
  923. (build-system gnu-build-system)
  924. (native-inputs `(("texinfo" ,texinfo)))
  925. (arguments
  926. '(#:phases (modify-phases %standard-phases
  927. (delete 'configure)
  928. (delete 'check)
  929. (replace 'build
  930. (lambda _
  931. (invoke "make"
  932. "gnu-c-manual.info"
  933. "gnu-c-manual.html")))
  934. (replace 'install
  935. (lambda* (#:key outputs #:allow-other-keys)
  936. (let* ((out (assoc-ref outputs "out"))
  937. (info (string-append out "/share/info"))
  938. (html (string-append
  939. out "/share/doc/gnu-c-manual")))
  940. (mkdir-p info)
  941. (mkdir-p html)
  942. (for-each (lambda (file)
  943. (copy-file file
  944. (string-append info "/"
  945. file)))
  946. (find-files "." "\\.info(-[0-9])?$"))
  947. (for-each (lambda (file)
  948. (copy-file file
  949. (string-append html "/"
  950. file)))
  951. (find-files "." "\\.html$"))
  952. #t))))))
  953. (synopsis "Reference manual for the C programming language")
  954. (description
  955. "This is a reference manual for the C programming language, as
  956. implemented by the GNU C Compiler (gcc). As a reference, it is not intended
  957. to be a tutorial of the language. Rather, it outlines all of the constructs
  958. of the language. Library functions are not included.")
  959. (home-page "https://www.gnu.org/software/gnu-c-manual/")
  960. (license fdl1.3+)))