Dylib Installer is a tool for handling dylib directories and generating .pc files. It helps to automate the process of installing dynamic libraries and their associated headers, and it ensures that the required pkg-config files are generated correctly.
- Automatically detects and processes
.dylib
files in a specified directory. - Generates
.pc
files for use withpkg-config
. - Copies library files to the target directory.
- Optionally copies header files to the target directory.
You will need the following tools installed on your system to use Dylib Installer:
- pkg-config
If you are using macOS, you can install pkg-config using Homebrew:
brew install pkg-config
If you are using Linux, you can install pkg-config using your package manager:
- Debian/Ubuntu:
sudo apt-get install pkg-config
- Fedora:
sudo dnf install pkg-config
- CentOS/RHEL:
sudo yum install pkg-config
- Arch Linux:
sudo pacman -S pkg-config
- Alpine Linux:
apk add pkgconfig
To install Dylib Installer, ensure you have Rust installed on your system. You can install the project from source or using cargo install
:
If you are using macOS, you can install the tool using Homebrew:
brew tap hackerchai/tap
brew install dylib-installer
git clone https://github.com/hackerchai/dylib-installer.git
cd dylib-installer
cargo build --release
The binary will be located in the target/release
directory.
cargo install dylib_installer
Or installing with latest head from repository:
cargo install --git https://github.com/hackerchai/dylib-installer
Dylib Installer requires several arguments to specify the paths and options. Here are the available options:
dylib_installer [OPTIONS] <dylib_path> [HEADERPATH]
-
<dylib_path>
Sets the directory where the dylib files are stored.(required) -
[HEADERPATH]
Sets the path to store the header files
-n, --name <NAME>
: Sets the name of the library. If not provided, it will be inferred from the dylib file name.-i, --headerpath <HEADERPATH>
: Sets the path to store the header files.-v, --version <VERSION>
: Sets the version of the library. Default is "0.1.0".-c, --description <DESC>
: Sets the description of the library. Default is "No description provided".-p, --pcpath <PCPATH>
: Sets the path to store the .pc file. If not provided, it will use the default pkg-config path.-t, --libpath <LIBPATH>
: Sets the target path for the library files. If not provided, it will use the system library path.-r, --header_target_path <HEADER_TARGET_PATH>
: Sets the target path for the header files.-h, --help
: Print help.
Recommend to use sudo to install the library to system path.
-
In most cases (without specifying headers):
sudo dylib_installer /path/to/dylibs
-
If you want to specify full options:
dylib_installer /path/to/dylibs /path/to/headers \ -n mylibrary \ -v 0.1.0 \ -c "My Library Description" \ -p /path/to/pkgconfig \ -t /usr/local/lib \ -r /usr/local/include/mylibrary
If you do not provide a library name, the tool will attempt to infer it from the .dylib
file names found in the specified directory. For example, if it finds a file named libfuse.dylib
or libfuse.2.1.dylib
, it will use fuse
as the library name.
We welcome contributions! Please open an issue or submit a pull request on GitHub.
This project is licensed under the GPL License. See the LICENSE file for details.