1 |
commit: 054390fe89008990cf541508a0d2e987df943db2 |
2 |
Author: Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de> |
3 |
AuthorDate: Tue Apr 26 12:34:54 2022 +0000 |
4 |
Commit: Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de> |
5 |
CommitDate: Tue Apr 26 12:40:19 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=054390fe |
7 |
|
8 |
app-office/sc-im: move all flags to the ebuild |
9 |
|
10 |
Moved all CFLAGS and LDLIBS arguments to the ebuild from the Makefile |
11 |
and removed the patches that "fixed" the automagic dependencies / |
12 |
clipboard commands / installation prefix. Now all is handled from within |
13 |
the ebuild. |
14 |
|
15 |
Signed-off-by: Dex Conner <cantcuckthis <AT> danwin1210.de> |
16 |
|
17 |
app-office/sc-im/files/sc-im-0.8.2-automagic.patch | 92 ---------------------- |
18 |
app-office/sc-im/files/sc-im-0.8.2-clipboard.patch | 20 ----- |
19 |
app-office/sc-im/files/sc-im-0.8.2-prefix.patch | 11 --- |
20 |
app-office/sc-im/sc-im-0.8.2-r1.ebuild | 54 +++++++++++-- |
21 |
4 files changed, 47 insertions(+), 130 deletions(-) |
22 |
|
23 |
diff --git a/app-office/sc-im/files/sc-im-0.8.2-automagic.patch b/app-office/sc-im/files/sc-im-0.8.2-automagic.patch |
24 |
deleted file mode 100644 |
25 |
index 6ff1aeced..000000000 |
26 |
--- a/app-office/sc-im/files/sc-im-0.8.2-automagic.patch |
27 |
+++ /dev/null |
28 |
@@ -1,92 +0,0 @@ |
29 |
---- src/Makefile |
30 |
-+++ src/Makefile |
31 |
-@@ -82,11 +82,6 @@ |
32 |
- LDLIBS += -pthread |
33 |
- endif |
34 |
- |
35 |
--# Check for gnuplot existance |
36 |
--ifneq (, $(shell which gnuplot)) |
37 |
-- CFLAGS += -DGNUPLOT |
38 |
--endif |
39 |
-- |
40 |
- # OpenBSD does not implement wordexp() |
41 |
- ifeq ($(shell uname -s),OpenBSD) |
42 |
- CFLAGS += -DNO_WORDEXP |
43 |
-@@ -97,77 +92,6 @@ |
44 |
- LDLIBS += -ldl |
45 |
- endif |
46 |
- |
47 |
--ifneq (, $(shell which pkg-config)) |
48 |
-- # Any system with pkg-config |
49 |
-- |
50 |
-- # NOTE: ncursesw (required) |
51 |
-- ifeq ($(shell uname -s),Darwin) |
52 |
-- # macOS' ncurses is built with wide-char support |
53 |
-- LDFLAGS += -lncurses |
54 |
-- else ifneq ($(shell pkg-config --exists ncursesw || echo 'no'),no) |
55 |
-- CFLAGS += $(shell pkg-config --cflags ncursesw) |
56 |
-- LDLIBS += $(shell pkg-config --libs ncursesw) |
57 |
-- else ifneq ($(shell pkg-config --exists ncurses || echo 'no'),no) |
58 |
-- # hopefully this includes wide character support then |
59 |
-- CFLAGS += $(shell pkg-config --cflags ncurses) |
60 |
-- LDLIBS += $(shell pkg-config --libs ncurses) |
61 |
-- else |
62 |
-- LDLIBS += -lncursesw |
63 |
-- endif |
64 |
-- |
65 |
-- # NOTE: libxlsreader (libxls) is required for xls file reading support |
66 |
-- ifneq ($(shell pkg-config --exists libxls || echo 'no'),no) |
67 |
-- CFLAGS += -DXLS $(shell pkg-config --cflags libxls) |
68 |
-- LDLIBS += $(shell pkg-config --libs libxls) |
69 |
-- endif |
70 |
-- |
71 |
-- # NOTE: libxml and libzip are required for xlsx file import support |
72 |
-- ifneq ($(shell pkg-config --exists libzip libxml-2.0 || echo 'no'),no) |
73 |
-- CFLAGS += -DODS -DXLSX $(shell pkg-config --cflags libxml-2.0 libzip) |
74 |
-- LDLIBS += $(shell pkg-config --libs libxml-2.0 libzip) |
75 |
-- endif |
76 |
-- |
77 |
-- # NOTE: libxlsxwriter is required for xlsx file export support |
78 |
-- ifneq ($(shell pkg-config --exists xlsxwriter || echo 'no'),no) |
79 |
-- CFLAGS += -DXLSX_EXPORT $(shell pkg-config --cflags xlsxwriter) |
80 |
-- LDLIBS += $(shell pkg-config --libs xlsxwriter) |
81 |
-- endif |
82 |
-- |
83 |
-- # NOTE: lua support |
84 |
-- ifneq ($(shell pkg-config --exists lua || echo 'no'),no) # Check for user's default lua |
85 |
-- CFLAGS += -DXLUA $(shell pkg-config --cflags lua) |
86 |
-- ifneq ($(shell uname -s),Darwin) |
87 |
-- LDLIBS += $(shell pkg-config --libs lua) -Wl,--export-dynamic |
88 |
-- else |
89 |
-- LDLIBS += $(shell pkg-config --libs lua) -rdynamic |
90 |
-- endif |
91 |
-- else ifneq ($(shell pkg-config --exists luajit || echo 'no'),no) # If not found, check for luajit |
92 |
-- CFLAGS += -DXLUA $(shell pkg-config --cflags luajit) |
93 |
-- ifneq ($(shell uname -s),Darwin) |
94 |
-- LDLIBS += $(shell pkg-config --libs luajit) -Wl,--export-dynamic |
95 |
-- else |
96 |
-- LDLIBS += $(shell pkg-config --libs luajit) -rdynamic |
97 |
-- endif |
98 |
-- endif |
99 |
--else ifeq ($(shell uname -s),Darwin) |
100 |
-- # macOS without pkg-config |
101 |
-- |
102 |
-- # macOS' ncurses is built with wide-char support |
103 |
-- LDFLAGS += -lncurses |
104 |
--else ifeq ($(shell uname -s),NetBSD) |
105 |
-- # NetBSD without pkg-config |
106 |
-- |
107 |
-- CFLAGS += -I/usr/pkg/include |
108 |
-- CFLAGS += -I/usr/pkg/include/ncursesw |
109 |
-- |
110 |
-- LDFLAGS += -L/usr/pkg/lib |
111 |
-- LDFLAGS += -Wl,-R/usr/pkg/lib |
112 |
-- |
113 |
-- LDLIBS += -lncursesw |
114 |
--else |
115 |
-- LDFLAGS += -lncursesw |
116 |
--endif |
117 |
-- |
118 |
- OBJS = $(patsubst %.c, %.o, $(wildcard *.c) $(wildcard utils/*.c)) gram.o |
119 |
- |
120 |
- .PHONY : all clean install docs man_install man_uninstall |
121 |
|
122 |
diff --git a/app-office/sc-im/files/sc-im-0.8.2-clipboard.patch b/app-office/sc-im/files/sc-im-0.8.2-clipboard.patch |
123 |
deleted file mode 100644 |
124 |
index 2668e7d29..000000000 |
125 |
--- a/app-office/sc-im/files/sc-im-0.8.2-clipboard.patch |
126 |
+++ /dev/null |
127 |
@@ -1,20 +0,0 @@ |
128 |
---- src/Makefile |
129 |
-+++ src/Makefile |
130 |
-@@ -58,7 +58,7 @@ |
131 |
- # Choose one of the following commands for copying to different clipboards: |
132 |
- # You can later change it at runtime. |
133 |
- #to copy to tmux clipboard: |
134 |
--CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\" |
135 |
-+#CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\" |
136 |
- #to copy to X clipboard: |
137 |
- #CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\" |
138 |
- #to copy to OSX clipboard: |
139 |
-@@ -66,7 +77,7 @@ |
140 |
- # |
141 |
- # Choose one of the proposed commands for pasting from different clipboards: |
142 |
- # You can later change it at runtime. |
143 |
--CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\" |
144 |
-+#CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\" |
145 |
- #CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\" |
146 |
- #CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""pbpaste"\" |
147 |
- |
148 |
|
149 |
diff --git a/app-office/sc-im/files/sc-im-0.8.2-prefix.patch b/app-office/sc-im/files/sc-im-0.8.2-prefix.patch |
150 |
deleted file mode 100644 |
151 |
index c34d226c2..000000000 |
152 |
--- a/app-office/sc-im/files/sc-im-0.8.2-prefix.patch |
153 |
+++ /dev/null |
154 |
@@ -1,11 +0,0 @@ |
155 |
---- src/Makefile |
156 |
-+++ src/Makefile |
157 |
-@@ -2,7 +2,7 @@ |
158 |
- name = sc-im |
159 |
- |
160 |
- # The base directory where everything should be installed. |
161 |
--prefix = /usr/local |
162 |
-+prefix = /usr |
163 |
- |
164 |
- EXDIR = $(prefix)/bin |
165 |
- HELPDIR = $(prefix)/share/$(name) |
166 |
|
167 |
diff --git a/app-office/sc-im/sc-im-0.8.2-r1.ebuild b/app-office/sc-im/sc-im-0.8.2-r1.ebuild |
168 |
index 15abb065d..d95a385a1 100644 |
169 |
--- a/app-office/sc-im/sc-im-0.8.2-r1.ebuild |
170 |
+++ b/app-office/sc-im/sc-im-0.8.2-r1.ebuild |
171 |
@@ -17,12 +17,6 @@ KEYWORDS="~amd64 ~x86" |
172 |
IUSE="X plots wayland xls xlsx lua ods tmux" |
173 |
REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" |
174 |
|
175 |
-PATCHES=( |
176 |
- "${FILESDIR}/${P}-prefix.patch" |
177 |
- "${FILESDIR}/${P}-automagic.patch" |
178 |
- "${FILESDIR}/${P}-clipboard.patch" |
179 |
-) |
180 |
- |
181 |
DEPEND=" |
182 |
sys-libs/ncurses |
183 |
|
184 |
@@ -64,11 +58,48 @@ pkg_setup() { |
185 |
lua-single_pkg_setup |
186 |
} |
187 |
|
188 |
+src_prepare() { |
189 |
+ default |
190 |
+ |
191 |
+ # Clean Makefile from all sorts of flag / lib setting |
192 |
+ sed -i -e '/CFLAGS +=\|LDLIBS +=/d' Makefile \ |
193 |
+ || die "sed fix failed. Uh-oh..." |
194 |
+ # Also clean the now useless comments and logic |
195 |
+ sed -i -e '/#\|if\|else/d' Makefile \ |
196 |
+ || die "sed fix failed. Uh-oh..." |
197 |
+} |
198 |
+ |
199 |
src_configure() { |
200 |
tc-export CC |
201 |
|
202 |
PKGCONF=$(tc-getPKG_CONFIG) |
203 |
|
204 |
+ LDLIBS="-lm" |
205 |
+ |
206 |
+ # default flags that dont need optional dependencies |
207 |
+ append-cflags -Wall -g \ |
208 |
+ -DNCURSES \ |
209 |
+ -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE \ |
210 |
+ '-DSNAME=\"sc-im\"' \ |
211 |
+ '-DHELP_PATH=\"/usr/share/sc-im\"' \ |
212 |
+ '-DLIBDIR=\"/usr/share/doc/sc-im\"' \ |
213 |
+ '-DDFLT_PAGER=\"less\"' \ |
214 |
+ '-DDFLT_EDITOR=\"vim\"' \ |
215 |
+ -DUSECOLORS \ |
216 |
+ '-DHISTORY_FILE=\"sc-iminfo\"' \ |
217 |
+ '-DHISTORY_DIR=\".cache\"' \ |
218 |
+ '-DCONFIG_FILE=\"scimrc\"' \ |
219 |
+ '-DCONFIG_DIR=\".config/sc-im\"' \ |
220 |
+ '-DINS_HISTORY_FILE=\"sc-iminfo\"' \ |
221 |
+ -DUNDO \ |
222 |
+ -DMAXROWS=65536 \ |
223 |
+ -DUSELOCALE \ |
224 |
+ -DMOUSE \ |
225 |
+ '-DDEFAULT_OPEN_FILE_UNDER_CURSOR_CMD=\""scopen"\"' \ |
226 |
+ -DAUTOBACKUP \ |
227 |
+ -DHAVE_PTHREAD |
228 |
+ |
229 |
+ # setting default clipboard commands |
230 |
if use tmux ; then |
231 |
append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"' |
232 |
append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"' |
233 |
@@ -80,6 +111,7 @@ src_configure() { |
234 |
append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"' |
235 |
fi |
236 |
|
237 |
+ # optional feature dependency |
238 |
use plots && append-cflags -DGNUPLOT |
239 |
if use xls; then |
240 |
append-cflags -DXLS $(${PKGCONF} --cflags libxls) |
241 |
@@ -99,5 +131,13 @@ src_configure() { |
242 |
fi |
243 |
append-cflags $(${PKGCONF} --cflags ncursesw) || append-cflags $(${PKGCONF} --cflags ncurses) |
244 |
LDLIBS+=" $(${PKGCONF} --libs ncursesw)" || LDLIBS+=" $(${PKGCONF} --libs ncurses)" |
245 |
- export LDLIBS |
246 |
+} |
247 |
+ |
248 |
+src_compile() { |
249 |
+ emake LDLIBS="${LDLIBS}" CFLAGS="${CFLAGS}" |
250 |
+} |
251 |
+ |
252 |
+src_install() { |
253 |
+ emake DESTDIR="${D}" prefix="/usr" install |
254 |
+ einstalldocs |
255 |
} |