[bug#72569,2/4] gnu: Add sort-h.
Commit Message
From 0af97f6bab6c523903c075b2578245fc280e6613 Mon Sep 17 00:00:00 2001
Message-ID: <0af97f6bab6c523903c075b2578245fc280e6613.1723353069.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1723353069.git.adam.faiz@disroot.org>
References: <cover.1723353069.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 11 Aug 2024 08:41:05 +0800
Subject: [PATCH 2/4] gnu: Add sort-h.
* gnu/packages/c.scm (sort-h): New variable.
---
gnu/packages/c.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
Comments
Am Sonntag, dem 11.08.2024 um 13:17 +0800 schrieb Adam Faiz:
> +(define-public sort-h
> + ;; The latest commit is used as there is no release.
> + (let ((commit "24f5b8b13810ad130109c7b56daf8e99ab0fe1b8")
> + (revision "0"))
> + (package
> + (name "sort-h")
I'd call this one c-template-sort, after the "subject" on Github.
> + (version (git-version "0.0.0" revision commit))
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/swenson/sort")
> + (commit commit)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> +
> "0q3pgw51rjq7pb6gc7zx9i48pckyl930lcab4ngxrpa5a8flq850"))
> + (modules '((guix build utils)))
> + (snippet
> + #~(begin
> + (substitute* "Makefile"
> + (("^demo:" all)
> + (string-append
> + "install:\n\t"
> + "install -d $(DESTDIR)$(PREFIX)/include\n\t"
> + "install sort.h
> $(DESTDIR)$(PREFIX)/include\n\t"
> + "install sort_extra.h
> $(DESTDIR)$(PREFIX)/include\n\n"
> + all)))))))
Note: this package might be a better fit for copy-build-system. You
can still have a check phase, but I think you'll benefit from the
install plan.
> + (build-system gnu-build-system)
> + (arguments
> + (list
> + #:make-flags
> + #~(list
> + (string-append "CC=" #$(cc-for-target))
> + (string-append "PREFIX=" #$output))
> + #:test-target "test"
> + #:phases
> + #~(modify-phases %standard-phases
> + (delete 'configure)
> + (delete 'build))))
> + (home-page "https://github.com/swenson/sort")
> + (synopsis "C implementation of many sorting algorithms")
> + (description "@code{sort.h} is an implementation of a ton of
> sorting
> +algorithms in C with a user-defined type that is provided at include
> time.")
I'd say something like "This package provides a header-only C library,
that implements several sorting algorithms. It is configured using
macros and supports user-defined types."
Cheers
@@ -695,6 +695,51 @@ (define-public sfsexp
expressions.")
(license license:lgpl2.1+)))
+(define-public sort-h
+ ;; The latest commit is used as there is no release.
+ (let ((commit "24f5b8b13810ad130109c7b56daf8e99ab0fe1b8")
+ (revision "0"))
+ (package
+ (name "sort-h")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/swenson/sort")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q3pgw51rjq7pb6gc7zx9i48pckyl930lcab4ngxrpa5a8flq850"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (substitute* "Makefile"
+ (("^demo:" all)
+ (string-append
+ "install:\n\t"
+ "install -d $(DESTDIR)$(PREFIX)/include\n\t"
+ "install sort.h $(DESTDIR)$(PREFIX)/include\n\t"
+ "install sort_extra.h $(DESTDIR)$(PREFIX)/include\n\n"
+ all)))))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:make-flags
+ #~(list
+ (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output))
+ #:test-target "test"
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'build))))
+ (home-page "https://github.com/swenson/sort")
+ (synopsis "C implementation of many sorting algorithms")
+ (description "@code{sort.h} is an implementation of a ton of sorting
+algorithms in C with a user-defined type that is provided at include time.")
+ (license license:expat))))
+
(define-public sparse
(package
(name "sparse")