summaryrefslogtreecommitdiffstats
path: root/games.scm
blob: 800a41e90c32345408859cae29d5bba1a34108f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
(define-module (games)
               #:use-module ((guix licenses) #:prefix license:)  
               #:use-module (gnu packages audio)
               #:use-module (gnu packages base)
               #:use-module (gnu packages bash)
               #:use-module (gnu packages boost)
               #:use-module (gnu packages check)
               #:use-module (gnu packages chromium)
               #:use-module (gnu packages commencement)
               #:use-module (gnu packages compression)
               #:use-module (gnu packages cpp)
               #:use-module (gnu packages crates-audio)
               #:use-module (gnu packages rust-crates)
               #:use-module (gnu packages crypto)
               #:use-module (gnu packages cups)
               #:use-module (gnu packages curl)
               #:use-module (gnu packages databases)
               #:use-module (gnu packages digest)
               #:use-module (gnu packages elf)
               #:use-module (gnu packages emulators)
               #:use-module (gnu packages fonts)
               #:use-module (gnu packages fontutils)
               #:use-module (gnu packages game-development)
               #:use-module (gnu packages games)
               #:use-module (gnu packages gcc)
               #:use-module (gnu packages gl)
               #:use-module (gnu packages glib)
               #:use-module (gnu packages gnome)
               #:use-module (gnu packages gnupg)
               #:use-module (gnu packages gtk)
               #:use-module (gnu packages image)
               #:use-module (gnu packages kerberos)
               #:use-module (gnu packages libbsd)
               #:use-module (gnu packages libffi)
               #:use-module (gnu packages libusb)
               #:use-module (gnu packages linux)
               #:use-module (gnu packages llvm)
               #:use-module (gnu packages maths)
               #:use-module (gnu packages mp3)
               #:use-module (gnu packages multiprecision)
               #:use-module (gnu packages nettle)
               #:use-module (gnu packages networking)
               #:use-module (gnu packages nss)
               #:use-module (gnu packages pkg-config)
               #:use-module (gnu packages pretty-print)
               #:use-module (gnu packages pulseaudio)
               #:use-module (gnu packages qt)
               #:use-module (gnu packages rust)
               #:use-module (gnu packages rust-apps)
               #:use-module (gnu packages sdl)
               #:use-module (gnu packages serialization)
               #:use-module (gnu packages stb)
               #:use-module (gnu packages tls)
               #:use-module (gnu packages upnp)
               #:use-module (gnu packages video)
               #:use-module (gnu packages vulkan)
               #:use-module (gnu packages wxwidgets)
               #:use-module (gnu packages xdisorg)
               #:use-module (gnu packages xiph)
               #:use-module (gnu packages xml)
               #:use-module (gnu packages xorg)
               #:use-module (gnu packages java)
               #:use-module (gnu packages)
               #:use-module (guix build download)
               #:use-module (guix build utils)
               #:use-module (guix build-system cargo)
               #:use-module (guix build-system cmake)
               #:use-module (guix build-system gnu)
               #:use-module (guix build-system maven)
               #:use-module (guix build-system trivial)
               #:use-module (guix build-system)
               #:use-module (guix download)
               #:use-module (guix gexp)
               #:use-module (guix gexp)
               #:use-module (guix git-download)
               #:use-module (guix monads)
               #:use-module (guix packages)
               #:use-module (guix packages)
               #:use-module (guix records)
               #:use-module (guix store)
               #:use-module (guix transformations)
               #:use-module (guix utils)
               #:use-module (ice-9 match)
               #:use-module (ice-9 session)
               #:use-module (nonguix build-system binary)
               #:use-module (nonguix build-system chromium-binary)
               #:use-module (nonguix licenses)
               #:use-module (srfi srfi-1)
               )

