push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
{
lib,
stdenv,
SDL,
SDL2,
fetchurl,
gzip,
libGL,
libGLU,
libvorbis,
libmad,
flac,
libopus,
opusfile,
libogg,
libxmp,
copyDesktopItems,
makeDesktopItem,
pkg-config,
useSDL2 ? stdenv.hostPlatform.isDarwin, # TODO: CoreAudio fails to initialize with SDL 1.x for some reason.
}:
stdenv.mkDerivation rec {
pname = "quakespasm";
version = "0.96.3";
src = fetchurl {
url = "mirror://sourceforge/quakespasm/quakespasm-${version}.tar.gz";
sha256 = "sha256-tXjWzkpPf04mokRY8YxLzI04VK5iUuuZgu6B2V5QGA4=";
};
sourceRoot = "${pname}-${version}/Quake";
patches = lib.optionals stdenv.hostPlatform.isDarwin [
# Makes Darwin Makefile use system libraries instead of ones from app bundle
./quakespasm-darwin-makefile-improvements.patch
];
# Quakespasm tries to set a 10.6 deployment target, but thats too low for SDL2.
postPatch = ''
sed -i Makefile.darwin -e '/-mmacosx-version-min/d'
'';
nativeBuildInputs = [
copyDesktopItems
pkg-config
];
buildInputs = [
gzip
libGL
libGLU
libvorbis
libmad
flac
libopus
opusfile
libogg
libxmp
(if useSDL2 then SDL2 else SDL)
];
buildFlags = [
"DO_USERDIRS=1"
# Makefile defaults, set here to enforce consistency on Darwin build
"USE_CODEC_WAVE=1"
"USE_CODEC_MP3=1"
"USE_CODEC_VORBIS=1"
"USE_CODEC_FLAC=1"
"USE_CODEC_OPUS=1"
"USE_CODEC_MIKMOD=0"
"USE_CODEC_UMX=0"
"USE_CODEC_XMP=1"
"MP3LIB=mad"
"VORBISLIB=vorbis"
]
++ lib.optionals useSDL2 [
"SDL_CONFIG=sdl2-config"
"USE_SDL2=1"
];
makefile = if (stdenv.hostPlatform.isDarwin) then "Makefile.darwin" else "Makefile";
preInstall = ''
mkdir -p "$out/bin"
substituteInPlace Makefile --replace "/usr/local/games" "$out/bin"
substituteInPlace Makefile.darwin --replace "/usr/local/games" "$out/bin"
'';
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Let's build app bundle
mkdir -p $out/Applications/Quake.app/Contents/MacOS
mkdir -p $out/Applications/Quake.app/Contents/Resources
cp ../MacOSX/Info.plist $out/Applications/Quake.app/Contents/
cp ../MacOSX/QuakeSpasm.icns $out/Applications/Quake.app/Contents/Resources/
cp -r ../MacOSX/English.lproj $out/Applications/Quake.app/Contents/Resources/
ln -sf $out/bin/quake $out/Applications/Quake.app/Contents/MacOS/quake
substituteInPlace $out/Applications/Quake.app/Contents/Info.plist \
--replace '>''${EXECUTABLE_NAME}' '>quake'
substituteInPlace $out/Applications/Quake.app/Contents/Info.plist \
--replace '>''${PRODUCT_NAME}' '>QuakeSpasm'
'';
enableParallelBuilding = true;
desktopItems = [
(makeDesktopItem {
name = "quakespasm";
exec = "quake";
desktopName = "Quakespasm";
categories = [ "Game" ];
})
];
meta = with lib; {
description = "Engine for iD software's Quake";
homepage = "https://quakespasm.sourceforge.net/";
longDescription = ''
QuakeSpasm is a modern, cross-platform Quake 1 engine based on FitzQuake.
It includes support for 64 bit CPUs and custom music playback, a new sound driver,
some graphical niceities, and numerous bug-fixes and other improvements.
Quakespasm utilizes either the SDL or SDL2 frameworks, so choose which one
works best for you. SDL is probably less buggy, but SDL2 has nicer features
and smoother mouse input - though no CD support.
'';
platforms = platforms.unix;
maintainers = with maintainers; [ mikroskeem ];
mainProgram = "quake";
};
}

View File

