Otok public index

apotocki/bzip2

apotocki/bzip2 1.0.8 (r1, windows)

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

Recipe files changed

Inputs

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

Platforms

windows

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 638 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: bz2.lib, or bz2.lib with bz2.dll.
function build(slice, options, deps)
    otok.copy(slice.recipe .. "/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
    otok.cmake{}
    local p = slice.prefix
    local dll = otok.glob("bin/bz2.dll", p)[1]
    if dll then return { libraries = { bz2 = { link = p .. "/lib/bz2.lib", runtime = dll } }, headers = p .. "/include" } end
    return { libraries = { bz2 = p .. "/lib/bz2.lib" }, headers = p .. "/include" }
end
recipe.toml 897 bytes · raw
# The otok recipe of bzip2 (https://github.com/apotocki/otok): bz2 for Windows, from the release archive, with MSVC
# or with clang-cl across from Linux; 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 = ["windows"]
build-on = ["windows/msvc", "linux/clang-cl"]

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

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