Otok public index

apotocki/protobuf

apotocki/protobuf 36.2 (r1, apple)

Library
protobuf
Variant
apple, target apple
Channel
stable
Published
2026-11-14
Recipe source
https://github.com/otok-dev/recipes.git
92d81fe0aabb0cd949726f5b8011beb83fc2ae02 in recipes/protobuf/36/apple/
Recipe SHA-256
fd532f292ab95e2d13edb98bc1549f03131b787a0e828ec94a24cc03a368b1aa

Recipe files changed

Inputs

source.sha2563d9642a662d10e68ebae5e53f14dcce5105684212d5078f8e0d47d1ab3ae6b64
source.urlhttps://github.com/protocolbuffers/protobuf/releases/download/v36.2/protobuf-36.2.tar.gz

Platforms

ios, iossim, macosx, catalyst, tvos, tvossim, watchos, watchossim, xros, xrossim

Options

OptionTypeDefaultDescription
runtime enum of ["full", "lite"] "full" The runtime: full (libprotobuf: reflection, descriptors, text and JSON) or lite (libprotobuf-lite: messages optimized for code size, no reflection). A program uses one of them.
zlibadditive bool false GzipOutputStream and ZeroCopyGzip streams, with zlib.

Dependencies

LibraryVersionRecipeDetails
abseil >= 20260000 apotocki/abseil

Toolchains

Recipe files

PrivacyInfo.xcprivacy 627 bytes · raw
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSPrivacyTracking</key>
	<false/>
	<key>NSPrivacyTrackingDomains</key>
	<array/>
	<key>NSPrivacyCollectedDataTypes</key>
	<array/>
	<key>NSPrivacyAccessedAPITypes</key>
	<array>
		<dict>
			<key>NSPrivacyAccessedAPIType</key>
			<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
			<key>NSPrivacyAccessedAPITypeReasons</key>
			<array>
				<string>C617.1</string>
				<string>3B52.1</string>
			</array>
		</dict>
	</array>
</dict>
</plist>
build.lua 1422 bytes · raw
-- protobuf's CMake project, the runtime libraries, static, with the Abseil of deps; in the tool slice (a tool dependency, or a
-- tool a project delivers to its own build) protoc too, with libprotoc and libupb, which its upb generator needs. Nothing is
-- fetched. What it installs: libprotobuf.a or libprotobuf-lite.a and libutf8_validity.a (it holds utf8_range as well).
function build(slice, options, deps)
    local defines = {
        protobuf_BUILD_TESTS = false, protobuf_BUILD_CONFORMANCE = false, protobuf_BUILD_EXAMPLES = false,
        protobuf_BUILD_PROTOC_BINARIES = slice.is_tool, protobuf_BUILD_LIBPROTOC = slice.is_tool,
        protobuf_BUILD_LIBUPB = slice.is_tool,
        protobuf_BUILD_SHARED_LIBS = false, protobuf_MSVC_STATIC_RUNTIME = false,
        protobuf_LOCAL_DEPENDENCIES_ONLY = true, protobuf_WITH_ZLIB = options.zlib,
        absl_DIR = deps.abseil.prefix .. "/lib/cmake/absl",
    }
    otok.cmake{ defines = defines }
    local p = slice.prefix
    local lite = options.runtime == "lite"
    local libraries = {}
    for _, name in ipairs{ lite and "protobuf-lite" or "protobuf", "utf8_validity" } do
        libraries[name] = otok.glob("lib/lib" .. name .. ".a", p)[1]
    end
    local out = { libraries = libraries, headers = p .. "/include" }
    if slice.is_tool then out.programs = { protoc = p .. "/bin/protoc" .. (slice.os == "windows" and ".exe" or "") } end
    return out
end
recipe.toml 2303 bytes · raw
# The otok recipe of Protocol Buffers (https://github.com/apotocki/otok): the C++ runtime (libprotobuf or libprotobuf-lite) for every Apple platform, from the
# release archive, with protobuf's CMake and the Abseil of deps, static; protoc for the build machine where it is a tool.
[recipe]
api = 1
library = "protobuf"
name = "protobuf"
version = "36.2"
revision = 1
license = "BSD-3-Clause"
license-files = ["LICENSE"]
homepage = "https://protobuf.dev"
documentation = "https://protobuf.dev/reference/cpp/"
description = "Protocol Buffers, Google's data interchange format: the C++ runtime, and protoc for the build machine."
keywords = ["protobuf", "serialization", "rpc"]
cxx-standard = ">= 17"
linkage = ["static"]

# protoc in the tool slice (build.lua): for the recipes that generate code with it and for projects that deliver it
[tool]
programs = ["protoc"]

[source]
url = "https://github.com/protocolbuffers/protobuf/releases/download/v36.2/protobuf-36.2.tar.gz"
sha256 = "3d9642a662d10e68ebae5e53f14dcce5105684212d5078f8e0d47d1ab3ae6b64"

[options.runtime]
type = "enum"
values = ["full", "lite"]
default = "full"
doc = "The runtime: full (libprotobuf: reflection, descriptors, text and JSON) or lite (libprotobuf-lite: messages optimized for code size, no reflection). A program uses one of them."

[options.zlib]
type = "bool"
default = false
additive = true
doc = "GzipOutputStream and ZeroCopyGzip streams, with zlib."

[platforms]
supported = ["ios", "iossim", "macosx", "catalyst", "tvos", "tvossim", "watchos", "watchossim", "xros", "xrossim"]
build-on = ["macos/xcode"]

[deps.abseil]
version = ">= 20260000"
default-recipe = "apotocki/abseil"

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[[product]]
name = "Protobuf"
when = { option = "runtime", is = "full" }
libraries = ["protobuf", "utf8_validity"]
apple = { privacy-manifest = "PrivacyInfo.xcprivacy" }
link = { libraries = [{ library = "z", when = { option = "zlib" } }] }

[[product]]
name = "ProtobufLite"
when = { option = "runtime", is = "lite" }
libraries = ["protobuf-lite", "utf8_validity"]
apple = { privacy-manifest = "PrivacyInfo.xcprivacy" }
link = { libraries = [{ library = "z", when = { option = "zlib" } }] }