Subject: [bug#50656] [PATCH] gnu: Add opentesarena.

From: phodina <[email-masked]>
Date: Sat, 18 Sep 2021 10:11:20 +0000

* gnu/packages/games.scm (opentesarena): New variable.

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c39770c260..4cdf4c27aa 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1637,6 +1637,48 @@ built-in level editor.")
            license:public-domain
            license:silofl1.1))))

+(define-public opentesarena
+  (package
+    (name "opentesarena")
+    (version "0.13.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/afritz1/OpenTESArena")
+                    (commit (string-append "opentesarena-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1j8vzjryvv3jsiy17mrabmf55znjys1922xz4j02rhwjyagz278s"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (data (string-append bin "/data"))
+                    (options (string-append bin "/options")))
+               (mkdir-p bin)
+               (mkdir-p data)
+               (mkdir-p options)
+               (install-file "TESArena" bin)
+               (copy-recursively "OpenTESArena/data" data)
+               (copy-recursively "OpenTESArena/options" options)))))))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("sdl" ,(sdl-union (list sdl2
+                                       sdl2-mixer)))
+              ("openal" ,openal)
+              ("wildmidi" ,wildmidi)
+              ("boost" ,boost)))
+    (synopsis "Open-source re-implementation of The Elder Scrolls: Arena")
+    (description "Modern open-source engine re-implementation for the 1994
+video game The Elder Scrolls: Arena by Bethesda Softworks.")
+    (home-page "https://github.com/afritz1/OpenTESArena")
+    (license license:expat))) ; MIT
+
 (define-public knights
   (package
     (name "knights")
--
2.32.0