(define-module (refl-cpp) #:use-module (guix build-system cmake) #:use-module (guix git-download) #:use-module ((guix licenses) :prefix license:) #:use-module (guix packages)) ;; DATA LAYER (define refl-cpp-description-lines (list "refl-cpp is a header-only library which provides compile-time " "reflection and introspection capabilities to C++. By encoding type " "metadata in the type system, refl-cpp allows you to process types and " "their fields and functions via constexpr and template " "metaprogramming.")) (define refl-cpp-git-reference-url "https://github.com/veselink1/refl-cpp.git") (define refl-cpp-hash "021aggcrh92ircxrk8g375czz5njn62h502arn265d672kn05nrq") (define refl-cpp-home-page "https://veselink1.github.io/refl-cpp/md__introduction.html") (define refl-cpp-name "refl-cpp") (define refl-cpp-synopsis "Static reflection for C++17") (define refl-cpp-tests #f) (define refl-cpp-version "v0.12.4") ;; ABSTRACTION LAYER -3 (define patch-install-rules `(lambda _ (substitute* "cmake/install-rules.cmake" (("include\\/refl-cpp") "include")))) ;; ABSTRACTION LAYER -2 (define expose-header-file `(add-after 'unpack 'expose-header ,patch-install-rules)) ;; ABSTRACTION LAYER -1 (define refl-cpp-content-hash (content-hash (base32 refl-cpp-hash))) (define refl-cpp-git-reference (git-reference (url refl-cpp-git-reference-url) (commit refl-cpp-version))) (define refl-cpp-phases `(modify-phases %standard-phases ,expose-header-file)) ;; ABSTRACTION LAYER 0 (define refl-cpp-arguments (list #:phases refl-cpp-phases #:tests? refl-cpp-tests)) (define refl-cpp-description (string-concatenate refl-cpp-description-lines)) (define refl-cpp-origin (origin (uri refl-cpp-git-reference) (method git-fetch) (hash refl-cpp-content-hash))) ;; SURFACE LAYER (define-public refl-cpp (package (name refl-cpp-name) (version refl-cpp-version) (source refl-cpp-origin) (build-system cmake-build-system) (arguments refl-cpp-arguments) (synopsis refl-cpp-synopsis) (description refl-cpp-description) (license license:expat) (home-page refl-cpp-home-page)))