GNU bug report logs - #56576
[PATCH] gnu: Add nuklear.

Previous Next

Package: guix-patches;

Reported by: Antero Mejr <antero <at> mailbox.org>

Date: Fri, 15 Jul 2022 14:58:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

To reply to this bug, email your comments to 56576 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Fri, 15 Jul 2022 14:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Antero Mejr <antero <at> mailbox.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 15 Jul 2022 14:58:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add nuklear.
Date: Fri, 15 Jul 2022 14:57:35 +0000
* gnu/packages/c.scm (nuklear): New variable.
---
 gnu/packages/c.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index b1f68c706b..61bc1f13dc 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1219,3 +1219,38 @@ (define-public utest-h
       (description
        "This package provides a header-only unit testing library for C/C++.")
       (license license:unlicense))))
+
+(define-public nuklear
+  (package
+    (name "nuklear")
+    (version "4.9.6")
+    (home-page "https://github.com/Immediate-Mode-UI/Nuklear")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "18hvrmynycv5msc20f5v4drgapbig85s67iqq6k87n9l816zi1qg"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f ;no tests
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (replace 'build
+                          (lambda _
+                            (with-directory-excursion "src"
+                                                      (invoke "./paq.sh"))))
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (install-file "nuklear.h"
+                                          (string-append #$output "/include")))))))
+    (synopsis "Graphical user interface toolkit written in ANSI C")
+    (description "This package provides an immediate-mode graphical user
+interface toolkit.  It was designed as an embeddable user interface
+for applications and does not have any dependencies, a default render backend
+or OS window/input handling.  The library is self contained in one single header
+file and can be used either in header only mode or in implementation mode.")
+    (license (list license:unlicense license:expat))))
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Fri, 05 Aug 2022 03:05:02 GMT) Full text and rfc822 format available.

Message #8 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Antero Mejr <antero <at> mailbox.org>
Cc: 56576 <at> debbugs.gnu.org
Subject: Re: bug#56576: [PATCH] gnu: Add nuklear.
Date: Fri, 05 Aug 2022 11:03:58 +0800
Antero Mejr <antero <at> mailbox.org> writes:

> * gnu/packages/c.scm (nuklear): New variable.
> ---
>  gnu/packages/c.scm | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)

Hello, I think better put it in toolkits.scm, as imgui is there.
>
> diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
> index b1f68c706b..61bc1f13dc 100644
> --- a/gnu/packages/c.scm
> +++ b/gnu/packages/c.scm
> @@ -1219,3 +1219,38 @@ (define-public utest-h
>        (description
>         "This package provides a header-only unit testing library for C/C++.")
>        (license license:unlicense))))
> +
> +(define-public nuklear
> +  (package
> +    (name "nuklear")
> +    (version "4.9.6")
4.10.1 was released yesterday, time to update!

> +    (home-page "https://github.com/Immediate-Mode-UI/Nuklear")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url home-page)
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "18hvrmynycv5msc20f5v4drgapbig85s67iqq6k87n9l816zi1qg"))))
> +    (build-system python-build-system)
> +    (arguments
> +     (list #:tests? #f ;no tests
> +           #:phases #~(modify-phases %standard-phases
> +                        (delete 'configure)
> +                        (replace 'build
> +                          (lambda _
> +                            (with-directory-excursion "src"
> +                                                      (invoke "./paq.sh"))))
> +                        (replace 'install
> +                          (lambda* (#:key outputs #:allow-other-keys)
> +                            (install-file "nuklear.h"
> +                                          (string-append #$output
> "/include")))))))

How about install the html doc too?

> +    (synopsis "Graphical user interface toolkit written in ANSI C")
> +    (description "This package provides an immediate-mode graphical user
> +interface toolkit.  It was designed as an embeddable user interface
> +for applications and does not have any dependencies, a default render backend
> +or OS window/input handling.  The library is self contained in one single header
> +file and can be used either in header only mode or in implementation mode.")
> +    (license (list license:unlicense license:expat))))

Could you send an update, thank you!




Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Sat, 06 Aug 2022 22:59:02 GMT) Full text and rfc822 format available.

Message #11 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: 56576 <at> debbugs.gnu.org
Cc: Antero Mejr <antero <at> mailbox.org>, iyzsong <at> envs.net
Subject: [PATCH 1/2] gnu: Add stddoc.
Date: Sat,  6 Aug 2022 18:57:42 -0400
* gnu/packages/documentation.scm (stddoc): New variable.
---
Need this to generate Nuklear's HTML doc from source (code comments).

 gnu/packages/documentation.scm | 42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 6f24149b5d..9b98db4d40 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -393,3 +393,45 @@ (define-public zeal
       (description "Zeal is a simple offline documentation browser
 inspired by Dash.")
       (license gpl3+))))
