app-office/sc-im: runtime dep change revbump

Signed-off-by: Dex Conner <cantcuckthis@danwin1210.de>
This commit is contained in:
Dex Conner
2022-04-24 18:21:06 +03:00
parent b0b6e91a61
commit 03ed3db1f7

View File

@@ -0,0 +1,103 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
LUA_COMPAT=( lua5-1 luajit )
inherit lua-single toolchain-funcs flag-o-matic
DESCRIPTION="Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal"
HOMEPAGE="https://github.com/andmarti1424/sc-im"
SRC_URI="https://github.com/andmarti1424/sc-im/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD-4"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="X plots wayland xls xlsx lua ods tmux"
REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
PATCHES=(
"${FILESDIR}/${P}-prefix.patch"
"${FILESDIR}/${P}-automagic.patch"
"${FILESDIR}/${P}-clipboard.patch"
)
DEPEND="
sys-libs/ncurses
lua? (
${LUA_DEPS}
)
ods? (
dev-libs/libxml2
dev-libs/libzip
)
plots? ( sci-visualization/gnuplot )
tmux? ( app-misc/tmux )
wayland? ( gui-apps/wl-clipboard )
X? ( x11-misc/xclip )
xls? (
dev-libs/libxls
)
xlsx? (
dev-libs/libxlsxwriter
dev-libs/libxml2
dev-libs/libzip
)
"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
S="${WORKDIR}/${P}/src"
pkg_setup() {
CONFLICTING=$(usex tmux "tmux " "")$(usex wayland "wayland " "")$(usex X "X" "")
if ( use tmux && ( use wayland || use X ) ) ; then
elog "Conflicting flags for clipboard support are set: ${CONFLICTING}"
elog "tmux support has been preferred."
elif ( use wayland && use X ) ; then
elog "Conflicting flags for clipboard support are set: ${CONFLICTING}"
elog "Wayland support has been preferred."
fi
# Run lua setup
lua-single_pkg_setup
}
src_configure() {
tc-export CC
PKGCONF=$(tc-getPKG_CONFIG)
if use tmux ; then
append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"'
append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"'
elif use wayland ; then
append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""wl-copy <"\"'
append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""wl-paste"\"'
elif use X ; then
append-cflags '-DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"'
append-cflags '-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"'
fi
use plots && append-cflags -DGNUPLOT
if use xls; then
append-cflags -DXLS $(${PKGCONF} --cflags libxls)
LDLIBS+=" $(${PKGCONF} --libs libxls)"
fi
if use xlsx || use ods ; then
append-cflags -DODS -DXLSX $(${PKGCONF} --cflags libxml-2.0 libzip)
LDLIBS+=" -DODS -DXLSX $(${PKGCONF} --libs libxml-2.0 libzip)"
fi
if use xlsx ; then
append-cflags -DXLSX_EXPORT $(${PKGCONF} --cflags xlsxwriter)
LDLIBS+=" -DXLSX_EXPORT $(${PKGCONF} --libs xlsxwriter)"
fi
if use lua ; then
append-cflags -DXLUA $(${PKGCONF} --cflags lua)
LDLIBS+=" -DXLUA $(${PKGCONF} --libs lua) -rdynamic"
fi
append-cflags $(${PKGCONF} --cflags ncursesw) || append-cflags $(${PKGCONF} --cflags ncurses)
LDLIBS+=" $(${PKGCONF} --libs ncursesw)" || LDLIBS+=" $(${PKGCONF} --libs ncurses)"
export LDLIBS
}