commit: 114b19583501eb9a86b8b21ae50f65606ebd6c4f Author: Carlos Eduardo <carana2099 <AT> gmail <DOT> com> AuthorDate: Wed Feb 16 19:21:47 2022 +0000 Commit: Carlos Eduardo <carana2099 <AT> gmail <DOT> com> CommitDate: Wed Feb 16 19:21:47 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=114b1958
app-misc/neo: add Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Carlos Eduardo <carana2099 <AT> gmail.com> app-misc/neo/Manifest | 1 + .../neo-0.6-fixes-for-building-with-ncursesw.patch | 119 +++++++++++++++++++++ app-misc/neo/metadata.xml | 9 ++ app-misc/neo/neo-0.6.ebuild | 35 ++++++ app-misc/neo/neo-9999.ebuild | 1 + 5 files changed, 165 insertions(+) diff --git a/app-misc/neo/Manifest b/app-misc/neo/Manifest new file mode 100644 index 000000000..f700cd338 --- /dev/null +++ b/app-misc/neo/Manifest @@ -0,0 +1 @@ +DIST neo-0.6.tar.gz 141062 BLAKE2B 3e069e071281816913edb90218be551a5d82ded55f5b7cedbe305bce413acf624f0177945e90cf0ec48359ec47a0840adb7b5a32a5e553027e93945876c37a50 SHA512 de3f0d958ecaa284427b4271d7cf1f7569f545487ec0e525f381a999cae4a1dcd6b543c6e9cfe359fa1be8700fc38bbf091d077e6a5fbcea2a37f5cc3af83062 diff --git a/app-misc/neo/files/neo-0.6-fixes-for-building-with-ncursesw.patch b/app-misc/neo/files/neo-0.6-fixes-for-building-with-ncursesw.patch new file mode 100644 index 000000000..e2feda052 --- /dev/null +++ b/app-misc/neo/files/neo-0.6-fixes-for-building-with-ncursesw.patch @@ -0,0 +1,119 @@ +From c7e849a63327166b77e01e6d1683f44e129b3ef7 Mon Sep 17 00:00:00 2001 +From: Stewart Reive <[email protected]> +Date: Sat, 18 Dec 2021 21:43:47 -0800 +Subject: [PATCH 11/12] Fixes for building with ncursesw + +This commit makes three improvements for building with ncursesw: + +1. Include "ncursesw/ncurses.h" if it exists +2. Explicitly link against libtinfow or libtinfo if necessary +3. Define _XOPEN_SOURCE_EXTENDED for Mac builds because it should + enable some of the widechar functions with the system's default + version of ncurses.h. +--- + configure.ac | 18 +++++++++++++++++- + src/Makefile.am | 1 - + src/cloud.h | 12 ++++++++++-- + src/neo.cpp | 12 +++++++++++- + 4 files changed, 38 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 67fc25f..7b33b91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6,7 +6,23 @@ AC_LANG(C++) + AC_PROG_CXX + AC_PROG_INSTALL + AC_PROG_MAKE_SET +-AC_CHECK_LIB(ncursesw, initscr) ++AC_CHECK_LIB(ncursesw, mvadd_wch) + AC_CHECK_HEADERS(getopt.h locale.h ncurses.h) ++ ++dnl Some systems have both ncurses.h and ncursesw/ncurses.h. ++dnl On many systems, the headers are identical (e.g. Ubuntu), ++dnl but for some systems they differ. So we should always try ++dnl to use ncursesw/ncurses.h if it exists. ++AC_CHECK_HEADER(ncursesw/ncurses.h, AC_DEFINE(HAVE_NCURSESW_H)) ++ ++dnl Some systems build ncurses with a separate "termlib" library. ++dnl This will usually be libtinfo or less frequently libtinfow. ++dnl These libraries provide functions that do not depend on whether ++dnl or not ncurses is using widechars (e.g. cbreak). This line adds ++dnl -ltinfow or -ltinfo to LIBS, if needed. If libncursesw ++dnl already provides cbreak, then the configure script should ++dnl print a message saying "none required", but it should not fail. ++AC_SEARCH_LIBS(cbreak, [tinfow tinfo]) ++ + AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile]) + AC_OUTPUT +diff --git a/src/Makefile.am b/src/Makefile.am +index e34d8e3..6673492 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -2,7 +2,6 @@ bin_PROGRAMS = neo + AM_CXXFLAGS =\ + -DNCURSES_WIDECHAR\ + -std=c++11 +-LDADD = -lncursesw + neo_SOURCES = \ + droplet.h \ + cloud.h \ +diff --git a/src/cloud.h b/src/cloud.h +index aca7630..20342d8 100644 +--- a/src/cloud.h ++++ b/src/cloud.h +@@ -25,11 +25,19 @@ + #include "droplet.h" + #include "neo.h" + +-#include <ncurses.h> +- + #include <random> + #include <vector> + ++#ifdef __APPLE__ ++ #define _XOPEN_SOURCE_EXTENDED 1 ++#endif ++ ++#ifdef HAVE_NCURSESW_H ++ #include <ncursesw/ncurses.h> ++#else ++ #include <ncurses.h> ++#endif ++ + using namespace std; + + class Cloud { +diff --git a/src/neo.cpp b/src/neo.cpp +index fd288f7..8fda940 100644 +--- a/src/neo.cpp ++++ b/src/neo.cpp +@@ -23,7 +23,6 @@ + + #include <getopt.h> + #include <locale.h> +-#include <ncurses.h> + #include <cassert> + #include <climits> + #include <cstdarg> +@@ -32,6 +31,17 @@ + #include <random> + #include <thread> + #include <utility> ++ ++#ifdef __APPLE__ ++ #define _XOPEN_SOURCE_EXTENDED 1 ++#endif ++ ++#ifdef HAVE_NCURSESW_H ++ #include <ncursesw/ncurses.h> ++#else ++ #include <ncurses.h> ++#endif ++ + using namespace std; + using namespace chrono; + +-- +2.35.1 + diff --git a/app-misc/neo/metadata.xml b/app-misc/neo/metadata.xml new file mode 100644 index 000000000..61ba8aceb --- /dev/null +++ b/app-misc/neo/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream><remote-id type="github">st3w/neo</remote-id></upstream> + <maintainer type="person"> + <email>[email protected]</email> + <name>Carlos Eduardo</name> + </maintainer> +</pkgmetadata> diff --git a/app-misc/neo/neo-0.6.ebuild b/app-misc/neo/neo-0.6.ebuild new file mode 100644 index 000000000..31dbbddfe --- /dev/null +++ b/app-misc/neo/neo-0.6.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="cmatrix clone with 32-bit color and Unicode support" +HOMEPAGE="https://github.com/st3w/neo" + +if [ "$PV" = 9999 ]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/st3w/neo/" + KEYWORDS="" +else + SRC_URI="https://github.com/st3w/neo/releases/download/v${PV}/${P}.tar.gz" + KEYWORDS="~amd64" + [ "$PV" = 0.6 ] && PATCHES=( + "${FILESDIR}"/neo-0.6-fixes-for-building-with-ncursesw.patch + ) +fi + +LICENSE="GPL-3" +SLOT="0" +IUSE="" + +DEPEND="sys-libs/ncurses" +RDEPEND="${DEPEND}" +BDEPEND=" + sys-devel/autoconf + sys-devel/autoconf-archive +" + +src_prepare() { + default + [ -f ./configure ] || ./autogen.sh || die 'autoreconf failed' +} diff --git a/app-misc/neo/neo-9999.ebuild b/app-misc/neo/neo-9999.ebuild new file mode 120000 index 000000000..7fee11d41 --- /dev/null +++ b/app-misc/neo/neo-9999.ebuild @@ -0,0 +1 @@ +neo-0.6.ebuild \ No newline at end of file