+
+(define-public stddoc
+  (let ((commit "6eef9deaf2e36bae812f50e448a8012b3e5efb14"))
+    (package
+      (name "stddoc")
+      (version "1.0.2")
+      (home-page "https://github.com/r-lyeh/stddoc.c")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "06phjp7wbf4x1sagxwfapgv6iyiixmijxxbg2clb48kyvjg5mlwn"))
+         (snippet #~(delete-file "stddoc.c.html"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;no tests
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda _
+                              (invoke "gcc" "-O2" "-g" "-o" "stddoc" "stddoc.c")
+                              (with-input-from-file "stddoc.c"
+                                (lambda _
+                                  (with-output-to-file "stddoc.c.html"
+                                    (lambda _
+                                      (invoke "./stddoc")))))))
+                          (replace 'install
+                            (lambda _
+                              (install-file "stddoc"
+                                            (string-append #$output "/bin"))
+                              (install-file "stddoc.c.html"
+                                            (string-append #$output
+                                                           "/share/doc")))))))
+      (synopsis "Documentation generator for 60 programming languages")
+      (description "@code{stddoc.c} is a tiny documentation generator for 60
+programming languages.  Markdeep code comments are extracted from stdin and
+printed into stdout as a HTML file.")
+      (license unlicense))))
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Sat, 06 Aug 2022 22:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: 56576 <at> debbugs.gnu.org
Cc: Antero Mejr <antero <at> mailbox.org>, iyzsong <at> envs.net
Subject: [PATCH 2/2] gnu: Add nuklear.
Date: Sat,  6 Aug 2022 18:57:43 -0400
* gnu/packages/toolkits.scm (nuklear): New variable.
---
Package moved to toolkits.scm, updated to 4.10.1, installs HTML doc generated
using stddoc.

 gnu/packages/toolkits.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/toolkits.scm b/gnu/packages/toolkits.scm
index 3030e3aa49..79ea8068f1 100644
--- a/gnu/packages/toolkits.scm
+++ b/gnu/packages/toolkits.scm
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages toolkits)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages sdl)
@@ -27,6 +28,7 @@ (define-module (gnu packages toolkits)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (guix git-download))
 
 (define-public imgui
@@ -141,3 +143,50 @@ (define-public imgui-1.86
               (sha256
                (base32
                 "02a7b05zrka20jhzag2jb4jl624i1m456bsv69jb9zgys2p9dv1n"))))))
+
+(define-public nuklear
+  (package
+    (name "nuklear")
+    (version "4.10.1")
+    (home-page "https://github.com/Immediate-Mode-UI/Nuklear")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0qmaza0iiq3da3qya23znnajmv9prm6rv0nbqg58qdrl23207kar"))
+              (snippet #~(begin (delete-file "nuklear.h")
+                                (delete-file "doc/index.html")))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f ;no tests
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (replace 'build
+                          (lambda _
+                            (with-directory-excursion "src"
+                              (invoke "./paq.sh"))
+                            (with-directory-excursion "doc"
+                              (with-input-from-file "../nuklear.h"
+                                (lambda _
+                                  (with-output-to-file "index.html"
+                                    (lambda _
+                                      (invoke "stddoc"))))))))
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (install-file "nuklear.h"
+                                          (string-append #$output "/include"))
+                            (install-file "doc/index.html"
+                                          (string-append #$output
+                                                         "/share/doc")))))))
+    (native-inputs (list stddoc))
+    (synopsis "Graphical user interface toolkit written in ANSI C")
+    (description "This package provides an immediate-mode graphical user
+interface toolkit.  It was designed as an embeddable user interface
+for applications and does not have any dependencies, a default render backend
+or OS window/input handling.  The library is self contained in one single header
+file and can be used either in header only mode or in implementation mode.")
+    (license (list license:unlicense license:expat))))
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Sun, 07 Aug 2022 12:12:02 GMT) Full text and rfc822 format available.

