Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Apr 2016 17:23:45 +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: r412362 - in head/graphics: . sekrit-twc-zimg sekrit-twc-zimg/files
Message-ID:  <201604011723.u31HNju8031848@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Apr  1 17:23:44 2016
New Revision: 412362
URL: https://svnweb.freebsd.org/changeset/ports/412362

Log:
  graphics/sekrit-twc-zimg: add new port
  
  The "z" library implements the commonly required image processing
  basics of scaling, colorspace conversion, and depth conversion. A
  simple API enables conversion between any supported formats to operate
  with minimal knowledge from the programmer. All library routines were
  designed from the ground-up with flexibility, thread-safety, and
  correctness as first priorities. Allocation, buffering, and I/O are
  cleanly separated from processing, allowing the programmer to adapt
  "z" to many scenarios.
  
  https://github.com/sekrit-twc/zimg

Added:
  head/graphics/sekrit-twc-zimg/
  head/graphics/sekrit-twc-zimg/Makefile   (contents, props changed)
  head/graphics/sekrit-twc-zimg/distinfo   (contents, props changed)
  head/graphics/sekrit-twc-zimg/files/
  head/graphics/sekrit-twc-zimg/files/patch-no-extra-deps   (contents, props changed)
  head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__sse2__test.cpp   (contents, props changed)
  head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp   (contents, props changed)
  head/graphics/sekrit-twc-zimg/pkg-descr   (contents, props changed)
  head/graphics/sekrit-twc-zimg/pkg-plist   (contents, props changed)
Modified:
  head/graphics/Makefile   (contents, props changed)

Modified: head/graphics/Makefile
==============================================================================
--- head/graphics/Makefile	Fri Apr  1 16:56:54 2016	(r412361)
+++ head/graphics/Makefile	Fri Apr  1 17:23:44 2016	(r412362)
@@ -978,6 +978,7 @@
     SUBDIR += seam-carving-gui
     SUBDIR += seejpeg
     SUBDIR += seexpr
+    SUBDIR += sekrit-twc-zimg
     SUBDIR += seom
     SUBDIR += separate
     SUBDIR += seq2gif

