public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: app-office/sc-im/, app-office/sc-im/files/
@ 2022-04-13 16:27 Dex Conner
  0 siblings, 0 replies; 2+ messages in thread
From: Dex Conner @ 2022-04-13 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     4709ec0506b5ba321e1a5a3ba8ab125a9895c441
Author:     Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de>
AuthorDate: Wed Apr 13 16:26:12 2022 +0000
Commit:     Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de>
CommitDate: Wed Apr 13 16:26:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4709ec05

app-office/sc-im: initial import

Signed-off-by: Dex Conner <cantcuckthis <AT> danwin1210.de>

 app-office/sc-im/Manifest                       |  1 +
 app-office/sc-im/files/sc-im-0.8.2-prefix.patch | 11 +++++++
 app-office/sc-im/metadata.xml                   | 14 +++++++++
 app-office/sc-im/sc-im-0.8.2.ebuild             | 38 +++++++++++++++++++++++++
 4 files changed, 64 insertions(+)

diff --git a/app-office/sc-im/Manifest b/app-office/sc-im/Manifest
new file mode 100644
index 000000000..a085c5e62
--- /dev/null
+++ b/app-office/sc-im/Manifest
@@ -0,0 +1 @@
+DIST sc-im-0.8.2.tar.gz 1619617 BLAKE2B 1957b79749012b5e8b24e26f3cde63c84bf971d2183791f986c98ec823a9ab74bf8a126dcdb2a58920af07e068520ebd7efe9c9394235c5a58670f120495e980 SHA512 ae02fd31eb7254208de26802ed6d8b21d77ce2d6997f4a2de5bd2f0a002c763f67f53e6c8e49d66ded096ecd8bf50b1117015e9a0356eaf11c3caef22cf4552c

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
new file mode 100644
index 000000000..c34d226c2
--- /dev/null
+++ b/app-office/sc-im/files/sc-im-0.8.2-prefix.patch
@@ -0,0 +1,11 @@
+--- src/Makefile
++++ src/Makefile
+@@ -2,7 +2,7 @@
+ name = sc-im
+ 
+ # The base directory where everything should be installed.
+-prefix  = /usr/local
++prefix  = /usr
+ 
+ EXDIR   = $(prefix)/bin
+ HELPDIR = $(prefix)/share/$(name)

diff --git a/app-office/sc-im/metadata.xml b/app-office/sc-im/metadata.xml
new file mode 100644
index 000000000..ff8f94c7c
--- /dev/null
+++ b/app-office/sc-im/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>cantcuckthis@danwin1210.de</email>
+		<name>Dex Conner</name>
+	</maintainer>
+	<use>
+		<flag name='plots'>Add <pkg>sci-visualization/gnuplot</pkg> for plotting support</flag>
+		<flag name='xls'>Add xls/xlsx support. Pulls in <pkg>dev-python/xlsxwriter</pkg>, <pkg>dev-haskell/libxml</pkg>, <pkg>dev-libs/libzip</pkg> and <pkg>dev-libs/libxls</pkg></flag>
+		<flag name='ods'>Add <pkg>dev-libs/libzip</pkg> for ods import support</flag>
+		<flag name='X'>Use <pkg>x11-misc/xclip</pkg> for clipboard copy/paste</flag>
+	</use>
+</pkgmetadata>

diff --git a/app-office/sc-im/sc-im-0.8.2.ebuild b/app-office/sc-im/sc-im-0.8.2.ebuild
new file mode 100644
index 000000000..e59b5e8f0
--- /dev/null
+++ b/app-office/sc-im/sc-im-0.8.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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 xls lua ods"
+
+PATCHES=(
+	"${FILESDIR}/${P}-prefix.patch"
+)
+
+DEPEND="
+	sys-libs/ncurses
+	X? ( || ( app-misc/tmux x11-misc/xclip ) )
+	plots? ( sci-visualization/gnuplot )
+	xls? (
+		dev-libs/libxlsxwriter
+		dev-haskell/libxml
+		dev-libs/libzip
+		dev-libs/libxls
+	)
+	lua? (
+		dev-lang/lua
+	)
+	ods? (
+		dev-libs/libzip
+	)
+"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+S="${WORKDIR}/${P}/src"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-office/sc-im/, app-office/sc-im/files/
@ 2022-04-16  8:15 Dex Conner
  0 siblings, 0 replies; 2+ messages in thread