(define-public openarena
               (package
                 (name "openarena")
                 (version "0.8.8")
                 (source
                   (origin
                     (method url-fetch)
                     (uri "http://deb.debian.org/debian/pool/main/o/openarena/openarena_0.8.8+dfsg.orig.tar.xz")
                     (sha256
                       (base32
                         "07iixz5shc0xj86b19k8iijrjhaxi3762bbyvmkfrywgsw8ph71j"))
                     ))
                 (build-system gnu-build-system)
                 (inputs (list bash-minimal))
                 (arguments
                   `(
                     #:make-flags
                     (list (string-append "CC=gcc"))
                     #:phases
                     #~(modify-phases %standard-phases
                                      (delete 'configure)
                                      )))
                 (home-page "https://lei-lei.neocities.org/openarena/")
                 (synopsis "OpenArena modifications to the ioquake3 engine")
                 (description "This project is a fork of ioquake3 with OpenArena specific changes to the client and server.")
                 (license license:gpl2)
                 ))

(define-public curl-openssl
               (package (inherit curl)
                        (name "curl-openssl")
                        (arguments
                          (list
                            #:disallowed-references '("doc")
                            #:configure-flags
                            #~(list "--with-openssl"
                                    "--enable-versioned-symbols"
                                    (string-append "--with-gssapi="
                                                   (dirname (dirname
                                                              (search-input-file
                                                                %build-inputs "lib/libgssrpc.so"))))
                                    "--disable-static")
                            
                            #:phases
                            #~(modify-phases %standard-phases
                                             (add-after 'unpack 'do-not-record-configure-flags
                                                        (lambda _
                                                          ;; Do not save the configure options to avoid unnecessary references.
                                                          (substitute* "curl-config.in"
                                                                       (("@CONFIGURE_OPTIONS@")
                                                                        "\"not available\""))))
                                             (add-after 'install 'move-man3-pages
                                                        (lambda _
                                                          ;; Move section 3 man pages to "doc".
                                                          (mkdir-p (string-append #$output:doc "/share/man"))
                                                          (rename-file (string-append #$output "/share/man/man3")
                                                                       (string-append #$output:doc "/share/man/man3"))))
                                             (delete 'check)
                                             #$@(if (system-hurd?)
                                                  #~((add-after 'unpack 'skip-tests
                                                                (lambda _
                                                                  (let ((port (open-file "tests/data/DISABLED" "a")))
                                                                    (display "526\n" port)
                                                                    (display "527\n" port)
                                                                    (display "532\n" port)
                                                                    (display "533\n" port)
                                                                    (display "537\n" port)
                                                                    (display "546\n" port)
                                                                    (display "564\n" port)
                                                                    (display "575\n" port)
                                                                    (display "1021\n" port)
                                                                    (display "1501\n" port)
                                                                    (close port)))))
                                                  #~()))))
                        (inputs (modify-inputs (package-inputs curl)
                                               (prepend openssl-3.0)))
                        ))

(define-public unappimage
               (package
                 (inherit squashfs-tools)
                 (version "d7f86f2a0d7ec3a69211125207d5f127386b849a")
                 (name "unappimage")
                 (source
                   (origin
                     (method git-fetch)
                     (uri (git-reference
                            (url "https://github.com/refi64/unappimage.git")
                            (commit version)))
                     (file-name (git-file-name name version))
                     (sha256
                       (base32 "1mcavvaxn3ncnbi68mcqb3fnp1xgxvsz3j7slgwqcmizbw5sgd3n"))))
                 (inputs (modify-inputs (package-inputs squashfs-tools)
                                        (prepend libelf)))
                 ))

(define-public slippi-launcher
               (package
                 (name "slippi-launcher")
                 (version "2.11.10")
                 (source
                   (origin
                     (method url-fetch)
                     (uri
                       (string-append
                         "https://github.com/project-slippi/slippi-launcher/releases/download/v" version "/Slippi-Launcher-" version "-x86_64.AppImage"))
                     (sha256
                       (base32 "0vmr52z0g6h4i23qf19fkwspcnvanrckcldm6nrs0yva6p99vd9s"))))
                 (supported-systems '("x86_64-linux"))
                 (build-system chromium-binary-build-system)
                 (arguments
                   (list #:validate-runpath? #f
                         #:wrapper-plan
                         #~'(
                             (
                              "lib/Slippi/slippi-launcher" (("out" "/lib/Slippi"))
                              )
                             )
                         #:phases
                         #~(modify-phases %standard-phases
                                          (replace 'unpack
                                                   (lambda _
                                                     (invoke (string-append #$(this-package-input "unappimage") "/bin/unappimage") #$source)
                                                     (mkdir-p "lib")
                                                     (rename-file "squashfs-root/" "lib/Slippi/")
                                                     ;(delete-file-recursively "squashfs-root")
                                                     ))
                                          (add-after 'install 'set-vars-for-visuals
                                                     (lambda _
                                                       (wrap-program (string-append #$output "/lib/Slippi/slippi-launcher")
                                                                     `("QT_QPA_PLATFORM" ":" prefix ("xcb"))
                                                                     )
                                                       ))
                                          (add-after 'set-vars-for-visuals 'wrap-where-patchelf-does-not-work
                                                     (lambda _
                                                       (wrap-program (string-append #$output "/lib/Slippi/slippi-launcher")
                                                                     `("LD_LIBRARY_PATH" ":" prefix
                                                                       (,(string-join
                                                                           (list
                                                                             (string-append #$output "/lib/Slippi"))
                                                                           ":"))))))
                                          (add-after 'install 'symlink-binary-file
                                                     (lambda _
                                                       (mkdir-p (string-append #$output "/bin"))
                                                       (symlink (string-append #$output "/lib/Slippi/slippi-launcher")
                                                                (string-append #$output "/bin/slippi-launcher"))))
                                          )))
                 (inputs (list
                           alsa-lib
                           ao
                           at-spi2-core
                           bluez
                           brotli
                           bzip2
                           cairo
                           chromaprint
                           cubeb
                           cups
                           curl-openssl
                           dbus
                           dbus
                           double-conversion
                           enet
                           eudev
                           expat
                           ffmpeg-4
                           flac
                           fmt-7
                           font-wqy-microhei
                           fontconfig
                           freeglut
                           freetype
                           gcc-toolchain-13
                           gdk-pixbuf
                           glew
                           glib
                           glibc
                           glu
                           gmp
                           gnutls
                           graphite2
                           gtk+
                           gtk+-2
                           gzip
                           hidapi
                           libaom
                           libb2
                           libbluray
                           libbsd
                           libcap
                           libdatrie
                           libdrm
                           libevdev
                           libevdev
                           libffi
                           libgcrypt
                           libglvnd
                           libglvnd
                           libgme
                           libpng
                           libsm
                           libusb
                           libx11
                           libxcb
                           libxcomposite
                           libxdamage
                           libxext
                           libxfixes
                           libxi
                           libxkbcommon
                           libxrandr
                           libxrandr
                           lzo
                           mbedtls-lts
                           mesa
                           miniupnpc
                           minizip-ng
                           mit-krb5
                           nettle
                           nspr
                           nss
                           openal
                           p11-kit
                           pango
                           patchelf
                           pugixml
                           pulseaudio
                           qtbase-5
                           sdl2
                           sfml
                           soil
                           soundtouch-1/integer-samples
                           unappimage
                           util-linux
                           vulkan-headers
                           vulkan-loader
                           xorg-server
                           xxhash
                           zlib
                           ))

                 (native-inputs `(("source" ,source)))
                 (home-page "https://github.com/project-slippi/slippi-launcher")
                 (synopsis "The way to play Slippi Online and watch replays.")
                 (description "The Slippi Launcher acts as a one stop shop for everything Slippi related. It handles updating Slippi Dolphin, playing Slippi Online, launching and analyzing replays, and more.")
                 (properties
                   '((release-monitoring-url . "https://github.com/project-slippi/slippi-launcher/releases")))
                 (license license:gpl3)))

(define-public SlippiRustExtensions
               (package
                 (name "SlippiRustExtensions")
                 (version "7d756c7cbba04d62f351114abf0c4fcfa3761d26")
                 (source
                   (origin
                     (method git-fetch)
                     (uri (git-reference
                            (url "https://github.com/project-slippi/slippi-rust-extensions")
                            (commit version)
                            (recursive? #t)
                            ))
                     (file-name (git-file-name name version))
                     (sha256
                       (base32 "1r5h7ca6hkvp31sjjsdrpmhm3ab96ssixxdgkdad9jmy1vzak2yv"))
                     (patches (search-patches "aux-files/ishiiruka/remove-network-call-in-cargo.patch"))
                     ))
                 (build-system cargo-build-system)
                 (inputs (list rust-cpal-0.13 rust-time-0.3 rust-tracing-0.1 rust-tracing-subscriber-0.3 rust-chksum-0.4.0))
                 (synopsis "Rust extensions for Slippi Dolphin")
                 (description "This external module houses various Slippi-specific bits of functionality and is ultimately linked into the Dolphin executable and instrumented via the C FFI. This is an evolving workspace area and may be subject to changes.")
                 (home-page "https://github.com/project-slippi/slippi-rust-extensions")
                 (license license:gpl2)
                 ))

(define-public ishiiruka
               (package (inherit dolphin-emu)
                        (name "ishiiruka")
                        (version "3.4.6")
                        (source
                          (origin
                            (method git-fetch)
                            (uri (git-reference
                                   (url "https://github.com/project-slippi/Ishiiruka")
                                   (commit (string-append "v" version))
                                   (recursive? #t)
                                   ))
                            (file-name (git-file-name name version))
                            (sha256
                              (base32 "1dfqf1pyc18wjb3d0w9i9zhkzpiyi873wva6l332ammyffyql53p"))
                            ))
                        (arguments
                          (list
                            #:phases
                            #~(modify-phases %standard-phases
                                             (add-before 'configure 'remove-unittests-target-post-build-command
                                                         (lambda _
                                                           ;; To skip a few problematic tests, CTest will be manually
                                                           ;; invoked in the post-check phase.
                                                           (with-directory-excursion "Source/UnitTests"
                                                                                     (substitute* "CMakeLists.txt"
                                                                                                  (("add_custom_command\\(TARGET unittests POST_BUILD.*")
                                                                                                   "")))))
                                             (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
                                                         (lambda* (#:key inputs #:allow-other-keys)
                                                                  (let ((fontfile
                                                                          (search-input-file inputs
                                                                                             "/share/fonts/truetype/wqy-microhei.ttc"))
                                                                        (libvulkan
                                                                          (search-input-file inputs "/lib/libvulkan.so")))
                                                                    (chdir "docs")
                                                                    (invoke "bash" "-c" "g++ -O2 $(freetype-config \
                                                                                                                   --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
                                                                    (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
                                                                    (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
                                                                    (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
                                                                    (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
                                                                    (chdir "..")
                                                                    (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
                                                                                 (("\"vulkan\", 1") (string-append "\"vulkan\""))
                                                                                 (("\"vulkan\"") (string-append "\"" libvulkan "\""))
                                                                                 (("Common::DynamicLibrary::GetVersionedFilename") "")))))
                                             (add-after 'check 'post-check
                                                        (lambda* (#:key tests? #:allow-other-keys)
                                                                 (when tests?
                                                                   (with-directory-excursion "Source/UnitTests"
                                                                                             (invoke "ctest" "-V" "--output-on-failure"
                                                                                                     ;; These tests fail due to libusb failing to
                                                                                                     ;; init inside the build container.
                                                                                                     "-E" (string-join
                                                                                                            '("MMIOTest"
                                                                                                              "PageFaultTest"
                                                                                                              "CoreTimingTest"
                                                                                                              "FileSystemTest"
                                                                                                              "PowerPCTest"
                                                                                                              "VertexLoaderTest")
                                                                                                            "|"))))))
                                             (add-before 'install 'build-codeloader.bin
                                                         (lambda _
                                                           (with-directory-excursion "../source/docs"
                                                                                     ;; The following command-line is adapted from the example in
                                                                                     ;; codehandler.s.
                                                                                     (invoke "powerpc-linux-gnu-gcc" "-mpowerpc" "-mbig"
                                                                                             "codehandler.s" "-nostartfiles" "-nodefaultlibs"
                                                                                             "-nostdlib" "-T" "codehandler.ld"
                                                                                             "-o" "codehandler.bin")
                                                                                     (copy-file "codehandler.bin" "../Data/Sys/codehandler.bin"))))
                                             (add-before 'install 'build-dsp_rom.bin
                                                         (lambda _
                                                           ;; Ensure dsptool is on PATH.
                                                           (setenv "PATH" (string-append (getenv "PATH") ":"
                                                                                         (getcwd) "/Binaries"))
                                                           (with-directory-excursion "../source"
                                                                                     (invoke "dsptool" "-o" "Data/Sys/GC/dsp_rom.bin"
                                                                                             "docs/DSP/free_dsp_rom/dsp_rom.ds"))))
                                             (add-before 'install 'build-dsp_coefs.bin
                                                         (lambda _
                                                           (with-directory-excursion "../source"
                                                                                     (invoke "python3" "docs/DSP/free_dsp_rom/generate_coefs.py")
                                                                                     (rename-file "dsp_coef.bin" "Data/Sys/GC/dsp_coef.bin")))))
                            ;; The FindGTK2 cmake script only checks hardcoded directories for
                            ;; glib/gtk headers.  Also add some include directories via the CXX
                            ;; flags to let GCC find some headers not actively searched by the
                            ;; build system.
                            #:configure-flags
                            #~(list (string-append "-DCMAKE_CXX_FLAGS="
                                                   "-I" (search-input-directory
                                                          %build-inputs "include/soundtouch"))
                                    "-DDSPTOOL=ON"
                                    (string-append "-DX11_INCLUDE_DIR="
                                                   #$(this-package-input "libx11")
                                                   "/include")
                                    (string-append "-DX11_LIBRARIES="
                                                   (search-input-file %build-inputs
                                                                      "lib/libX11.so"))
                                    (string-append "-DGTK3_GLIBCONFIG_INCLUDE_DIR="
                                                   #$(this-package-input "glib")
                                                   "/include")
                                    "-DX11_FOUND=1")
                            ))
                        (inputs (modify-inputs (package-inputs dolphin-emu) (prepend rust-cargo rust gtk+ gtk gdk-pixbuf-xlib glibc glib wxwidgets portaudio SlippiRustExtensions)))
                        ))

(define-public libretro-desmume
  (package
    (inherit desmume)
    (name "libretro-desmume")
    (version "7f05a8d447b00acd9e0798aee97b4f72eb505ef9")
    (source
      (origin
        (inherit (package-source desmume))
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/libretro/desmume")
               (commit version)))
        (file-name (git-file-name name version))
        (sha256
          (base32 "04kcc4vg9zc9ak50bdkrxrdv08s3nxghszkc9k7g6vfmx4r5dnq6"))
        ))
    (build-system gnu-build-system)
    (arguments
      (list
        #:tests? #f
        #:make-flags #~(list "CC=gcc" "CXX=g++")
        #:configure-flags #~(list
                                      "-DCMAKE_HOST_CC=gcc"
                                      "-Dfrontend-cli=true"
                                      "-Dfrontend-gtk=true"
                                      "-Dgdb-stub=true"
                                      "-Dopenal=true")
            #:phases #~(modify-phases %standard-phases
                                      (delete 'configure)
                                      (add-after 'unpack 'chdir
                                                 (lambda _
                                                   (chdir "desmume/src/frontend/libretro")))
              (replace 'install
                (lambda _
                  (install-file "desmume_libretro.so"
                                (string-append #$output "/lib/libretro"))
                  )))))
    (inputs (modify-inputs (package-inputs desmume) (prepend clang)))

    ))

(define (version-with-underscores version)
  (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))

(define-public boost-for-torzu
               (hidden-package (package (inherit boost)
                                        (name "boost-for-torzu")
                                        (version "1.86.0")
                                        (source (origin
                                                  (method url-fetch)
                                                  (uri (string-append "https://archives.boost.io/release/"
                                                                      version "/source/boost_"
                                                                      (version-with-underscores version) ".tar.bz2"))
                                                  (sha256
                                                    (base32
                                                      "0fsisws4vqk4mvdw0caz1i6zllp3k6sbmm3n3xxcpch10kj8iv8v"))))
                                        )))
(define-public renderdoc
               (package
                 (name "renderdoc")
                 (version "1.39")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/baldurk/renderdoc")
                                  (commit (string-append "v" version))
                                  (recursive? #t)
                                  ))

                           (sha256
                             (base32
                               "0fsisws4vqk4mvdw0caz1i6zllp3k6sbmm3n3xxcpch10kj8iv8v"))
                           ))
                 (build-system cmake-build-system)
                 (synopsis "RenderDoc is a stand-alone graphics debugging tool.")
                 (description "RenderDoc is a frame-capture based graphics debugger, currently available for Vulkan, D3D11, D3D12, OpenGL, and OpenGL ES development on Windows, Linux, Android, and Nintendo Switch™. It is completely open-source under the MIT license.

                              RenderDoc is intended for debugging your own programs only. Any discussion of capturing programs that you did not create will not be allowed in any official public RenderDoc setting, including the issue tracker, discord, or via email. For example this includes capturing commercial games that you did not create, or capturing Google Maps or Google Earth. Note: Capturing projects you created that use a third party engine like Unreal or Unity, or open source and free projects is completely fine and supported. ")
                              (home-page "https://renderdoc.org/")
                              (license license:expat)
                              ))

(define-public jsoncons
               (package
                 (name "jsconcons")
                 (version "28c56b90ec7337f98a5b8942574590111a5e5831")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/danielaparker/jsoncons")
                                  (commit version)))
                           (sha256
                             (base32
                               "00ib81q6zzv558vwiwqc2wq3v3s8pd234yic7l2w49ggnhnavfj3"))

                           ))
                 (build-system cmake-build-system)
                 (home-page "https://github.com/danielaparker/jsoncons")
                 (synopsis "A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON")
                 (description
                   "
                   jsoncons is a C++, header-only library for constructing JSON and JSON-like data formats such as CBOR. For each supported data format, it enables you to work with the data in a number of ways:

    As a variant-like, allocator-aware, data structure, basic_json

    As a strongly typed C++ data structure that implements jsoncons reflection traits

    With cursor-level access to a stream of parse events, somewhat analogous to StAX pull parsing and push serializing in the XML world.

Compared to other JSON libraries, jsoncons has been designed to handle very large JSON texts. At its heart are SAX-style parsers and serializers. It supports reading an entire JSON text in memory in a variant-like structure. But it also supports efficient access to the underlying data using StAX-style pull parsing and push serializing. And it supports incremental parsing into a user's preferred form, using information about user types provided by specializations of json_type_traits.

The jsoncons data model supports the familiar JSON types - nulls, booleans, numbers, strings, arrays, objects - plus byte strings. In addition, jsoncons supports semantic tagging of datetimes, epoch times, big integers, big decimals, big floats and binary encodings. This allows it to preserve these type semantics when parsing JSON-like data formats such as CBOR that have them.

jsoncons is distributed under the Boost Software License.

jsoncons is free but welcomes support to sustain its development. If you find this library helpful, please consider making a one time donation or becoming a ❤️ sponsor.

As the jsoncons library has evolved, names have sometimes changed. To ease transition, jsoncons deprecates the old names but continues to support many of them. The deprecated names can be suppressed by defining the macro JSONCONS_NO_DEPRECATED, and doing so is recommended for new code.
                   "
                   )
                 (license license:boost1.0)))

