summaryrefslogtreecommitdiff
path: root/guix.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2024-10-02 21:22:19 -0400
committerDavid Thompson <dthompson2@worcester.edu>2024-10-19 21:49:01 -0400
commit9b1d91b4c68477145434021ea7392c16d849ebaa (patch)
tree3e6c3934c530d4cc79a85adc95729f8da2af61c3 /guix.scm
First commit!main
Diffstat (limited to 'guix.scm')
-rw-r--r--guix.scm149
1 files changed, 149 insertions, 0 deletions
diff --git a/guix.scm b/guix.scm
new file mode 100644
index 0000000..8e39021
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1,149 @@
+;;; guile-sdl3 --- FFI bindings for SDL3
+;;; Copyright © 2024 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; This file is part of guile-sdl3.
+;;;
+;;; Guile-sdl3 is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU Lesser General Public License as
+;;; published by the Free Software Foundation; either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Guile-sdl3 is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with guile-sdl3. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; GNU Guix development package. To build and install, run:
+;;
+;; guix package -f guix.scm
+;;
+;; To use as the basis for a development environment, run:
+;;
+;; guix shell
+;;
+;;; Code:
+
+(use-modules (gnu packages)
+ (gnu packages autotools)
+ (gnu packages fcitx)
+ (gnu packages freedesktop)
+ (gnu packages glib)
+ (gnu packages guile)
+ (gnu packages ibus)
+ (gnu packages linux)
+ (gnu packages pkg-config)
+ (gnu packages pulseaudio)
+ (gnu packages sdl)
+ (gnu packages texinfo)
+ (gnu packages vulkan)
+ (gnu packages xdisorg)
+ (gnu packages xorg)
+ (guix build-system cmake)
+ (guix build-system gnu)
+ (guix gexp)
+ (guix git)
+ (guix git-download)
+ ((guix licenses) #:prefix license:)
+ (guix packages))
+
+(define sdl3
+ (let ((commit "596fcfa6c4fd20e5a952c0a1b0147f2fa9f69198")
+ (revision "1"))
+ (package
+ (inherit sdl2)
+ (name "sdl3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/libsdl-org/SDL")
+ (commit commit)))
+ (sha256
+ (base32
+ "0f3dx1r92crkf3l0iyf8rbmzba06dpcy90vha39i1jvdmifhyqbs"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:tests? #f
+ #:configure-flags
+ #~(list "-DSDL_KMSDRM=ON"
+ "-DSDL_ALSA_SHARED=OFF"
+ "-DSDL_PULSEAUDIO_SHARED=OFF"
+ "-DSDL_PIPEWIRE_SHARED=OFF"
+ "-DSDL_X11_SHARED=OFF"
+ "-DSDL_WAYLAND_SHARED=OFF"
+ "-DSDL_WAYLAND_LIBDECOR_SHARED=OFF"
+ "-DSDL_KMSDRM_SHARED=OFF"
+ (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,"
+ #$(this-package-input "eudev") "/lib"
+ ",-rpath,"
+ #$(this-package-input "vulkan-loader") "/lib"))))
+ (propagated-inputs
+ (list
+ alsa-lib
+ libxcursor ;enables X11 cursor support
+ libxkbcommon
+ libxrandr
+ pipewire
+ pulseaudio
+ wayland))
+ (inputs
+ (list
+ dbus
+ eudev ;for discovering input devices
+ fcitx
+ glib
+ ibus-minimal
+ libdecor
+ vulkan-loader
+ wayland-protocols)))))
+
+(define guile-bstruct
+ (let ((commit "3186036e116d3e885eae3970e0cad77289d922fd")
+ (revision "1"))
+ (package
+ (name "guile-bstruct")
+ (version "0.1.0-git")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.dthompson.us/guile-bstruct.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "0128p1wdiad1sfifaa40w45899pii4mpw30aw3h1rc1dsgm6288m"))))
+ (build-system gnu-build-system)
+ (native-inputs (list automake autoconf pkg-config texinfo))
+ (inputs (list guile-3.0-latest))
+ (synopsis "Efficient binary structures for Guile")
+ (description "Guile-bstruct provides an efficient implementation of low-level binary
+structures for Guile Scheme.")
+ (home-page "https://dthompson.us/projects/guile-bstruct.html")
+ (license license:asl2.0))))
+
+(package
+ (name "guile-sdl3")
+ (version "0.1.0")
+ (source (git-checkout (url (dirname (current-filename)))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:make-flags '("GUILE_AUTO_COMPILE=0")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'bootstrap
+ (lambda _ (invoke "sh" "bootstrap"))))))
+ (native-inputs (list autoconf automake pkg-config texinfo))
+ (inputs (list guile-3.0-latest sdl3))
+ (propagated-inputs (list guile-bstruct))
+ (synopsis "Guile bindings for SDL3")
+ (description "Guile-SDL3 provides pure Guile Scheme bindings to the SDL3 C shared
+library via the foreign function interface.")
+ (home-page "https://git.dthompson.us/guile-sdl3.git")
+ (license license:asl2.0))