diff --git a/media-gfx/chafa/chafa-1.6.0.recipe b/media-gfx/chafa/chafa-1.6.0.recipe new file mode 100644 index 000000000..0194fd795 --- /dev/null +++ b/media-gfx/chafa/chafa-1.6.0.recipe @@ -0,0 +1,99 @@ +SUMMARY="Versatile and fast Unicode/ASCII/ANSI graphics renderer" +DESCRIPTION="Chafa is a command-line utility that converts all kinds of \ +images, including animated GIFs, into sixel or ANSI/Unicode character output \ +that can be displayed in a terminal. + +It is highly configurable, with support for alpha transparency and multiple \ +color modes and color spaces, combining selectable ranges of Unicode \ +characters to produce the desired output." +HOMEPAGE="https://hpjansson.org/chafa/" +COPYRIGHT="2018-2021 Hans Petter Jansson et al + 2004 Richard Wilson + 2008 Sean Fox" +LICENSE="GNU LGPL v3" +REVISION="1" +SOURCE_URI="https://github.com/hpjansson/chafa/archive/refs/tags/$portVersion.tar.gz" +CHECKSUM_SHA256="b1f00204865beca6d643478edcb88a0058673ad59ced1033514a56c9b0d7f2df" +if [ "$targetArchitecture" = x86_gcc2 ]; then + PATCHES="chafa-$portVersion.patchset" +fi + +ARCHITECTURES="!x86_gcc2 x86_64" +SECONDARY_ARCHITECTURES="x86" + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +libVersion="0.5.0" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +PROVIDES=" + chafa$secondaryArchSuffix = $portVersion + cmd:chafa$commandSuffix = $portVersion + lib:libchafa$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libglib_2.0$secondaryArchSuffix + lib:libgomp$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libMagickWand_7.Q16HDRI$secondaryArchSuffix + " + +PROVIDES_devel=" + chafa${secondaryArchSuffix}_devel = $portVersion + devel:libchafa$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + chafa$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libfreetype$secondaryArchSuffix + devel:libglib_2.0$secondaryArchSuffix + devel:libMagickWand_7.Q16HDRI$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoreconf + cmd:awk + cmd:gcc$secondaryArchSuffix + cmd:gtkdocize + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:which + " + +BUILD() +{ + NOCONFIGURE=1 ./autogen.sh + runConfigure --omit-dirs binDir ./configure \ + --bindir=$commandBinDir + make $jobArgs OBJ_DIR=objects +} + +INSTALL() +{ + make install + + # remove libtool file + rm $libDir/libchafa.la + + prepareInstalledDevelLibs \ + libchafa + packageEntries devel \ + $developDir +} + +TEST() +{ + make check +} diff --git a/media-gfx/chafa/patches/chafa-1.6.0.patchset b/media-gfx/chafa/patches/chafa-1.6.0.patchset new file mode 100644 index 000000000..cc6ca7b04 --- /dev/null +++ b/media-gfx/chafa/patches/chafa-1.6.0.patchset @@ -0,0 +1,80 @@ +From 32ad9d1ca101d7224f46f9a0adb8ac3e09ae8942 Mon Sep 17 00:00:00 2001 +From: begasus +Date: Sun, 9 May 2021 12:17:45 +0000 +Subject: Import upstream patch to enable NOCONFIGURE to ./autogen.sh + + +diff --git a/autogen.sh b/autogen.sh +index 892a590..b59afe5 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -77,7 +77,7 @@ test $TEST_TYPE $FILE || { + exit 1 + } + +-if test -z "$*"; then ++if test x$NOCONFIGURE = x && test -z "$*"; then + ${MY_ECHO} + ${MY_ECHO} "I am going to run ./configure with no arguments - if you wish " + ${MY_ECHO} "to pass any to it, please specify them on the $0 command line." +@@ -102,4 +102,13 @@ ${MY_ECHO} "Running autoconf..." + autoconf + + cd $ORIGDIR +-$srcdir/configure --enable-maintainer-mode "$@" ++ ++conf_flags="--enable-maintainer-mode" ++ ++if test x$NOCONFIGURE = x; then ++ ${MY_ECHO} Running $srcdir/configure $conf_flags "$@" ... ++ $srcdir/configure $conf_flags "$@" \ ++ && ${MY_ECHO} Now type \`make\' to compile $PROJECT || exit 1 ++else ++ ${MY_ECHO} Skipping configure process. ++fi +-- +2.30.2 + + +From b2134549210a1834640911e4dfe993ac9ae15ec7 Mon Sep 17 00:00:00 2001 +From: begasus +Date: Sun, 9 May 2021 16:16:18 +0000 +Subject: Fix __int32_t issue + + +diff --git a/chafa/internal/chafa-popcnt.c b/chafa/internal/chafa-popcnt.c +index f4dc954..809f262 100644 +--- a/chafa/internal/chafa-popcnt.c ++++ b/chafa/internal/chafa-popcnt.c +@@ -29,7 +29,7 @@ chafa_pop_count_u64_builtin (guint64 v) + #if defined(HAVE_POPCNT64_INTRINSICS) + return (gint) _mm_popcnt_u64 (v); + #else /* HAVE_POPCNT32_INTRINSICS */ +- __int32_t* w = (__int32_t*)&v; ++ guint32* w = (guint32*)&v; + return (gint) _mm_popcnt_u32(w[0]) + _mm_popcnt_u32(w[1]); + #endif + } +@@ -42,7 +42,7 @@ chafa_pop_count_vu64_builtin (const guint64 *vv, gint *vc, gint n) + #if defined(HAVE_POPCNT64_INTRINSICS) + *(vc++) = _mm_popcnt_u64 (*(vv++)); + #else /* HAVE_POPCNT32_INTRINSICS */ +- __int32_t* w = (__int32_t*)vv; ++ guint32* w = (guint32*)vv; + *(vc++) = _mm_popcnt_u32(w[0]) + _mm_popcnt_u32(w[1]); + vv++; + #endif +@@ -66,8 +66,8 @@ chafa_hamming_distance_vu64_builtin (guint64 a, const guint64 *vb, gint *vc, gin + *(vc++) = _mm_popcnt_u64 (a ^ *(vb++)); + } + #else /* HAVE_POPCNT32_INTRINSICS */ +- __int32_t* aa = (__int32_t*)&a; +- __int32_t* wb = (__int32_t*)vb; ++ guint32* aa = (guint32*)&a; ++ guint32* wb = (guint32*)vb; + while (n--) { + *(vc++) = _mm_popcnt_u32 (aa [0] ^ wb [0]) + _mm_popcnt_u32 (aa [1] ^ wb [1]); + wb += 2; +-- +2.30.2 +