Skip to content

Commit

Permalink
Migrate to GNU autotools
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Jun 23, 2016
1 parent f89b44f commit 6546191
Show file tree
Hide file tree
Showing 46 changed files with 1,506 additions and 479 deletions.
31 changes: 25 additions & 6 deletions .gitignore
@@ -1,9 +1,28 @@
/*.o
/*.d
*.o
.deps
.dirstamp
/*.S
/test
/hiptext
/*.a
/*.d
/*.plist
/*.swp
/*.tar.gz
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache
/config.*
/config/compile
/config/config.*
/config/depcomp
/config/install-sh
/config/missing
/config/test-driver
/configure
/cpplint.py
/gtest/src/*.o
/*.swp
/*.plist
/hiptext
/hiptext_test*
/src/pixel_parse.cc
/stamp-h1
/test-suite.log
35 changes: 35 additions & 0 deletions .travis.yml
@@ -0,0 +1,35 @@
language: cpp

dist: trusty
addons:
apt:
packages:
- libavcodec-dev
- libavformat-dev
- libfreetype6-dev
- libgflags-dev
- libgoogle-glog-dev
- libjpeg-dev
- libpng12-dev
- libswscale-dev
- ragel

compiler:
- clang
- gcc

script:
- ./autogen.sh
- ./configure --disable-silent-rules
- make -j2 hiptext hiptext_test
- ./hiptext_test
- make check
- make dist
- sudo apt-get remove -y ragel
- tar xvzf hiptext-?.?.tar.gz
- cd hiptext-?.?
- ./configure
- make -j2
- sudo make install
- hiptext --width=80 --nocolor balls.png
- hiptext --width=80 --xterm256 balls.png
90 changes: 0 additions & 90 deletions Makefile

This file was deleted.

120 changes: 120 additions & 0 deletions Makefile.am
@@ -0,0 +1,120 @@
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I config

EXTRA_DIST = \
DejaVuSansMono.ttf \
README.md \
autogen.sh \
balls.png \
obama.jpg \
$(shell find gtest)

bin_PROGRAMS = hiptext
noinst_LIBRARIES = libhiptext.a libgtest.a

################################################################################
## libhiptext.a

libhiptext_a_SOURCES = \
src/artiste.cc \
src/charquantizer.cc \
src/font.cc \
src/graphic.cc \
src/hiptext.cc \
src/hiptext/artiste.h \
src/hiptext/charquantizer.h \
src/hiptext/font.h \
src/hiptext/graphic.h \
src/hiptext/jpeg.h \
src/hiptext/macterm.h \
src/hiptext/movie.h \
src/hiptext/pixel.h \
src/hiptext/png.h \
src/hiptext/sixelprinter.h \
src/hiptext/termprinter.h \
src/hiptext/unicode.h \
src/hiptext/unused.h \
src/hiptext/xterm256.h \
src/jpeg.cc \
src/macterm.cc \
src/movie.cc \
src/pixel.cc \
src/pixel_parse.cc \
src/pixel_parse.rl \
src/png.cc \
src/sixelprinter.cc \
src/termprinter.cc \
src/unicode.cc \
src/xterm256.cc

libhiptext_a_CPPFLAGS = \
-Isrc \
$(LIBAVCODEC_CFLAGS) \
$(LIBAVFORMAT_CFLAGS) \
$(LIBAVUTIL_CFLAGS) \
$(LIBFREETYPE_CFLAGS) \
$(LIBGFLAGS_CFLAGS) \
$(LIBGLOG_CFLAGS) \
$(LIBPNG_CFLAGS) \
$(LIBSWSCALE_CFLAGS)

src/pixel_parse.cc: src/pixel_parse.rl

################################################################################
## hiptext

hiptext_SOURCES = src/hiptext.cc

hiptext_CPPFLAGS = $(libhiptext_a_CPPFLAGS)

hiptext_LDADD = \
libhiptext.a \
-ljpeg \
$(LIBAVCODEC_LIBS) \
$(LIBAVFORMAT_LIBS) \
$(LIBAVUTIL_LIBS) \
$(LIBFREETYPE_LIBS) \
$(LIBGFLAGS_LIBS) \
$(LIBGLOG_LIBS) \
$(LIBPNG_LIBS) \
$(LIBSWSCALE_LIBS)

################################################################################
## libgtest

libgtest_a_SOURCES = \
gtest/src/gtest-all.cc

libgtest_a_CPPFLAGS = \
$(PTHREAD_CFLAGS) \
-Igtest \
-Igtest/include

################################################################################
## test

check_PROGRAMS = hiptext_test
TESTS = $(check_PROGRAMS)

hiptext_test_SOURCES = \
test/pixel_test.cc \
test/xterm256_test.cc \
test/test.cc

hiptext_test_CPPFLAGS = \
$(hiptext_CPPFLAGS) \
$(PTHREAD_CFLAGS) \
-Igtest/include

hiptext_test_LDADD = \
libgtest.a \
$(hiptext_LDADD) \
$(PTHREAD_LIBS) \
$(PTHREAD_CFLAGS) # XXX: Not sure why this is needed.

################################################################################
## miscellaneous

src/%.cc: src/%.rl
@echo " RL " $@;
@$(RAGEL) -G2 -o $@ $<
11 changes: 4 additions & 7 deletions README.md
@@ -1,4 +1,4 @@
# hiptext
# hiptext [![Build Status](https://travis-ci.org/jart/hiptext.svg?branch=master)](https://travis-ci.org/jart/hiptext)

hiptext is command line tool for rendering images and videos inside terminals.

Expand All @@ -13,12 +13,13 @@ hiptext is command line tool for rendering images and videos inside terminals.
You need clang or gcc >=4.7. You also need to install:

sudo apt-get install build-essential libpng12-dev libjpeg-dev \
libfreetype6-dev libgif-dev ragel libavformat-dev libavcodec-dev \
libfreetype6-dev libavformat-dev libavcodec-dev \
libswscale-dev libgflags-dev libgoogle-glog-dev

## Installation

make
./configure
make -j4
sudo make install

## Usage
Expand Down Expand Up @@ -106,7 +107,3 @@ not the case, you can specify your background color using a CSS or X11 color
string.

hiptext --bg=white balls.png

## Testing

make test && ./test
4 changes: 4 additions & 0 deletions autogen.sh
@@ -0,0 +1,4 @@
#!/bin/sh
set -ex
aclocal --install --force -I config
autoreconf --install --force --verbose -I config

0 comments on commit 6546191

Please sign in to comment.