Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2016 14:31:00 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r417308 - in head/graphics: . hiptext hiptext/files
Message-ID:  <201606221431.u5MEV0ta041201@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Jun 22 14:31:00 2016
New Revision: 417308
URL: https://svnweb.freebsd.org/changeset/ports/417308

Log:
  graphics/hiptext: add new port
  
  PR:		210404
  Submitted by:	yuri@rawbw.com
  
  hiptext is command line tool for rendering images and videos inside terminals.
  
  https://github.com/jart/hiptext

Added:
  head/graphics/hiptext/
  head/graphics/hiptext/Makefile   (contents, props changed)
  head/graphics/hiptext/distinfo   (contents, props changed)
  head/graphics/hiptext/files/
  head/graphics/hiptext/files/patch-Makefile   (contents, props changed)
  head/graphics/hiptext/files/patch-artiste.cc   (contents, props changed)
  head/graphics/hiptext/files/patch-hiptext.cc   (contents, props changed)
  head/graphics/hiptext/files/patch-movie.cc   (contents, props changed)
  head/graphics/hiptext/pkg-descr   (contents, props changed)
Modified:
  head/graphics/Makefile   (contents, props changed)

Modified: head/graphics/Makefile
==============================================================================
--- head/graphics/Makefile	Wed Jun 22 14:16:07 2016	(r417307)
+++ head/graphics/Makefile	Wed Jun 22 14:31:00 2016	(r417308)
@@ -333,6 +333,7 @@
     SUBDIR += gwenview-kde4
     SUBDIR += gx
     SUBDIR += hdr_tools
+    SUBDIR += hiptext
     SUBDIR += hobbes-icons-xpm
     SUBDIR += hppsmtools
     SUBDIR += hs-HGL

Added: head/graphics/hiptext/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/Makefile	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,42 @@
+# Created by: Yuri Victorovich <yuri@rawbw.com>
+# $FreeBSD$
+
+PORTNAME=	hiptext
+PORTVERSION=	0.0.s20160621
+CATEGORIES=	graphics
+
+MAINTAINER=	yuri@rawbw.com
+COMMENT=	Tool for rendering images and videos inside terminals
+
+BUILD_DEPENDS=	ragel:devel/ragel
+LIB_DEPENDS=	libgflags.so:devel/gflags \
+		libglog.so:devel/glog \
+		libpng.so:graphics/png \
+		libswscale.so:multimedia/ffmpeg \
+		libfreetype.so:print/freetype2
+TEST_DEPENDS=	googletest>=1.7.0:devel/googletest
+RUN_DEPENDS=	${LOCALBASE}/share/fonts/dejavu/DejaVuSans.ttf:x11-fonts/dejavu
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	jart
+GH_TAGNAME=	f89b44f
+
+USES=		compiler:c++11-lib gmake jpeg localbase
+CPPFLAGS+=	-D_GLIBCXX_USE_C99 # XXX ports/193528
+CPPFLAGS+=	-I${LOCALBASE}/include/freetype2
+MAKE_ENV=	GTEST_DIR="${LOCALBASE}"
+TEST_TARGET=	check
+
+PLIST_FILES=	bin/hiptext
+
+post-extract:
+	@${RM} -r ${WRKSRC}/gtest
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|"DejaVuSansMono.ttf"|"${LOCALBASE}/share/fonts/dejavu/DejaVuSansMono.ttf"|' \
+		${WRKSRC}/font.cc
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/hiptext ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>

Added: head/graphics/hiptext/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/distinfo	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1466564837
+SHA256 (jart-hiptext-0.0.s20160621-f89b44f_GH0.tar.gz) = b07164083cb2912fdc7f19c46934c34eca3f5bfd7a34a5990c82b047b4bfa6d1
+SIZE (jart-hiptext-0.0.s20160621-f89b44f_GH0.tar.gz) = 1566318

