diff mbox series

[bug#70035,4/8] gnu: Add pystring.

Message ID d5027278f67f0259d6d3d8ff89d2d40f439e3015.1711551246.git.monego@posteo.net
State New
Headers show
Series Update and cleanup ASWF tools. | expand

Commit Message

Vinicius Monego March 27, 2024, 5:17 p.m. UTC
* gnu/packages/cpp.scm (pystring): New variable.

Change-Id: Ifff1ae3d3ed8ec880a2dd098d6d81de28d7bdda6
---
 gnu/packages/cpp.scm | 41 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index acbe3e4836..02445eecea 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@ 
 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2020, 2021, 2023, 2024 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
-;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021, 2022, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
@@ -477,6 +477,45 @@  (define-public rct
       (license (list license:expat        ; cJSON
                      license:bsd-4)))))   ; everything else (LICENSE.txt)
 
+(define-public pystring
+  (package
+    (name "pystring")
+    (version "1.1.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/imageworks/pystring")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "0h12x24skrlx4fv0k5vl8wnar8gi6bq091yp93awkwsbnm8qwkzd"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:tests? #f
+           #:phases
+           #~(modify-phases %standard-phases
+               ;; The install phase doesn't install the header
+               (add-after 'install 'install-header
+                 (lambda _
+                   (mkdir-p (string-append #$output "/include"))
+                   (copy-file
+                    (string-append #$(package-source this-package)
+                                   "/pystring.h")
+                    (string-append #$output
+                                   "/include/pystring.h")))))))
+    (native-inputs (list pkg-config))
+    (home-page "https://github.com/aseba-community/dashel")
+    (synopsis "C++ functions matching the Python string methods")
+    (description
+     "Pystring is a collection of C++ functions which match the interface and
+behavior of Python's string class methods using std::string.  Implemented in
+C++, it does not require or make use of a python interpreter.  It provides
+convenience and familiarity for common string operations not included in the
+standard C++ library. It's also useful in environments where both C++ and
+Python are used.")
+    (license license:bsd-3)))
+
 (define-public dashel
   (package
     (name "dashel")