summaryrefslogtreecommitdiff
path: root/px/packages/cpp.scm
diff options
context:
space:
mode:
authorFranz Geffke <m@f-a.nz>2024-05-06 22:39:11 +0100
committerFranz Geffke <m@f-a.nz>2024-05-06 22:39:11 +0100
commit1e9c54f814a13be3c8d447e5dc89fe0721f29c89 (patch)
tree37b803c8e80d8b5f939fb8fe7c843c58e5294c1b /px/packages/cpp.scm
parent8b5041a7bda40c47e4fe9060e911c49e4d394bb5 (diff)
px: qr-code-generator: Added
Diffstat (limited to 'px/packages/cpp.scm')
-rw-r--r--px/packages/cpp.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/px/packages/cpp.scm b/px/packages/cpp.scm
new file mode 100644
index 0000000..73adf21
--- /dev/null
+++ b/px/packages/cpp.scm
@@ -0,0 +1,53 @@
+(define-module (px packages cpp)
+ #:use-module ((guix licenses)
+ #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix utils)
+ #:use-module (guix build-system cmake)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
+ #:use-module (ice-9 match))
+
+(define-public cpp-qr-code-generator
+ (package
+ (name "qr-code-generator")
+ (version "1.8.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/nayuki/QR-Code-generator/archive/refs/tags/v"
+ version ".tar.gz"))
+ (sha256
+ (base32 "0q5f6iywzi8hzvpjnzd5rymkkqaz5pa77x7a5sa1qlkg7p9s9h1f"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases
+ ;; The build scripts are are in cpp/.
+ (modify-phases %standard-phases
+ (add-after 'unpack 'pre-configure
+ (lambda _
+ (chdir "cpp")))
+ ;; The source does not have a ./configure script.
+ (delete 'configure)
+ (replace 'install
+ ;; The Makefile lacks an ‘install’ target.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib (string-append out "/lib"))
+ (include (string-append out "/include")))
+ (mkdir-p lib)
+ (mkdir-p include)
+ (install-file "qrcodegen.hpp" include)
+ (install-file "qrcodegen.cpp" include)
+ (install-file "qrcodegen.o" lib)
+ (install-file "libqrcodegencpp.a" lib)
+ #t))))))
+ (home-page "https://github.com/nayuki/QR-Code-generator")
+ (synopsis "High-quality QR Code generator library - C++ version")
+ (description
+ "This project aims to be the best, clearest QR Code generator library
+in multiple languages.")
+ (license license:expat))) \ No newline at end of file