uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,99 @@
{ lib, stdenv, SDL, SDL2, fetchurl, gzip, libvorbis, libmad
, Cocoa, CoreAudio, CoreFoundation, IOKit, OpenGL
, copyDesktopItems, makeDesktopItem
, useSDL2 ? stdenv.isDarwin # TODO: CoreAudio fails to initialize with SDL 1.x for some reason.
}:
stdenv.mkDerivation rec {
pname = "quakespasm";
version = "0.94.3";
src = fetchurl {
url = "mirror://sourceforge/quakespasm/quakespasm-${version}.tar.gz";
sha256 = "sha256-PpX20+XHIF4aRosErKGnylXIqdMtG3Ubsi70zNG9Dq0=";
};
sourceRoot = "${pname}-${version}/Quake";
patches = lib.optionals stdenv.isDarwin [
# Makes Darwin Makefile use system libraries instead of ones from app bundle
./quakespasm-darwin-makefile-improvements.patch
];
nativeBuildInputs = [ copyDesktopItems ];
buildInputs = [
gzip libvorbis libmad (if useSDL2 then SDL2 else SDL)
] ++ lib.optionals stdenv.isDarwin [
Cocoa CoreAudio IOKit OpenGL
] ++ lib.optionals (stdenv.isDarwin && useSDL2) [
CoreFoundation
];
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=0"
"USE_CODEC_OPUS=0"
"USE_CODEC_MIKMOD=0"
"USE_CODEC_UMX=0"
"MP3LIB=mad"
"VORBISLIB=vorbis"
] ++ lib.optionals useSDL2 [
"SDL_CONFIG=sdl2-config"
"USE_SDL2=1"
];
makefile = if (stdenv.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.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 = "An engine for iD software's Quake";
homepage = "http://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 m3tti ];
mainProgram = "quake";
};
}

View file

@ -0,0 +1,92 @@
--- a/Makefile.darwin 2021-09-12 14:42:51.000000000 +0300
+++ b/Makefile.darwin 2021-09-12 15:09:16.000000000 +0300
@@ -49,6 +49,7 @@
LIPO ?= lipo
STRIP ?= strip
+PKG_CONFIG ?= pkg-config
CPUFLAGS=
LDFLAGS =
@@ -84,9 +85,6 @@
USE_RPATH=1
endif
CFLAGS += $(CPUFLAGS)
-ifeq ($(USE_RPATH),1)
-LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks
-endif
ifneq ($(DEBUG),0)
DFLAGS += -DDEBUG
@@ -115,19 +113,14 @@
# 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 ?= sdl2-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 :=
@@ -164,38 +157,26 @@
endif
ifeq ($(USE_CODEC_FLAC),1)
CFLAGS+= -DUSE_CODEC_FLAC
-CODEC_INC = -I../MacOSX/codecs/include
-CODEC_LINK= -L../MacOSX/codecs/lib
CODECLIBS+= -lFLAC
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 opusfile)
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs 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)
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)
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
endif
ifeq ($(USE_CODEC_UMX),1)
@@ -332,3 +313,5 @@
clean:
rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print)
+install: quakespasm
+ install -D -m 755 quakespasm /usr/local/games/quake

View file

@ -0,0 +1,59 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, SDL2, gzip, libvorbis, libmad, vulkan-headers, vulkan-loader }:
stdenv.mkDerivation rec {
pname = "vkquake";
version = "1.13.0";
src = fetchFromGitHub {
owner = "Novum";
repo = "vkQuake";
rev = version;
sha256 = "sha256-dRPeUsBLliBevjMOSMU+uPSAivrQ0tbuh4QeLmowrAI=";
};
sourceRoot = "source/Quake";
nativeBuildInputs = [
makeWrapper
vulkan-headers
];
buildInputs = [
gzip
SDL2
libvorbis
libmad
vulkan-loader
];
buildFlags = [ "DO_USERDIRS=1" ];
preInstall = ''
mkdir -p "$out/bin"
'';
makeFlags = [ "prefix=$(out) bindir=$(out)/bin" ];
postFixup = ''
wrapProgram $out/bin/vkquake \
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Vulkan Quake port based on QuakeSpasm";
homepage = src.meta.homepage;
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 = platforms.linux;
maintainers = with maintainers; [ ];
};
}