nav: init at 1.2.1 (#356071)
[NixPkgs.git] / pkgs / games / quakespasm / quakespasm-darwin-makefile-improvements.patch
blobc3098fa23d6379b548440f89a40392c7e0213be9
1 diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin
2 index 6a08e6d..4e320cd 100644
3 --- a/Makefile.darwin
4 +++ b/Makefile.darwin
5 @@ -50,6 +50,7 @@ LINKER = $(CC)
6 LIPO ?= lipo
8 STRIP ?= strip -S
9 +PKG_CONFIG ?= pkg-config
11 CPUFLAGS=
12 LDFLAGS =
13 @@ -86,9 +87,6 @@ USE_RPATH=1
14 endif
15 CFLAGS += $(call check_gcc,-std=gnu11,)
16 CFLAGS += $(CPUFLAGS)
17 -ifeq ($(USE_RPATH),1)
18 -LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks
19 -endif
20 ifneq ($(DEBUG),0)
21 DFLAGS += -DDEBUG
22 CFLAGS += -g
23 @@ -117,19 +115,14 @@ CFLAGS += -DGL_SILENCE_DEPRECATION=1
24 # not relying on sdl-config command and assuming
25 # /Library/Frameworks/SDL.framework is available
26 SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE
27 -SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG
28 ifeq ($(USE_SDL2),1)
29 -SDL_FRAMEWORK_NAME = SDL2
30 +SDL_CONFIG ?= sdl2-config
31 else
32 -SDL_FRAMEWORK_NAME = SDL
33 -endif
34 -# default to our local SDL[2].framework for build
35 -SDL_FRAMEWORK_PATH ?=../MacOSX
36 -ifneq ($(SDL_FRAMEWORK_PATH),)
37 -SDL_LIBS +=-F$(SDL_FRAMEWORK_PATH)
38 -SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH)
39 +SDL_CONFIG ?= sdl-config
40 endif
41 -SDL_LIBS +=-Wl,-framework,$(SDL_FRAMEWORK_NAME) -Wl,-framework,Cocoa
42 +SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
43 +SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
44 +SDL_LIBS += -Wl,-framework,Cocoa
46 NET_LIBS :=
48 @@ -165,45 +158,31 @@ ifeq ($(USE_CODEC_WAVE),1)
49 CFLAGS+= -DUSE_CODEC_WAVE
50 endif
51 ifeq ($(USE_CODEC_FLAC),1)
52 -CFLAGS+= -DUSE_CODEC_FLAC
53 -CODEC_INC = -I../MacOSX/codecs/include
54 -CODEC_LINK= -L../MacOSX/codecs/lib
55 -CODECLIBS+= -lFLAC
56 +CFLAGS+= -DUSE_CODEC_FLAC $(shell $(PKG_CONFIG) --cflags flac)
57 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs flac)
58 endif
59 ifeq ($(USE_CODEC_OPUS),1)
60 -CFLAGS+= -DUSE_CODEC_OPUS
61 -CODEC_INC = -I../MacOSX/codecs/include
62 -CODEC_LINK= -L../MacOSX/codecs/lib
63 -CODECLIBS+= -lopusfile -lopus -logg
64 +CFLAGS+= -DUSE_CODEC_OPUS $(shell $(PKG_CONFIG) --cflags ogg opus opusfile)
65 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg opus opusfile)
66 endif
67 ifeq ($(USE_CODEC_VORBIS),1)
68 -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
69 -CODEC_INC = -I../MacOSX/codecs/include
70 -CODEC_LINK= -L../MacOSX/codecs/lib
71 -CODECLIBS+= $(lib_vorbisdec)
72 +CFLAGS+= -DUSE_CODEC_VORBIS $(shell $(PKG_CONFIG) --cflags ogg vorbis vorbisfile)
73 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg vorbis vorbisfile)
74 endif
75 ifeq ($(USE_CODEC_MP3),1)
76 -CFLAGS+= -DUSE_CODEC_MP3
77 -CODEC_INC = -I../MacOSX/codecs/include
78 -CODEC_LINK= -L../MacOSX/codecs/lib
79 -CODECLIBS+= $(lib_mp3dec)
80 +CFLAGS+= -DUSE_CODEC_MP3 $(shell $(PKG_CONFIG) --cflags $(MP3LIB))
81 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs $(MP3LIB))
82 endif
83 ifeq ($(USE_CODEC_MIKMOD),1)
84 CFLAGS+= -DUSE_CODEC_MIKMOD
85 -CODEC_INC = -I../MacOSX/codecs/include
86 -CODEC_LINK= -L../MacOSX/codecs/lib
87 CODECLIBS+= -lmikmod
88 endif
89 ifeq ($(USE_CODEC_XMP),1)
90 -CFLAGS+= -DUSE_CODEC_XMP
91 -CODEC_INC = -I../MacOSX/codecs/include
92 -CODEC_LINK= -L../MacOSX/codecs/lib
93 -CODECLIBS+= -lxmp
94 +CFLAGS+= -DUSE_CODEC_XMP $(shell $(PKG_CONFIG) --cflags libxmp)
95 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs libxmp)
96 endif
97 ifeq ($(USE_CODEC_MODPLUG),1)
98 CFLAGS+= -DUSE_CODEC_MODPLUG
99 -CODEC_INC = -I../MacOSX/codecs/include
100 -CODEC_LINK= -L../MacOSX/codecs/lib
101 CODECLIBS+= -lmodplug
102 endif
103 ifeq ($(USE_CODEC_UMX),1)
104 @@ -333,4 +312,7 @@ debug:
105 clean:
106 $(RM) *.o *.d $(DEFAULT_TARGET)
108 +install: quakespasm
109 + install -D -m 755 quakespasm /usr/local/games/quake
111 sinclude $(OBJS:.o=.d)