Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'brotli' package #604

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ hunter_default_version(bison VERSION 3.0.4-p0)
hunter_default_version(boost-pba VERSION 1.0.0-p0)
hunter_default_version(botan VERSION 2.11.0-110af9494)
hunter_default_version(breakpad VERSION 0.0.0-12ecff3-p4)
hunter_default_version(brotli VERSION 1.0.9-p0)
hunter_default_version(bullet VERSION 2.87-p0)
hunter_default_version(byte-lite VERSION 0.3.0-p0)
hunter_default_version(c-ares VERSION 1.14.0-p0)
Expand Down
30 changes: 30 additions & 0 deletions cmake/projects/brotli/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
brotli
VERSION
1.0.9-p0
URL
"https://github.com/cpp-pm/brotli/archive/v1.0.9-p0.tar.gz"
SHA1
04697e4bb782218ba2a19f3084b3795be8f7b6f1
)

hunter_cmake_args(brotli CMAKE_ARGS
BROTLI_DISABLE_TESTS=YES
BROTLI_BUILD_EXECUTABLE=NO
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(brotli)
hunter_download(PACKAGE_NAME brotli)
21 changes: 21 additions & 0 deletions docs/packages/pkg/brotli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

brotli

.. index::
single: compression ; brotli

.. _pkg.brotli:

brotli
======

- `Official <https://github.com/google/brotli>`__
- `Hunterized <https://github.com/cpp-pm/brotli>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/brotli/CMakeLists.txt>`__
- Added by `drodin <https://github.com/drodin>`__ (`pr-604 <https://github.com/cpp-pm/hunter/pull/604>`__)

.. literalinclude:: /../examples/brotli/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/brotli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.5)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-brotli)

# DOCUMENTATION_START {
hunter_add_package(brotli)
find_package(brotli CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC brotli::brotlicommon brotli::brotlidec brotli::brotlienc)
# DOCUMENTATION_END }
6 changes: 6 additions & 0 deletions examples/brotli/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <brotli/decode.h>
#include <brotli/encode.h>

int main() {
NeroBurner marked this conversation as resolved.
Show resolved Hide resolved
return !(BrotliDecoderVersion() == BrotliEncoderVersion());
}
Loading