Github messages for voidlinux
 help / color / mirror / Atom feed
From: TwelveEyes <TwelveEyes@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: dsda-doom-0.22.5
Date: Sat, 02 Apr 2022 04:17:22 +0200	[thread overview]
Message-ID: <20220402021722.PSJKlKxvpU9JTtpHP_kSmz6x79TGlUnSSFgYqivi-0A@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32880@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]

There is an updated pull request by TwelveEyes against master on the void-packages repository

https://github.com/TwelveEyes/void-packages dsda-doom
https://github.com/void-linux/void-packages/pull/32880

New package: dsda-doom-0.22.5
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/32880.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dsda-doom-32880.patch --]
[-- Type: text/x-diff, Size: 6556 bytes --]

From fb8481192dbb0449529c406360fd0e097779b30f Mon Sep 17 00:00:00 2001
From: Gene <elkaufman5@gmail.com>
Date: Wed, 8 Sep 2021 13:13:53 -0700
Subject: [PATCH] New package: dsda-doom-0.24.3

---
 srcpkgs/dsda-doom/patches/affinity-hack.patch | 165 ++++++++++++++++++
 srcpkgs/dsda-doom/template                    |  19 ++
 2 files changed, 184 insertions(+)
 create mode 100644 srcpkgs/dsda-doom/patches/affinity-hack.patch
 create mode 100644 srcpkgs/dsda-doom/template