(define-public jwt-cpp
               (package
                 (name "jwt-cpp")
                 (version "0.7.1")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/Thalhammer/jwt-cpp")
                                  (commit (string-append "v" version))))
                           (sha256
                             (base32
                               "0qs9296p9sfw8hqpvwskbmc8rbr885p9524115j1sy74280q5qwx"))

                           ))
                 (build-system cmake-build-system)
                 (arguments (list
                              #:tests? #f
                              #:configure-flags #~(list
                                                           "-DJWT_EXTERNAL_NLOHMANN_JSON=ON"
                                                           )
                              ))
                 (inputs (list openssl-3.0 nlohmann-json jsoncpp jsoncons))
                 (home-page "https://thalhammer.github.io/jwt-cpp/")
                 (synopsis "A header only library for creating and validating JSON Web Tokens in C++")
                 (description
                   "A header only library for creating and validating JSON Web Tokens in C++11. The objective is to deliver a versatile and universally applicable collection of algorithms, classes, and data structures, fostering adaptability and seamless integration with other libraries that you may already be employing.")
                 (license license:expat)))

(define-public xbyak
               (package
                 (name "xbyak")
                 (version "7.27")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/herumi/xbyak")
                                  (commit (string-append "v" version))))

                           (sha256
                             (base32
                               "132l8v9agfanrclnbqa0571l246k97grb6pq2ix0ahjvfiw7629j"))

                           ))
                 (build-system cmake-build-system)
                 (arguments
                   (list
                     #:tests? #f
                     ))
                 (home-page "https://github.com/herumi/xbyak")
                 (synopsis "A JIT assembler for x86/x64 architectures supporting MMX, SSE (1-4), AVX (1-2, 512), FPU, APX, and AVX10.2")
                 (description
                   "A JIT assembler for x86/x64 architectures supporting advanced instruction sets up to AVX10.2.")
                 (license license:bsd-3)))

