From fa84972de70ca6fb9fd2fbcb544af727f2d0e13e Mon Sep 17 00:00:00 2001 From: aurtzy Date: Wed, 7 May 2025 01:59:09 -0400 Subject: [PATCH] gnu: stb-*: Make it possible to translate descriptions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/stb.scm (define-stb-header-package): New macro. (stb-image, stb-image-resize2, stb-image-write, stb-rect-pack, stb-sprintf, stb-truetype): Use it. Change-Id: Ie7da51a2eb2dc91dff8d23e0d3c8397af3eb6d67 Signed-off-by: Ludovic Courtès --- gnu/packages/stb.scm | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/gnu/packages/stb.scm b/gnu/packages/stb.scm index 64375e7480583858d90c60a0e482e0e2bad02227..395959608d3d8835708a0fad922e4b927cba06c4 100644 --- a/gnu/packages/stb.scm +++ b/gnu/packages/stb.scm @@ -96,39 +96,43 @@ the C programming language.") #t)))) (description description))) -;; TODO: These descriptions are not translatable! They should be -;; converted to macros as outlined in . -(define-public stb-image - (make-stb-header-package - "stb-image" "2.30" +(define-syntax define-stb-header-package + (syntax-rules (description) + ((_ symbol name version (description text)) + (define-public symbol + (make-stb-header-package name version text))))) + +(define-stb-header-package stb-image + "stb-image" "2.30" + (description "stb-image is a small and self-contained library for image loading or decoding from file or memory. A variety of formats are supported.")) -(define-public stb-image-resize2 - (make-stb-header-package - "stb-image-resize2" "2.12" +(define-stb-header-package stb-image-resize2 + "stb-image-resize2" "2.12" + (description "stb-image-resize2 is a library that supports scaling and translation of images.")) -(define-public stb-image-write - (make-stb-header-package - "stb-image-write" "1.16" +(define-stb-header-package stb-image-write + "stb-image-write" "1.16" + (description "stb-image-write is a small library for writing image files to the C@tie{}@code{stdio} interface.")) -(define-public stb-rect-pack - (make-stb-header-package - "stb-rect-pack" "1.01" +(define-stb-header-package stb-rect-pack + "stb-rect-pack" "1.01" + (description "stb-rect-pack is a small rectangle packing library useful for, e.g., packing rectangular textures into an atlas. It does not do rotation.")) -(define-public stb-sprintf - (make-stb-header-package - "stb-sprintf" "1.10" +(define-stb-header-package stb-sprintf + "stb-sprintf" "1.10" + (description "stb-sprintf implements fast @code{sprintf}, @code{snprintf} for C/C++.")) -(define-public stb-truetype - (make-stb-header-package - "stb-truetype" "1.26" +(define-stb-header-package stb-truetype + "stb-truetype" "1.26" + (description "stb-truetype is a library for parsing, decoding, and rasterizing characters from TrueType fonts."))