Message #17 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Antero Mejr <antero <at> mailbox.org>, 56576 <at> debbugs.gnu.org
Cc: iyzsong <at> envs.net
Subject: Re: [bug#56576] [PATCH 1/2] gnu: Add stddoc.
Date: Sun, 7 Aug 2022 14:10:59 +0200
[Message part 1 (text/plain, inline)]
On 07-08-2022 00:57, Antero Mejr via Guix-patches via wrote:
> +                              (invoke "gcc" "-O2" "-g" "-o" "stddoc" "stddoc.c")

For cross-compilation, you need to use #$(cc-for-target) instead of 
"gcc", otherwise it will be compiled for the wrong architecture.

> +                              (with-input-from-file "stddoc.c"
> +                                (lambda _
> +                                  (with-output-to-file "stddoc.c.html"
> +                                    (lambda _
> +                                      (invoke "./stddoc")))))))
Except when emulation is used, cross-compiled binaries cannot be run. 
However, you can add 'this-package' to native-inputs (conditional on 
cross-compilation, otherwise you get a loop) and run that stddoc:

(native-inputs (if (%current-target-system) (list this-package) '()))

[...]

(invoke #$(if (%current-target-system) "stddoc" "./stddoc"))

(untested!).

It includes Javascript and CSS from external sources:

> static void stddoc( FILE *in, FILE *out ) {
>     fprintf(out, "%s\n", "<meta charset='utf-8' emacsmode='-*- 
> markdown -*-'>");
>     fprintf(out, "%s\n", "<link rel='stylesheet' 
> href='https://casual-effects.com/m""arkdeep/latest/apidoc.css?'>");
>
I don't think this is good, privacy-wise, could you substitute them with 
a local copy?

Also, on 
<https://github.com/r-lyeh/stddoc.c/blob/6eef9deaf2e36bae812f50e448a8012b3e5efb14/stddoc.c#L111>, 
it looks like it forgets to quote things like &. I don't know if that's 
important in this particular case but often forgetting to quote things 
can be pretty bad.

(Ignoring the return value of printf also isn't ideal, but less important)

> +      (description "@code{stddoc.c} is a tiny documentation generator for 60
> +programming languages.  Markdeep code comments are extracted from stdin and
> +printed into stdout as a HTML file.")
This seems misleading to me, the Markdown->HTML happens at runtime, via 
the Javascript. Also, instead of mentioning the number 60, you could 
refer to the Javascript package; that way, the user can check if their 
language is in the list. I also don't think that the generator 
'https://morgan3d.github.io/markdeep/latest/markdeep.js' counts as tiny.

stdout -> output, stdin -> input

Greetings,
Maxime

[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Wed, 03 Apr 2024 22:54:03 GMT) Full text and rfc822 format available.

Message #20 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Christina O'Donnell <cdo <at> mutix.org>
To: 56576 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telnet.be>, Christina O'Donnell <cdo <at> mutix.org>,
 Steve George <steve <at> futrile.net>
Subject: [PATCH v3 1/3] gnu: Add markdeep.
Date: Wed,  3 Apr 2024 23:46:32 +0100
* gnu packages/documentation.scm (markdeep): New variable.

Change-Id: I34303377f50740ba357c1bb299c9434079a6e23d
---
 gnu/packages/documentation.scm | 65 ++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

Hi,

I've gone through these patches, making the changes that Maxime listed
and that came up from `guix lint`. I've added the additional package
markdeep, which is a css/javascript rendering library needed for stddoc.

I checked these very carefully, but I'm new to this so it's likely that
I've made at least a few mistakes. Everything appears to be working as
far as I've tested it. I had anything to test nuklear with, so I'm
taking that part on faith.

Let me know whether there's anything that I could change or do better
for next time. 

Kind regards,
Christina

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 83c4313bd7..da930c7304 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -37,6 +37,7 @@ (define-module (gnu packages documentation)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt)
@@ -57,11 +58,13 @@ (define-module (gnu packages documentation)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages javascript)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages sphinx)
+  #:use-module (gnu packages uglifyjs)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
@@ -453,3 +456,65 @@ (define-public zeal
       (description "Zeal is a simple offline documentation browser
 inspired by Dash.")
       (license license:gpl3+))))
+
+(define-public markdeep
+  (package
+    (name "markdeep")
+    (version "1.16")
+    (home-page "https://casual-effects.com/markdeep/")
+    (source
+     (origin (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/morgan3d/markdeep")
+                   (commit (string-append "v0" version))))
+             (sha256
+              (base32 "05bvw3993xh1260ckclwk4jw38hvgiff0b2940ryhbhz0p1k41l8"))))
+    (build-system copy-build-system)
+    (arguments
+     (list #:modules '((guix build utils)
+                       (guix build copy-build-system)
+                       (ice-9 popen))
+           #:install-plan ''(("." "/share/markdeep/"))
+           #:phases
+           #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-urls
+            (lambda _
+              (for-each (lambda (filename)
+
+                          (substitute* filename
+                            ;; Don't include a reference to the remote version.
+                            (("<script src=\"https://casual-effects\\.com/\
+markdeep/latest/markdeep\\.min\\.js\\?\"></script>")
+                             "")
+                            (("MATHJAX_URL = .*$")
+                             ;; Use our local copy of mathjax
+                             (string-append "MATHJAX_URL = 'file://" #$js-mathjax
+                                            "/share/javascript/es5/tex-mml-chtml.js'"))))
+                        (find-files "." (lambda (file stat)
+                                          (string-suffix? ".js" file))))))
+          (add-before 'install 'minify
+            (lambda _
+              (for-each (lambda (filename)
+                          (let ((minified-filename
+                                 (string-append (string-drop-right filename 3)
+                                                ".min.js")))
+                          (format #t "~a -> ~a~%" filename minified-filename)
+                          (let ((minified (open-pipe* OPEN_READ "uglifyjs" filename)))
+                            (call-with-output-file minified-filename
+                              (lambda (port)
+                                (dump-port minified port)))
+
+                            (let ((exit (close-pipe minified)))
+                              (unless (zero? exit)
+                                (error "uglifyjs failed" exit))))))
+                        (find-files "latest"
+                                    (lambda (path stat)
+                                      (and (string-suffix? ".js" path)
+                                           (not (string-suffix? ".min.js" path)))))))))))
+    (inputs (list js-mathjax))
+    (native-inputs (list uglifyjs))
+    (synopsis "Tool for displaying markdown documents in a web-browser")
+    (description "Markdeep is a technology for writing plain text documents that can
+be displayed in any web browser, whether local or remote.  It supports diagrams,
+calendars, equations, and other features as extensions of Markdown syntax.")
+    (license license:bsd-2)))

base-commit: 4d994f98a49e1a6e58b9b0b512a05efc1c431a50
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Wed, 03 Apr 2024 22:56:02 GMT) Full text and rfc822 format available.

Message #23 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Christina O'Donnell <cdo <at> mutix.org>
To: 56576 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telnet.be>, Christina O'Donnell <cdo <at> mutix.org>,
 Steve George <steve <at> futrile.net>
Subject: [PATCH v3 2/3] gnu: Add stddoc.
Date: Wed,  3 Apr 2024 23:46:34 +0100
* gnu/packages/documentation.scm (stddoc): New variable.

Change-Id: I0f60126ef78a45733ad7395352e9bad49561437b
---
 gnu/packages/documentation.scm | 57 ++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index da930c7304..c9ec860fef 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -518,3 +518,60 @@ (define-public markdeep
 be displayed in any web browser, whether local or remote.  It supports diagrams,
 calendars, equations, and other features as extensions of Markdown syntax.")
     (license license:bsd-2)))
+
+(define-public stddoc
+  (let ((commit "6eef9deaf2e36bae812f50e448a8012b3e5efb14")
+        (revision "1"))
+    (package
+      (name "stddoc")
+      (version (git-version "1.0.2" revision commit))
+      (home-page "https://github.com/r-lyeh/stddoc.c")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "06phjp7wbf4x1sagxwfapgv6iyiixmijxxbg2clb48kyvjg5mlwn"))
+         (snippet #~(delete-file "stddoc.c.html"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ; no tests
+             #:phases
+             #~(modify-phases %standard-phases
+                 (replace 'configure
+                   (lambda _
+                     (substitute* "stddoc.c"
+                       ;; Note: For some reason quote characters are being
+                       ;; inserted into urls and tags, eg.
+                       ;; 'https://morgan3d.github.io/m""arkdeep/latest/markdeep.min.js?'
+                       (("https://casual-effects.com/m\"*arkdeep/latest/")
+                        (string-append #$markdeep "/share/markdeep/latest/"))
+                       (("https://morgan3d.github.io/m\"*arkdeep/latest/")
+                        (string-append #$markdeep "/share/markdeep/latest/")))))
+                 (replace 'build
+                   (lambda _
+                     (invoke #$(cc-for-target)
+                             "-O2" "-g" "-o" "stddoc" "stddoc.c")
+                     (with-input-from-file "stddoc.c"
+                       (lambda _
+                         (with-output-to-file "stddoc.c.html"
+                           (lambda _
+                             (invoke #$(if (%current-target-system)
+                                           "stddoc"
+                                           "./stddoc"))))))))
+                 (replace 'install
+                   (lambda _
+                     (install-file "stddoc"
+                                   (string-append #$output "/bin"))
+                     (install-file "stddoc.c.html"
+                                   (string-append #$output
+                                                  "/share/doc")))))))
+      (native-inputs (if (%current-target-system) (list this-package) '()))
+      (synopsis "Documentation generator for multiple programming languages")
+      (description "@code{stddoc.c} is a tiny documentation generator with many
+supported programming languages.  Markdeep code comments are extracted from stdin and
+printed into stdout as a HTML file.")
+      (license license:unlicense))))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#56576; Package guix-patches. (Wed, 03 Apr 2024 22:56:03 GMT) Full text and rfc822 format available.

Message #26 received at 56576 <at> debbugs.gnu.org (full text, mbox):

From: Christina O'Donnell <cdo <at> mutix.org>
To: 56576 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telnet.be>, Antero Mejr <antero <at> mailbox.org>,
 Steve George <steve <at> futrile.net>
Subject: [PATCH v3 3/3] gnu: Add nuklear.
Date: Wed,  3 Apr 2024 23:46:35 +0100
From: Antero Mejr <antero <at> mailbox.org>

* gnu/packages/toolkits.scm (nuklear): New variable.
---
 gnu/packages/toolkits.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/toolkits.scm b/gnu/packages/toolkits.scm
index 9d002ecab1..3ba3399899 100644
--- a/gnu/packages/toolkits.scm
+++ b/gnu/packages/toolkits.scm
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages toolkits)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages sdl)
@@ -27,6 +28,7 @@ (define-module (gnu packages toolkits)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (guix git-download))
 
 (define-public imgui
@@ -181,3 +183,50 @@ (define-public imgui-1.86
     (inputs
      (modify-inputs (package-inputs imgui)
        (delete "freetype")))))
+
+(define-public nuklear
+  (package
+    (name "nuklear")
+    (version "4.12.0")
+    (home-page "https://github.com/Immediate-Mode-UI/Nuklear")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "13cswwdys4hqdvbm4g4b9l269i16s7c4204j16v67ghj3b4mjifg"))
+              (snippet #~(begin (delete-file "nuklear.h")
+                                (delete-file "doc/index.html")))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f ;no tests
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (replace 'build
+                          (lambda _
+                            (with-directory-excursion "src"
+                              (invoke "./paq.sh"))
+                            (with-directory-excursion "doc"
+                              (with-input-from-file "../nuklear.h"
+                                (lambda _
+                                  (with-output-to-file "index.html"
+                                    (lambda _
+                                      (invoke "stddoc"))))))))
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (install-file "nuklear.h"
+                                          (string-append #$output "/include"))
+                            (install-file "doc/index.html"
+                                          (string-append #$output
+                                                         "/share/doc")))))))
+    (native-inputs (list stddoc))
+    (synopsis "Graphical user interface toolkit written in ANSI C")
+    (description "This package provides an immediate-mode graphical user
+interface toolkit.  It was designed as an embeddable user interface
+for applications and does not have any dependencies, a default render backend
+or OS window/input handling.  The library is self contained in one single header
+file and can be used either in header only mode or in implementation mode.")
+    (license (list license:unlicense license:expat))))
-- 
2.41.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 11 Apr 2024 10:39:02 GMT) Full text and rfc822 format available.

Notification sent to Antero Mejr <antero <at> mailbox.org>:
bug acknowledged by developer. (Thu, 11 Apr 2024 10:39:02 GMT) Full text and rfc822 format available.

Message #31 received at 56576-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christina O'Donnell <cdo <at> mutix.org>
Cc: Maxime Devos <maximedevos <at> telnet.be>, Steve George <steve <at> futrile.net>,
 56576-done <at> debbugs.gnu.org
Subject: Re: [bug#56576] [PATCH v3 1/3] gnu: Add markdeep.
Date: Thu, 11 Apr 2024 12:37:46 +0200
Hi Christina,

Christina O'Donnell <cdo <at> mutix.org> skribis:

> * gnu packages/documentation.scm (markdeep): New variable.
>
> Change-Id: I34303377f50740ba357c1bb299c9434079a6e23d
> ---
>  gnu/packages/documentation.scm | 65 ++++++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
>
> Hi,
>
> I've gone through these patches, making the changes that Maxime listed
> and that came up from `guix lint`. I've added the additional package
> markdeep, which is a css/javascript rendering library needed for stddoc.
>
> I checked these very carefully, but I'm new to this so it's likely that
> I've made at least a few mistakes. Everything appears to be working as
> far as I've tested it. I had anything to test nuklear with, so I'm
> taking that part on faith.
>
> Let me know whether there's anything that I could change or do better
> for next time. 

It’s perfect!  There was a tiny indentation issue for phases in
‘markdeep’ but the rest looks good to me.

Applied, thanks!

Ludo’.




This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.