1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
6 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
8 ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages c)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system trivial)
32 #:use-module (gnu packages bootstrap)
33 #:use-module (gnu packages bison)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages guile)
39 #:use-module (gnu packages multiprecision)
40 #:use-module (gnu packages pcre)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages xml))
49 (name "tcc") ;aka. "tinycc"
53 (uri (string-append "mirror://savannah/tinycc/tcc-"
57 "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
58 (build-system gnu-build-system)
59 (native-inputs `(("perl" ,perl)
60 ("texinfo" ,texinfo)))
62 `(#:configure-flags (list (string-append "--elfinterp="
63 (assoc-ref %build-inputs "libc")
64 ,(glibc-dynamic-linker))
65 (string-append "--crtprefix="
66 (assoc-ref %build-inputs "libc")
68 (string-append "--sysincludepaths="
69 (assoc-ref %build-inputs "libc")
71 (assoc-ref %build-inputs
73 "/include:{B}/include")
74 (string-append "--libpaths="
75 (assoc-ref %build-inputs "libc")
77 ,@(if (string-prefix? "armhf-linux"
78 (or (%current-target-system)
80 `("--triplet=arm-linux-gnueabihf")
82 #:test-target "test"))
84 (list (search-path-specification
87 (search-path-specification
88 (variable "LIBRARY_PATH")
89 (files '("lib" "lib64")))))
90 ;; Fails to build on MIPS: "Unsupported CPU"
91 (supported-systems (delete "mips64el-linux" %supported-systems))
92 (synopsis "Tiny and fast C compiler")
94 "TCC, also referred to as \"TinyCC\", is a small and fast C compiler
95 written in C. It supports ANSI C with GNU and extensions and most of the C99
97 (home-page "http://www.tinycc.org/")
98 ;; An attempt to re-licence tcc under the Expat licence is underway but not
99 ;; (if ever) complete. See the RELICENSING file for more information.
100 (license license:lgpl2.1+)))
108 (uri (string-append "http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-"
112 "1p34w496095mi0473f815w6wbi57zxil106mg7pj6sg6gzpjcgww"))))
113 (build-system gnu-build-system)
116 (modify-phases %standard-phases
118 (lambda _ (invoke "make" "-C" "cc/cpp" "test") #t)))))
122 (synopsis "Portable C compiler")
124 "PCC is a portable C compiler. The project goal is to write a C99
125 compiler while still keeping it small, simple, fast and understandable.")
126 (home-page "http://pcc.ludd.ltu.se")
127 (supported-systems (delete "aarch64-linux" %supported-systems))
128 ;; PCC incorporates code under various BSD licenses; for new code bsd-2 is
129 ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more details.
130 (license (list license:bsd-2 license:bsd-3))))
132 (define-public libbytesize
139 "https://github.com/storaged-project/libbytesize/releases/"
140 "download/" version "/libbytesize-" version ".tar.gz"))
143 "1bpz9cpb8s47kqplkkiz6ryfahas2ma95g9rh2axnfjp6w1d9ixc"))))
144 (build-system gnu-build-system)
148 `(("gettext" ,gettext-minimal)
149 ("pkg-config" ,pkg-config)
154 (home-page "https://github.com/storaged-project/libbytesize")
155 (synopsis "Tiny C library for working with arbitrary big sizes in bytes")
157 "The goal of this project is to provide a tiny library that would
158 facilitate the common operations with sizes in bytes. Many projects need to
159 work with sizes in bytes (be it sizes of storage space, memory...) and all of
160 them need to deal with the same issues like:
163 @item How to get a human-readable string for the given size?
164 @item How to store the given size so that no significant information is lost?
165 @item If we store the size in bytes, what if the given size gets over the
167 @item How to interpret sizes entered by users according to their locale and
169 @item How to deal with the decimal/binary units (MB versus MiB) ambiguity?
172 @code{libbytesize} offers a generally usable solution that could be used by
173 every project that needs to deal with sizes in bytes. It is written in the C
174 language with thin bindings for other languages.")
175 (license license:lgpl2.1+)))
177 (define-public udunits
183 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/udunits/"
184 "udunits-" version ".tar.gz"))
187 "0v9mqw4drnkzkm57331ail6yvs9485jmi37s40lhvmf7r5lli3rn"))))
188 (build-system gnu-build-system)
191 (home-page "https://www.unidata.ucar.edu/software/udunits/")
192 (synopsis "C library for units of physical quantities and value-conversion utils")
194 "The UDUNITS-2 package provides support for units of physical quantities.
195 Its three main components are:
198 @item @code{udunits2lib}, a C library for units of physical quantities;
199 @item @code{udunits2prog}, a utility for obtaining the definition of a unit
200 and for converting numeric values between compatible units; and
201 @item an extensive database of units.
203 ;; Like the BSD-3 license but with an extra anti patent clause.
204 (license (license:non-copyleft "file://COPYRIGHT"))))
206 (define-public libfixposix
210 (home-page "https://github.com/sionescu/libfixposix")
216 (commit (string-append "v" version))))
217 (file-name (git-file-name name version))
220 "1x4q6yspi5g2s98vq4qszw4z3zjgk9l5zs8471w4d4cs6l97w08j"))))
221 (build-system gnu-build-system)
223 `(("autoconf" ,autoconf)
224 ("automake" ,automake)
226 ("pkg-config" ,pkg-config)
228 (synopsis "Thin wrapper over POSIX syscalls")
230 "The purpose of libfixposix is to offer replacements for parts of POSIX
231 whose behaviour is inconsistent across *NIX flavours.")
232 (license license:boost1.0)))
241 (uri (string-append "mirror://sourceforge/libhx/libHX/"
242 "libHX-" version ".tar.xz"))
245 "0i8v2464p830c15myknvvs6bhxaf663lrqgga95l94ygfynkw6x5"))))
246 (build-system gnu-build-system)
247 (home-page "http://libhx.sourceforge.net")
248 (synopsis "C library with common data structures and functions")
250 "This is a C library (with some C++ bindings available) that provides data
251 structures and functions commonly needed, such as maps, deques, linked lists,
252 string formatting and autoresizing, option and config file parsing, type
253 checking casts and more.")
254 (license license:lgpl2.1+)))