diff options
author | 宋文武 <iyzsong@member.fsf.org> | 2025-04-19 07:42:35 +0800 |
---|---|---|
committer | 宋文武 <iyzsong@member.fsf.org> | 2025-04-27 08:45:33 +0800 |
commit | 0af911f68211d17b00da17f03a8ce9a693cb2c32 (patch) | |
tree | 803ca4592b0f6232373851d76e75acfeac31c545 | |
parent | b055afaaf38d38f00f1ea2ecd664774b3e1bc7c1 (diff) | |
download | guix-0af911f68211d17b00da17f03a8ce9a693cb2c32.tar.gz guix-0af911f68211d17b00da17f03a8ce9a693cb2c32.zip |
gnu: Add sdl2-compat.
* gnu/packages/sdl.scm (sdl2-compat): New variable.
Change-Id: I57eae86fc14224f08c42f079b9e271509e855166
-rw-r--r-- | gnu/packages/sdl.scm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm index c23614745c..567f2615e7 100644 --- a/gnu/packages/sdl.scm +++ b/gnu/packages/sdl.scm @@ -201,6 +201,46 @@ hardware.") vulkan-loader wayland-protocols)))) +(define-public sdl2-compat + (package + (name "sdl2-compat") + (version "2.32.54") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/libsdl-org/sdl2-compat") + (commit (string-append "release-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ijpx62b9syypxxnwvggz4l5fmrgln95ka180am9g2hgyqkqlj5n")))) + (build-system cmake-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'qualify-libsdl3 + (lambda _ + (substitute* "src/sdl2_compat.c" + (("libSDL3[.]so[.]0") + (string-append #$(this-package-input "sdl3") + "/lib/libSDL3.so.0"))))) + (add-after 'install 'install-sdl2.pc + (lambda _ + (let ((pcdir (string-append #$output + "/lib/pkgconfig"))) + (symlink (string-append pcdir "/sdl2-compat.pc") + (string-append pcdir "/sdl2.pc")))))))) + (inputs (list sdl3)) + (propagated-inputs (list libx11)) ;required by SDL_syswm.h + (synopsis "Compatibility layer for the SDL2 game development library") + (description "Simple DirectMedia Layer is a cross-platform development library +designed to provide low level access to audio, keyboard, mouse, joystick, and +graphics hardware. This package is a compatibility layer; it provides a binary and +source compatible API for programs written against SDL2, but it uses SDL3 behind the +scenes.") + (home-page "https://libsdl.org/") + (license license:zlib))) + (define-public sdl12-compat (package (name "sdl12-compat") |