unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 81de853572d774c2f08517c033e8f865e3186bd8 8514 bytes (raw)
name: gnu/packages/toolkits.scm 	 # note: path name is non-authoritative(*)

  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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2023 Simon South <simon@simonsouth.net>
;;;
;;; 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 toolkits)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages sdl)
  #:use-module (guix gexp)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (guix build-system gnu)
  #:use-module (guix git-download))

(define-public imgui
  (package
    (name "imgui")
    (version "1.88")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/ocornut/imgui")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "13cw4hx55y5z678r558hv7znfz666wh0w849c5padnj4nkpbihdi"))
              (modules '((guix build utils)))
              (snippet
               ;; Remove bundled fonts.
               '(delete-file-recursively "misc/fonts"))))
    (outputs '("out" "doc"))
    (build-system gnu-build-system)
    (arguments
     (list
      #:tests? #f                       ;no test suite
      #:modules '((guix build gnu-build-system)
                  (guix build utils)
                  (ice-9 ftw)
                  (srfi srfi-26))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'adjust-includes
            (lambda _
              (substitute* (find-files "." "(\\.cpp|\\.mm)$")
                (("#include <SDL")
                 "#include <SDL2/SDL"))))
          (delete 'configure)
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Build main library.
              (apply invoke #$(cc-for-target) "-I" (getcwd)
                     "-I" (search-input-directory inputs "include/freetype2")
                     "-g" "-O2" "-fPIC" "-shared"
                     "-lGL" "-lSDL2" "-lglfw"
                     "-o" "libimgui.so"
                     "imgui.cpp"
                     "imgui_draw.cpp"
                     "imgui_tables.cpp"
                     "imgui_widgets.cpp"
                     ;; Include the supported backends.
                     "backends/imgui_impl_glfw.cpp"
                     "backends/imgui_impl_sdl.cpp"
                     "backends/imgui_impl_opengl2.cpp"
                     "backends/imgui_impl_opengl3.cpp"
                     ;; Include wrappers for C++ standard library (STL) and
                     ;; fontconfig.
                     (find-files "misc" "\\.cpp$"))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (doc (assoc-ref outputs "doc"))
                     (header? (cut string-suffix? ".h" <>))
                     (imgui-headers (scandir "." header?))
                     (backend-headers (find-files
                                       "backends"
                                       "(glfw|opengl|sdl|vulkan).*\\.h$"))
                     (misc-headers (find-files "misc" "\\.h$")))
                (install-file "libimgui.so" (string-append out "/lib"))
                ;; Install headers.
                (for-each (lambda (f)
                            (install-file f (string-append out "/include/imgui")))
                          imgui-headers)
                (for-each (lambda (f)
                            (install-file f (string-append
                                             out "/include/imgui/backends")))
                          backend-headers)
                (for-each (lambda (f)
                            (install-file f (string-append
                                             out "/include/imgui/" (dirname f))))
                          misc-headers)
                ;; Install examples.
                (copy-recursively
                 "examples" (string-append
                             doc "/share/imgui/examples"))))))))
    (inputs (list fontconfig glfw mesa sdl2))
    (home-page "https://github.com/ocornut/imgui")
    (synopsis "Immediate-mode C++ GUI library with minimal dependencies")
    (description "@code{dear imgui} (also know as ImGui) is a graphical user
interface library for C++.  It creates optimized vertex buffers that you can
render anytime in your 3D-pipeline-enabled application.  It's fast, portable,
renderer-agnostic, and self-contained, without external dependencies.

ImGui is aimed at content creation, visualization, and debugging tools as
opposed to average end-user interfaces.  Hence it favors simplicity and
productivity but lacks certain features often found in higher-level libraries.
It is particularly suited to integration in game engine tooling, real-time 3D
applications, full-screen applications, and embedded platforms without
standard operating system features.")
    (license license:expat)))

(define-public imgui-1.86
  (package
    (inherit imgui)
    (name "imgui")
    (version "1.86")
    (source (origin
              (inherit (package-source imgui))
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/ocornut/imgui")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "02a7b05zrka20jhzag2jb4jl624i1m456bsv69jb9zgys2p9dv1n"))))))

(define-public implot
  (package
    (name "implot")
    (version "0.14")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/epezent/implot")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0kp0h5s9dh7380yink5f091ss5cwfj321n6ym87j4skcp0giiym6"))))
    (build-system gnu-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (delete 'bootstrap)
          (delete 'configure)
          (replace 'build
            ;; Build a shared library from the source code.
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke #$(cc-for-target) "-I" (getcwd)
                      "-I" (search-input-directory inputs "include/imgui")
                      "-g" "-O2" "-fPIC" "-shared"
                      "-o" "libimplot.so"
                      "implot.cpp"
                      "implot_items.cpp")))
          (replace 'install
            ;; Copy the library and header files to the output.
            (lambda _
              (install-file "libimplot.so" (string-append #$output "/lib"))
              (for-each (lambda (file-name)
                          (install-file file-name
                                        (string-append #$output
                                                       "/include/implot")))
                        '("implot.h" "implot_internal.h")))))
      #:tests? #f))                     ; no test suite
    (inputs
     (list imgui))
    (home-page "https://github.com/epezent/implot")
    (synopsis "Immediate-mode C++ plotting library for ImGui")
    (description "ImPlot is an immediate-mode, GPU-accelerated plotting
library in C++ for the ImGui GUI library, suitable for creating real-time
visualizations or interactive plots.  Like ImGui, ImPlot is self-contained and
requires only minimal code to integrate with existing applications.")
    (license license:expat)))

debug log:

solving 81de853572 ...
found 81de853572 in https://yhetil.org/guix-patches/413b2f8271dcae1fa1b79a71874e1028fe826651.1673286570.git.simon@simonsouth.net/ ||
	https://yhetil.org/guix-patches/a0b76d6447d711358ad45db6d6c12c7601dde214.1674850363.git.simon@simonsouth.net/
found 3030e3aa49 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 3030e3aa49e3891f4bae6b058583a95b403cd544	gnu/packages/toolkits.scm

applying [1/1] https://yhetil.org/guix-patches/413b2f8271dcae1fa1b79a71874e1028fe826651.1673286570.git.simon@simonsouth.net/
diff --git a/gnu/packages/toolkits.scm b/gnu/packages/toolkits.scm
index 3030e3aa49..81de853572 100644

Checking patch gnu/packages/toolkits.scm...
Applied patch gnu/packages/toolkits.scm cleanly.

skipping https://yhetil.org/guix-patches/a0b76d6447d711358ad45db6d6c12c7601dde214.1674850363.git.simon@simonsouth.net/ for 81de853572
index at:
100644 81de853572d774c2f08517c033e8f865e3186bd8	gnu/packages/toolkits.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).