From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MLCxDmpwJ2fZLQEA62LTzQ:P1 (envelope-from ) for ; Sun, 03 Nov 2024 12:45:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id MLCxDmpwJ2fZLQEA62LTzQ (envelope-from ) for ; Sun, 03 Nov 2024 13:45:30 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Nwt7tb4N; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=VNuL0Vjw; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1730637929; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=U2Qelt0gin92RZfPN27l1Ef8PRWjLoAKo1eNUHplnaA=; b=YCZeQK4o+3alba1d0KARFSPayNdgTCb43NSAI6pIgwEejI82KOn+tdB5t9wBXbdbJrbn+m dFCgFbAL0sj5u0BOFNHgOqLRExU3Ic8r+O8yn7SINfqOLAjveHeHI0JM97gY9GMMqN9tRU TFLWP19ov22SvvOIIdHMX8/CnnqeclwNH4dw7DacC3a+ecaqm+NOfgLctb4dBufLWHKwgc e6PK1h7+RQ3reRgcf3+Zj4GOYRPGr946L1l5hJDjbkDqiJCse5tFgMSSY3oFj9UXgADEfK +mUmijfsmvmSRTs1uuFnjg4Q8/j0/0zhxqxDETo8tcdzqygorYhYiwbzNr05gQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1730637929; a=rsa-sha256; cv=none; b=Hz2+YpJO2Cm+/IoWpE9kVtN22MAlR5LJOFM8WNje0gTGQABc+FLJN3Lmi/j85A4JAVa0y0 roI/6UMXeRdLIW3LsiFTcNxfzPwtPTPexZIbYyGKjR9g6t9PMiysiCj5Pa5oN288W7nZZS +NrS+DqSAqDU6oQdaFvTPFMLnwV87uvVr+nfmyAiEi+vNRRj7OnhOzRuF0nd1HMFMkrx0j bih1O+fb5Qtv1gPYTBtdJOrxP5H3UKDlTvQlKxim3lLx5iVGuD9WEUCp1Ic4JSp11hr3o7 089X0mTieos/ztYJLs9pMHcI9sAmLweL+1g23PlVPLYAGhiNhpJSbqxu7yKONg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Nwt7tb4N; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=VNuL0Vjw; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A33E758F44 for ; Sun, 03 Nov 2024 13:45:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7Zye-0006Ba-U0; Sun, 03 Nov 2024 07:45:09 -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 1t7Zyc-0006BA-W3 for guix-patches@gnu.org; Sun, 03 Nov 2024 07:45:07 -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 1t7Zyb-00022s-Qo for guix-patches@gnu.org; Sun, 03 Nov 2024 07:45:06 -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=U2Qelt0gin92RZfPN27l1Ef8PRWjLoAKo1eNUHplnaA=; b=Nwt7tb4NFNn4t4lE8bZzKSedinBNWHQBqBykN0aPz8OyQuDv3/X5iehbVgzu0wkj0YfWFTCvS4X6t465m+syb73mIfFphOip0Hy5RsnfbgW5oOtKpdN4HyYiBMeaXsirM2zsCv12zRQAEdJWCL0yIKqUkpbTjupTvRC4FNLYierpQPwBPHx31L9J8/lA6IJNhV2yTpJoFbcg4ylDrJvMLoVVCxt8TH/kf1VJWDD2YXeUq5E03WRD4bSnG23GZBF1XvZ/FlnEfTsMRqWPudWU5naFMy1WM5Ua2UsXKGWvkA0Qycc8WH6IcEg43HX5035WkqVZYINh+3L5R0aFbmizhQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t7ZyY-0005iJ-5l; Sun, 03 Nov 2024 07:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73287] [PATCH v3 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, 03 Nov 2024 12:45: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?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-Xcc: Adam Faiz , Liliana Marie Prikler , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Received: via spool by 73287-submit@debbugs.gnu.org id=B73287.173063785721907 (code B ref 73287); Sun, 03 Nov 2024 12:45:02 +0000 Received: (at 73287) by debbugs.gnu.org; 3 Nov 2024 12:44:17 +0000 Received: from localhost ([127.0.0.1]:60204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7Zxn-0005hG-Tg for submit@debbugs.gnu.org; Sun, 03 Nov 2024 07:44:16 -0500 Received: from layka.disroot.org ([178.21.23.139]:53226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7Zxk-0005h8-Bl for 73287@debbugs.gnu.org; Sun, 03 Nov 2024 07:44:14 -0500 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id EADBC251B4; Sun, 3 Nov 2024 13:44:11 +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 BfSwNYtCONG3; Sun, 3 Nov 2024 13:44:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1730637847; bh=qWk4y3ZO9TadT4QLuodbwrU9T5k/kdNisY80jm0+y0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VNuL0VjwMvd83yR82/1RGb+vMRTHfK8j+L1D0NfTF77+lqswr0kIToNd8MjEbSGVd PHif8PV09FTCu+K13sFWDtl1CjEnwlaTQ8x83C5GpYJd6AemchCxv2gRUaK8pn3CwU J5Mx14bsIPPhSAWnaIDGFUfkTtM+2DqyqJDa+CgdObG8pyYH29NyM1eSqL3gPSkQU8 7AnsXGYjawGBYsRFr3gunJ0dHF4r2gfqdQDVvTyHErcOkJzF7HKhx341kPZU3bocxO 25C/q0ehhWvY1gnnZ1Z9DwVb8QeHTEENXSnBuQAvBSP3nQiM8ClkvQ3WLEBJ26Bpla 80QVYvioMsjXQ== Date: Sun, 3 Nov 2024 05:39:45 -0700 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: James Smith via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.68 X-Spam-Score: -1.68 X-Migadu-Queue-Id: A33E758F44 X-Migadu-Scanner: mx13.migadu.com X-TUID: MyvGGd6DHQPz * 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 | 31 +++++++ ...-tools-gcc-11-pass-const-to-offsetof.patch | 87 +++++++++++++++++++ 4 files changed, 188 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 5b28de35f2..f2a620ffdd 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. # @@ -1208,6 +1209,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 ee869c9cc5..7d168151d2 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -2399,6 +2399,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..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; -- 2.46.0