summaryrefslogtreecommitdiff
path: root/gnu/packages/emulators.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-09-27 22:20:27 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-10-07 01:20:21 +0900
commit9875fbfeba8ce0ad7916c03365eded648bbb0275 (patch)
treecb37f841eafa5499649d1663b66c35a502cb7bd5 /gnu/packages/emulators.scm
parent6be4c3feb16faa234a5073a342e340b377671dfa (diff)
gnu: retroarch: Reduce bundled libraries to a minimum.
* gnu/packages/emulators.scm (retroarch) [source]: Add snippet removing most bundled sources. Apply patch to allow using system SPIRV-Cross. [phases] <configure>: Add --disable-builtinspirv_cross. Disable non-core features making use of bundled libraries (7zip, cheevos crtswitchres, discord, dr_mp3, ixbm, stb_font, stb_image, stb_vorbis and xdelta). [inputs]: Add spirv-cross. [license]: Add licenses of bundled sources. * gnu/packages/patches/retroarch-unbundle-spirv-cross.patch: New file. Change-Id: I824391424bf0fa2ec3888f02535b94dea3021378
Diffstat (limited to 'gnu/packages/emulators.scm')
-rw-r--r--gnu/packages/emulators.scm52
1 files changed, 49 insertions, 3 deletions
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index d984b7d5293..35a7e845d34 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -1587,9 +1587,38 @@ physical device and the RetroPad virtual controller.")
1587 (uri (git-reference 1587 (uri (git-reference
1588 (url "https://github.com/libretro/RetroArch") 1588 (url "https://github.com/libretro/RetroArch")
1589 (commit (string-append "v" version)))) 1589 (commit (string-append "v" version))))
1590 (snippet
1591 #~(begin
1592 (use-modules (guix build utils)
1593 (ice-9 ftw)
1594 (srfi srfi-26))
1595 ;; XXX: 'delete-all-but' is copied from the turbovnc package.
1596 (define (delete-all-but directory . preserve)
1597 (define (directory? x)
1598 (and=> (stat x #f)
1599 (compose (cut eq? 'directory <>) stat:type)))
1600 (with-directory-excursion directory
1601 (let* ((pred
1602 (negate (cut member <> (append '("." "..") preserve))))
1603 (items (scandir "." pred)))
1604 (for-each (lambda (item)
1605 (if (directory? item)
1606 (delete-file-recursively item)
1607 (delete-file item)))
1608 items))))
1609 ;; Remove as much bundled sources as possible, shaving off about
1610 ;; 65 MiB.
1611 (delete-all-but "deps"
1612 "feralgamemode" ;used in platform_unix.c
1613 "mbedtls" ;further refined below
1614 "yxml") ;used in rxml.c
1615 ;; This is an old root certificate used in net_socket_ssl_mbed.c,
1616 ;; not actually from mbedtls.
1617 (delete-all-but "deps/mbedtls" "cacert.h")))
1590 (file-name (git-file-name name version)) 1618 (file-name (git-file-name name version))
1591 (sha256 1619 (sha256
1592 (base32 "15nh4y4vpf4n1ryhiy4fwvzn5xz5idzfzn9fsi5v9hzp25vbjmrm")))) 1620 (base32 "15nh4y4vpf4n1ryhiy4fwvzn5xz5idzfzn9fsi5v9hzp25vbjmrm"))
1621 (patches (search-patches "retroarch-unbundle-spirv-cross.patch"))))
1593 (build-system gnu-build-system) 1622 (build-system gnu-build-system)
1594 (arguments 1623 (arguments
1595 (list 1624 (list
@@ -1626,7 +1655,20 @@ physical device and the RetroPad virtual controller.")
1626 "--disable-builtinbearssl" 1655 "--disable-builtinbearssl"
1627 "--disable-builtinzlib" 1656 "--disable-builtinzlib"
1628 "--disable-builtinflac" 1657 "--disable-builtinflac"
1629 "--disable-builtinglslang")))))) 1658 "--disable-builtinglslang"
1659 "--disable-builtinspirv_cross"
1660 ;; These are disabled to avoid requiring the bundled
1661 ;; dependencies.
1662 "--disable-7zip"
1663 "--disable-cheevos"
1664 "--disable-crtswitchres"
1665 "--disable-discord"
1666 "--disable-dr_mp3"
1667 "--disable-ibxm"
1668 "--disable-stb_font"
1669 "--disable-stb_image"
1670 "--disable-stb_vorbis"
1671 "--disable-xdelta"))))))
1630 (inputs 1672 (inputs
1631 (list alsa-lib 1673 (list alsa-lib
1632 eudev 1674 eudev
@@ -1648,6 +1690,7 @@ physical device and the RetroPad virtual controller.")
1648 python 1690 python
1649 qtbase-5 1691 qtbase-5
1650 sdl2 1692 sdl2
1693 spirv-cross
1651 spirv-headers 1694 spirv-headers
1652 spirv-tools 1695 spirv-tools
1653 v4l-utils 1696 v4l-utils
@@ -1669,7 +1712,10 @@ the easy creation of emulators, games and multimedia applications that can plug
1669straight into any libretro-compatible frontend. RetroArch is the official 1712straight into any libretro-compatible frontend. RetroArch is the official
1670reference frontend for the libretro API, currently used by most as a modular 1713reference frontend for the libretro API, currently used by most as a modular
1671multi-system game/emulator system.") 1714multi-system game/emulator system.")
1672 (license license:gpl3+))) 1715 (license (list license:gpl3+ ;for RetroArch itself
1716 license:asl2.0 ;SPIRV-Cross
1717 license:expat ;yxml
1718 license:bsd-3)))) ;feragamemode
1673 1719
1674(define-public wasm4 1720(define-public wasm4
1675 (package 1721 (package