Added: head/graphics/hiptext/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/files/patch-Makefile	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,28 @@
+--- Makefile.orig	2016-06-21 21:09:17 UTC
++++ Makefile
+@@ -48,7 +48,7 @@ check: test
+ 	./test --alsologtostderr --gtest_color=yes
+ 
+ clean:
+-	$(RM) test hiptext $(wildcard *.o *.d *.S $(GTEST_DIR)/*.o) cpplint.py
++	$(RM) test hiptext $(wildcard *.o *.d *.S) cpplint.py
+ 
+ install: hiptext
+ 	install --mode=0755 hiptext $(PREFIX)/bin
+@@ -78,12 +78,11 @@ pixel_parse.o: CXXFLAGS := $(filter-out 
+ font.%:        CXXFLAGS += $(shell freetype-config --cflags)
+ 
+ # google-test integration magic.
+-GTEST_DIR ?= gtest
+-TESTS = $(GTEST_DIR)/src/gtest-all.o $(GTEST_DIR)/src/gtest_main.o \
+-        $(patsubst %.cc,%.o,$(wildcard *_test.cc))
+-$(TESTS): CXXFLAGS += -I$(GTEST_DIR)/include -I$(GTEST_DIR) -pthread
++GTEST_DIR ?= $(PREFIX)
++TESTS = $(patsubst %.cc,%.o,$(wildcard *_test.cc))
++$(TESTS): CXXFLAGS += -I$(GTEST_DIR)/include -pthread
+ $(filter gtest%,$(TESTS)): CXXFLAGS := $(filter-out -MD -Wall,$(CXXFLAGS))
+-test: $(TESTS) $(SOURCES) ; $(LINK.cc) $^ $(LDLIBS) -lpthread -o $@
++test: $(TESTS) $(SOURCES) ; $(LINK.cc) $^ $(LDLIBS) -lpthread -L$(GTEST_DIR)/lib -lgtest -lgtest_main -o $@
+ 
+ # Recompile sources when headers change.
+ CXXFLAGS += -MD

Added: head/graphics/hiptext/files/patch-artiste.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/files/patch-artiste.cc	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,11 @@
+--- artiste.cc.orig	2016-06-21 21:09:17 UTC
++++ artiste.cc
+@@ -166,7 +166,7 @@ void Artiste::PrintMovie(Movie movie) {
+   ComputeDimensions(RatioOf(movie.width(), movie.height()));
+   movie.PrepareRGB(width_, height_);
+   HideCursor();
+-  sighandler_t old_handler = signal(SIGINT, OnCtrlC);
++  sig_t old_handler = signal(SIGINT, OnCtrlC);
+   for (auto graphic : movie) {
+     if (g_done) {
+       break;

Added: head/graphics/hiptext/files/patch-hiptext.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/files/patch-hiptext.cc	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,15 @@
+--- hiptext.cc.orig	2016-06-21 21:09:17 UTC
++++ hiptext.cc
+@@ -197,9 +197,9 @@ inline string GetExtension(const string&
+ int main(int argc, char** argv) {
+   // if (!isatty(1))
+   //   FLAGS_color = false;
+-  google::SetUsageMessage("hiptext [FLAGS]");
+-  google::SetVersionString("0.1");
+-  google::ParseCommandLineFlags(&argc, &argv, true);
++  gflags::SetUsageMessage("hiptext [FLAGS]");
++  gflags::SetVersionString("0.1");
++  gflags::ParseCommandLineFlags(&argc, &argv, true);
+   google::InitGoogleLogging(argv[0]);
+   google::InstallFailureSignalHandler();
+   const char* lang = std::getenv("LANG");

Added: head/graphics/hiptext/files/patch-movie.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/files/patch-movie.cc	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,29 @@
+--- movie.cc.orig	2016-06-21 21:09:17 UTC
++++ movie.cc
+@@ -53,7 +53,7 @@ void Movie::PrepareRGB(int width, int he
+ 
+   // Prepare context for scaling and converting to RGB.
+   sws_ = sws_getContext(context_->width, context_->height, context_->pix_fmt,
+-                        width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,
++                        width_, height_, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR,
+                         nullptr, nullptr, nullptr);
+   CHECK(codec_ = avcodec_find_decoder(context_->codec_id))
+       << "Unsupported codec.\n";
+@@ -61,13 +61,13 @@ void Movie::PrepareRGB(int width, int he
+       << "Could not open codec.\n";
+ 
+   // Allocate Raw + RGB frame buffers.
+-  CHECK(frame_ = avcodec_alloc_frame());
+-  CHECK(frame_rgb_ = avcodec_alloc_frame());
+-  int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);
++  CHECK(frame_ = av_frame_alloc());
++  CHECK(frame_rgb_ = av_frame_alloc());
++  int rgb_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, width_, height_);
+   buffer_ = static_cast<uint8_t*>(av_malloc(rgb_bytes));
+   LOG(INFO) << "RGB Buffer: " << rgb_bytes << " bytes.";
+   int prep = avpicture_fill(reinterpret_cast<AVPicture*>(frame_rgb_),
+-                            buffer_, PIX_FMT_RGB24, width_, height_);
++                            buffer_, AV_PIX_FMT_RGB24, width_, height_);
+   CHECK_GE(prep, 0) << "Failed to prepare RGB buffer.";
+   LOG(INFO) << "RGB dimensions: " << width_  << "x" << height_;
+ }

Added: head/graphics/hiptext/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/hiptext/pkg-descr	Wed Jun 22 14:31:00 2016	(r417308)
@@ -0,0 +1,3 @@
+hiptext is command line tool for rendering images and videos inside terminals.
+
+WWW: https://github.com/jart/hiptext



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606221431.u5MEV0ta041201>