summaryrefslogtreecommitdiff
path: root/games-puzzle/icebreaker/files/icebreaker-2.2.2_p20231115-makefile.patch
blob: 7d2bd50cb6f0a05fcbcc8a363172a41e17af11dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From a5950b94d56f6e35c3dca2e1ad2ff334aacaa070 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Wed, 12 Jun 2024 22:50:15 +0100
Subject: [PATCH 1/3] Don't include -Werror in CFLAGS

Distributions don't like -Werror because it prevents end users from
building the software using newer compilers that may raise warnings you
don't know about yet. This is particularly bad for source-based
distributions like Gentoo.
---
 Makefile     | 2 +-
 Makefile.w32 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 686e636..808b36b 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ ifndef bindir
 endif
 
 
-CFLAGS+=-Wall -Werror $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\"
+CFLAGS+=-Wall $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\"
 
 SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
     level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
diff --git a/Makefile.w32 b/Makefile.w32
index 92f60c5..17dd71a 100644
--- a/Makefile.w32
+++ b/Makefile.w32
@@ -12,7 +12,7 @@ ifndef OPTIMIZE
   OPTIMIZE=-O2
 endif
 
-CFLAGS=-Wall -Werror -Wno-error=pointer-sign $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\".\" -DHISCOREPREFIX=\".\" -DWIN32 -fstack-protector
+CFLAGS+=-Wall -Wno-error=pointer-sign $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\".\" -DHISCOREPREFIX=\".\" -DWIN32 -fstack-protector
 
 SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
     level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
-- 
2.45.1


From 6ee6046bf1f9893a3c4bfd239871b3296c90b047 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Wed, 12 Jun 2024 22:54:52 +0100
Subject: [PATCH 2/3] Include LDFLAGS earlier in the linking command

Some flags need to come before the inputs in order to be effective.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 808b36b..45a7035 100644
--- a/Makefile
+++ b/Makefile
@@ -173,7 +173,7 @@ icebreaker.exe: $(DISTFILES)
 	[ -d win32.build ] && rm -rf win32.build || true
 
 icebreaker:	$(SRC:.c=.o)
-	$(CC) $(CFLAGS) $^ -o icebreaker $(SDL_LIB) $(LDFLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o icebreaker $(SDL_LIB)
 
 man: icebreaker.6
 
-- 
2.45.1


From 40b865e7776962d45e082fed4904b4c2690b753f Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Sat, 15 Jun 2024 11:09:45 +0100
Subject: [PATCH 3/3] Silence error when rpm command doesn't exist and add
 fallback

The error can trigger QA warnings in non-RPM distros.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 45a7035..5a497ce 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ MAKENSIS=makensis
 WINDLLS=SDL.dll SDL_mixer.dll libgcc_s_dw2-1.dll libvorbisfile-3.dll libvorbis-0.dll libogg-0.dll libssp-0.dll libwinpthread-1.dll
 export WINARCH
 
-RPMARCH := $(shell  rpm --eval %{_arch} )
+RPMARCH := $(shell rpm --eval %{_arch} 2>/dev/null || echo none)
 RPMOPTS=
 RPMCRAZYDEFINES := --define "_topdir %(pwd)/rpmbuild" --define "_sourcedir %(pwd)" --define "_specdir %(pwd)"  --define "_tmppath %(pwd)/rpmbuild/tmp/"  --define "_builddir %(pwd)/rpmbuild/build/" --define "_rpmdir %(pwd)" --define "_srcrpmdir %(pwd)" --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm"
 
-- 
2.45.1