Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/sc-im/
Date: Mon, 27 Feb 2023 12:35:30
Message-Id: 1677501324.a6e801b0b3c3e8bde43f3f141e752f07c2b1f646.juippis@gentoo
1 commit: a6e801b0b3c3e8bde43f3f141e752f07c2b1f646
2 Author: Efe ─░zbudak <efe.izbudak <AT> metu <DOT> edu <DOT> tr>
3 AuthorDate: Thu Feb 16 06:32:57 2023 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 27 12:35:24 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6e801b0
7
8 app-office/sc-im: add 0.8.3
9
10 Signed-off-by: Efe ─░zbudak <efe.izbudak <AT> metu.edu.tr>
11 Closes: https://github.com/gentoo/gentoo/pull/29600
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 app-office/sc-im/Manifest | 1 +
15 app-office/sc-im/sc-im-0.8.3.ebuild | 141 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 142 insertions(+)
17
18 diff --git a/app-office/sc-im/Manifest b/app-office/sc-im/Manifest
19 index a085c5e62cde..e87e88fee0d7 100644
20 --- a/app-office/sc-im/Manifest
21 +++ b/app-office/sc-im/Manifest
22 @@ -1 +1,2 @@
23 DIST sc-im-0.8.2.tar.gz 1619617 BLAKE2B 1957b79749012b5e8b24e26f3cde63c84bf971d2183791f986c98ec823a9ab74bf8a126dcdb2a58920af07e068520ebd7efe9c9394235c5a58670f120495e980 SHA512 ae02fd31eb7254208de26802ed6d8b21d77ce2d6997f4a2de5bd2f0a002c763f67f53e6c8e49d66ded096ecd8bf50b1117015e9a0356eaf11c3caef22cf4552c
24 +DIST sc-im-0.8.3.tar.gz 1664440 BLAKE2B 9f02e265ecd39b4f3a5e3ab61222094a1424f9591c04ff3ddf745576f2aa1c89345ea2e4d4c95a0565d7f287985e81d9eba849113f5b7aa61744cf69284ce312 SHA512 a3d7cf99c7c959d24ebf7e525abb665c02690674c9b3cdf5b234dcdb376fd73e9488bda522106802932084bbfd239928e39b35743c7051178aa14edf61ec2cb8
25
26 diff --git a/app-office/sc-im/sc-im-0.8.3.ebuild b/app-office/sc-im/sc-im-0.8.3.ebuild
27 new file mode 100644
28 index 000000000000..f0befe2dda44
29 --- /dev/null
30 +++ b/app-office/sc-im/sc-im-0.8.3.ebuild
31 @@ -0,0 +1,141 @@
32 +# Copyright 2022-2023 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +LUA_COMPAT=( lua5-1 luajit )
38 +
39 +inherit lua-single toolchain-funcs flag-o-matic
40 +
41 +DESCRIPTION="Ncurses based, vim-like spreadsheet calculator"
42 +HOMEPAGE="https://github.com/andmarti1424/sc-im"
43 +SRC_URI="https://github.com/andmarti1424/sc-im/archive/v${PV}.tar.gz -> ${P}.tar.gz"
44 +S="${WORKDIR}/${P}/src"
45 +
46 +LICENSE="BSD-4"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
49 +IUSE="lua ods plots tmux wayland X xls xlsx"
50 +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
51 +
52 +DEPEND="
53 + sys-libs/ncurses:=
54 + lua? (
55 + ${LUA_DEPS}
56 + )
57 + ods? (
58 + dev-libs/libxml2
59 + dev-libs/libzip
60 + )
61 + plots? ( sci-visualization/gnuplot )
62 + tmux? ( app-misc/tmux )
63 + wayland? ( gui-apps/wl-clipboard )
64 + X? ( x11-misc/xclip )
65 + xls? (
66 + dev-libs/libxls
67 + )
68 + xlsx? (
69 + dev-libs/libxlsxwriter
70 + dev-libs/libxml2
71 + dev-libs/libzip
72 + )
73 +"
74 +RDEPEND="${DEPEND}"
75 +BDEPEND="app-alternatives/yacc
76 + virtual/pkgconfig"
77 +
78 +pkg_setup() {
79 + CONFLICTING=$(usex tmux "tmux " "")$(usex wayland "wayland " "")$(usex X "X" "")
80 + if ( use tmux && ( use wayland || use X ) ) ; then
81 + elog "Conflicting flags for clipboard support are set: ${CONFLICTING}"
82 + elog "tmux support has been preferred."
83 + elif ( use wayland && use X ) ; then
84 + elog "Conflicting flags for clipboard support are set: ${CONFLICTING}"
85 + elog "Wayland support has been preferred."
86 + fi
87 +
88 + # Run lua setup
89 + lua-single_pkg_setup
90 +}
91 +
92 +src_prepare() {
93 + default
94 +
95 + # Clean Makefile from all sorts of flag / lib setting
96 + sed -i -e '/CFLAGS +=\|LDLIBS +=/d' Makefile \
97 + || die "sed fix failed. Uh-oh..."
98 + # Also clean the now useless comments and logic
99 + sed -i -e '/#\|if\|else/d' Makefile \
100 + || die "sed fix failed. Uh-oh..."
101 +}
102 +
103 +src_configure() {
104 + tc-export CC PKG_CONFIG
105 +
106 + LDLIBS="-lm"
107 +
108 + # default flags that dont need optional dependencies
109 + append-cflags -Wall -g \
110 + -DNCURSES \
111 + -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE \
112 + '-DSNAME=\"sc-im\"' \
113 + '-DHELP_PATH=\"/usr/share/sc-im\"' \
114 + '-DLIBDIR=\"/usr/share/doc/sc-im\"' \
115 + '-DDFLT_PAGER=\"less\"' \
116 + '-DDFLT_EDITOR=\"vim\"' \
117 + -DUSECOLORS \
118 + '-DHISTORY_FILE=\"sc-iminfo\"' \
119 + '-DHISTORY_DIR=\".cache\"' \
120 + '-DCONFIG_FILE=\"scimrc\"' \
121 + '-DCONFIG_DIR=\".config/sc-im\"' \
122 + '-DINS_HISTORY_FILE=\"sc-iminfo\"' \
123 + -DUNDO \
124 + -DMAXROWS=65536 \
125 + -DUSELOCALE \
126 + -DMOUSE \
127 + '-DDEFAULT_OPEN_FILE_UNDER_CURSOR_CMD=\""scopen"\"' \
128 + -DAUTOBACKUP \
129 + -DHAVE_PTHREAD
130 +
131 + # setting default clipboard commands
132 + if use tmux ; then
133 + append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"'
134 + append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"'
135 + elif use wayland ; then
136 + append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""wl-copy <"\"'
137 + append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""wl-paste"\"'
138 + elif use X ; then
139 + append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"'
140 + append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"'
141 + fi
142 +
143 + # optional feature dependency
144 + use plots && append-cflags -DGNUPLOT
145 + if use xls; then
146 + append-cflags -DXLS $(${PKG_CONFIG} --cflags libxls)
147 + LDLIBS+=" $(${PKG_CONFIG} --libs libxls)"
148 + fi
149 + if use xlsx || use ods ; then
150 + append-cflags -DODS -DXLSX $(${PKG_CONFIG} --cflags libxml-2.0 libzip)
151 + LDLIBS+=" -DODS -DXLSX $(${PKG_CONFIG} --libs libxml-2.0 libzip)"
152 + fi
153 + if use xlsx ; then
154 + append-cflags -DXLSX_EXPORT $(${PKG_CONFIG} --cflags xlsxwriter)
155 + LDLIBS+=" -DXLSX_EXPORT $(${PKG_CONFIG} --libs xlsxwriter)"
156 + fi
157 + if use lua ; then
158 + append-cflags -DXLUA $(${PKG_CONFIG} --cflags lua)
159 + LDLIBS+=" -DXLUA $(${PKG_CONFIG} --libs lua) -rdynamic"
160 + fi
161 + append-cflags $(${PKG_CONFIG} --cflags ncursesw) || append-cflags $(${PKG_CONFIG} --cflags ncurses)
162 + LDLIBS+=" $(${PKG_CONFIG} --libs ncursesw)" || LDLIBS+=" $(${PKG_CONFIG} --libs ncurses)"
163 +}
164 +
165 +src_compile() {
166 + emake LDLIBS="${LDLIBS}" CFLAGS="${CFLAGS}"
167 +}
168 +
169 +src_install() {
170 + emake DESTDIR="${D}" prefix="/usr" install
171 + einstalldocs
172 +}