Added: head/graphics/sekrit-twc-zimg/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/Makefile	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,57 @@
+# $FreeBSD$
+
+PORTNAME=	zimg
+PORTVERSION=	2.0.4
+DISTVERSIONPREFIX=	release-
+CATEGORIES=	graphics
+PKGNAMEPREFIX=	${GH_ACCOUNT}-
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Scaling, colorspace conversion, and dithering library
+
+LICENSE=	WTFPL2
+LICENSE_NAME=	Do What The Fuck You Want To Public License version 2
+LICENSE_FILE=	${WRKSRC}/COPYING
+LICENSE_PERMS=	${_LICENSE_PERMS_DEFAULT}
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	sekrit-twc
+
+USES=		autoreconf compiler:c++11-lib gmake libtool pathfix
+EXTRACT_AFTER_ARGS=	--exclude test/extra
+PATHFIX_MAKEFILEIN=	Makefile.am
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--enable-testapp
+CFLAGS+=	-D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH_TR1 \
+		-D_DECLARE_C99_LDBL_MATH # XXX ports/193528
+INSTALL_TARGET=	install-strip
+USE_LDCONFIG=	yes
+
+OPTIONS_DEFINE=	TEST
+
+OPTIONS_DEFINE_amd64=	SIMD
+OPTIONS_DEFINE_i386=	SIMD
+OPTIONS_DEFAULT_amd64=	SIMD
+OPTIONS_DEFAULT_i386=	SIMD # runtime detection
+
+SIMD_CONFIGURE_ENABLE=	x86simd
+
+TEST_BUILD_DEPENDS=	googletest>=1.6.0:devel/googletest
+TEST_USES=		localbase
+TEST_CONFIGURE_ENABLE=	unit-test
+TEST_TEST_TARGET=	check VERBOSE=1
+
+post-patch:
+	@${REINPLACE_CMD} -e 's/x86_64/&|amd64/g' \
+		${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's/-O2 //' \
+		-e '/zimg-test/ { s/+=/=/; s/^noinst_/bin_/; } ' \
+		${WRKSRC}/Makefile.am
+	@${REINPLACE_CMD} -e 's/nullptr_t/std::&/' \
+		-e 's/off64_t/off_t/' \
+		${WRKSRC}/src/testcommon/json.* \
+		${WRKSRC}/src/testcommon/mmap.cpp
+
+pre-install-TEST-on: do-test
+
+.include <bsd.port.mk>

Added: head/graphics/sekrit-twc-zimg/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/distinfo	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,2 @@
+SHA256 (sekrit-twc-zimg-release-2.0.4_GH0.tar.gz) = e3b1f5b9f8ce750f96b9bc9801ff5d6aa931d35300d67711826e397df43c5245
+SIZE (sekrit-twc-zimg-release-2.0.4_GH0.tar.gz) = 174469

Added: head/graphics/sekrit-twc-zimg/files/patch-no-extra-deps
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/files/patch-no-extra-deps	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,113 @@
+--- Makefile.am.orig	2016-01-22 18:12:28 UTC
++++ Makefile.am
+@@ -197,35 +197,16 @@ endif # TESTAPP
+ if UNIT_TEST
+ TESTS = test/unit_test
+ 
+-check_LTLIBRARIES = test/libmusl_m.la
+ check_PROGRAMS = test/unit_test
+ 
+-test_libmusl_m_la_CFLAGS = $(AM_CFLAGS) -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable
+-
+-test_libmusl_m_la_SOURCES = test/extra/musl-libm/__cos.c \
+-							test/extra/musl-libm/__rem_pio2.c \
+-							test/extra/musl-libm/__rem_pio2_large.c \
+-							test/extra/musl-libm/__sin.c \
+-							test/extra/musl-libm/cos.c \
+-							test/extra/musl-libm/fpu_wrapper.c \
+-							test/extra/musl-libm/libm.h \
+-							test/extra/musl-libm/mymath.h \
+-							test/extra/musl-libm/pow.c \
+-							test/extra/musl-libm/powf.c \
+-							test/extra/musl-libm/sin.c
+-
+ test_unit_test_CPPFLAGS = -I$(srcdir)/src/zimg \
+ 						  -I$(srcdir)/test \
+-						  -I$(srcdir)/test/extra \
+-						  -I$(srcdir)/test/extra/googletest/googletest/include
++						  -I$(srcdir)/test/extra
+ 
+ test_unit_test_SOURCES = test/main.cpp \
+ 						 test/colorspace/colorspace_test.cpp \
+ 						 test/depth/depth_convert_test.cpp \
+ 						 test/depth/dither_test.cpp \
+-						 test/extra/sha1/config.h \
+-						 test/extra/sha1/sha1.c \
+-						 test/extra/sha1/sha1.h \
+ 						 test/graph/audit_buffer.cpp \
+ 						 test/graph/audit_buffer.h \
+ 						 test/graph/basic_filter_test.cpp \
+@@ -247,7 +228,6 @@ test_unit_test_SOURCES += test/colorspac
+ 
+ endif #X86SIMD
+ 
+-test_unit_test_LDADD = test/extra/googletest/googletest/lib/libgtest.la \
+-						test/libmusl_m.la \
++test_unit_test_LDADD = -lgtest -lmd -lpthread \
+ 						libzimg.la
+ endif # UNIT_TEST
+--- configure.ac.orig	2016-01-22 18:12:28 UTC
++++ configure.ac
+@@ -29,8 +29,6 @@ AS_IF([test "x$enable_unit_test" = "xyes
+           [x86_64], [],
+           [AC_MSG_WARN([Could not determine how to enable IEEE-754 compliance on host. Tests may fail.])]
+         )
+-        AC_CONFIG_SUBDIRS(test/extra/googletest/googletest)
+-        AC_SUBST([CONFIG_SUBDIRS], [test/extra/googletest/googletest])
+       ],
+ )
+ 
+--- test/graph/filter_validator.cpp.orig	2016-01-22 18:12:28 UTC
++++ test/graph/filter_validator.cpp
+@@ -13,7 +13,7 @@
+ #include "gtest/gtest.h"
+ 
+ extern "C" {
+-  #include "sha1/sha1.h"
++  #include <sha.h>
+ }
+ 
+ #include "audit_buffer.h"
+@@ -35,14 +35,14 @@ void hash_buffer(const AuditBuffer<T> &b
+ 	auto image_buffer = buf.as_read_buffer();
+ 	SHA1_CTX sha_ctx;
+ 
+-	SHA1Init(&sha_ctx);
++	SHA1_Init(&sha_ctx);
+ 
+ 	for (unsigned i = 0; i < height; ++i) {
+ 		const unsigned char *ptr = zimg::graph::static_buffer_cast<const unsigned char>(image_buffer[p])[i];
+-		SHA1Update(&sha_ctx, ptr, width * sizeof(T));
++		SHA1_Update(&sha_ctx, ptr, width * sizeof(T));
+ 	}
+ 
+-	SHA1Final(digest, &sha_ctx);
++	SHA1_Final(digest, &sha_ctx);
+ }
+ 
+ std::string hash_to_str(const unsigned char digest[20])
+--- test/main.cpp.orig	2016-01-22 18:12:28 UTC
++++ test/main.cpp
+@@ -3,22 +3,11 @@
+ #include "common/libm_wrapper.h"
+ 
+ #include "gtest/gtest.h"
+-#include "musl-libm/mymath.h"
+-
+-void wrap_libm()
+-{
+-	_zimg_sin = mysin;
+-	_zimg_cos = mycos;
+-	_zimg_pow = mypow;
+-	_zimg_powf = mypowf;
+-}
+ 
+ int main(int argc, char **argv)
+ {
+ 	int ret;
+ 
+-	wrap_libm();
+-
+ 	::testing::InitGoogleTest(&argc, argv);
+ 	ret = RUN_ALL_TESTS();
+ 

Added: head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__sse2__test.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__sse2__test.cpp	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,11 @@
+--- test/resize/resize_impl_sse2_test.cpp.orig	2016-01-22 18:12:28 UTC
++++ test/resize/resize_impl_sse2_test.cpp
+@@ -7,6 +7,8 @@
+ #include "gtest/gtest.h"
+ #include "graph/filter_validator.h"
+ 
++#include <cmath> // INFINITY
++
+ namespace {;
+ 
+ void test_case(const zimg::resize::Filter &filter, bool horizontal, unsigned src_w, unsigned src_h, unsigned dst_w, unsigned dst_h,

Added: head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,36 @@
+test/resize/resize_impl_test.cpp:37:3: error: no matching conversion for functional-style cast from
+      'std::__1::unique_ptr<zimg::graph::ImageFilter,
+      std::__1::default_delete<zimg::graph::ImageFilter> >' to '::testing::AssertionResult'
+                ASSERT_TRUE(filter);
+                ^~~~~~~~~~~~~~~~~~~
+/usr/local/include/gtest/gtest.h:1921:3: note: expanded from macro 'ASSERT_TRUE'
+  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
+  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/usr/local/include/gtest/internal/gtest-internal.h:1111:7: note: expanded from macro
+      'GTEST_TEST_BOOLEAN_'
+      ::testing::AssertionResult(expression)) \
+      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/usr/local/include/gtest/gtest.h:260:3: note: candidate constructor not viable: no known conversion
+      from 'std::__1::unique_ptr<zimg::graph::ImageFilter,
+      std::__1::default_delete<zimg::graph::ImageFilter> >' to 'const testing::AssertionResult' for
+      1st argument
+  AssertionResult(const AssertionResult& other);
+  ^
+/usr/local/include/gtest/gtest.h:262:12: note: candidate constructor not viable: no known conversion
+      from 'std::__1::unique_ptr<zimg::graph::ImageFilter,
+      std::__1::default_delete<zimg::graph::ImageFilter> >' to 'bool' for 1st argument
+  explicit AssertionResult(bool success) : success_(success) {}
+           ^
+1 error generated.
+
+--- test/resize/resize_impl_test.cpp.orig	2016-01-22 18:12:28 UTC
++++ test/resize/resize_impl_test.cpp
+@@ -34,7 +34,7 @@ void test_case(const zimg::PixelFormat &
+ 			set_shift(shift).
+ 			set_subwidth(subwidth_factor * (horizontal ? src_w : src_h)).create();
+ 
+-		ASSERT_TRUE(filter);
++		ASSERT_TRUE(static_cast<bool>(filter));
+ 		validate_filter(filter.get(), src_w, src_h, format, expected_sha1[sha1_idx++]);
+ 	}
+ }

Added: head/graphics/sekrit-twc-zimg/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/pkg-descr	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,10 @@
+The "z" library implements the commonly required image processing
+basics of scaling, colorspace conversion, and depth conversion. A
+simple API enables conversion between any supported formats to operate
+with minimal knowledge from the programmer. All library routines were
+designed from the ground-up with flexibility, thread-safety, and
+correctness as first priorities. Allocation, buffering, and I/O are
+cleanly separated from processing, allowing the programmer to adapt
+"z" to many scenarios.
+
+WWW: https://github.com/sekrit-twc/zimg

Added: head/graphics/sekrit-twc-zimg/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/sekrit-twc-zimg/pkg-plist	Fri Apr  1 17:23:44 2016	(r412362)
@@ -0,0 +1,9 @@
+bin/zimg-test
+include/zimg++.hpp
+include/zimg.h
+lib/libzimg.a
+lib/libzimg.so
+lib/libzimg.so.2
+lib/libzimg.so.2.0.0
+lib/zimg/vszimg.so
+libdata/pkgconfig/zimg.pc



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