diff --git a/srcpkgs/dsda-doom/patches/affinity-hack.patch b/srcpkgs/dsda-doom/patches/affinity-hack.patch
new file mode 100644
index 000000000000..2155ab116b82
--- /dev/null
+++ b/srcpkgs/dsda-doom/patches/affinity-hack.patch
@@ -0,0 +1,165 @@
+diff --git a/prboom2/CMakeLists.txt b/prboom2/CMakeLists.txt
+index d317ddec..c86f76b0 100644
+--- a/prboom2/CMakeLists.txt
++++ b/prboom2/CMakeLists.txt
+@@ -53,6 +53,15 @@ endif()
+ check_symbol_exists(getopt "unistd.h" HAVE_GETOPT)
+ check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
+ check_symbol_exists(CreateFileMapping "windows.h" HAVE_CREATE_FILE_MAPPING)
++if(NOT WIN32)
++    set(CMAKE_REQUIRED_DEFINITIONS_PREV ${CMAKE_REQUIRED_DEFINITIONS})
++    set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE)
++    check_symbol_exists(sched_setaffinity "sched.h" HAVE_SCHED_SETAFFINITY)
++    set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_PREV})
++    if(HAVE_SCHED_SETAFFINITY)
++        add_definitions(-D_GNU_SOURCE)
++    endif()
++endif()
+ check_symbol_exists(strsignal "string.h" HAVE_STRSIGNAL)
+ check_symbol_exists(mkstemp "stdlib.h" HAVE_MKSTEMP)
+ 
+diff --git a/prboom2/cmake/config.h.cin b/prboom2/cmake/config.h.cin
+index f92f3d88..2ad70033 100644
+--- a/prboom2/cmake/config.h.cin
++++ b/prboom2/cmake/config.h.cin
+@@ -11,6 +11,7 @@
+ #cmakedefine HAVE_GETOPT
+ #cmakedefine HAVE_MMAP
+ #cmakedefine HAVE_CREATE_FILE_MAPPING
++#cmakedefine HAVE_SCHED_SETAFFINITY
+ #cmakedefine HAVE_STRSIGNAL
+ #cmakedefine HAVE_MKSTEMP
+ 
+diff --git a/prboom2/src/SDL/i_main.c b/prboom2/src/SDL/i_main.c
+index 7537c53f..670f3dbd 100644
+--- a/prboom2/src/SDL/i_main.c
++++ b/prboom2/src/SDL/i_main.c
+@@ -45,6 +45,9 @@
+ #ifdef _WIN32
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
++typedef BOOL (WINAPI *SetAffinityFunc)(HANDLE hProcess, DWORD mask);
++#else
++#include <sched.h>
+ #endif
+ 
+ #include <errno.h>
+@@ -373,6 +376,83 @@ static void I_Quit (void)
+ uid_t stored_euid = -1;
+ #endif
+ 
++//
++// Ability to use only the allowed CPUs
++//
++
++static void I_SetAffinityMask(void)
++{
++  // This was only set for the sdl music backend,
++  //   but now the backend changes based on the music type.
++  // Not sure what the consequences are for this...
++  process_affinity_mask = 1;
++
++  // Set the process affinity mask so that all threads
++  // run on the same processor.  This is a workaround for a bug in
++  // SDL_mixer that causes occasional crashes.
++  if (process_affinity_mask)
++  {
++    const char *errbuf = NULL;
++#ifdef _WIN32
++    HMODULE kernel32_dll;
++    SetAffinityFunc SetAffinity = NULL;
++    int ok = false;
++
++    // Find the kernel interface DLL.
++    kernel32_dll = LoadLibrary("kernel32.dll");
++
++    if (kernel32_dll)
++    {
++      // Find the SetProcessAffinityMask function.
++      SetAffinity = (SetAffinityFunc)GetProcAddress(kernel32_dll, "SetProcessAffinityMask");
++
++      // If the function was not found, we are on an old (Win9x) system
++      // that doesn't have this function.  That's no problem, because
++      // those systems don't support SMP anyway.
++
++      if (SetAffinity)
++      {
++        ok = SetAffinity(GetCurrentProcess(), process_affinity_mask);
++      }
++    }
++
++    if (!ok)
++    {
++      errbuf = WINError();
++    }
++#elif defined(HAVE_SCHED_SETAFFINITY)
++    // POSIX version:
++    int i;
++    {
++      cpu_set_t set;
++
++      CPU_ZERO(&set);
++
++      for(i = 0; i < 16; i++)
++      {
++        CPU_SET((process_affinity_mask>>i)&1, &set);
++      }
++
++      if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)
++      {
++        errbuf = strerror(errno);
++      }
++    }
++#else
++    return;
++#endif
++
++    if (errbuf == NULL)
++    {
++      lprintf(LO_INFO, "I_SetAffinityMask: manual affinity mask is %d\n", process_affinity_mask);
++    }
++    else
++    {
++      lprintf(LO_ERROR, "I_SetAffinityMask: failed to set process affinity mask (%s)\n", errbuf);
++    }
++  }
++}
++
+ //
+ // Sets the priority class for the prboom-plus process
+ //
+@@ -482,6 +562,9 @@ int main(int argc, char **argv)
+   signal(SIGABRT, I_SignalHandler);
+ #endif
+ 
++  // Ability to use only the allowed CPUs
++  I_SetAffinityMask();
++
+   // Priority class for the prboom-plus process
+   I_SetProcessPriority();
+ 
+diff --git a/prboom2/src/SDL/i_video.c b/prboom2/src/SDL/i_video.c
+index 5a564a5a..9b68aee7 100644
+--- a/prboom2/src/SDL/i_video.c
++++ b/prboom2/src/SDL/i_video.c
+@@ -895,6 +895,7 @@ static void I_ClosestResolution (int *width, int *height)
+   }
+ }
+ 
++int process_affinity_mask;
+ int process_priority;
+ 
+ // e6y
+diff --git a/prboom2/src/i_video.h b/prboom2/src/i_video.h
+index 46f0fb71..c39a197e 100644
+--- a/prboom2/src/i_video.h
++++ b/prboom2/src/i_video.h
+@@ -109,6 +109,8 @@ void I_UpdateRenderSize(void);	// Handle potential
+ extern int renderW;		// resolution scaling
+ extern int renderH;		// - DTIED
+ 
++// Set the process affinity mask so that all threads
++extern int process_affinity_mask;
+ // Priority class for the prboom-plus process
+ extern int process_priority;
+ // Use vanilla keybaord mapping
diff --git a/srcpkgs/dsda-doom/template b/srcpkgs/dsda-doom/template
new file mode 100644
index 000000000000..79ff765c6d5b
--- /dev/null
+++ b/srcpkgs/dsda-doom/template
@@ -0,0 +1,19 @@
+# Template file for 'dsda-doom'
+pkgname=dsda-doom
+version=0.24.3
+revision=1
+build_wrksrc=prboom2
+build_style=cmake
+makedepends="pcre-devel fluidsynth-devel libmad-devel SDL2_mixer-devel
+ SDL2_image-devel portmidi-devel dumb-devel libvorbis-devel"
+short_desc="Fork of prboom+ with extra tooling for demo recording and playback"
+maintainer="Gene <elkaufman5@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://github.com/kraflab/dsda-doom"
+distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
+checksum=d4cfc82eea029068329d6b6a2dcbe0b316b31a60af12e6dc5ad3e1d2c359d913
+
+post_install() {
+	vinstall ICONS/dsda-doom.desktop 644 usr/share/applications
+	vinstall ICONS/dsda-doom.png 644 usr/share/pixmaps
+}

  parent reply	other threads:[~2022-04-02  2:17 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 20:33 [PR PATCH] New package: dsda-doom-0.21.3 TwelveEyes
2021-09-09  7:52 ` [PR PATCH] [Updated] " TwelveEyes
2021-09-27 20:14 ` TwelveEyes
2021-09-27 20:33 ` TwelveEyes
2021-09-27 20:41 ` TwelveEyes
2021-09-27 20:50 ` TwelveEyes
2021-09-28  0:59 ` [PR REVIEW] " ericonr
2021-09-28  0:59 ` ericonr
2021-09-28  2:54 ` [PR PATCH] [Updated] " TwelveEyes
2021-09-28  3:03 ` TwelveEyes
2021-09-28  4:11 ` TwelveEyes
2021-09-28 19:26 ` [PR PATCH] [Updated] " TwelveEyes
2021-09-28 23:49 ` TwelveEyes
2021-09-29 22:39 ` ericonr
2021-09-30 22:25 ` TwelveEyes
2021-09-30 22:51 ` q66
2021-10-05 20:44 ` [PR PATCH] [Updated] " TwelveEyes
2021-10-22 20:22 ` TwelveEyes
2021-11-19  5:27 ` TwelveEyes
2021-11-19  5:39 ` TwelveEyes
2021-11-21 19:23 ` New package: dsda-doom-0.22.1 ericonr
2021-11-21 22:44 ` TwelveEyes
2021-11-22 18:23 ` ericonr
2021-12-02  3:39 ` [PR PATCH] [Updated] " TwelveEyes
2021-12-08 22:04 ` TwelveEyes
2021-12-14  2:27 ` TwelveEyes
2022-01-03 10:38 ` TwelveEyes
2022-01-03 20:13 ` TwelveEyes
2022-01-04 23:24 ` New package: dsda-doom-0.22.5 TwelveEyes
2022-01-11 20:26 ` [PR PATCH] [Updated] " TwelveEyes
2022-01-11 20:27 ` TwelveEyes
2022-02-11  3:36 ` TwelveEyes
2022-02-12  2:47 ` TwelveEyes
2022-03-25 16:54 ` TwelveEyes
2022-03-25 21:00 ` TwelveEyes
2022-03-30  1:39 ` TwelveEyes
2022-03-31  5:53 ` TwelveEyes
2022-03-31  5:59 ` TwelveEyes
2022-04-01  2:08 ` TwelveEyes
2022-04-02  2:17 ` TwelveEyes [this message]
2022-04-02 16:07 ` TwelveEyes
2022-04-03 16:47 ` q66
2022-04-03 16:47 ` [PR PATCH] [Merged]: " q66

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=20220402021722.PSJKlKxvpU9JTtpHP_kSmz6x79TGlUnSSFgYqivi-0A@z \
    --to=twelveeyes@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).