From b4491820804572cf05d0ec133a963685d771d60b Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Wed, 12 Jan 2022 00:42:36 +0800 Subject: [PATCH] graphics/brunsli: Add brunsli 0.1 Brunsli is a lossless JPEG repacking library. Brunsli allows for a 22% decrease in file size while allowing the original JPEG to be recovered byte-by-byte. It is possible to try how much Brunsli will save on your images on the site brunsli.dev. Images are transcoded in browser, no data is transmitted or stored. Codec is powered by WASM technology. WWW: https://github.com/google/brunsli --- graphics/Makefile | 1 + graphics/brunsli/Makefile | 29 +++++++++++++++++++++ graphics/brunsli/distinfo | 3 +++ graphics/brunsli/files/patch-CMakeLists.txt | 10 +++++++ graphics/brunsli/files/patch-brunsli.cmake | 20 ++++++++++++++ graphics/brunsli/pkg-descr | 10 +++++++ graphics/brunsli/pkg-plist | 11 ++++++++ 7 files changed, 84 insertions(+) create mode 100644 graphics/brunsli/Makefile create mode 100644 graphics/brunsli/distinfo create mode 100644 graphics/brunsli/files/patch-CMakeLists.txt create mode 100644 graphics/brunsli/files/patch-brunsli.cmake create mode 100644 graphics/brunsli/pkg-descr create mode 100644 graphics/brunsli/pkg-plist diff --git a/graphics/Makefile b/graphics/Makefile index 60fce7f7c465..77d992f1698e 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -82,6 +82,7 @@ SUBDIR += bmp2html SUBDIR += bonzomatic SUBDIR += box + SUBDIR += brunsli SUBDIR += bsd-plotutils SUBDIR += c-a-i-r SUBDIR += cadubi diff --git a/graphics/brunsli/Makefile b/graphics/brunsli/Makefile new file mode 100644 index 000000000000..6d9bca277a78 --- /dev/null +++ b/graphics/brunsli/Makefile @@ -0,0 +1,29 @@ +# Created by: Po-Chuan Hsieh + +PORTNAME= brunsli +PORTVERSION= 0.1 +DISTVERSIONPREFIX= v +CATEGORIES= graphics + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Lossless JPEG repacking library + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libbrotlidec.so:archivers/brotli \ + libgtest_main.so:devel/googletest \ + libhighwayhash.so:security/highwayhash + +USES= cmake compiler:c++11-lang localbase:ldflags + +USE_CXXSTD= c++11 + +GH_ACCOUNT= google +USE_GITHUB= yes + +post-patch: +# Clean up bundled libraries + @${RM} -r ${WRKSRC}/third_party/ + +.include diff --git a/graphics/brunsli/distinfo b/graphics/brunsli/distinfo new file mode 100644 index 000000000000..85cdefbe6dd6 --- /dev/null +++ b/graphics/brunsli/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1641045700 +SHA256 (google-brunsli-v0.1_GH0.tar.gz) = 62762dc740f9fcc9706449c078f12c2a366416486d2882be50a9f201f99ac0bc +SIZE (google-brunsli-v0.1_GH0.tar.gz) = 876192 diff --git a/graphics/brunsli/files/patch-CMakeLists.txt b/graphics/brunsli/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..55bd29fba640 --- /dev/null +++ b/graphics/brunsli/files/patch-CMakeLists.txt @@ -0,0 +1,10 @@ +--- CMakeLists.txt.orig 2019-10-28 09:56:51 UTC ++++ CMakeLists.txt +@@ -26,7 +26,5 @@ set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + +-add_subdirectory(third_party) +- + # The Brunsli library definition. + include(brunsli.cmake) diff --git a/graphics/brunsli/files/patch-brunsli.cmake b/graphics/brunsli/files/patch-brunsli.cmake new file mode 100644 index 000000000000..61bdcd767a59 --- /dev/null +++ b/graphics/brunsli/files/patch-brunsli.cmake @@ -0,0 +1,20 @@ +--- brunsli.cmake.orig 2019-10-28 09:56:51 UTC ++++ brunsli.cmake +@@ -57,7 +57,7 @@ add_library(brunslidec-static STATIC + ${BRUNSLI_DEC_HEADERS} + ) + target_link_libraries(brunslidec-static PRIVATE +- brotlidec-static ++ brotlidec + brunslicommon-static + ) + +@@ -66,7 +66,7 @@ add_library(brunslienc-static STATIC + ${BRUNSLI_ENC_HEADERS} + ) + target_link_libraries(brunslienc-static PRIVATE +- brotlienc-static ++ brotlienc + brunslicommon-static + ) + diff --git a/graphics/brunsli/pkg-descr b/graphics/brunsli/pkg-descr new file mode 100644 index 000000000000..8dda1bddf5bc --- /dev/null +++ b/graphics/brunsli/pkg-descr @@ -0,0 +1,10 @@ +Brunsli is a lossless JPEG repacking library. + +Brunsli allows for a 22% decrease in file size while allowing the original JPEG +to be recovered byte-by-byte. + +It is possible to try how much Brunsli will save on your images on the site +brunsli.dev. Images are transcoded in browser, no data is transmitted or stored. +Codec is powered by WASM technology. + +WWW: https://github.com/google/brunsli diff --git a/graphics/brunsli/pkg-plist b/graphics/brunsli/pkg-plist new file mode 100644 index 000000000000..4d6b94b46568 --- /dev/null +++ b/graphics/brunsli/pkg-plist @@ -0,0 +1,11 @@ +include/brunsli/brunsli_decode.h +include/brunsli/brunsli_encode.h +include/brunsli/decode.h +include/brunsli/encode.h +include/brunsli/jpeg_data.h +include/brunsli/jpeg_data_reader.h +include/brunsli/jpeg_data_writer.h +include/brunsli/status.h +include/brunsli/types.h +lib/libbrunslidec-c.so +lib/libbrunslienc-c.so