(use-modules (gnu packages pretty-print) (gnu packages pkg-config) (guix packages) (guix gexp) (guix transformations) (guix build-system meson) ((guix licenses) #:select (gpl3+)) ((guix git-download) #:select (git-file-name)) (srfi srfi-26)) (define why-hello (package (name "why-hello") (version "0") (source (file-union (git-file-name name version) `(("hello.cpp" ,(plain-file "hello.cpp" "\ #include int main() { fmt::print (\"{}\\n\", \"Hello, world\"); return 0; } ")) ("meson.build" ,(plain-file "meson.build" "\ project('hello', 'cpp', default_options: ['cpp_std=c++20']) executable('hello', files('hello.cpp'), install: true, dependencies: [dependency('fmt')]) "))))) (build-system meson-build-system) (inputs (list fmt)) (native-inputs (list pkg-config)) (home-page (and=> (current-filename) (cute string-append "file://" <>))) (synopsis "Hello world") (description "This package provides a simple program that builds with GCC/G++ normally, but fails miserably when the clang-toolchain is used.") (license gpl3+))) (define why-hello-clang ((options->transformation '((with-c-toolchain . "why-hello=clang-toolchain"))) why-hello)) why-hello-clang