From 110f6962f309ac3a7cb858210eed31b1098514f8 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 2 Feb 2023 14:27:13 -0500 Subject: [PATCH 2/4] gnu: Add minifb. * gnu/packages/graphics.scm (minifb): New variable. --- gnu/packages/graphics.scm | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index ebf571d93e..1c5f429084 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -34,6 +34,7 @@ ;;; Copyright © 2022 Paul A. Patience ;;; Copyright © 2022 dan ;;; Copyright © 2023 Sharlatan Hellseher +;;; Copyright © 2023 David Thompson ;;; ;;; This file is part of GNU Guix. ;;; @@ -234,6 +235,49 @@ (define-public directfb (home-page "https://github.com/deniskropp/DirectFB") (license license:lgpl2.1+))) +(define-public minifb + (let ((commit "43f8c1309341f4709a471b592d04434326042483") + (revision "1")) + (package + (name "minifb") + (version (git-version "0" revision commit)) + (source (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/emoon/minifb") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1z0720azsgi83yg4ysmfvpvsg0566s2cq59xx52w8w5rpkla4cjh")))) + (build-system cmake-build-system) + (arguments + '(#:configure-flags '("-DMINIFB_BUILD_EXAMPLES=0") + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (includedir (string-append out "/include")) + (libdir (string-append out "/lib"))) + (mkdir-p includedir) + (mkdir-p libdir) + (for-each (lambda (header) + (copy-file header + (string-append includedir "/" + (basename header)))) + (find-files "../source/include" "\\.h$")) + (copy-file "libminifb.a" (string-append libdir "/libminifb.a")))))) + ;; No check target. + #:tests? #f)) + ;; libminifb.a won't work without these libraries, so propagate them. + (propagated-inputs (list libx11 libxkbcommon mesa)) + (synopsis "Small library for rendering pixels to a framebuffer") + (description "MiniFB (Mini FrameBuffer) is a small, cross-platform +library that makes it easy to render (32-bit) pixels in a window.") + (home-page "https://github.com/emoon/minifb") + (license license:expat)))) + (define-public flux (package (name "flux") -- 2.39.1