Otok public index

apotocki/bzip2

apotocki/bzip2 1.0.8 (r1, linux)

Library
bzip2
Variant
linux, target linux
Channel
stable
Published
2026-11-07
Recipe source
https://github.com/otok-dev/recipes
32756a87cf5bd189ca4c9825159bf0713ea8cf5e in recipes/bzip2/1.0/linux/
Recipe SHA-256
2f7845ec58bb9e7fc38cf79b925e71cfec7341cf8cfc591db37a7a6a2c089ceb

Recipe files changed

Inputs

source.sha256ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
source.urlhttps://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz

Platforms

linux

Toolchains

Recipe files

CMakeLists.txt 835 bytes · raw
# libbz2 of the otok recipe: the objects of the release's Makefile (OBJS), without the bzip2 and bzip2recover
# programs, static or shared as BUILD_SHARED_LIBS says.
cmake_minimum_required(VERSION 3.20...4.0)
project(bzip2 VERSION 1.0.8 LANGUAGES C)

add_library(bz2 blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)
# the soname of Makefile-libbz2_so: libbz2.so.1.0
set_target_properties(bz2 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 1.0)
if(WIN32)
    # bzlib.h declares the API without dllexport
    set_target_properties(bz2 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(MSVC)
    target_compile_definitions(bz2 PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()

install(TARGETS bz2 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(FILES bzlib.h DESTINATION include)
build.lua 551 bytes · raw
-- libbz2 through the recipe's CMakeLists.txt: the release has only makefiles (a static library, a Linux
-- shared one, MSVC's makefile.msc), no CMake project. What it installs: libbz2.a, or libbz2.so with its links.
function build(slice, options, deps)
    otok.copy(slice.recipe .. "/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
    otok.cmake{}
    local p = slice.prefix
    local lib = otok.glob(slice.linkage == "static" and "lib/libbz2.a" or "lib/libbz2.so", p)[1]
    return { libraries = { bz2 = lib }, headers = p .. "/include" }
end
recipe.toml 844 bytes · raw
# The otok recipe of bzip2 (https://github.com/apotocki/otok): libbz2 for Linux, from the release archive; static
# or dynamic.
[recipe]
api = 1
library = "bzip2"
name = "bzip2"
version = "1.0.8"
revision = 1
license = "bzip2-1.0.6"
license-files = ["LICENSE"]
homepage = "https://sourceware.org/bzip2/"
description = "libbz2, the bzip2 compression library."
keywords = ["compression", "bzip2"]
linkage = ["static", "dynamic"]

[source]
url = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"

[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]

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

[[product]]
name = "BZip2"
libraries = ["bz2"]