diff options
| author | Sughosha <sughosha@disroot.org> | 2025-08-18 15:31:56 +0530 |
|---|---|---|
| committer | Gabriel Wicki <gabriel@erlikon.ch> | 2025-09-17 14:14:20 +0200 |
| commit | 1c9be166c1f546e40c96d3cc2330346cf47bad97 (patch) | |
| tree | 49024cd4bf53a26f5ad485e6120047ae0705628c | |
| parent | a480ab6908e8a85607864223612f2bc7c11a011b (diff) | |
gnu: Add nanovg.
* gnu/packages/gl.scm (nanovg): New variable.
Change-Id: I89333066029e5277c979854c5f96b5e60d999579
Signed-off-by: Gabriel Wicki <gabriel@erlikon.ch>
| -rw-r--r-- | gnu/packages/gl.scm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 2a1c7a90de..353017d209 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com> ;;; Copyright © 2024 Arnaud Lechevallier <arnaud.lechevallier@free.fr> ;;; Copyright © 2024 aurtzy <aurtzy@gmail.com> +;;; Copyright © 2025 Sughosha <sughosha@disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1088,6 +1089,68 @@ and surfaces, receiving input and events.") (arguments (substitute-keyword-arguments (package-arguments glfw) ((#:out-of-source? _ #f) #f))))) +(define-public nanovg + ;; No tags are available. + (let ((revision "0") + (commit "b83cf926525e7cea8d2483da2a75852b8c7b6d28")) + (package + (name "nanovg") + (version (git-version "0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/memononen/nanovg") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1zp355pw6xnb5mjarz67cxkglv7j1s0qzv705fz1wf0gl0sjhy8f")) + (modules '((guix build utils))) + (snippet + ;; Fix including freetype. + '(substitute* (find-files "." "\\.(c|h)$") + (("ft2build\\.h") "freetype2/ft2build.h"))))) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;no test suite + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ;no configure script + ;; No Makefile exists. + (replace 'build + (lambda _ + (invoke #$(cc-for-target) + "../source/src/nanovg.c" "-c" "-fPIC" + "-DFONS_USE_FREETYPE=1" + (string-append "-I" + #$(this-package-input "freetype") + "/include/freetype2")) + (invoke #$(cc-for-target) + "-shared" "-olibnanovg.so" "nanovg.o" + "-lfreetype"))) + ;; No Makefile exists. + (replace 'install + (lambda _ + (let ((lib (string-append #$output "/lib")) + (include (string-append #$output + "/include/nanovg"))) + (install-file "libnanovg.so" lib) + (with-directory-excursion "../source" + (for-each + (lambda (file) + (install-file file include)) + (append (find-files "src" "nanovg.*\\.h$") + '("example/perf.h" + "example/stb_image_write.h")))))))))) + (inputs + (list freetype)) + (home-page "https://github.com/memononen/nanovg") + (synopsis "2D vector drawing library on top of OpenGL") + (description + "NanoVG is an antialiased vector graphics rendering library for OpenGL. +It is aimed for building scalable user interfaces and visualizations.") + (license license:zlib)))) + (define-public nanovg-for-extempore (let ((version "0.7.1") (revision "0") |
