all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: James Smith via Guix-patches via <guix-patches@gnu.org>
To: 73287@debbugs.gnu.org
Cc: "James Smith" <jsubuntuxp@disroot.org>,
	"Adam Faiz" <adam.faiz@disroot.org>,
	"Liliana Marie Prikler" <liliana.prikler@gmail.com>,
	宋文武 <iyzsong@envs.net>
Subject: [bug#73287] [PATCH v4 3/3] gnu: Add trenchbroom.
Date: Sat,  7 Dec 2024 20:48:32 -0700	[thread overview]
Message-ID: <7b762e62ff9523102189f3f3b4c251d1b38ef826.1733629326.git.jsubuntuxp@disroot.org> (raw)
In-Reply-To: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org>

* gnu/packages/game-development.scm: (trenchbroom): New variable.

Change-Id: I50691b1db2010cd8c2c7f04bdfd80278b9e14aed
---
 gnu/packages/game-development.scm | 93 +++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 2aee26593c..1bc6e8fa49 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -92,12 +92,14 @@ (define-module (gnu packages game-development)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages m4)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages music)
@@ -105,6 +107,7 @@ (define-module (gnu packages game-development)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -123,6 +126,7 @@ (define-module (gnu packages game-development)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
@@ -680,6 +684,95 @@ (define-public tiled
     ;; under BSD-2.
     (license license:gpl2+)))
 
+(define-public trenchbroom
+  (package
+    (name "trenchbroom")
+    (version "2024.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/TrenchBroom/TrenchBroom")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xysz7rkjy11wp9sshdqllmlw8qb65f1zlljpw3q22483szwzxnb"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags
+           #~(list "-DCMAKE_BUILD_TYPE=Release" "-G" "Unix Makefiles"
+                   "-DCMAKE_PREFIX_PATH=cmake/packages"
+                   (string-append "-DFREEIMAGE_INCLUDE_PATH="
+                                  #$freeimage "/include")
+                   (string-append "-DFREEIMAGE_LIBRARY="
+                                  #$freeimage "/lib/libfreeimage.so")
+                   (string-append "-Dfreetype_INCLUDE_DIR="
+                                  #$freetype "/include/freetype2")
+                   (string-append "-Dfreetype_LIBRARY="
+                                  #$freetype "/lib/libfreetype.so"))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-build-system
+                 (lambda _
+                   (substitute* "CMakeLists.txt"
+                     (("set\\(CMAKE_TOOLCHAIN_FILE")
+                      "#set(CMAKE_TOOLCHAIN_FILE"))
+                   (substitute* "app/CMakeLists.txt"
+                     (("/usr") #$output))))
+               (add-before 'build 'set-environment-variables
+                 (lambda _
+                   ;; Set home so fontconfig can write cache.
+                   (setenv "HOME" (getenv "TEMP"))
+                   ;; Set QT platform for offscreen rendering.
+                   (setenv "QT_QPA_PLATFORM" "offscreen")
+                   (setenv "XDG_RUNTIME_DIR" (getenv "TEMP"))))
+               (add-after 'install 'wrap-trenchbroom
+                 (lambda _
+                   (wrap-program (string-append #$output "/bin/trenchbroom")
+                     ;; TrenchBroom needs $XDG_DATA_DIRS set to find game
+                     ;; configs.
+                     `("XDG_DATA_DIRS" ":" prefix
+                       (,(string-append #$output "/share")))
+                     ;; TrenchBroom also doesn't work well with Wayland backend.
+                     '("QT_QPA_PLATFORM" = ("xcb")))))
+               (add-after 'install 'install-desktop-file
+                 (lambda _
+                   (make-desktop-entry-file
+                    (string-append #$output "/share/applications/"
+                                   #$(package-name this-package) ".desktop")
+                    #:name "TrenchBroom"
+                    #:comment #$(package-synopsis this-package)
+                    #:exec #$name
+                    #:icon #$name
+                    #:categories '("Development")
+                    #:keywords '("quake" "level" "editor")))))
+           #:tests? #f)) ; No tests.
+    (inputs
+     (list assimp
+           bash-minimal
+           catch2
+           fmt
+           freeglut
+           freeimage
+           freetype
+           glew
+           glm
+           glu
+           libxxf86vm
+           mesa
+           miniz
+           qtbase-5
+           qtsvg-5
+           tinyxml2))
+    (native-inputs (list git pandoc python p7zip))
+    (home-page "https://kristianduske.com/trenchbroom/")
+    (synopsis "Cross-platform level editor for Quake-engine based games")
+    (description "TrenchBroom is a cross-platform level editor for
+Quake-engine based games.  It supports Quake, Quake 2, Hexen 2, as well as
+other games.  TrenchBroom provides many simple and advanced tools to create
+complex and interesting levels.")
+    (license license:gpl3+)))
+
 (define-public tsukundere
   (package
     (name "tsukundere")
-- 
2.46.0





      parent reply	other threads:[~2024-12-08  3:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16  2:10 [bug#73287] [PATCH 0/3] Add ericw-tools and TrenchBroom James Smith via Guix-patches via
2024-09-16  2:16 ` [bug#73287] [PATCH 1/3] gnu: Add embree-2 James Smith via Guix-patches via
2024-09-20  7:58   ` Liliana Marie Prikler
2024-09-21  0:35     ` James Smith via Guix-patches via
2024-09-16  2:16 ` [bug#73287] [PATCH 2/3] gnu: Add ericw-tools James Smith via Guix-patches via
2024-09-20  8:04   ` Liliana Marie Prikler
2024-09-16  2:16 ` [bug#73287] [PATCH 3/3] gnu: Add trenchbroom James Smith via Guix-patches via
2024-09-20  8:02   ` Liliana Marie Prikler
2024-09-21  0:38 ` [bug#73287] [PATCH v2 1/3] gnu: Add embree-2 James Smith via Guix-patches via
2024-09-21  0:38   ` [bug#73287] [PATCH v2 2/3] gnu: Add ericw-tools James Smith via Guix-patches via
2024-09-21  0:38   ` [bug#73287] [PATCH v2 3/3] gnu: Add trenchbroom James Smith via Guix-patches via
     [not found] ` <handler.73287.B.172645275019055.ack@debbugs.gnu.org>
2024-10-27 14:30   ` [bug#73287] [PATCH 0/3] Add ericw-tools and TrenchBroom James Smith via Guix-patches via
2024-12-08  3:48 ` [bug#73287] [PATCH v4 1/3] gnu: Add embree-2 James Smith via Guix-patches via
2024-12-08  3:48   ` [bug#73287] [PATCH v4 2/3] gnu: Add ericw-tools James Smith via Guix-patches via
2024-12-08  3:48   ` James Smith via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b762e62ff9523102189f3f3b4c251d1b38ef826.1733629326.git.jsubuntuxp@disroot.org \
    --to=guix-patches@gnu.org \
    --cc=73287@debbugs.gnu.org \
    --cc=adam.faiz@disroot.org \
    --cc=iyzsong@envs.net \
    --cc=jsubuntuxp@disroot.org \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.