@@ -0,0 +1,111 @@
diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin
index 6a08e6d..4e320cd 100644
--- a/Makefile.darwin
+++ b/Makefile.darwin
@@ -50,6 +50,7 @@ LINKER = $(CC)
LIPO ?= lipo
STRIP ?= strip -S
+PKG_CONFIG ?= pkg-config
CPUFLAGS=
LDFLAGS =
@@ -86,9 +87,6 @@ USE_RPATH=1
endif
CFLAGS += $(call check_gcc,-std=gnu11,)
CFLAGS += $(CPUFLAGS)
-ifeq ($(USE_RPATH),1)
-LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks
-endif
ifneq ($(DEBUG),0)
DFLAGS += -DDEBUG
CFLAGS += -g
@@ -117,19 +115,14 @@ CFLAGS += -DGL_SILENCE_DEPRECATION=1
# not relying on sdl-config command and assuming
# /Library/Frameworks/SDL.framework is available
SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE
-SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG
ifeq ($(USE_SDL2),1)
-SDL_FRAMEWORK_NAME = SDL2
+SDL_CONFIG ?= sdl2-config
else
-SDL_FRAMEWORK_NAME = SDL
-endif
-# default to our local SDL[2].framework for build
-SDL_FRAMEWORK_PATH ?=../MacOSX
-ifneq ($(SDL_FRAMEWORK_PATH),)
-SDL_LIBS +=-F$(SDL_FRAMEWORK_PATH)
-SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH)
+SDL_CONFIG ?= sdl-config
endif
-SDL_LIBS +=-Wl,-framework,$(SDL_FRAMEWORK_NAME) -Wl,-framework,Cocoa
+SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
+SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
+SDL_LIBS += -Wl,-framework,Cocoa
NET_LIBS :=
@@ -165,45 +158,31 @@ ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
endif
ifeq ($(USE_CODEC_FLAC),1)
-CFLAGS+= -DUSE_CODEC_FLAC
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
-CODECLIBS+= -lFLAC
+CFLAGS+= -DUSE_CODEC_FLAC $(shell $(PKG_CONFIG) --cflags flac)
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs flac)
endif
ifeq ($(USE_CODEC_OPUS),1)
-CFLAGS+= -DUSE_CODEC_OPUS
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
-CODECLIBS+= -lopusfile -lopus -logg
+CFLAGS+= -DUSE_CODEC_OPUS $(shell $(PKG_CONFIG) --cflags ogg opus opusfile)
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg opus opusfile)
endif
ifeq ($(USE_CODEC_VORBIS),1)
-CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
-CODECLIBS+= $(lib_vorbisdec)
+CFLAGS+= -DUSE_CODEC_VORBIS $(shell $(PKG_CONFIG) --cflags ogg vorbis vorbisfile)
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg vorbis vorbisfile)
endif
ifeq ($(USE_CODEC_MP3),1)
-CFLAGS+= -DUSE_CODEC_MP3
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
-CODECLIBS+= $(lib_mp3dec)
+CFLAGS+= -DUSE_CODEC_MP3 $(shell $(PKG_CONFIG) --cflags $(MP3LIB))
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs $(MP3LIB))
endif
ifeq ($(USE_CODEC_MIKMOD),1)
CFLAGS+= -DUSE_CODEC_MIKMOD
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
CODECLIBS+= -lmikmod
endif
ifeq ($(USE_CODEC_XMP),1)
-CFLAGS+= -DUSE_CODEC_XMP
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
-CODECLIBS+= -lxmp
+CFLAGS+= -DUSE_CODEC_XMP $(shell $(PKG_CONFIG) --cflags libxmp)
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs libxmp)
endif
ifeq ($(USE_CODEC_MODPLUG),1)
CFLAGS+= -DUSE_CODEC_MODPLUG
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
CODECLIBS+= -lmodplug
endif
ifeq ($(USE_CODEC_UMX),1)
@@ -333,4 +312,7 @@ debug:
clean:
$(RM) *.o *.d $(DEFAULT_TARGET)
+install: quakespasm
+ install -D -m 755 quakespasm /usr/local/games/quake
+
sinclude $(OBJS:.o=.d)

View File

@@ -0,0 +1,117 @@
{
SDL2,
fetchFromGitHub,
flac,
glslang,
gzip,
lib,
libmpg123,
libopus,
libvorbis,
libX11,
makeWrapper,
meson,
moltenvk,
ninja,
opusfile,
pkg-config,
stdenv,
vulkan-headers,
vulkan-loader,
copyDesktopItems,
makeDesktopItem,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "vkquake";
version = "1.32.3.1";
src = fetchFromGitHub {
owner = "Novum";
repo = "vkQuake";
tag = finalAttrs.version;
hash = "sha256-Hsj6LgxlEICI3MMDMCE1KvslYrsYfQPhShpP5kzLCTI=";
};
nativeBuildInputs = [
makeWrapper
glslang
meson
ninja
pkg-config
copyDesktopItems
];
buildInputs = [
SDL2
flac
gzip
libmpg123
libopus
libvorbis
libX11
opusfile
vulkan-loader
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
moltenvk
vulkan-headers
];
mesonFlags = [ "-Ddo_userdirs=enabled" ];
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
"-Wno-error=unused-but-set-variable"
"-Wno-error=implicit-const-int-float-conversion"
];
};
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp vkquake "$out/bin"
install -D ../Misc/vkQuake_256.png "$out/share/icons/hicolor/256x256/apps/vkquake.png"
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
exec = finalAttrs.meta.mainProgram;
name = "vkquake";
icon = "vkquake";
comment = finalAttrs.meta.description;
desktopName = "vkQuake";
categories = [ "Game" ];
})
];
postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
patchelf $out/bin/vkquake \
--add-rpath ${lib.makeLibraryPath [ vulkan-loader ]}
'';
meta = {
description = "Vulkan Quake port based on QuakeSpasm";
homepage = "https://github.com/Novum/vkQuake";
changelog = "https://github.com/Novum/vkQuake/releases";
longDescription = ''
vkQuake is a Quake 1 port using Vulkan instead of OpenGL for rendering.
It is based on the popular QuakeSpasm port and runs all mods compatible with it
like Arcane Dimensions or In The Shadows. vkQuake also serves as a Vulkan demo
application that shows basic usage of the API. For example it demonstrates render
passes & sub passes, pipeline barriers & synchronization, compute shaders, push &
specialization constants, CPU/GPU parallelism and memory pooling.
'';
platforms = with lib.platforms; linux ++ darwin;
maintainers = with lib.maintainers; [
PopeRigby
ylh
];
mainProgram = "vkquake";
license = lib.licenses.gpl2Plus;
};
})