unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#31485] [PATCH] gnu: Add uncrustify.
@ 2018-05-17 20:37 Pierre Neidhardt
  2018-05-18  6:50 ` Pierre Neidhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2018-05-17 20:37 UTC (permalink / raw)
  To: 31485

* gnu/packages/pretty-print.scm (uncrustify): New variable.
---
 gnu/packages/pretty-print.scm | 47 +++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 6edfba95c..f8cb4af80 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -322,3 +322,50 @@ highlighting.  Language definitions and color themes are customizable.")
      "Artistic Style is a source code indenter, formatter, and beautifier for
 the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
     (license lgpl3+)))
+
+(define-public uncrustify
+  (package
+    (name "uncrustify")
+    (version "0.67")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/uncrustify/uncrustify/archive/"
+                    "uncrustify-" version ".zip"))
+              (sha256
+               (base32
+                "0n13kq0nsm35fxhdp0f275n4x0w88hdv3bdjy0hgvv42x0dx5zyp"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'unpack-etc
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Configuration samples are not installed by default.
+             (let* ((output (assoc-ref outputs "out"))
+                    (etcdir (string-append output "/etc")))
+               (begin
+                 (mkdir-p etcdir)
+                 (for-each (lambda (l)
+                             (copy-file
+                              l (string-append etcdir "/" (basename l))))
+                           (find-files "etc" "\\.cfg$"))))
+             #t)))))
+    (home-page "http://uncrustify.sourceforge.net/")
+    (synopsis "Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA")
+    (description
+     "A highly configurable, easily modifiable source code beautifier.  Features:
+- Indent code, aligning on parens, assignments, etc.
+- Align on @code{=} and variable definitions.
+- Align structure initializers.
+- Align #define stuff.
+- Align backslash-newline stuff.
+- Reformat comments (a little bit).
+- Fix inter-character spacing.
+- Add or remove parens on return statements.
+- Add or remove braces on single-statement if/do/while/for statements.
+- Supports embedded SQL @code{EXEC SQL} stuff.
+- Highly configurable - More than 600 configurable options.")
+    (license gpl2)))
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-17 20:37 [bug#31485] [PATCH] gnu: Add uncrustify Pierre Neidhardt
@ 2018-05-18  6:50 ` Pierre Neidhardt
  2018-05-19 20:32 ` Ludovic Courtès
  2018-06-16  1:37 ` [bug#31485] 27.0.50; Error building master on MacOS Paul Eggert
  2 siblings, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2018-05-18  6:50 UTC (permalink / raw)
  To: 31485

[-- Attachment #1: Type: text/plain, Size: 73 bytes --]


Forgot to add my name to the copyright list.

-- 
Pierre Neidhardt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-17 20:37 [bug#31485] [PATCH] gnu: Add uncrustify Pierre Neidhardt
  2018-05-18  6:50 ` Pierre Neidhardt
@ 2018-05-19 20:32 ` Ludovic Courtès
  2018-05-19 22:41   ` Pierre Neidhardt
  2018-06-16  1:37 ` [bug#31485] 27.0.50; Error building master on MacOS Paul Eggert
  2 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2018-05-19 20:32 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 31485

Hi Pierre,

Pierre Neidhardt <ambrevar@gmail.com> skribis:

> * gnu/packages/pretty-print.scm (uncrustify): New variable.

Thanks for the patch!  Perhaps indent.scm or code.scm would be a better
match?

> +         (add-after 'unpack 'unpack-etc
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             ;; Configuration samples are not installed by default.
> +             (let* ((output (assoc-ref outputs "out"))
> +                    (etcdir (string-append output "/etc")))
> +               (begin

You can omit ‘begin’.

> +                 (mkdir-p etcdir)
> +                 (for-each (lambda (l)
> +                             (copy-file
> +                              l (string-append etcdir "/" (basename l))))

Simply: (install-file l etcdir), and you can omit ‘mkdir-p’ as well.

> +    (home-page "http://uncrustify.sourceforge.net/")
> +    (synopsis "Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA")

Maybe: “Indent source code written in C or related languages”?
(I wasn’t sure what “beautifier” meant.)

> +    (description
> +     "A highly configurable, easily modifiable source code beautifier.  Features:
> +- Indent code, aligning on parens, assignments, etc.
> +- Align on @code{=} and variable definitions.
> +- Align structure initializers.
> +- Align #define stuff.
> +- Align backslash-newline stuff.
> +- Reformat comments (a little bit).
> +- Fix inter-character spacing.
> +- Add or remove parens on return statements.
> +- Add or remove braces on single-statement if/do/while/for statements.
> +- Supports embedded SQL @code{EXEC SQL} stuff.
> +- Highly configurable - More than 600 configurable options.")

Please use full sentences and Texinfo markup for lists (@enumerate,
etc.):

  https://www.gnu.org/software/guix/manual/html_node/Synopses-and-Descriptions.html

I’m not sure we need to least feature with this level of detail, though.
Your call!

> +    (license gpl2)))

Should be ‘gpl2+’ (version 2 “or any later version”).

Could you send an updated patch?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-19 20:32 ` Ludovic Courtès
@ 2018-05-19 22:41   ` Pierre Neidhardt
  2018-05-20 12:31     ` Pierre Neidhardt
  2018-05-20 20:31     ` Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2018-05-19 22:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31485

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]


> Maybe: “Indent source code written in C or related languages”?
> (I wasn’t sure what “beautifier” meant.)

Well, technically "indent" is only about the spacing to the margin.
Beautifiers (also known as prettifiers or formatters) do more than that,
they also handle the spacing elsewhere, transform into idiomatic syntax,
etc.

I'm not sure which is better.  I like "code formatter".

I know 3 C-oriented code formatters:

- GNU indent (already in Guix)
- Astyle (already in Guix)
- Uncrustify

> I’m not sure we need to least feature with this level of detail, though.
> Your call!

Probably not, this was a copy-paste from the homepage.  Sorry for the
lazy move :p

> Could you send an updated patch?

Will do!

-- 
Pierre Neidhardt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-19 22:41   ` Pierre Neidhardt
@ 2018-05-20 12:31     ` Pierre Neidhardt
  2018-05-20 20:31     ` Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2018-05-20 12:31 UTC (permalink / raw)
  To: 31485

[-- Attachment #1: Type: text/plain, Size: 2626 bytes --]


* gnu/packages/pretty-print.scm (uncrustify): New variable.
---
 gnu/packages/pretty-print.scm | 43 +++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 6edfba95c..baba79ac9 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -322,3 +323,45 @@ highlighting.  Language definitions and color themes are customizable.")
      "Artistic Style is a source code indenter, formatter, and beautifier for
 the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
     (license lgpl3+)))
+
+(define-public uncrustify
+  (package
+    (name "uncrustify")
+    (version "0.67")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/uncrustify/uncrustify/archive/"
+                    "uncrustify-" version ".zip"))
+              (sha256
+               (base32
+                "0n13kq0nsm35fxhdp0f275n4x0w88hdv3bdjy0hgvv42x0dx5zyp"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'unpack-etc
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Configuration samples are not installed by default.
+             (let* ((output (assoc-ref outputs "out"))
+                    (etcdir (string-append output "/etc")))
+               (for-each (lambda (l)
+                           (install-file l etcdir))
+                         (find-files "etc" "\\.cfg$")))
+             #t)))))
+    (home-page "http://uncrustify.sourceforge.net/")
+    (synopsis "Code formatter for C and other related languages")
+    (description
+     "Beautify source code in many languages of the C family (C, C++, C#,
+ObjectiveC, D, Java, Pawn and VALA).  Features:
+@itemize
+@item Indent and align code.
+@item Reformat comments (a little bit).
+@item Fix inter-character spacing.
+@item Add or remove parens / braces.
+@item Supports embedded SQL @code{EXEC SQL} stuff.
+@item Highly configurable - More than 600 configurable options.
+@end itemize\n")
+    (license gpl2)))
-- 
2.17.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-19 22:41   ` Pierre Neidhardt
  2018-05-20 12:31     ` Pierre Neidhardt
@ 2018-05-20 20:31     ` Ludovic Courtès
  2018-05-20 20:49       ` Pierre Neidhardt
  1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2018-05-20 20:31 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 31485

Hi Pierre,

Pierre Neidhardt <ambrevar@gmail.com> skribis:

>> Maybe: “Indent source code written in C or related languages”?
>> (I wasn’t sure what “beautifier” meant.)
>
> Well, technically "indent" is only about the spacing to the margin.
> Beautifiers (also known as prettifiers or formatters) do more than that,
> they also handle the spacing elsewhere, transform into idiomatic syntax,
> etc.
>
> I'm not sure which is better.  I like "code formatter".

Sure, it’s even clearer.

> * gnu/packages/pretty-print.scm (uncrustify): New variable.

There are two minor issues from my previous email that we should
resolve:

> Perhaps indent.scm or code.scm would be a better match?

and:

> Should be ‘gpl2+’ (version 2 “or any later version”).

I’m happy to fix both on your behalf if that’s fine with you, or you can
send an updated patch.

Let me know!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] [PATCH] gnu: Add uncrustify.
  2018-05-20 20:31     ` Ludovic Courtès
@ 2018-05-20 20:49       ` Pierre Neidhardt
  2018-05-23 10:18         ` bug#31485: " Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre Neidhardt @ 2018-05-20 20:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31485

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

>> Perhaps indent.scm or code.scm would be a better match?

Well, indent, astyle and uncrustify clearly belong together.
At the moment astyle is in pretty-print.scm and indent is alone in its
own file, indent.scm.

My suggestions:

- Move indent to pretty-print.scm.
- Move astyle, indent and uncrustify to code.scm.

> and:
>
>> Should be ‘gpl2+’ (version 2 “or any later version”).

Sorry, forgot that one.  Please go ahead and fix it, sorry for the bother.

-- 
Pierre Neidhardt

Emerson's Law of Contrariness:
	Our chief want in life is somebody who shall make us do what we
	can.  Having found them, we shall then hate them for it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31485: [PATCH] gnu: Add uncrustify.
  2018-05-20 20:49       ` Pierre Neidhardt
@ 2018-05-23 10:18         ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2018-05-23 10:18 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 31485-done

Hello,

Pierre Neidhardt <ambrevar@gmail.com> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>>> Perhaps indent.scm or code.scm would be a better match?
>
> Well, indent, astyle and uncrustify clearly belong together.
> At the moment astyle is in pretty-print.scm and indent is alone in its
> own file, indent.scm.
>
> My suggestions:
>
> - Move indent to pretty-print.scm.
> - Move astyle, indent and uncrustify to code.scm.

I did the latter and pushed all this, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] 27.0.50; Error building master on MacOS
  2018-05-17 20:37 [bug#31485] [PATCH] gnu: Add uncrustify Pierre Neidhardt
  2018-05-18  6:50 ` Pierre Neidhardt
  2018-05-19 20:32 ` Ludovic Courtès
@ 2018-06-16  1:37 ` Paul Eggert
  2018-06-16 16:16   ` Ludovic Courtès
  2 siblings, 1 reply; 11+ messages in thread
From: Paul Eggert @ 2018-06-16  1:37 UTC (permalink / raw)
  To: John Mastro; +Cc: Andy Moreton, 31485-done

Thanks for reporting that; it should be fixed now.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] 27.0.50; Error building master on MacOS
  2018-06-16  1:37 ` [bug#31485] 27.0.50; Error building master on MacOS Paul Eggert
@ 2018-06-16 16:16   ` Ludovic Courtès
  2018-06-16 16:32     ` [bug#31485] bug#31845: " Paul Eggert
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2018-06-16 16:16 UTC (permalink / raw)
  To: Paul Eggert; +Cc: John Mastro, Andy Moreton, 31485

Hi Paul,

Paul Eggert <eggert@cs.ucla.edu> skribis:

> Thanks for reporting that; it should be fixed now.

I was glad to see your name on bug-guix, but it turns out you emailed
the wrong bug address.  :-)

  https://bugs.gnu.org/31485

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#31485] bug#31845: 27.0.50; Error building master on MacOS
  2018-06-16 16:16   ` Ludovic Courtès
@ 2018-06-16 16:32     ` Paul Eggert
  0 siblings, 0 replies; 11+ messages in thread
From: Paul Eggert @ 2018-06-16 16:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: John Mastro, Andy Moreton, 31485, 31845-done

Ludovic Courtès wrote:
> Hi Paul,
> 
> Paul Eggert <eggert@cs.ucla.edu> skribis:
> 
>> Thanks for reporting that; it should be fixed now.
> 
> I was glad to see your name on bug-guix, but it turns out you emailed
> the wrong bug address.  :-)
> 
>    https://bugs.gnu.org/31485

Sorry about that, and thanks for letting me know. Closing the correct bug number 
(31845) now.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-16 16:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 20:37 [bug#31485] [PATCH] gnu: Add uncrustify Pierre Neidhardt
2018-05-18  6:50 ` Pierre Neidhardt
2018-05-19 20:32 ` Ludovic Courtès
2018-05-19 22:41   ` Pierre Neidhardt
2018-05-20 12:31     ` Pierre Neidhardt
2018-05-20 20:31     ` Ludovic Courtès
2018-05-20 20:49       ` Pierre Neidhardt
2018-05-23 10:18         ` bug#31485: " Ludovic Courtès
2018-06-16  1:37 ` [bug#31485] 27.0.50; Error building master on MacOS Paul Eggert
2018-06-16 16:16   ` Ludovic Courtès
2018-06-16 16:32     ` [bug#31485] bug#31845: " Paul Eggert

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).