[PATCH] gnu: astyle: Update to 3.5.

  • Done
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 9 months ago
(address . guix-patches@gnu.org)(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
bb8cefa0c6300a0590b01a129bba1b4138436c8b.1718304845.git.poptsov.artyom@gmail.com
* gnu/packages/code.scm (astyle): Update to 3.5.
[source]: Change source archive file name to match the upstream.
[arguments]: Remove "modules". Add "patch-makefile" phase to set
the C++ compiler to version c++17 as it is required for the build.
Simplify "install-more" file.

Change-Id: I8777710d723d22320c288c331645f8d61d5e640e
---
gnu/packages/code.scm | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)

Toggle diff (78 lines)
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index d6ac8178f3..44edf43db5 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2023 Fries <fries1234@protonmail.com>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -823,14 +824,14 @@ (define-public uncrustify
(define-public astyle
(package
(name "astyle")
- (version "3.4.8")
+ (version "3.5")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
- version "/astyle_" version "_linux.tar.gz"))
+ version "/astyle-" version ".tar.bz2"))
(sha256
- (base32 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
+ (base32 "0g4jyp47iz97ld9ac4wb5k59j4cs8dbw4dp8f32bwqx8pyvirz6y"))))
(build-system gnu-build-system)
(arguments
(list
@@ -839,11 +840,13 @@ (define-public astyle
#~(list (string-append "prefix=" #$output)
"INSTALL=install"
"release" "shared")
- #:modules '((guix build gnu-build-system) ;FIXME use %default-modules
- (guix build utils)
- (ice-9 regex))
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-makefile
+ (lambda _
+ (substitute* "build/gcc/Makefile"
+ (("CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c\\+\\+11")
+ "CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c++17"))))
(replace 'configure
(lambda _
(chdir "build/gcc")))
@@ -852,12 +855,6 @@ (define-public astyle
;; Libraries and headers aren't installed by default.
(let ((include (string-append #$output "/include"))
(lib (string-append #$output "/lib")))
- (define (link.so file strip-pattern)
- (symlink
- (basename file)
- (regexp-substitute #f
- (string-match strip-pattern file)
- 'pre)))
(mkdir-p include)
(copy-file "../../src/astyle.h"
(string-append include "/astyle.h"))
@@ -865,12 +862,7 @@ (define-public astyle
(for-each (lambda (l)
(copy-file
l (string-append lib "/" (basename l))))
- (find-files "bin" "^lib.*\\.so"))
- (for-each
- (lambda (file)
- (link.so file "(\\.[0-9]+){3}$") ;.so
- (link.so file "(\\.[0-9]+){2}$")) ;.so.3
- (find-files lib "lib.*\\.so\\..*"))))))))
+ (find-files "bin" "^lib.*\\.so"))))))))
(home-page "https://astyle.sourceforge.net/")
(synopsis "Source code indenter, formatter, and beautifier")
(description

base-commit: 7e00fb9f31f51ac2f9fa67b71a3eb8aaa23efdb6
--
2.45.1
Maxim Cournoyer wrote 9 months ago
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 71539-done@debbugs.gnu.org)
87frt384ms.fsf@gmail.com
Hi Artyom,

"Artyom V. Poptsov" <poptsov.artyom@gmail.com> writes:

Toggle quote (6 lines)
> * gnu/packages/code.scm (astyle): Update to 3.5.
> [source]: Change source archive file name to match the upstream.
> [arguments]: Remove "modules". Add "patch-makefile" phase to set
> the C++ compiler to version c++17 as it is required for the build.
> Simplify "install-more" file.

Nitpick, there is no hanging indent is for GNU ChangeLogs.

Toggle quote (50 lines)
> Change-Id: I8777710d723d22320c288c331645f8d61d5e640e
> ---
> gnu/packages/code.scm | 28 ++++++++++------------------
> 1 file changed, 10 insertions(+), 18 deletions(-)
>
> diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
> index d6ac8178f3..44edf43db5 100644
> --- a/gnu/packages/code.scm
> +++ b/gnu/packages/code.scm
> @@ -20,6 +20,7 @@
> ;;; Copyright © 2023 Fries <fries1234@protonmail.com>
> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
> ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
> +;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -823,14 +824,14 @@ (define-public uncrustify
> (define-public astyle
> (package
> (name "astyle")
> - (version "3.4.8")
> + (version "3.5")
> (source
> (origin
> (method url-fetch)
> (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
> - version "/astyle_" version "_linux.tar.gz"))
> + version "/astyle-" version ".tar.bz2"))
> (sha256
> - (base32 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
> + (base32 "0g4jyp47iz97ld9ac4wb5k59j4cs8dbw4dp8f32bwqx8pyvirz6y"))))
> (build-system gnu-build-system)
> (arguments
> (list
> @@ -839,11 +840,13 @@ (define-public astyle
> #~(list (string-append "prefix=" #$output)
> "INSTALL=install"
> "release" "shared")
> - #:modules '((guix build gnu-build-system) ;FIXME use %default-modules
> - (guix build utils)
> - (ice-9 regex))
> #:phases
> #~(modify-phases %standard-phases
> + (add-after 'unpack 'patch-makefile
> + (lambda _
> + (substitute* "build/gcc/Makefile"
> + (("CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c\\+\\+11")
> + "CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c++17"))))

That's breaking our max columns width of 80. I've broken the long
strings locally.

Toggle quote (31 lines)
> (replace 'configure
> (lambda _
> (chdir "build/gcc")))
> @@ -852,12 +855,6 @@ (define-public astyle
> ;; Libraries and headers aren't installed by default.
> (let ((include (string-append #$output "/include"))
> (lib (string-append #$output "/lib")))
> - (define (link.so file strip-pattern)
> - (symlink
> - (basename file)
> - (regexp-substitute #f
> - (string-match strip-pattern file)
> - 'pre)))
> (mkdir-p include)
> (copy-file "../../src/astyle.h"
> (string-append include "/astyle.h"))
> @@ -865,12 +862,7 @@ (define-public astyle
> (for-each (lambda (l)
> (copy-file
> l (string-append lib "/" (basename l))))
> - (find-files "bin" "^lib.*\\.so"))
> - (for-each
> - (lambda (file)
> - (link.so file "(\\.[0-9]+){3}$") ;.so
> - (link.so file "(\\.[0-9]+){2}$")) ;.so.3
> - (find-files lib "lib.*\\.so\\..*"))))))))
> + (find-files "bin" "^lib.*\\.so"))))))))
> (home-page "https://astyle.sourceforge.net/")
> (synopsis "Source code indenter, formatter, and beautifier")
> (description

The rest LGTM, assuming their build system now takes care of what we
used to be doing manually.

Applied locally, will push shortly.

--
Thanks,
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 71539@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71539
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help