diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-06-22 22:31:00 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-06-22 22:31:00 +0800 |
commit | b4a93a3c020516b607ca99176f32ddfc5973b918 (patch) | |
tree | bc330d490bcce800bd4351178ef9d1d3e03caeef | |
parent | 7aa640e91988accd1c003625a85516507c037b35 (diff) | |
download | freebsd-ports-gnome-b4a93a3c020516b607ca99176f32ddfc5973b918.tar.gz freebsd-ports-gnome-b4a93a3c020516b607ca99176f32ddfc5973b918.tar.zst freebsd-ports-gnome-b4a93a3c020516b607ca99176f32ddfc5973b918.zip |
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
-rw-r--r-- | graphics/Makefile | 1 | ||||
-rw-r--r-- | graphics/hiptext/Makefile | 42 | ||||
-rw-r--r-- | graphics/hiptext/distinfo | 3 | ||||
-rw-r--r-- | graphics/hiptext/files/patch-Makefile | 28 | ||||
-rw-r--r-- | graphics/hiptext/files/patch-artiste.cc | 11 | ||||
-rw-r--r-- | graphics/hiptext/files/patch-hiptext.cc | 15 | ||||
-rw-r--r-- | graphics/hiptext/files/patch-movie.cc | 29 | ||||
-rw-r--r-- | graphics/hiptext/pkg-descr | 3 |
8 files changed, 132 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile index 55cf7d0162f3..408b6d0da3e5 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -333,6 +333,7 @@ SUBDIR += gwenview-kde4 SUBDIR += gx SUBDIR += hdr_tools + SUBDIR += hiptext SUBDIR += hobbes-icons-xpm SUBDIR += hppsmtools SUBDIR += hs-HGL diff --git a/graphics/hiptext/Makefile b/graphics/hiptext/Makefile new file mode 100644 index 000000000000..8d78aadb17e4 --- /dev/null +++ b/graphics/hiptext/Makefile @@ -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> diff --git a/graphics/hiptext/distinfo b/graphics/hiptext/distinfo new file mode 100644 index 000000000000..55698cd87ce0 --- /dev/null +++ b/graphics/hiptext/distinfo @@ -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 diff --git a/graphics/hiptext/files/patch-Makefile b/graphics/hiptext/files/patch-Makefile new file mode 100644 index 000000000000..3c5e6b016a7e --- /dev/null +++ b/graphics/hiptext/files/patch-Makefile @@ -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 diff --git a/graphics/hiptext/files/patch-artiste.cc b/graphics/hiptext/files/patch-artiste.cc new file mode 100644 index 000000000000..7d4da546d785 --- /dev/null +++ b/graphics/hiptext/files/patch-artiste.cc @@ -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; diff --git a/graphics/hiptext/files/patch-hiptext.cc b/graphics/hiptext/files/patch-hiptext.cc new file mode 100644 index 000000000000..bdcb897438ff --- /dev/null +++ b/graphics/hiptext/files/patch-hiptext.cc @@ -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"); diff --git a/graphics/hiptext/files/patch-movie.cc b/graphics/hiptext/files/patch-movie.cc new file mode 100644 index 000000000000..ae9370ae3a06 --- /dev/null +++ b/graphics/hiptext/files/patch-movie.cc @@ -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_; + } diff --git a/graphics/hiptext/pkg-descr b/graphics/hiptext/pkg-descr new file mode 100644 index 000000000000..e3b742b346e9 --- /dev/null +++ b/graphics/hiptext/pkg-descr @@ -0,0 +1,3 @@ +hiptext is command line tool for rendering images and videos inside terminals. + +WWW: https://github.com/jart/hiptext |