This document describes how to install ipv6-parse using various package managers.
- Homebrew (macOS/Linux)
- Conan (Cross-platform)
- vcpkg (Cross-platform)
- NPM (Node.js)
- APT (Debian/Ubuntu)
- YUM/DNF (Fedora/RHEL)
- CMake FetchContent
Homebrew is a popular package manager for macOS and Linux.
# Install from HEAD (latest master)
brew install --HEAD https://raw.githubusercontent.com/jrepp/ipv6-parse/master/Formula/ipv6-parse.rb
# Or, after publishing to homebrew-core:
brew install ipv6-parsebrew install ipv6-parse --with-emscriptenThis installs WASM files to /usr/local/share/ipv6-parse/wasm/ (or /opt/homebrew/share/ipv6-parse/wasm/ on Apple Silicon).
Command-line tool:
ipv6-parse-cli "2001:db8::1/64"C library:
#include <ipv6.h>
int main() {
ipv6_address addr;
if (ipv6_parse("2001:db8::1", &addr) == 0) {
char formatted[IPV6_STRING_SIZE];
ipv6_format(&addr, formatted, sizeof(formatted));
printf("%s\n", formatted);
}
return 0;
}Compile with Homebrew:
gcc -o test test.c $(pkg-config --cflags --libs ipv6-parse)brew uninstall ipv6-parseConan is a decentralized, cross-platform C/C++ package manager.
pip install conanOption 1: From Source (Development)
# Clone repository
git clone https://github.com/jrepp/ipv6-parse.git
cd ipv6-parse
# Create package
conan create . ipv6-parse/1.2.1@
# Or install to local cache
conan install . --install-folder=buildOption 2: From Conan Center (After Publishing)
Add to your conanfile.txt:
[requires]
ipv6-parse/1.2.1
[generators]
CMakeDeps
CMakeToolchainOr in conanfile.py:
from conan import ConanFile
class MyProject(ConanFile):
requires = "ipv6-parse/1.2.1"
generators = "CMakeDeps", "CMakeToolchain"CMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
project(my_project)
find_package(ipv6-parse REQUIRED)
add_executable(my_app main.c)
target_link_libraries(my_app PRIVATE ipv6-parse::ipv6-parse)Build:
conan install . --output-folder=build --build=missing
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
cmake --build .# Build shared library (default: static)
conan install . -o ipv6-parse:shared=True
# Build for specific configuration
conan install . -s build_type=Release
# Cross-compile
conan install . -s arch=armv7 -s os=Linuxvcpkg is Microsoft's cross-platform package manager for C/C++.
# Clone vcpkg (if not already installed)
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh # or bootstrap-vcpkg.bat on WindowsOption 1: Install from vcpkg Registry (After Publishing)
./vcpkg install ipv6-parseOption 2: Install from Local Port (Development)
# Copy port files to vcpkg
cp -r /path/to/ipv6-parse/vcpkg /path/to/vcpkg/ports/ipv6-parse
# Install
./vcpkg install ipv6-parseCMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
project(my_project)
find_package(ipv6-parse CONFIG REQUIRED)
add_executable(my_app main.c)
target_link_libraries(my_app PRIVATE ipv6-parse::ipv6-parse)Build with vcpkg:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake
cmake --build buildOr set environment variable:
export VCPKG_ROOT=/path/to/vcpkg
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build build# Install specific features
./vcpkg install ipv6-parse[tools] # Include CLI tool
# Cross-compile
./vcpkg install ipv6-parse:x64-windows
./vcpkg install ipv6-parse:arm64-osx
./vcpkg install ipv6-parse:x64-linuxFor Node.js and JavaScript/TypeScript projects.
npm install ipv6-parseSee README_NPM.md for complete NPM usage guide.
For Debian-based Linux distributions.
# Download .deb from releases
wget https://github.com/jrepp/ipv6-parse/releases/download/v1.2.1/ipv6-parse-1.2.1-Linux.deb
# Install
sudo dpkg -i ipv6-parse-1.2.1-Linux.deb
# Install dependencies if needed
sudo apt-get install -f# Use command-line tool
ipv6-parse-cli "2001:db8::1"
# Compile C programs
gcc -o test test.c $(pkg-config --cflags --libs ipv6-parse)sudo apt-get remove ipv6-parseFor RPM-based Linux distributions.
# Download .rpm from releases
wget https://github.com/jrepp/ipv6-parse/releases/download/v1.2.1/ipv6-parse-1.2.1-Linux.rpm
# Install (Fedora/RHEL 8+)
sudo dnf install ipv6-parse-1.2.1-Linux.rpm
# Or (RHEL/CentOS 7)
sudo yum install ipv6-parse-1.2.1-Linux.rpmSame as APT usage above.
# Fedora/RHEL 8+
sudo dnf remove ipv6-parse
# RHEL/CentOS 7
sudo yum remove ipv6-parseIntegrate directly into your CMake project without external package managers.
cmake_minimum_required(VERSION 3.14)
project(my_project)
include(FetchContent)
FetchContent_Declare(
ipv6-parse
GIT_REPOSITORY https://github.com/jrepp/ipv6-parse.git
GIT_TAG v1.2.1 # or master for latest
)
# Make available
FetchContent_MakeAvailable(ipv6-parse)
add_executable(my_app main.c)
target_link_libraries(my_app PRIVATE ipv6-parse)mkdir build && cd build
cmake ..
cmake --build .| Package Manager | Platforms | Languages | Binary/Source | Toolchain |
|---|---|---|---|---|
| Homebrew | macOS, Linux | C, CLI | Binary | Built-in |
| Conan | All | C, C++ | Both | CMake, Meson, etc. |
| vcpkg | All | C, C++ | Source (cached) | CMake, MSBuild |
| NPM | All | Node.js, JS, TS | Binary (WASM) | Node.js |
| APT | Debian/Ubuntu | C, CLI | Binary | dpkg |
| YUM/DNF | Fedora/RHEL | C, CLI | Binary | rpm |
| FetchContent | All | C, C++ | Source | CMake |
Use Homebrew if:
- You're on macOS or Linux
- You want simple command-line installation
- You're building native applications
Use Conan if:
- You need cross-platform C++ builds
- You have complex dependency chains
- You want fine-grained control over builds
Use vcpkg if:
- You're using Visual Studio or CMake
- You want Microsoft's ecosystem integration
- You need extensive cross-platform support
Use NPM if:
- You're building Node.js applications
- You need browser support (WASM)
- You want TypeScript type definitions
Use APT/YUM if:
- You're deploying on Linux servers
- You need system-level package management
- You want automatic dependency resolution
Use CMake FetchContent if:
- You want zero external dependencies
- You're building from source anyway
- You need the latest development version
After installing via any method, test with:
# Basic test
ipv6-parse-cli "2001:db8::1"
# Expected output:
# Parsed successfully
# Formatted: 2001:db8::1
# ...
# Test with CIDR
ipv6-parse-cli "2001:db8::/32"
# Test with port
ipv6-parse-cli "[::1]:8080"
# Test with zone ID
ipv6-parse-cli "fe80::1%eth0"// test.c
#include <ipv6.h>
#include <stdio.h>
#include <string.h>
int main() {
ipv6_address addr;
if (ipv6_parse("2001:db8::1/64", &addr) == 0) {
char formatted[IPV6_STRING_SIZE];
ipv6_format(&addr, formatted, sizeof(formatted));
printf("Parsed: %s\n", formatted);
printf("Mask: %d\n", addr.mask);
if (strcmp(formatted, "2001:db8::1") == 0 && addr.mask == 64) {
printf("✓ Test passed\n");
return 0;
}
}
printf("✗ Test failed\n");
return 1;
}Compile and run:
gcc -o test test.c $(pkg-config --cflags --libs ipv6-parse)
./test# Make sure you're using the full URL for HEAD install
brew install --HEAD https://raw.githubusercontent.com/jrepp/ipv6-parse/master/Formula/ipv6-parse.rb# Make sure to create package from source first
conan create . ipv6-parse/1.2.1@# Copy port files manually
cp -r vcpkg /path/to/vcpkg/ports/ipv6-parse# Check PKG_CONFIG_PATH
echo $PKG_CONFIG_PATH
# Add install location if needed
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATHFound an issue with package installations? Please report at: https://github.com/jrepp/ipv6-parse/issues
- Main README - General information and building from source
- WASM Guide - WebAssembly usage
- NPM Guide - Node.js package usage
- Contributing Guide - Development setup