Dylib Installer
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.
Features
- Automatically detects and processes
.dylibfiles in a specified directory. - Generates
.pcfiles for use withpkg-config. - Copies library files to the target directory.
- Optionally copies header files to the target directory.
Pre-requisites
You will need the following tools installed on your system to use Dylib Installer:
- pkg-config
Installing pkg-config
If you are using macOS, you can install pkg-config using Homebrew:
If you are using Linux, you can install pkg-config using your package manager:
- Debian/Ubuntu:
- Fedora:
- CentOS/RHEL:
- Arch Linux:
- Alpine Linux:
Installation
To install Dylib Installer, ensure you have Rust installed on your system. You can install the project from source or using cargo install:
From brew
If you are using macOS, you can install the tool using Homebrew:
From Source
The binary will be located in the target/release directory.
Using Cargo Install
Or installing with latest head from repository:
Usage
Dylib Installer requires several arguments to specify the paths and options. Here are the available options:
Arguments:
-
<dylib_path>Sets the directory where the dylib files are stored.(required) -
[HEADERPATH]Sets the path to store the header files
Options
-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.
Example
Recommend to use sudo to install the library to system path.
-
In most cases (without specifying headers):
-
If you want to specify full options:
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.
Contributing
We welcome contributions! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the GPL License. See the LICENSE file for details.