mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
gnu: sdl: Replace with sdl12-compat.
* gnu/packages/sdl.scm (sdl12-compat): New package. (sdl): Remove package, defined as sdl12-compat. (sdl2): Don't inherit from sdl. (propagated-inputs-with-sdl2): Add case for sdl12-compat. * gnu/packages/patches/sdl-libx11-1.6.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Unregister it. Change-Id: I843d349b3d69164cc640c7db204464a51819a0df Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
6f057dfd8f
commit
31584128b7
3 changed files with 110 additions and 87 deletions
|
@ -2132,7 +2132,6 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/scons-test-environment.patch \
|
%D%/packages/patches/scons-test-environment.patch \
|
||||||
%D%/packages/patches/screen-hurd-path-max.patch \
|
%D%/packages/patches/screen-hurd-path-max.patch \
|
||||||
%D%/packages/patches/scsh-nonstring-search-path.patch \
|
%D%/packages/patches/scsh-nonstring-search-path.patch \
|
||||||
%D%/packages/patches/sdl-libx11-1.6.patch \
|
|
||||||
%D%/packages/patches/seed-webkit.patch \
|
%D%/packages/patches/seed-webkit.patch \
|
||||||
%D%/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch \
|
%D%/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch \
|
||||||
%D%/packages/patches/sendgmail-remove-domain-restriction.patch \
|
%D%/packages/patches/sendgmail-remove-domain-restriction.patch \
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
Update _XData32 declaration in SDL_x11sym.h to match that of libx11 1.6.
|
|
||||||
|
|
||||||
--- SDL-1.2.15/src/video/x11/SDL_x11sym.h.~1~ 2012-01-19 01:30:06.000000000 -0500
|
|
||||||
+++ SDL-1.2.15/src/video/x11/SDL_x11sym.h 2014-12-26 00:22:36.445067694 -0500
|
|
||||||
@@ -165,7 +165,7 @@
|
|
||||||
*/
|
|
||||||
#ifdef LONG64
|
|
||||||
SDL_X11_MODULE(IO_32BIT)
|
|
||||||
-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
|
|
||||||
+SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
|
|
||||||
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ (define-module (gnu packages sdl)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (guix git-download)
|
#:use-module (guix git-download)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
|
#:use-module (guix build-system cmake)
|
||||||
#:use-module (guix build-system copy)
|
#:use-module (guix build-system copy)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (guix build-system trivial)
|
#:use-module (guix build-system trivial)
|
||||||
|
@ -67,56 +68,8 @@ (define-module (gnu packages sdl)
|
||||||
#:use-module (gnu packages xorg)
|
#:use-module (gnu packages xorg)
|
||||||
#:export (sdl-union))
|
#:export (sdl-union))
|
||||||
|
|
||||||
(define-public sdl
|
|
||||||
(package
|
|
||||||
(name "sdl")
|
|
||||||
(version "1.2.15")
|
|
||||||
(source (origin
|
|
||||||
(method url-fetch)
|
|
||||||
(uri
|
|
||||||
(string-append "https://libsdl.org/release/SDL-"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(sha256
|
|
||||||
(base32
|
|
||||||
"005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))
|
|
||||||
(patches (search-patches "sdl-libx11-1.6.patch"))))
|
|
||||||
(build-system gnu-build-system)
|
|
||||||
(arguments
|
|
||||||
'(;; Explicitly link against shared libraries instead of dlopening them.
|
|
||||||
;; For X11, ALSA, and PulseAudio.
|
|
||||||
;; OpenGL library is still dlopened at runtime.
|
|
||||||
#:configure-flags '("--disable-alsa-shared"
|
|
||||||
"--disable-pulseaudio-shared"
|
|
||||||
"--disable-x11-shared"
|
|
||||||
;; Explicitly link with mesa.
|
|
||||||
;; This add mesa to libsdl's RUNPATH, to make dlopen
|
|
||||||
;; finding the libGL from mesa at runtime.
|
|
||||||
"LDFLAGS=-lGL")
|
|
||||||
|
|
||||||
#:make-flags '("V=1") ;build verbosely
|
|
||||||
|
|
||||||
#:tests? #f)) ; no check target
|
|
||||||
(propagated-inputs
|
|
||||||
;; SDL headers include X11 headers.
|
|
||||||
(list libx11
|
|
||||||
libcap ; 'libSDL.la' contain `-lcap'.
|
|
||||||
;; TODO: Since building Mesa with Meson it is now necessary that Mesa is
|
|
||||||
;; a propogated input. We still need to figure out why, possibly due to a
|
|
||||||
;; change in pkg-config.
|
|
||||||
mesa))
|
|
||||||
(native-inputs (list pkg-config))
|
|
||||||
(inputs (list libxrandr glu alsa-lib pulseaudio))
|
|
||||||
(outputs '("out" "debug"))
|
|
||||||
(synopsis "Cross platform 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.")
|
|
||||||
(home-page "https://libsdl.org/")
|
|
||||||
(license license:lgpl2.1)))
|
|
||||||
|
|
||||||
(define-public sdl2
|
(define-public sdl2
|
||||||
(package
|
(package
|
||||||
(inherit sdl)
|
|
||||||
(name "sdl2")
|
(name "sdl2")
|
||||||
(version "2.30.1")
|
(version "2.30.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
|
@ -127,39 +80,121 @@ (define-public sdl2
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0fj7gxc7rlzzrafnx9nmf7ws3paxy583fmx7bcbavi6gr3xmy881"))))
|
"0fj7gxc7rlzzrafnx9nmf7ws3paxy583fmx7bcbavi6gr3xmy881"))))
|
||||||
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments (package-arguments sdl)
|
(list
|
||||||
((#:configure-flags flags)
|
#:tests? #f ;no check target
|
||||||
#~(append '("--disable-wayland-shared" "--enable-video-kmsdrm"
|
;; Explicitly link against shared libraries instead of dlopening them.
|
||||||
"--disable-kmsdrm-shared")
|
;; For X11, ALSA, and PulseAudio.
|
||||||
#$flags))
|
;; OpenGL library is still dlopened at runtime.
|
||||||
((#:make-flags flags ''())
|
#:configure-flags
|
||||||
#~(cons*
|
#~(append
|
||||||
;; SDL dlopens libudev and libvulkan, so make sure they are in
|
'("--disable-wayland-shared"
|
||||||
;; rpath. This overrides the LDFLAG set in sdl’s configure-flags,
|
"--enable-video-kmsdrm"
|
||||||
;; which isn’t necessary as sdl2 includes Mesa by default.
|
"--disable-kmsdrm-shared")
|
||||||
(string-append "LDFLAGS=-Wl,-rpath,"
|
'("--disable-alsa-shared"
|
||||||
#$(this-package-input "eudev") "/lib"
|
"--disable-pulseaudio-shared"
|
||||||
",-rpath,"
|
"--disable-x11-shared"
|
||||||
#$(this-package-input "vulkan-loader") "/lib")
|
;; Explicitly link with mesa.
|
||||||
#$flags))))
|
;; This add mesa to libsdl's RUNPATH, to make dlopen
|
||||||
|
;; finding the libGL from mesa at runtime.
|
||||||
|
"LDFLAGS=-lGL"))
|
||||||
|
#:make-flags
|
||||||
|
#~(cons*
|
||||||
|
;; SDL dlopens libudev and libvulkan, so make sure they are in
|
||||||
|
;; rpath. This overrides the LDFLAG set in sdl’s configure-flags,
|
||||||
|
;; which isn’t necessary as sdl2 includes Mesa by default.
|
||||||
|
(string-append "LDFLAGS=-Wl,-rpath,"
|
||||||
|
#$(this-package-input "eudev") "/lib"
|
||||||
|
",-rpath,"
|
||||||
|
#$(this-package-input "vulkan-loader") "/lib")
|
||||||
|
'("V=1")))) ;build verbosely
|
||||||
|
(propagated-inputs
|
||||||
|
;; SDL headers include X11 headers.
|
||||||
|
(list libx11
|
||||||
|
libcap ; 'libSDL.la' contain `-lcap'.
|
||||||
|
;; TODO: Since building Mesa with Meson it is now necessary that Mesa is
|
||||||
|
;; a propogated input. We still need to figure out why, possibly due to a
|
||||||
|
;; change in pkg-config.
|
||||||
|
mesa))
|
||||||
|
(native-inputs (list pkg-config))
|
||||||
(inputs
|
(inputs
|
||||||
;; SDL2 needs to be built with ibus support otherwise some systems
|
;; SDL2 needs to be built with ibus support otherwise some systems
|
||||||
;; experience a bug where input events are doubled.
|
;; experience a bug where input events are doubled.
|
||||||
;;
|
;;
|
||||||
;; For more information, see: https://dev.solus-project.com/T1721
|
;; For more information, see: https://dev.solus-project.com/T1721
|
||||||
(modify-inputs (package-inputs sdl)
|
(list
|
||||||
(append dbus
|
libxrandr
|
||||||
eudev ;for discovering input devices
|
glu
|
||||||
glib
|
alsa-lib
|
||||||
ibus-minimal
|
pulseaudio
|
||||||
libxkbcommon
|
dbus
|
||||||
libxcursor ;enables X11 cursor support
|
eudev ;for discovering input devices
|
||||||
vulkan-loader
|
glib
|
||||||
wayland
|
ibus-minimal
|
||||||
wayland-protocols)))
|
libxkbcommon
|
||||||
|
libxcursor ;enables X11 cursor support
|
||||||
|
vulkan-loader
|
||||||
|
wayland
|
||||||
|
wayland-protocols))
|
||||||
|
(outputs '("out" "debug"))
|
||||||
|
(synopsis "Cross platform 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.")
|
||||||
|
(home-page "https://libsdl.org/")
|
||||||
(license license:bsd-3)))
|
(license license:bsd-3)))
|
||||||
|
|
||||||
|
(define-public sdl12-compat
|
||||||
|
(package
|
||||||
|
(name "sdl12-compat")
|
||||||
|
(version "1.2.68")
|
||||||
|
(source (origin
|
||||||
|
(method git-fetch)
|
||||||
|
(uri (git-reference
|
||||||
|
(url "https://github.com/libsdl-org/sdl12-compat")
|
||||||
|
(commit (string-append "release-" version))))
|
||||||
|
(file-name (git-file-name name version))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"0qsjlzi1wqszi6k4pc3k9xdvzid5cx6ql8wbjw6qdapzpvf6arvz"))))
|
||||||
|
(build-system cmake-build-system)
|
||||||
|
(arguments
|
||||||
|
(list #:tests? #f ;no check target
|
||||||
|
#:configure-flags
|
||||||
|
;; This add SDL2 to sdl12-compat's RUNPATH, to make dlopen finding the
|
||||||
|
;; libSDL2 at runtime.
|
||||||
|
#~'("-DCMAKE_SHARED_LINKER_FLAGS=-lSDL2")
|
||||||
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'patch-sdl-config
|
||||||
|
(lambda _
|
||||||
|
;; Keep the old behaviour to honour "--prefix" option for
|
||||||
|
;; "--cflags" and "--libs", required by 'perl-alien-sdl'.
|
||||||
|
(substitute* "sdl-config.in"
|
||||||
|
(("echo -I[$][{]includedir[}]") "echo -I${prefix}/include")
|
||||||
|
(("echo -L[$][{]libdir[}]") "echo -L${prefix}/lib"))))
|
||||||
|
(add-after 'install 'install-sdl.pc
|
||||||
|
(lambda _
|
||||||
|
(let ((pcdir (string-append #$output
|
||||||
|
"/lib/pkgconfig")))
|
||||||
|
(symlink (string-append pcdir "/sdl12_compat.pc")
|
||||||
|
(string-append pcdir "/sdl.pc"))))))))
|
||||||
|
(inputs (list sdl2))
|
||||||
|
(propagated-inputs (list glu)) ;required by SDL_opengl.h
|
||||||
|
(synopsis "Cross platform 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 SDL 1.2, but it uses SDL 2.0
|
||||||
|
behind the scenes.")
|
||||||
|
(home-page "https://libsdl.org/")
|
||||||
|
;; dr_mp3 code are under public domain.
|
||||||
|
(license (list license:zlib license:public-domain))))
|
||||||
|
|
||||||
|
(define-public sdl sdl12-compat)
|
||||||
|
|
||||||
(define-public sdl2-2.0
|
(define-public sdl2-2.0
|
||||||
(package
|
(package
|
||||||
(inherit sdl2)
|
(inherit sdl2)
|
||||||
|
@ -452,6 +487,8 @@ (define (propagated-inputs-with-sdl2 package)
|
||||||
(map (match-lambda
|
(map (match-lambda
|
||||||
(("sdl" _)
|
(("sdl" _)
|
||||||
`("sdl2" ,sdl2))
|
`("sdl2" ,sdl2))
|
||||||
|
(("sdl12-compat" _)
|
||||||
|
`("sdl2" ,sdl2))
|
||||||
(other other))
|
(other other))
|
||||||
(package-propagated-inputs package)))
|
(package-propagated-inputs package)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue