diff mbox series

[bug#63254,v2,2/5] gnu: Add nanovg.

Message ID d7xMkbjrb0oDxBl7bXpGj7MNBaiExYKODbLt1SIrPKrduk_A_anU7ccCI2J3K8PAO8Hs0EHhy_DvS85L1HJb8Y98X61byD5whPwIJNMFpjc=@proton.me
State New
Headers show
Series None | expand

Commit Message

Sughosha May 4, 2023, 8:06 a.m. UTC
* gnu/packages/gl.scm (nanovg): New variable.
---
 gnu/packages/gl.scm | 46 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index e59d051f2e..b67215b406 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -893,6 +893,52 @@  (define-public glfw
 and surfaces, receiving input and events.")
     (license license:zlib)))
 
+(define-public nanovg
+  ;; No tags are available.
+  (let ((revision "0")
+        (commit "7544c114e83db7cf67bd1c9e012349b70caacc2f"))
+    (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
+                  "0n29rxdp20xnvnpsjcmg3v5n6z7ya5ji4qirp18qcyls5xdxdxkc"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;no test suite
+             #:phases
+             #~(modify-phases %standard-phases
+                 (delete 'configure) ;no configure script
+                  (replace 'build
+                    (lambda _
+                      (invoke #$(cc-for-target)
+                       "../source/src/nanovg.c" "-c" "-fPIC")
+                      (invoke #$(cc-for-target)
+                       "-shared" "-olibnanovg.so" "nanovg.o")))
+                  (replace 'install
+                    (lambda _
+                      (let ((lib (string-append #$output "/lib"))
+                            (include (string-append #$output
+                                                    "/include")))
+                        (install-file "libnanovg.so" lib)
+                        (with-directory-excursion "../source"
+                          (for-each
+                            (lambda (file)
+                              (install-file file include))
+                            (find-files "src" "nanovg.*\\.h$")))))))))
+      (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")