From: Dex Conner @ 2022-04-16  8:15 UTC (permalink / raw
  To: gentoo-commits

commit:     b0a81c922c0d176ad3d85c291d81493b76670a29
Author:     Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de>
AuthorDate: Sat Apr 16 08:10:54 2022 +0000
Commit:     Dex Conner <cantcuckthis <AT> danwin1210 <DOT> de>
CommitDate: Sat Apr 16 08:14:56 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b0a81c92

app-office/sc-im: rewrite fixing automagic deps

This is an almost complete rewrite patching the Makefile for clipboard
program control with use flags and replacing automagic dependencies with
use flags.

Signed-off-by: Dex Conner <cantcuckthis <AT> danwin1210.de>

 app-office/sc-im/files/sc-im-0.8.2-automagic.patch | 50 +++++++++++++++++
 app-office/sc-im/files/sc-im-0.8.2-clipboard.patch | 32 +++++++++++
 app-office/sc-im/files/sc-im-0.8.2-tmux.patch      | 23 --------
 app-office/sc-im/metadata.xml                      |  6 +-
 app-office/sc-im/sc-im-0.8.2.ebuild                | 64 +++++++++++++++++-----
 5 files changed, 135 insertions(+), 40 deletions(-)

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
new file mode 100644
index 000000000..33628e297
--- /dev/null
+++ b/app-office/sc-im/files/sc-im-0.8.2-automagic.patch
@@ -0,0 +1,50 @@
+--- src/Makefile	
++++ src/Makefile
+@@ -83,7 +83,7 @@
+ endif
+ 
+ # Check for gnuplot existance
+-ifneq (, $(shell which gnuplot))
++ifeq ($(PLOTS),yes)
+   CFLAGS += -DGNUPLOT
+ endif
+ 
+@@ -116,32 +116,33 @@
+   endif
+ 
+   # NOTE: libxlsreader (libxls) is required for xls file reading support
+-  ifneq ($(shell pkg-config --exists libxls || echo 'no'),no)
++  ifeq ($(XLS),yes)
+     CFLAGS += -DXLS $(shell pkg-config --cflags libxls)
+     LDLIBS += $(shell pkg-config --libs libxls)
+   endif
+ 
+   # NOTE: libxml and libzip are required for xlsx file import support
+-  ifneq ($(shell pkg-config --exists libzip libxml-2.0 || echo 'no'),no)
++  ifeq ($(XML_ZIP),yes)
+     CFLAGS += -DODS -DXLSX $(shell pkg-config --cflags libxml-2.0 libzip)
+     LDLIBS += $(shell pkg-config --libs libxml-2.0 libzip)
+   endif
+ 
+   # NOTE: libxlsxwriter is required for xlsx file export support
+-  ifneq ($(shell pkg-config --exists xlsxwriter || echo 'no'),no)
++  ifeq ($(XLSX),yes)
+     CFLAGS += -DXLSX_EXPORT $(shell pkg-config --cflags xlsxwriter)
+     LDLIBS += $(shell pkg-config --libs xlsxwriter)
+   endif
+ 
+   # NOTE: lua support
+-  ifneq ($(shell pkg-config --exists lua || echo 'no'),no) # Check for user's default lua
++  ifeq ($(LUA),yes)
+     CFLAGS += -DXLUA $(shell pkg-config --cflags lua)
+     ifneq ($(shell uname -s),Darwin)
+       LDLIBS += $(shell pkg-config --libs lua) -Wl,--export-dynamic
+     else
+       LDLIBS += $(shell pkg-config --libs lua) -rdynamic
+     endif
+-  else ifneq ($(shell pkg-config --exists luajit || echo 'no'),no) # If not found, check for luajit
++  endif
++  ifeq ($(LUAJIT),yes)
+     CFLAGS += -DXLUA $(shell pkg-config --cflags luajit)
+     ifneq ($(shell uname -s),Darwin)
+       LDLIBS += $(shell pkg-config --libs luajit) -Wl,--export-dynamic

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
new file mode 100644
index 000000000..88815c826
--- /dev/null
+++ b/app-office/sc-im/files/sc-im-0.8.2-clipboard.patch
@@ -0,0 +1,32 @@
+--- src/Makefile
++++ src/Makefile
+@@ -57,8 +57,19 @@
+ #
+ # Choose one of the following commands for copying to different clipboards:
+ # You can later change it at runtime.
++ifeq ($(TMUX),yes)
++  CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"
++  CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"
++else ifeq ($(WAYLAND),yes)
++  CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""wl-copy <"\"
++  CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""wl-paste"\"
++else ifeq ($(X),yes)
++  CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"
++  CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"
++endif
++
+ #to copy to tmux clipboard:
+-CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"
++#CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"
+ #to copy to X clipboard:
+ #CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"
+ #to copy to OSX clipboard:
+@@ -66,7 +77,7 @@
+ #
+ # Choose one of the proposed commands for pasting from different clipboards:
+ # You can later change it at runtime.
+-CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"
++#CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"
+ #CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"
+ #CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""pbpaste"\"
+ 

diff --git a/app-office/sc-im/files/sc-im-0.8.2-tmux.patch b/app-office/sc-im/files/sc-im-0.8.2-tmux.patch
deleted file mode 100644
index 63f910c54..000000000
--- a/app-office/sc-im/files/sc-im-0.8.2-tmux.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- src/Makefile
-+++ src/Makefile
-@@ -58,16 +58,16 @@
- # Choose one of the following commands for copying to different clipboards:
- # You can later change it at runtime.
- #to copy to tmux clipboard:
--#CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"
-+CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""tmux load-buffer"\"
- #to copy to X clipboard:
--CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"
-+#CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\"
- #to copy to OSX clipboard:
- #CFLAGS += -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""pbcopy <"\"
- #
- # Choose one of the proposed commands for pasting from different clipboards:
- # You can later change it at runtime.
--#CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"
--CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"
-+CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""tmux show-buffer"\"
-+#CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\"
- #CFLAGS += -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""pbpaste"\"
- 
- # Command to open file or link under cursor

diff --git a/app-office/sc-im/metadata.xml b/app-office/sc-im/metadata.xml
index ed2ff157e..5b29a497a 100644
--- a/app-office/sc-im/metadata.xml
+++ b/app-office/sc-im/metadata.xml
@@ -7,9 +7,11 @@
 	</maintainer>
 	<use>
 		<flag name='plots'>Add <pkg>sci-visualization/gnuplot</pkg> for plotting support</flag>
-		<flag name='xls'>Add xls/xlsx support</flag>
-		<flag name='ods'>Add <pkg>dev-libs/libzip</pkg> for ods import support</flag>
+		<flag name='xls'>Add xls support</flag>
+		<flag name='xlsx'>Add xlsx support</flag>
+		<flag name='ods'>Add ods import support</flag>
 		<flag name='X'>Use <pkg>x11-misc/xclip</pkg> for clipboard copy/paste</flag>
 		<flag name='tmux'>Use <pkg>app-misc/tmux</pkg> for clipboard copy/paste</flag>
+		<flag name='wayland'>Use <pkg>gui-apps/wl-clipboard</pkg> for clipboard copy/paste</flag>
 	</use>
 </pkgmetadata>

diff --git a/app-office/sc-im/sc-im-0.8.2.ebuild b/app-office/sc-im/sc-im-0.8.2.ebuild
index f170c72d4..39b1fabbd 100644
--- a/app-office/sc-im/sc-im-0.8.2.ebuild
+++ b/app-office/sc-im/sc-im-0.8.2.ebuild
@@ -3,6 +3,10 @@
 
 EAPI=7
 
+LUA_COMPAT=( lua5-1 luajit )
+
+inherit lua-single
+
 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"
@@ -10,28 +14,35 @@ SRC_URI="https://github.com/andmarti1424/sc-im/archive/v${PV}.tar.gz -> ${P}.tar
 LICENSE="BSD-4"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="X plots xls lua ods tmux"
+IUSE="X plots wayland xls xlsx lua ods tmux"
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
 
 PATCHES=(
 	"${FILESDIR}/${P}-prefix.patch"
-	"${FILESDIR}/${P}-tmux.patch"
+	"${FILESDIR}/${P}-automagic.patch"
+	"${FILESDIR}/${P}-clipboard.patch"
 )
 
 DEPEND="
 	sys-libs/ncurses
-	X? ( x11-misc/xclip )
-	tmux? ( app-misc/tmux )
-	plots? ( sci-visualization/gnuplot )
-	xls? (
-		dev-libs/libxlsxwriter
+
+	lua? (
+		${LUA_DEPS}
+	)
+	ods? (
 		dev-haskell/libxml
 		dev-libs/libzip
-		dev-libs/libxls
 	)
-	lua? (
-		dev-lang/lua
+	plots? ( sci-visualization/gnuplot )
+	tmux? ( app-misc/tmux )
+	wayland? ( gui-apps/wl-clipboard )
+	X? ( x11-misc/xclip )
+	xls? (
+		dev-libs/libxls
 	)
-	ods? (
+	xlsx? (
+		dev-libs/libxlsxwriter
+		dev-haskell/libxml
 		dev-libs/libzip
 	)
 "
@@ -39,8 +50,31 @@ RDEPEND="${DEPEND}"
 BDEPEND="virtual/pkgconfig"
 S="${WORKDIR}/${P}/src"
 
-src_prepare() {
-	eapply "${FILESDIR}/${P}-prefix.patch"
-	use tmux && eapply "${FILESDIR}/${P}-tmux.patch"
-	eapply_user
+pkg_setup() {
+	export X=$(usex X)
+	export TMUX=$(usex tmux)
+	export WAYLAND=$(usex wayland)
+	export PLOTS=$(usex plots)
+	export XLS=$(usex xls)
+	export XLSX=$(usex xlsx)
+	export LUA=$(usex lua)
+	export JUAJIT=$(usex lua_single_target_luajit)
+	( use xlsx || use ods ) && export XML_ZIP="yes"
+
+	# Prefer wayland support over X, and tmux support over both wayland and X.
+	use wayland && export X="no"
+	use tmux && X="no" && export WAYLAND="no"
+
+	# Notifying the user about which clipboard support is enabled if conflicting flags are set
+	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
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-16  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-16  8:15 [gentoo-commits] repo/proj/guru:dev commit in: app-office/sc-im/, app-office/sc-im/files/ Dex Conner
  -- strict thread matches above, loose matches on Subject: below --
2022-04-13 16:27 Dex Conner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox