aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/stb.scm
blob: 4ee1b4ebd2e64904edc8078eb1da9f96f6057daa (about) (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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 (gnu packages stb)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module ((guix licenses) #:select (expat public-domain)))

(define stb
  ;; stb is a collection of libraries developed within the same repository.
  ;; When updating this, remember to change versions below as appropriate.
  (let ((commit "b42009b3b9d4ca35bc703f5310eedc74f584be58")
        (revision "2"))
    (package
      (name "stb")
      (home-page "https://github.com/nothings/stb")
      (version (git-version "0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url home-page)
                      (commit commit)))
                (sha256
                 (base32
                  "1gmcjhmj62mfdscrsg2hv4j4j9v447y8zj3rbrm7mqn94cx73z1i"))
                (file-name (git-file-name name version))))
      (build-system gnu-build-system)
      (arguments
       `(#:modules ((ice-9 ftw)
                    (ice-9 regex)
                    (srfi srfi-26)
                    ,@%gnu-build-system-modules)
         #:phases (modify-phases %standard-phases
                    (delete 'configure)
                    (delete 'build)
                    (replace 'check
                      (lambda _
                        (invoke "make" "-C" "tests" "CC=gcc")))
                    (replace 'install
                      (lambda* (#:key outputs #:allow-other-keys)
                        (let ((out (assoc-ref outputs "out"))
                              (files (make-regexp "\\.(c|h|md)$")))
                          (for-each (lambda (file)
                                      (install-file file out))
                                    (scandir "." (cut regexp-exec files <>)))
                          #t))))))
      (synopsis "Single file libraries for C/C++")
      (description
       "This package contains a variety of small independent libraries for
the C programming language.")
      ;; The user can choose either license.
      (license (list expat public-domain)))))

(define (make-stb-header-package name version description)
  (package
    (inherit stb)
    (name name)
    (version version)
    (source #f)
    (inputs (list stb))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder (begin
                   (use-modules (guix build utils))
                   (let ((stb (assoc-ref %build-inputs "stb"))
                         (lib (string-join (string-split ,name #\-) "_"))
                         (out (assoc-ref %outputs "out")))
                     (install-file (string-append stb "/" lib ".h")
                                   (string-append out "/include"))
                     #t))))
    (description description)))

;; TODO: These descriptions are not translatable!  They should be
;; converted to macros as outlined in <https://bugs.gnu.org/32155>.
(define-public stb-image
  (make-stb-header-package
   "stb-image" "2.26"
   "stb-image is a small and self-contained library for image loading or
decoding from file or memory.  A variety of formats are supported."))

(define-public stb-image-write
  (make-stb-header-package
   "stb-image-write" "1.15"
   "stb-image-write is a small library for writing image files to the
C@tie{}@code{stdio} interface."))

(define-public stb-rect-pack
  (make-stb-header-package
   "stb-rect-pack" "1.00"
   "stb-rect-pack is a small rectangle packing library useful for, e.g., packing
rectangular textures into an atlas.  It does not do rotation."))

(define-public stb-sprintf
  (make-stb-header-package
   "stb-sprintf" "1.09"
   "stb-sprintf implements fast @code{sprintf}, @code{snprintf} for C/C++."))

(define-public stb-truetype
  (make-stb-header-package
   "stb-truetype" "1.24"
   "stb-truetype is a library for parsing, decoding, and rasterizing
characters from TrueType fonts."))
commencement.scm?id=b928e38bd333e6186727fe5c5e94b85d157b79d6'>gnu: commencement: mes-boot: Update to 0.24.2....This fixes <https://debbugs.gnu.org/41264>. * gnu/packages/commencement.scm (mes-boot): Update to 0.24.2. Jan (janneke) Nieuwenhuizen 2023-02-14gnu: %boot6-inputs: Replace xz with xz-final....* gnu/packages/commencement.scm (xz-final): New variable. (%boot6-inputs): Add xz-final. Remove xz. (%final-inputs): Add xz-final. Remove xz from packages 'to finalize'. Efraim Flashner 2023-02-12gnu: coreutils-boot0: Add comment about arm* configure-flags....* gnu/packages/commencement.scm (coreutils-boot0)[arguments]: Add a full comment around the configure-flags used when building for arm architectures. Efraim Flashner 2023-02-05gnu: Rename 'guile-3.0/fixed' to 'guile-3.0/pinned'....* gnu/packages/guile.scm: Rename variable 'guile-3.0/fixed' to 'guile-3.0/pinned', add deprecation. * etc/release-manifest.scm (%packages-to-cross-build): Replace 'guile-3.0/fixed' with 'guile-3.0/pinned'. * gnu/packages/autotools.scm (make-autoconf-wrapper)[inputs]: Likewise. * gnu/packages/commencement.scm (guile-final): Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Simon Tournier 2023-01-30Merge remote-tracking branch 'origin/master' into core-updates... Conflicts: doc/guix.texi gnu/local.mk gnu/packages/admin.scm gnu/packages/base.scm gnu/packages/chromium.scm gnu/packages/compression.scm gnu/packages/databases.scm gnu/packages/diffoscope.scm gnu/packages/freedesktop.scm gnu/packages/gnome.scm gnu/packages/gnupg.scm gnu/packages/guile.scm gnu/packages/inkscape.scm gnu/packages/llvm.scm gnu/packages/openldap.scm gnu/packages/pciutils.scm gnu/packages/ruby.scm gnu/packages/samba.scm gnu/packages/sqlite.scm gnu/packages/statistics.scm gnu/packages/syndication.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/copy.scm guix/scripts/home.scm Efraim Flashner 2022-12-11gnu: coreutils-boot0: Fix building on arm architectures....* gnu/packages/commencement.scm (coreutils-boot0)[arguments]: When building for arm architectures skip building some programs. Efraim Flashner 2022-10-28gnu: diffutils: Skip failing test on GNU/Hurd....* gnu/packages/base.scm (diffutils)[arguments]: Add #:make-flags. * gnu/packages/commencement.scm (diffutils-boot0)[arguments]: Adjust to always use substitute-keyword-arguments. Christopher Baines 2022-10-28gnu: findutils: Skip failing test on GNU/Hurd....* gnu/packages/base.scm (findutils)[arguments]: Add #:make-flags. * gnu/packages/commencement.scm (findutils-boot0)[arguments]: Likewise. Ludovic Courtès