diff options
| author | Sergio Pastor Pérez <sergio.pastorperez@outlook.es> | 2025-03-19 18:00:01 +0100 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-03-26 21:47:28 +0100 |
| commit | 51f0c29f9e1783075c07ff1190e09c688c24da1d (patch) | |
| tree | 3bded0d4eaaa7d4daa64eb8bb5333c235714362d /gnu/packages/cpp.scm | |
| parent | d1fc0b5840ddd987f8a0941d3888842051070a1c (diff) | |
gnu: Add miniaudio.
* gnu/packages/cpp.scm (miniaudio): New variable.
Change-Id: I27b74793dd7b80af4437e0a1b997cc87fe8822e5
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/cpp.scm')
| -rw-r--r-- | gnu/packages/cpp.scm | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 30de21a214d..a0f65e19a37 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -1958,6 +1958,66 @@ Google's C++ code base.") #~(cons* "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" (delete "-DBUILD_SHARED_LIBS=ON" #$flags))))))))) +(define-public miniaudio + (package + (name "miniaudio") + (version "0.11.22") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mackron/miniaudio") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1pjaiq71x24n9983vkhjxrsbraa24053h727db22b1rb2xyfrzm3")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'build) + (delete 'configure) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "tests/_build" + (let ((tests '("conversion" "filtering" "generation"))) + (mkdir "bin") + ;; Compile tests + (for-each (lambda (test) + (invoke "gcc" + (string-append "../" test "/" test + ".c") + "-o" + (string-append "bin/" test) + "-ldl" + "-lm" + "-lpthread" + "-Wall" + "-Wextra" + "-Wpedantic") + (let ((bin (string-append "./bin/" test))) + (if (string= test "filtering") + ;; NOTE: the 'filtering' test + ;; requires an input file. + (invoke bin bin) + (invoke bin)))) + tests)))))) + (replace 'install + (lambda _ + (install-file "miniaudio.h" + (string-append #$output "/include")) + (copy-recursively "extras" + (string-append #$output + "/include/extras/"))))))) + (home-page "https://miniaud.io") + (synopsis "Audio playback and capture library for C and C++") + (description + "Miniaudio is an audio playback and capture library for C and C++. It is +made up of a single source file and has no external dependencies.") + (license license:expat))) + (define-public abseil-cpp-cxxstd17 (abseil-cpp-for-c++-standard abseil-cpp 17)) ;XXX: the default with GCC 11? |
