guix_mirror_bot pushed a commit to branch master
in repository guix.
commit db3db06e6a1d8bb9bdba15c2818417992f99a692
Author: Rodion Goritskov <[email protected]>
AuthorDate: Sun Sep 20 09:16:21 2026 +0200
gnu: box2d: Generate pkg-config file.
Libreoffice build requires .pc file to be present. It is added in currently
unreleased versions of box2d, but for now let's create it manually.
* gnu/packages/game-development.scm (box2d):
[arguments]<phases>: Add pkg-config generation phase.
Relates-to: guix/guix!11370
Signed-off-by: Sharlatan Hellseher <[email protected]>
---
gnu/packages/game-development.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/game-development.scm
b/gnu/packages/game-development.scm
index d057305336a..7829786ce84 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -3850,7 +3850,24 @@ rigid body physics library written in C.")
(when tests?
(apply (assoc-ref gnu:%standard-phases 'check)
#:tests? tests? #:test-target "unit_test" args)
- (invoke "bin/unit_test")))))))
+ (invoke "bin/unit_test"))))
+ (add-after 'install 'generate-pkgconfig
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (pkgconfig-dir (string-append out "/lib/pkgconfig"))
+ (pc-file (string-append pkgconfig-dir "/box2d.pc")))
+ (mkdir-p pkgconfig-dir)
+ (with-output-to-file pc-file
+ (lambda ()
+ (format #t "prefix=~a~%" out)
+ (format #t "exec_prefix=${prefix}~%")
+ (format #t "libdir=${exec_prefix}/lib~%")
+ (format #t "includedir=${prefix}/include~%~%")
+ (format #t "Name: Box2D~%")
+ (format #t "Description: Box2D physics engine~%")
+ (format #t "Version: ~a~%" #$version)
+ (format #t "Libs: -L${libdir} -lbox2d~%")
+ (format #t "Cflags: -I${includedir}~%")))))))))
(native-inputs
(list doctest)) ;for tests
(inputs