Bug 210404 - [NEW PORT] graphics/hiptext: Tool for rendering images and videos inside terminals
Summary: [NEW PORT] graphics/hiptext: Tool for rendering images and videos inside term...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 08:31 UTC by Yuri Victorovich
Modified: 2016-06-22 14:34 UTC (History)
0 users

See Also:


Attachments
shar archive (5.59 KB, text/plain)
2016-06-20 08:31 UTC, Yuri Victorovich
no flags Details
shar archive (4.45 KB, text/plain)
2016-06-20 08:34 UTC, Yuri Victorovich
no flags Details
shar archive (6.75 KB, text/plain)
2016-06-22 04:03 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2016-06-20 08:31:15 UTC
Created attachment 171600 [details]
shar archive
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-20 08:34:09 UTC
Created attachment 171601 [details]
shar archive
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-06-22 01:26:33 UTC
Comment on attachment 171601 [details]
shar archive

Fails to build on 9.x. It wants USES=compiler:c++11-lib. If you really need C++14 features submit a bug for USES=compiler:c++14-lib or make a conditional after bsd.port.options.mk. However, it builds fine on 9.x and 10.1 with just C++11.

  In file included from hiptext.cc:17:
  ./artiste.h:15:30: error: no type named 'function' in namespace 'std'
  using RenderAlgorithm = std::function<void(std::ostream&, const Graphic&)>;
			  ~~~~~^
  In file included from hiptext.cc:23:
  ./macterm.h:7:10: fatal error: 'cstdint' file not found
  #include <cstdint>
	   ^

Fails to build with devel/googletest installed. Add CONFLICTS_BUILD, manage *FLAGS or use system gtest per https://www.freebsd.org/doc/en/books/porters-handbook/bundled-libs.html

  In file included from gtest/src/gtest-all.cc:42:
  gtest/src/gtest.cc:958:23: error: out-of-line definition of 'swap' does not match any declaration in
	'testing::AssertionResult'
  void AssertionResult::swap(AssertionResult& other) {
			^~~~
  gtest/src/gtest.cc:961:3: error: no matching function for call to 'swap'
    swap(message_, other.message_);
    ^~~~
  In file included from gtest/src/gtest-all.cc:42:
  gtest/src/gtest.cc:991:13: error: use of undeclared identifier 'EditType'
  std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
	      ^

Fails to build with ffmpeg 3.0 (bug 207547). Try s/PIX_FMT/AV_&/ + s/avcodec_alloc_frame/av_frame_alloc/

  movie.cc:56:42: error: use of undeclared identifier 'PIX_FMT_RGB24'; did you mean
	'AV_PIX_FMT_RGB24'?
			  width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,
					   ^~~~~~~~~~~~~
					   AV_PIX_FMT_RGB24
  movie.cc:64:18: error: use of undeclared identifier 'avcodec_alloc_frame'
    CHECK(frame_ = avcodec_alloc_frame());
		   ^

> XPORTVERSION=	0.160620

Do not abbreviate snapshot year to avoid confusion about the date format (%y%m%d vs. %d%m%y).
And prepend one more 0. to avoid PORTEPOCH issue in case upstream releases 0.1.

> X		libpng16.so:graphics/png \

Depend on libpng.so unless it won't build/work with libpng17.

> XCXXFLAGS+=	-I${PREFIX}/include -I${PREFIX}/include/freetype2

PREFIX is where *this* port installs, use LOCALBASE otherwise. In some cases the destination can be empty: poudriere testport -P ...

After that consider replacing -I${LOCALBASE}/include with USES=localbase.

> XPLIST_FILES=	bin/hiptext %%DATADIR%%/DejaVuSansMono.ttf
> X
> Xpost-patch:
> X	@${REINPLACE_CMD} -e 's|"DejaVuSansMono.ttf"|"${PREFIX}/share/${PORTNAME}/DejaVuSansMono.ttf"|' \
> X		${WRKSRC}/font.cc
> Xdo-install:
> X	(cd ${WRKSRC} && \

Why do you need to change directory just to run commands that work fine with absolute paths?

> X		${INSTALL_DATA} DejaVuSansMono.ttf ${STAGEDIR}${PREFIX}/share/${PORTNAME})

Use DejaVuSansMono.ttf from x11-fonts/dejavu unless the port needs modified version.

> Xdo-test:
> X	(cd ${WRKSRC} && \
> X		${MAKE_CMD} test && ./test)

Define TEST_TARGET=check instead to avoid losing MAKE_ENV/MAKE_ARGS/MAKE_JOBS etc.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-22 01:32:20 UTC
Sorry.
Could you just change to c++11 and commit then?
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-22 02:53:29 UTC
Ok, I will submit the changed shar.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-22 04:03:17 UTC
Created attachment 171661 [details]
shar archive

Fixed all issues.

It still doesn't build for me on 9.X - can't find std::function (c++11 feature) despite the header being included. I labeled it as broken on 9.X
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-06-22 14:31:51 UTC
A commit references this bug:

Author: jbeich
Date: Wed Jun 22 14:31:01 UTC 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

Changes:
  head/graphics/Makefile
  head/graphics/hiptext/
  head/graphics/hiptext/Makefile
  head/graphics/hiptext/distinfo
  head/graphics/hiptext/files/
  head/graphics/hiptext/files/patch-Makefile
  head/graphics/hiptext/files/patch-artiste.cc
  head/graphics/hiptext/files/patch-hiptext.cc
  head/graphics/hiptext/files/patch-movie.cc
  head/graphics/hiptext/pkg-descr
Comment 7 Jan Beich freebsd_committer freebsd_triage 2016-06-22 14:34:18 UTC
Thanks. Landed with minor changes.