From patchwork Mon Sep 16 02:16:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 67980 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 D970A27BBEA; Mon, 16 Sep 2024 03:18:18 +0100 (BST) 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_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 7D3BD27BBE2 for ; Mon, 16 Sep 2024 03:18:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sq1JL-0002DY-9C; Sun, 15 Sep 2024 22:17:55 -0400 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 1sq1JH-0002CP-58 for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:51 -0400 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 1sq1JG-00072i-Sj for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:50 -0400 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=hBHZxVel56J5iMkpljELhYHVTn14OOCw2T5OigeHItE=; b=riEKPthYBDRXhkhlxJhdh4Ht19/GM1ln+B4HW78YWoovOmhE9c2uGB5yN9qjfBWkxv9nvuoKM+cEYcp71UNyXBZYXXT6Jq5Bj48T+kIuM7YG+r1RPqDYbq+KpJFrigXEGnKa+oUnxWeRNjoHZwZkB0QA/9nmSThvNP/tniSiZyndf1Gu+EPXTlYQk3gh/trQFJ2jpMpaDlx7EL1p+0rEpPlc/pLFc4X/+S69NgPWUYMPQ10hpI/cASxzT7y0NKSsYYlqm/EtK1tdR2W8mWMQ2rsCDhSN61uexDnGW4cOjs5eNaF3l3NiiUus2Y0KXDZWrrR6vWAbYPmnS18lLeAz5w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sq1JS-0005HL-GG for guix-patches@gnu.org; Sun, 15 Sep 2024 22:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH 1/3] gnu: Add embree-2. Resent-From: James Smith Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Sep 2024 02:18: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 Received: via spool by 73287-submit@debbugs.gnu.org id=B73287.172645303320185 (code B ref 73287); Mon, 16 Sep 2024 02:18:02 +0000 Received: (at 73287) by debbugs.gnu.org; 16 Sep 2024 02:17:13 +0000 Received: from localhost ([127.0.0.1]:50764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1If-0005FU-16 for submit@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:13 -0400 Received: from layka.disroot.org ([178.21.23.139]:57620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1Id-0005FF-8K for 73287@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:12 -0400 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B8E1123D59; Mon, 16 Sep 2024 04:16:57 +0200 (CEST) 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 sz0EtY_uYR-v; Mon, 16 Sep 2024 04:16:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1726453016; bh=HKd2icmq/Wf/Kid+jLeKH8w1mvnhq06rcdDXeM4zXaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UFZjbuu7RFSeVyPUvW3kQoC8XJY8YWuDfXrqzxnD5hP+XG8JVIVHqaXuK9SArf/OX Ufjsmq2GFgjWfyJB6eH9ZUXJKIwMcJBQJois1Izy5r1vvCkf9pPJiVcsvbmSP2kuNp mGc/3B/wEKyZh0mJXyUP2wsq9eW4Bu4mvadLGZ4BIhnk0lnz8Tv+g7qK+MoILGKOkF mjiOX4+vPzmCtk9jNhrs6qHAOgKXjpbwcGObVCRxBi8c51DB6IU3vMkwXdRmRYr8Ar qX+7HgKb6R5U+agkCS0fj6LciTkvnNam366Vjl3AHyQky/yza8aJmnaftqFVCIvLQ4 P9V1F2Eox6VAQ== Date: Sun, 15 Sep 2024 19:16:22 -0700 Message-ID: <523f56c5bce617aba865a0d6cb7497caed06d249.1726445374.git.jsubuntuxp@disroot.org> In-Reply-To: References: 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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 3d03802245..d893c9dfee 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -37,6 +37,7 @@ ;;; Copyright © 2023 David Thompson ;;; Copyright © 2023 Eric Bavier ;;; Copyright © 2023, 2024 Artyom V. Poptsov +;;; Copyright © 2024 James Smith ;;; ;;; This file is part of GNU Guix. ;;; @@ -490,6 +491,27 @@ (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_TUTORIALS=OFF") #$configure-flags)))) + (inputs (modify-inputs (package-inputs embree) + (replace "tbb" tbb-2020))) + ;; Tries to build with SSE2 and AVX support on ARM, so disable building for + ;; those systems. + (supported-systems (list "i686-linux" "x86_64-linux")))) + (define-public openvdb (package (name "openvdb") From patchwork Mon Sep 16 02:16:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 67979 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 57D2627BBE9; Mon, 16 Sep 2024 03:18:17 +0100 (BST) 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_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable 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 E626327BBE2 for ; Mon, 16 Sep 2024 03:18:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sq1JJ-0002Cn-1T; Sun, 15 Sep 2024 22:17:53 -0400 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 1sq1JH-0002CX-QQ for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:51 -0400 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 1sq1JH-00072p-HQ for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:51 -0400 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=L6ujG49gWdQVS55IqfUxi7x1qwjzmhBRzWbZW4KD7aM=; b=Emd6bKGYOUNw7O0Jrl1K3/cPUEM1oX5D/wYjGtdBEpYTy+ApmMs/vO9PMiFX3fA9yD67HPahxzvGAfyLdKcEshxq6NgQVbSwnKo0+5Lvf/ycKJlRmw9lWamktgecgWfTDelfH27wjl7a8jh2sTN1I2rK8TtSI6j7g3Wvg4ne6W1/2OF62qp/LrvF8QUEFrFyWJZUEv6XAqLwdu4//moY2ymMygnCB0pofbh6lgtqyjS5cp/CTbMepgWapmakfossY6OWVDXJd47h9iDTE5k7X+yWFXzCSNF6zJXTV0OdsfH7h/ilP8PZWhf9myVk5siZVjOvJt/bRYQym9gkyKfipg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sq1JS-0005HS-V0; Sun, 15 Sep 2024 22:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH 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: Mon, 16 Sep 2024 02:18: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.172645304420217 (code B ref 73287); Mon, 16 Sep 2024 02:18:02 +0000 Received: (at 73287) by debbugs.gnu.org; 16 Sep 2024 02:17:24 +0000 Received: from localhost ([127.0.0.1]:50767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1Ip-0005Fy-Df for submit@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:24 -0400 Received: from layka.disroot.org ([178.21.23.139]:43844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1Im-0005Fo-5N for 73287@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:21 -0400 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id CF61B23D0F; Mon, 16 Sep 2024 04:17:06 +0200 (CEST) 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 di_pjPK23c1w; Mon, 16 Sep 2024 04:17:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1726453025; bh=oo4ByvykCVQxcgPV092952JMt9ExE/CPUSH8p9DXlKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=liLZODoyfvPa9IdiREc9jCKK27VqiNFERWox2CHdBPZRYTI5bth/MRJlJc4U/YGhK c7H8cU4+DvWQeB+z0w4dG+eYKpe6f6aetpLqVZ4XRsU0cldpf5FpmfVvwoFkxUXDfr QCrx1LP8c7CXc9ITXFC90AMVc05Qj8LtAW+Rbrejaq7BC3R/RXxNnIaSlativ/8U7u MUa9lNRAFScx7FunZeSLt0POFTqzETov8VEMFjFSevvYrjqTIHFxxw/KP8REDGmR+U e19D19ER1bErM3R49ipUjdh12TZeTB1qpWvauRRMBCgy9IF3M948j7v/nfnb+nGi8L DlOIonESm4iWA== Date: Sun, 15 Sep 2024 19:16:23 -0700 Message-ID: <77a59889d3bed9a7629b49da7b033846cb195715.1726445374.git.jsubuntuxp@disroot.org> In-Reply-To: References: 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 | 75 ++++++++++++++++ ...tools-add-check-for-sse2-in-light.cc.patch | 31 +++++++ ...-tools-gcc-11-pass-const-to-offsetof.patch | 87 +++++++++++++++++++ 4 files changed, 196 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 fcdf174099..bb7ec9960c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -67,6 +67,7 @@ # Copyright © 2024 David Elsing # Copyright © 2024 Ashish SHUKLA # Copyright © 2024 Fabio Natali +# Copyright © 2024 James Smith # # This file is part of GNU Guix. # @@ -1200,6 +1201,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 efbbabaaf5..d61b4d633a 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -2394,6 +2394,81 @@ (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 "Quake/Hexen 2 map compiling tools") + (description "Collection of command line utilities for building Quake levels +and working with various Quake file formats. A brief description of the tools +are listed below. + +Included utilities: + +@itemize @bullet +@item qbsp - Used for turning a .map file into a playable .bsp file. +@item qlight - Used for lighting a level after the bsp stage. This util was +previously known as TyrLite. +@item qvis - Creates the potentially visible set (PVS) for a bsp. +@item qbspinfo - Print stats about the data contained in a bsp file. +@item qbsputil - Simple tool for manipulation of bsp file data. +@end itemize") + (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..4c95b8570d --- /dev/null +++ b/gnu/packages/patches/ericw-tools-add-check-for-sse2-in-light.cc.patch @@ -0,0 +1,31 @@ +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..6da4179a9e --- /dev/null +++ b/gnu/packages/patches/ericw-tools-gcc-11-pass-const-to-offsetof.patch @@ -0,0 +1,87 @@ +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 Mon Sep 16 02:16:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smith X-Patchwork-Id: 67978 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 8E27427BBEA; Mon, 16 Sep 2024 03:18:11 +0100 (BST) 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_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 94D8F27BBE2 for ; Mon, 16 Sep 2024 03:18:10 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sq1JJ-0002Co-9W; Sun, 15 Sep 2024 22:17:53 -0400 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 1sq1JI-0002Ce-55 for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:52 -0400 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 1sq1JH-00072u-T3 for guix-patches@gnu.org; Sun, 15 Sep 2024 22:17:51 -0400 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=qu9MRX2p6DxzfN3r79dKqkNgb+wm8Y8v5wh5vua/TcI=; b=k0b6BmUZ+0+WutfNgByWwm7NG46Oj0jb0CoTJXXzjkj4uokgyu/0BYNIkwKVc8sTHLAXaQU3BCo80pXbDfefrvaV84UrsUrm7vCnvYZEF12KSjwk/NHB4imQVw6LbRJedUdiJqpYoAGUshSN86Yp8p3yI24Oq3336fYG3fsKd49UViS2ytGiu56iwdUvdhdtUGwmGZLIx4H3yv9VYCxiMenMQhEkMClUCigTeLXoyp62WMkNV6P3ua54HjBdUJ7f1+8tRJ2F4hmDWZhIODvy0Y3tJJ/ChnsiFHz3bda4DqJwThKCFcn+9Q3xb/MZLU6gq8s0nMKFCampwENP41Bkpw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sq1JT-0005Hb-Fk; Sun, 15 Sep 2024 22:18:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH 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: Mon, 16 Sep 2024 02:18: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.172645304720233 (code B ref 73287); Mon, 16 Sep 2024 02:18:03 +0000 Received: (at 73287) by debbugs.gnu.org; 16 Sep 2024 02:17:27 +0000 Received: from localhost ([127.0.0.1]:50770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1Is-0005GF-Cs for submit@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:27 -0400 Received: from layka.disroot.org ([178.21.23.139]:43850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sq1Iq-0005G0-A0 for 73287@debbugs.gnu.org; Sun, 15 Sep 2024 22:17:25 -0400 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2B18723D33; Mon, 16 Sep 2024 04:17:11 +0200 (CEST) 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 NWXELMUtSckp; Mon, 16 Sep 2024 04:17:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1726453030; bh=hxSaBjKBpH3cPYhvS7UrKapDDHOJ+e32vRCedvmA6p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hZKJ/lz2UNX4OSzXKtWl8CrV1QVSRrl9siFwUVMM0DK9x57k+y6fOPLwzn0isQpGx BTvgAkIxRTcUvK4NTza7+7LNJ2L3U19clMl8W85gGPKUExknT6qMRelx2NLAOpDtWI ijuNAySKGWhGLMzzZxoE5d7fIZLIT4H9kzwISBMXok4ARl/amFFJtXvMIND75AT3yA tzyjq/S1k2gBgh2X34/dzQPbkw6thvxgJf/H6jt6R3GgtZeLTycaD8mGnCwTwLF4OW f+bPYyyR9JeWWScbIKTsQTMpZcY3/NtZj5EPwSxv4qCgtWsHwLRnAg/ZyyX4JBwBwW bRmlM3b7LRo7g== Date: Sun, 15 Sep 2024 19:16:24 -0700 Message-ID: In-Reply-To: References: 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 d61b4d633a..abc144f535 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -91,12 +91,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) @@ -104,6 +106,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-crypto) @@ -121,6 +124,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) @@ -674,6 +678,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, and Hexen 2. TrenchBroom is easy and +provides many simple and advanced tools to create complex and interesting levels +with ease.") + (license license:gpl3+))) + (define-public tsukundere (package (name "tsukundere")