(define-public dynarmic
               (package
                 (name "dynarmic")
                 (version "9d4582339990d4eae53f1dc7160686920fc2075c")
                 (source (origin
                           (method git-fetch)
                           (uri (git-reference
                                  (url "https://github.com/yuzu-mirror/dynarmic")
                                  (commit version)))

                           (sha256
                             (base32
                               "0r86dq027iiyp4ip558j1c5wcqs5fja0gb9kvh5vp4qk1cyaiy7x"))
                           ))

                 (build-system cmake-build-system)
                 (home-page "https://github.com/yuzu-mirror/dynarmic")
                 (synopsis "A dynamic recompiler for ARM.")
                 (inputs (list boost))
                 (description
                   "A dynamic recompiler for ARM. Highlight features:
                   - Fast dynamic binary translation via Just-in-Time compilation
                   - Clean API
                   - Implemented in modern C++20
                   - Hooks exposed for easy code instrumentation
                   - Code injection support for very fine-grained instrumentation
                   - Support for unusual address space setups (bring-your-own memory system)
                   - Native support for most popular operating systems (Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, Android)
                   Please note that an adversarial guest program can determine if it is being run under dynarmic. Preventing this is not a goal of this project.")
                   (license license:bsd-0)))

(define-public zstd-for-torzu
               (package
                 (inherit zstd-1.5.7)
                 (build-system cmake-build-system)
                 (outputs (list "out"))                                        
                 (arguments (list
                              #:tests? #f
                              #:phases
                              #~(modify-phases %standard-phases
                                               (add-after 'unpack 'chdir
                                                          (lambda _
                                                            (chdir "build/cmake")))
                                               )
                              ))
                 ))

