From patchwork Sun Dec 8 03:48:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 34650 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4686127BBE2; Sun, 8 Dec 2024 03:50:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DF64627BBEA for ; Sun, 8 Dec 2024 03:50:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tK8J2-00022c-Pi; Sat, 07 Dec 2024 22:50:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tK8J0-00021I-Hv for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tK8J0-0003p2-7Q for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=M4FevOwKQiql5TYwodtONIvySzQjjvJk76pjlF7PRrE=; b=Sf0GpcaNGTsiIYeg0IY8VmDcNL5cAuo7JiHNMcWV5J7DaL/1AUL6+ZiI5xO0VckCbEDsTCRgI6IuNsWAf8tXkPM8R+fgFkNzK81stIRSfX1p7zWhGqo2MsQ3kQNoA278+Xr0TFq5KbDRgWnwRWw3eR1rFwpJ+S721Qghe5gzzPhkSKhHbBiFOfLovLEJBlqW2KFmUWj2qLNeYBvP2wvx+KtRMbyXD9LnWF50NZkdTW9SvX+3Wcm7BQKph84bFhzOvaubx7VK3+0mddvV2kdjBiCYCEJxKvJDxk2nn55FpOyfA6o2VQ+cyjXMRQLlL7U5lUjL7K7caiZxDFLPi34ypw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tK8J0-0006NO-1X for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH v4 1/3] gnu: Add embree-2. References: In-Reply-To: Resent-From: James Smith Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Dec 2024 03:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73287 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73287@debbugs.gnu.org Cc: James Smith Received: via spool by 73287-submit@debbugs.gnu.org id=B73287.173362975224412 (code B ref 73287); Sun, 08 Dec 2024 03:50:01 +0000 Received: (at 73287) by debbugs.gnu.org; 8 Dec 2024 03:49:12 +0000 Received: from localhost ([127.0.0.1]:49212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8I9-0006LR-L5 for submit@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:12 -0500 Received: from layka.disroot.org ([178.21.23.139]:41086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8I6-0006LD-7h for 73287@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:08 -0500 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A184925185; Sun, 8 Dec 2024 04:49:04 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pbMgzkzcRhD8; Sun, 8 Dec 2024 04:49:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1733629740; bh=TbTzgbrpcKLzd2UFUTkjt4vG2hu4R12veTsjglBYJDY=; h=From:To:Cc:Subject:Date; b=CydH2y1zJb8jyNAKsC1IEcliEeJG4onsY+k2td1No8zJYQhFHKLr83VZA+K1nFaoO ptizQuqDsjbKi4ieh7Btv4cUDongulYxWqTvghVP487zSYqfxOeQmtfIxdxQXdkNlu ODMJ97KKjv5KBFhd6eoLCSKvG1YyTc05Il1upGRawQxDrku5K8cV87oisRGByx7OiM JF0UypuEen2UCYmFP01MXnFZhhwP7W48QiUlS2Xt8U2UDuDKwYD7yCPyj7Xtca80fv 8HtIdlA8FCXc7Pa4upb2BslYM8jr4R/4VlNDaCuIusAYRRyNKjFiclPyyHVldV1W7c kRivFHEAMErQg== Date: Sat, 7 Dec 2024 20:48:30 -0700 Message-ID: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: James Smith X-ACL-Warn: , James Smith via Guix-patches X-Patchwork-Original-From: James Smith via Guix-patches via From: James Smith Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/graphics.scm: (embree-2): New variable. Change-Id: I2b2143b4d93c402ba940d408280ef1b37ab552ea --- gnu/packages/graphics.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) base-commit: bc630c5ebed27edd821ec363706f8b9cf1ee05cc diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index f33e9d3fcb..b1df26bca5 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -38,6 +38,7 @@ ;;; Copyright © 2023 Eric Bavier ;;; Copyright © 2023, 2024 Artyom V. Poptsov ;;; Copyright © 2024 Ivan Vilata-i-Balaguer +;;; Copyright © 2024 James Smith ;;; ;;; This file is part of GNU Guix. ;;; @@ -491,6 +492,30 @@ (define-public embree-3 (base32 "1kcvz7g6j56anv9zjyd3gidxl46vipw0gg82lns12m45cd43iwxm")))))) +(define-public embree-2 + (package/inherit embree + (version "2.17.7") + (source + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/RenderKit/embree") + (commit (string-append "v" version)))) + (file-name (git-file-name (package-name embree) version)) + (sha256 + (base32 "19v60zdfix33c772x6dzmhsarhafsns8qy7c2ysqr7a9j16whgql")))) + (arguments + (substitute-keyword-arguments (package-arguments embree) + ((#:configure-flags configure-flags) + #~(append (list "-DEMBREE_MAX_ISA=NONE" "-DEMBREE_TUTORIALS=OFF") + #$configure-flags)))) + (inputs (modify-inputs (package-inputs embree) + (replace "tbb" tbb-2020))) + ;; Embree requires SSE2 support, so build only for x86-based architectures. + (supported-systems (list "i686-linux" "x86_64-linux")) + (description (string-append (package-description embree) " + +Please note that this version requires a processor with SSE2 support.")))) + (define-public openvdb (package (name "openvdb") From patchwork Sun Dec 8 03:48:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 34649 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9A5DB27BBE2; Sun, 8 Dec 2024 03:50:43 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E469F27BBEB for ; Sun, 8 Dec 2024 03:50:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tK8J5-00024X-8t; Sat, 07 Dec 2024 22:50:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tK8J2-000236-Tz for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tK8J2-000417-LJ for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=88VVQIOBvZiq7K3ZuCQ9JVxHzzYzd//Qbe5W3iPTgvs=; b=Yj9xsb39sPRkHNuy2ho/umt5D90W4D9cFNKFWpjdVxVzbR0iL2Wt/WdBZ/vi6nlIAfqnD4JvqhsFD20gKXQxsj8bWSdsmG6ksqoB9+xV+j9FRv6DlQnnrn+GJ7qZc80Lk9o3OMhrTjbGIOKFxcsI+Q5Jn8ixuk+f0n358ngp20B1Cw0Q8hu3hWDjY8ILcya01LT2dAlV3huz+6TTqKY9IBw45pMWEl+66Dt3xyAOxtRdJ97udA18f5+J839kV/e4RYm8qL06Hzb3X2z1KactelWWqHiVuAQv+/wzBu/TLHBAp8gY7n9qMpvozlds184FWAGOPfEY7/PtabuQO4KPOw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tK8J0-0006NY-QW; Sat, 07 Dec 2024 22:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH v4 2/3] gnu: Add ericw-tools. Resent-From: James Smith Original-Sender: "Debbugs-submit" Resent-CC: adam.faiz@disroot.org, liliana.prikler@gmail.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Sun, 08 Dec 2024 03:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73287 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73287@debbugs.gnu.org Cc: James Smith , Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= X-Debbugs-Original-Xcc: Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= Received: via spool by 73287-submit@debbugs.gnu.org id=B73287.173362975424426 (code B ref 73287); Sun, 08 Dec 2024 03:50:02 +0000 Received: (at 73287) by debbugs.gnu.org; 8 Dec 2024 03:49:14 +0000 Received: from localhost ([127.0.0.1]:49215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8ID-0006Lo-MP for submit@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:14 -0500 Received: from layka.disroot.org ([178.21.23.139]:41098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8I8-0006LK-Ir for 73287@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:10 -0500 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id E190624D36; Sun, 8 Dec 2024 04:49:07 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7fAMTndrLG2B; Sun, 8 Dec 2024 04:49:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1733629743; bh=hob8ojuWmiTpCnClD05M5UriOdC2oYZgDKk22322+NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T+igxFn4pdRgrAcuJPD3o0nNM/SnaIJZuiM10gfPOyiIdumoHnaf6MDU8YFUUHA6C G69UKcd70uHTmVLVCoYP99xEU7QDKwgkICuFMjRET1sxIZlFOTRZu0zFnpP8owtd1U 8fD7msosh7N3GTKJ3r1EeASfbZobpe4aeHXj/CdanaBxUkED3rdlLa69he9A3w7dAY yPD6D0spqBYwll9yEWHykzoc6ttyNDlCbtEZk7IEZJbpxJCSSRB/iQDtE+DrjM7KC/ aqcgBRzbKKdu3ge4uubN5nB8K4L+6ojx5P2kgObg9uiwWYSKZosLf9H0Ax9+UqDG18 mpZY8n/UySgVA== Date: Sat, 7 Dec 2024 20:48:31 -0700 Message-ID: In-Reply-To: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org> References: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: James Smith X-ACL-Warn: , James Smith via Guix-patches X-Patchwork-Original-From: James Smith via Guix-patches via From: James Smith Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/game-development.scm: (ericw-tools): New variable. * gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch: New file. * gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch: New file. * gnu/local.mk: Register patch files. Change-Id: I896b8f781054442e4db4a7220d526b8f2878873c --- gnu/local.mk | 3 + gnu/packages/game-development.scm | 67 ++++++++++++++ ...tools-add-check-for-sse2-in-light.cc.patch | 34 +++++++ ...-tools-gcc-11-pass-const-to-offsetof.patch | 90 +++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch create mode 100644 gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch diff --git a/gnu/local.mk b/gnu/local.mk index a7bd32453b..5a3a762080 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -69,6 +69,7 @@ # Copyright © 2024 Fabio Natali # Copyright © 2024 Noé Lopez # Copyright © 2024 Runciter +# Copyright © 2024 James Smith # # This file is part of GNU Guix. # @@ -1211,6 +1212,8 @@ dist_patch_DATA = \ %D%/packages/patches/epiphany-fix-encoding-test.patch \ %D%/packages/patches/ergodox-firmware-fix-json-target.patch \ %D%/packages/patches/ergodox-firmware-fix-numpad.patch \ + %D%/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch \ + %D%/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch \ %D%/packages/patches/erlang-man-path.patch \ %D%/packages/patches/esmini-use-pkgconfig.patch \ %D%/packages/patches/esmtp-add-lesmtp.patch \ diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 6be9d746c7..2aee26593c 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -2382,6 +2382,73 @@ (define-public entt (license (list license:expat ; code license:cc-by4.0)))) ; documentation +(define-public ericw-tools + (package + (name "ericw-tools") + (version "0.18.1") + (source + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/ericwa/ericw-tools") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "11sap7qv0rlhw8q25azvhgjcwiql3zam09q0gim3i04cg6fkh0vp")) + (patches + (search-patches "ericw-tools-add-check-for-sse2-in-light.cc.patch" + "ericw-tools-gcc-11-pass-const-to-offsetof.patch")))) + (build-system cmake-build-system) + (arguments + (list #:configure-flags #~(list "-DENABLE_LIGHTPREVIEW=OFF") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-copying-embree-files + (lambda _ + ;; Tries to copy files from embree, disable it. + (substitute* "light/CMakeLists.txt" + (("install\\\(FILES \\$\\{EMBREE") + "#install(FILES ${EMBREE")))) + (add-after 'install 'rename-binaries + (lambda _ + ;; Rename binaries to prevent collisions with other + ;; packages. + (rename-file (string-append #$output "/bin/bspinfo") + (string-append #$output "/bin/qbspinfo")) + (rename-file (string-append #$output "/bin/bsputil") + (string-append #$output "/bin/qbsputil")) + (rename-file (string-append #$output "/bin/light") + (string-append #$output "/bin/qlight")) + (rename-file (string-append #$output "/bin/vis") + (string-append #$output "/bin/qvis")))) + (add-after 'install-license-files 'clean-up-bin-directory + (lambda _ + ;; Install target copies text documents to #$output/bin, move + ;; them to #$output/share/doc. + (delete-file (string-append #$output "/bin/gpl_v3.txt")) + (rename-file + (string-append #$output "/bin/changelog.txt") + (string-append #$output "/share/doc/" + #$(package-name this-package) "-" + #$(package-version this-package) + "/changelog.txt")) + (rename-file + (string-append #$output "/bin/README.md") + (string-append #$output "/share/doc/" + #$(package-name this-package) "-" + #$(package-version this-package) + "/README.md"))))) + #:tests? #f)) ; No tests + (inputs (list embree-2)) + (home-page "https://ericwa.github.io/ericw-tools/") + (synopsis "Map compiling tools for Quake/Hexen 2") + (description "A collection of command line utilities used for building +Quake maps as well as working with various Quake file formats. The utilities +include @command{qbsp} for building the geometry, @command{qvis} for +calculating visibility, @command{qlight} for lighting, @command{bspinfo} for +getting information, and @command{bsputil} for basic editing of data in a map +file.") + (license license:gpl2+))) + (define-public eureka (package (name "eureka") diff --git a/gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch b/gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch new file mode 100644 index 0000000000..5dee955a95 --- /dev/null +++ b/gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch @@ -0,0 +1,34 @@ +This patch is from upstream and shouldn't be needed in the next release. +https://github.com/ericwa/ericw-tools/commit/982ef5276bb231ded12c45a686b0875594175774.patch + +From 982ef5276bb231ded12c45a686b0875594175774 Mon Sep 17 00:00:00 2001 +From: Bryan Haley +Date: Mon, 28 Mar 2022 22:05:28 -0700 +Subject: [PATCH] Add check for SSE2 in light.cc (#328) + +--- + light/light.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/light/light.cc b/light/light.cc +index 7e23d040f..c00844643 100644 +--- a/light/light.cc ++++ b/light/light.cc +@@ -33,7 +33,7 @@ + #include + #include + +-#ifdef HAVE_EMBREE ++#if defined(HAVE_EMBREE) && defined (__SSE2__) + #include + //#include + #endif +@@ -255,7 +255,7 @@ LightThread(void *arg) + { + const mbsp_t *bsp = (const mbsp_t *)arg; + +-#ifdef HAVE_EMBREE ++#if defined(HAVE_EMBREE) && defined (__SSE2__) + _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); + // _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); + #endif diff --git a/gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch b/gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch new file mode 100644 index 0000000000..12ec4400d7 --- /dev/null +++ b/gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch @@ -0,0 +1,90 @@ +This patch is from upstream and shouldn't be needed in the next release. +https://github.com/ericwa/ericw-tools/commit/c9570260fa895dde5a21272d76f9a3b05d59efdd.patch + +From c9570260fa895dde5a21272d76f9a3b05d59efdd Mon Sep 17 00:00:00 2001 +From: Eric Wasylishen +Date: Sun, 30 May 2021 23:12:17 -0600 +Subject: [PATCH] gcc 11: pass constant to offsetof + +--- + common/polylib.cc | 5 ++++- + qbsp/util.cc | 5 ++++- + qbsp/winding.cc | 4 +++- + vis/vis.cc | 10 ++++++++-- + 4 files changed, 19 insertions(+), 5 deletions(-) + +diff --git a/common/polylib.cc b/common/polylib.cc +index 6397b3107..c8e1afbff 100644 +--- a/common/polylib.cc ++++ b/common/polylib.cc +@@ -230,7 +230,10 @@ polylib::CopyWinding(const winding_t * w) + int size; + winding_t *c; + +- size = offsetof(winding_t, p[w->numpoints]); ++ //size = offsetof(winding_t, p[w->numpoints]); ++ size = offsetof(winding_t, p[0]); ++ size += w->numpoints * sizeof(w->p[0]); ++ + c = static_cast(malloc(size)); + memcpy(c, w, size); + return c; +diff --git a/qbsp/util.cc b/qbsp/util.cc +index e8baf7205..16c9077f1 100644 +--- a/qbsp/util.cc ++++ b/qbsp/util.cc +@@ -53,7 +53,10 @@ AllocMem(int Type, int cElements, bool fZero) + if (cElements > MAX_POINTS_ON_WINDING) + Error("Too many points (%d) on winding (%s)", cElements, __func__); + +- cSize = offsetof(winding_t, points[cElements]) + sizeof(int); ++ //cSize = offsetof(winding_t, points[cElements]) + sizeof(int); ++ cSize = offsetof(winding_t, points[0]); ++ cSize += cElements * sizeof(static_cast(nullptr)->points[0]); ++ cSize += sizeof(int); + + // Set cElements to 1 so bookkeeping works OK + cElements = 1; +diff --git a/qbsp/winding.cc b/qbsp/winding.cc +index 1af1d096c..6e286c387 100644 +--- a/qbsp/winding.cc ++++ b/qbsp/winding.cc +@@ -106,7 +106,9 @@ CopyWinding(const winding_t *w) + winding_t *c; + + c = (winding_t *)AllocMem(WINDING, w->numpoints, false); +- size = offsetof(winding_t, points[w->numpoints]); ++ //size = offsetof(winding_t, points[w->numpoints]); ++ size = offsetof(winding_t, points[0]); ++ size += w->numpoints * sizeof(w->points[0]); + memcpy(c, w, size); + + return c; +diff --git a/vis/vis.cc b/vis/vis.cc +index 9fb0ea9ea..ec43a8a5f 100644 +--- a/vis/vis.cc ++++ b/vis/vis.cc +@@ -127,7 +127,10 @@ NewWinding(int points) + if (points > MAX_WINDING) + Error("%s: %i points", __func__, points); + +- size = offsetof(winding_t, points[points]); ++ //size = offsetof(winding_t, points[points]); ++ size = offsetof(winding_t, points[0]); ++ size += points * sizeof(w->points[0]); ++ + w = static_cast(malloc(size)); + memset(w, 0, size); + +@@ -178,7 +181,10 @@ CopyWinding(const winding_t * w) + int size; + winding_t *c; + +- size = offsetof(winding_t, points[w->numpoints]); ++ //size = offsetof(winding_t, points[w->numpoints]); ++ size = offsetof(winding_t, points[0]); ++ size += w->numpoints * sizeof(w->points[0]); ++ + c = static_cast(malloc(size)); + memcpy(c, w, size); + return c; From patchwork Sun Dec 8 03:48:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 34648 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5ACAC27BBEE; Sun, 8 Dec 2024 03:50:41 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 122F227BBE2 for ; Sun, 8 Dec 2024 03:50:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tK8JA-00028Y-OS; Sat, 07 Dec 2024 22:50:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tK8J8-000277-NK for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:10 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tK8J8-00041t-Ec for guix-patches@gnu.org; Sat, 07 Dec 2024 22:50:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=IQ7dnGXZN/HOqGtin1kOHUprJDWs+4eylEEdl6HCv7w=; b=cv5xJfPqXPmoWA+e1SyOMJ4dpwr/zLsKt9/O0ljdqqa1rg+9qS6P1oBA8INo1zRAHaJISYTqcJdeVU3Sit185Tk5Iim49tU06lN0j/enc2ABojiXlWWUCplQCt7wzTrjpkeLth/0iQIb/kQx8TknoeHw0AcOC3RY53nJUckK4HJK2sOf1lEY0Y+J515FIB/W8ueM4s2hzAgTsNlXLiiEJsRme/NEL/iDuqgvyzOjN9N80LPUKc/5SckZBw8q8A4jcNAoyQ+f96EmLEYFNlOgLPFg84vwzY8Nddynk9I9XPcEXuNSBF95aQpm/aWAlEhgl60ciTxzZ+9t/kVZj2HrSg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tK8J1-0006Nh-FL; Sat, 07 Dec 2024 22:50:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH v4 3/3] gnu: Add trenchbroom. Resent-From: James Smith Original-Sender: "Debbugs-submit" Resent-CC: adam.faiz@disroot.org, liliana.prikler@gmail.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Sun, 08 Dec 2024 03:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73287 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73287@debbugs.gnu.org Cc: James Smith , Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= X-Debbugs-Original-Xcc: Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= Received: via spool by 73287-submit@debbugs.gnu.org id=B73287.173362975524432 (code B ref 73287); Sun, 08 Dec 2024 03:50:03 +0000 Received: (at 73287) by debbugs.gnu.org; 8 Dec 2024 03:49:15 +0000 Received: from localhost ([127.0.0.1]:49217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8IE-0006Lv-Qk for submit@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:15 -0500 Received: from layka.disroot.org ([178.21.23.139]:41100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK8IA-0006LT-Es for 73287@debbugs.gnu.org; Sat, 07 Dec 2024 22:49:11 -0500 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0F7F124C9D; Sun, 8 Dec 2024 04:49:10 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Wn09lc6fJTYD; Sun, 8 Dec 2024 04:49:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1733629745; bh=jf+7jVanQ7Gp0hvd9PbYaTxE/ATEz/gWAu99GgI6LcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UGWekQinXMYkB69UlQHwTjBCwPzy1wrLdrmWWI6X0SLKdtH+NBnVa4toFJ6Lm+687 iXQo7g8UNPaJxkjA0fM4coKk3NDeGPXdymm8IrQIHyvYj/i4vshQuA5NDXClKEvoV+ CHgc8ujn3ZrmzTIA4QOAaClIaLIUfgIqn4d82CcFARIpGon4sjxbpi/7SJdQDTLOh2 hzfg08uIHe6ML1j9WJVNiRscJahV2linGXXK67eL3tik8wqvMMrOrM+izph5qZCZkF 3ZTuei/E6J+tpvEGKslUVQ5qDZMowS1Xv2Eo46SPWw14vt2wuAAKHzujxNAVrJ/f+8 guati8j0OylCA== Date: Sat, 7 Dec 2024 20:48:32 -0700 Message-ID: <7b762e62ff9523102189f3f3b4c251d1b38ef826.1733629326.git.jsubuntuxp@disroot.org> In-Reply-To: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org> References: <1358ec328b7c9a2452e2dd139d8cf203a83d6184.1733629326.git.jsubuntuxp@disroot.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: James Smith X-ACL-Warn: , James Smith via Guix-patches X-Patchwork-Original-From: James Smith via Guix-patches via From: James Smith Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")