(define-module (my-packages my-games) #:use-module (srfi srfi-26) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages audio) #:use-module (gnu packages gtk) #:use-module (gnu packages image) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages gl) #:use-module (gnu packages mp3) #:use-module (gnu packages sdl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages glib) #:use-module (gnu packages linux) #:use-module (gnu packages xiph) #:use-module (gnu packages game-development) #:use-module (gnu packages web) #:use-module (gnu packages video)) (define-public zmusic (package (name "zmusic") (version "1.1.14") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ZDoom/ZMusic") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "19arzkbwdj84vw1cfawc6930dfxdhhq4k6yawkkppaphj8qkfhdc")))) (build-system cmake-build-system) (inputs (list alsa-lib)) (native-inputs (list pkg-config glib)) (arguments (list #:tests? #f #:configure-flags #~(list (string-append "-DYN_SNDFILE=off" "-DYN_MPG123=off")))) (synopsis "GZDoom's music system as a standalone library") (description "This library for use with the projects GZDoom, Raze, and the newer PrBoom+.") (home-page "https://zdoom.org/index") ;; the source uses x86 assembly (supported-systems '("x86_64-linux" "i686-linux")) (license (list license:gpl3 license:lgpl2.1)))) (define-public my-gzdoom (package (name "gzdoom") (version "4.13.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ZDoom/gzdoom") (commit (string-append "g" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0zlvrdayrj1rk5x2hwnc57l8pl29bl64zmfq3qc9yfypknj1syfy")) ;; (patches (search-patches "gzdoom-search-in-installed-share.patch" ;; ;; "gzdoom-find-system-libgme.patch" ;; )) (modules '((guix build utils) (ice-9 regex))) ;; (snippet ;; '(begin ;; ;; remove files which mustn't be commercially redistributed. see ;; ;; , the ‘contribution ;; ;; guidelines’ at , and guix issue #73435. ;; (for-each ;; (lambda (directory) ;; (delete-file-recursively directory) ;; (substitute* "CMakeLists.txt" ;; (((string-append "add_subdirectory\\([[:blank:]]*" ;; directory ;; "[[:blank:]]*\\)")) ;; ""))) ;; '( ;; "wadsrc_extra" ;game_support.pk3 ;; "wadsrc_bm")) ;brightmaps.pk3 ;; ;; removing game_support.pk3 entirely would break freedoom & remove ;; ;; users' ability to play commercial games, despite owning (only) the ;; ;; non-functional data. that can't be right. out of an abundance of ;; ;; caution, remove anything from the pk3 that could conceivably be ;; ;; derived from copyrightable data that's not freely redistributable. ;; ;; (display "keeping only the following game_support.pk3 files:\n") ;; ;; (let* ((regexps (list "/font\\.inf$" ;; ;; "/harmony/.*\\.(txt|zs)$" ;; ;; "/(iwadinfo|mapinfo|sprofs)\\.txt$" ;; ;; "\\.z$")) ;; ;; (regexp* (format #f "(~{~a~^|~})" regexps)) ;; ;; (regexp (make-regexp regexp* regexp/icase))) ;; ;; (define (keep-file? file stat) ;; ;; (let ((keep? (regexp-exec regexp file))) ;; ;; (when keep? ;; ;; (format #t " ~a~%" file)) ;; ;; keep?)) ;; ;; (for-each delete-file (find-files "wadsrc_extra/static" ;; ;; (negate keep-file?)))) ;; ;; remove some bundled libraries. xxx there are more, but removing ;; ;; them would require, at least, patching the build system. ;; (with-directory-excursion "libraries" ;; (delete-file-recursively "bzip2") ;; ))) )) (arguments (list #:tests? #f #:configure-flags #~(list (string-append "-DCMAKE_CXX_FLAGS:=" "-DSHARE_DIR=\\\"" #$output "/share\\\" " "-DGUIX_OUT_PK3=\\\"" #$output "/share/games/doom\\\"") ;; the build requires some extra convincing not to use the bundled ;; libgme previously deleted in the soure snippet. ;; "-dforce_internal_gme=off" ;; link libraries at build time instead of loading them at run time. "-DDYN_OPENAL=off" "-DDYN_FLUIDSYNTH=off" "-DDYN_GTK=off" "-DDYN_MPG123=off" "-DDYN_SNDFILE=off" ;; Pointing CMake to precompiled binaries in library so that they can be statically linked into ) #:phases #~(modify-phases %standard-phases (add-before 'configure 'fix-file-names (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/CMakeLists.txt" (("command /bin/sh") (string-append "command " (which "sh")))) ;; (substitute* ;; "libraries/zmusic/mididevices/music_fluidsynth_mididevice.cpp" ;; (("/usr/share/sounds/sf2/fluidr3_gm.sf2") ;; (search-input-file inputs ;; "share/soundfonts/fluidr3mono_gm.sf3"))) ;; (substitute* ;; "libraries/zmusic/mididevices/music_timiditypp_mididevice.cpp" ;; (("(exename = \")(timidity)(\".*)" _ prefix exe suffix) ;; (string-append prefix ;; (search-input-file inputs ;; (string-append "bin/" exe)) ;; suffix))) ))))) (build-system cmake-build-system) (inputs (list bzip2 fluid-3 fluidsynth gtk+ libgme libjpeg-turbo libsndfile libvpx mesa mpg123 openal sdl2 timidity++ zlib zmusic)) (native-inputs (list pkg-config unzip)) (synopsis "modern doom 2 source port") (description "gzdoom is a port of the doom 2 game engine, with a modern renderer. it improves modding support with zdoom's advanced mapping features and the new zscript language. in addition to doom, it supports heretic, hexen, strife, chex quest, and fan-created games like harmony, hacx and freedoom.") (home-page "https://zdoom.org/index") ;; the source uses x86 assembly (supported-systems '("x86_64-linux" "i686-linux")) (license (list license:gpl3+ ; gzdoom game license:lgpl3+ ; gzdoom renderer license:expat ; gdtoa (license:non-copyleft ; modified dumb "file://dumb/licence.txt" "dumb license, explicitly gpl compatible."))))) (define-public my-barony (package (name "my-barony") (version "open-al-refresh") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/damiencarol/Barony.git") (commit "feb4ef9a969a3e788b0805841e4014945760bd93"))) (file-name (git-file-name name version)) (sha256 (base32 "0arfx7f2rfgc68ph4sq99hjrjjqsxiq6s4ppv0swyaqhqm0g2hrz")) ;; Fix textures for SDL 2.0.14. ;; See . (patches (list (search-path (map (cut string-append <> "/my-packages/patches") %load-path) "barony-fix-make-install-script.patch") (search-path (map (cut string-append <> "/my-packages/patches") %load-path) "barony-fix-double-free-bug.patch"))))) (build-system cmake-build-system) (arguments '(#:configure-flags (list "-DOPENAL_ENABLED=1" "-DFMOD_ENABLED=OFF" ; enable sound "-DEDITOR_EXE_NAME=barony-editor") ; instead of generic "editor" #:tests? #f ; there are no tests )) (inputs (list glu libpng libvorbis openal physfs rapidjson sdl2 sdl2-image sdl2-net sdl2-ttf zlib)) (outputs '("barony" "barony-editor")) (native-inputs (list pkg-config)) (home-page "https://baronygame.com") (synopsis "3D first-person roguelike game") (description "Barony is a first-person roguelike role-playing game with cooperative play. The player must descend a dark dungeon and destroy an undead lich while avoiding traps and fighting monsters. The game features randomly generated dungeons, 13 character classes, hundreds of items and artifacts, and cooperative multiplayer for up to four players. This package does @emph{not} provide the game assets.") (license license:bsd-2)))