(define-public lz4-for-torzu
               (package (inherit lz4)
                        (name "lz4-for-torzu")
                        (version (package-version lz4))
                        (build-system cmake-build-system)
                        (outputs (list "out"))                                        
                        (arguments (list
                                     #:tests? #f
                                     #:configure-flags #~(list
                                                           "-DLZ4_VERSION_MAJOR=1"
                                                           "-DLZ4_VERSION_MINOR=9"
                                                           "-DLZ4_VERSION_RELEASE=3"
                                                           "-DLZ4_VERSION_STRING=1.9.3"
                                                           )
                                     #:phases
                                     #~(modify-phases %standard-phases

                                                      (add-after 'unpack 'chdir
                                                                 (lambda _
                                                                   (chdir "build/cmake")))
                                                      )
                                     ))
                        ))

(define-public torzu
               (package
                 (name "torzu")
                 (version "2025-04-16")
                 (source
                   (origin
                     (method git-fetch)
                     (uri (git-reference
                            (url "http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu")
                            (commit (string-append "v" version))))
                     (sha256
                       (base32
                         "0adsn9xn4qyvsr7a2pl68anyyx2cysfs3m6gl7yff40fndz4mhia"))

                     (modules '((guix build utils)
                                (ice-9 regex)))
                     (snippet
                       '(begin
                          ;; Remove external stuff we don't need.
                          (for-each (lambda (dir)
                                      (delete-file-recursively
                                        (string-append "externals/" dir)))
                                    '("cubeb" "libusb"))
                          ))

                     ))
                 (inputs (list lz4-for-torzu cubeb ffmpeg fmt libusb mbedtls-lts boost-for-torzu llvm-17 libffi zlib zstd-for-torzu pkg-config nlohmann-json opus stb-image-resize simpleini vulkan-headers vulkan-loader catch2-3 xbyak dynarmic jwt-cpp))
                 (build-system cmake-build-system)
                 (arguments
                   (list
                     ;#:tests? #f
                     #:configure-flags #~(list
                                           "-DYUZU_USE_CPM=OFF"
                                           "-DYUZU_CHECK_SUBMODULES=OFF"
                                           )
                     ))
                 (home-page "http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu")
                 (synopsis "Yet another Yuzu fork")
                 (description "torzu is a fork of yuzu, an open-source Nintendo Switch emulator.")
                 (license license:gpl3+)
                 ))

(define-public libretro-yuzu-launcher-antimicrox
  (package
    (name "libretro-yuzu-launcher-antimicrox")
    (version "4069e287776924fcfda747af81996920211f7acd")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/new-penguin/libretro-yuzu-launcher-antimicrox")
               (commit version)))
        (file-name (git-file-name name version))
        (sha256
          (base32 "1a3vg54q0dqsy037g93igx8wnf3cxc5q7p7y4xn4mspyq8x79rrv"))
        ))
    (build-system cmake-build-system)
    (inputs (list torzu antimicrox))
    (synopsis "A quick and dirty fork of libretro-dolphin-launcher for running Yuzu via Retroarch. It uses antimicrox to quickly exit and return to Retroarch.")
    (description "Launch Nintendo Switch games through Yuzu, directly from RetroArch with full controller support using antimicrox.")
    (home-page "https://github.com/new-penguin/libretro-yuzu-launcher-antimicrox")
    (license license:expat)
    ))