Build static self-extracting app from dynamic executable
Project description
StaticX
Bundle dynamic executables with their library dependencies so they can be run anywhere, just like a static executable.
Requirements
StaticX currently works only with Linux 64-bit dynamic executables.
The following external tools need to be installed to run StaticX:
ldd
- Part of GNU C Libraryreadelf
- Part of binutilsobjcopy
- Part of binutilspatchelf
- Packages available for Debian 8+, Fedora 14+, others
- install with
pip install patchelf-wrapper
The following additional tools must be installed to build StaticX from source:
scons
musl-libc
(optional)
Installation
From PyPI
StaticX is avaiable on PyPI. The wheels are built on Travis CI and include a bootloader built with musl-libc.
You can install using Pip.
StaticX is compatible with Python 2.7 (pip
) or Python 3.4+ (pip3
):
sudo pip3 install staticx
From source
If you have musl libc installed, you can use it to build the staticx
bootloader, resulting in smaller, better binaries. To do so, set the
BOOTLOADER_CC
environment variable to your musl-gcc
wrapper path
wehn invoking pip
or setup.py
:
sudo BOOTLOADER_CC=/usr/local/musl/bin/musl-gcc pip3 install https://github.com/JonathonReinhart/staticx/archive/master.zip
cd staticx
sudo BOOTLOADER_CC=/usr/local/musl/bin/musl-gcc pip3 install .
Usage
Basic wrapping of an executable
staticx /path/to/exe /path/to/output
Including additional library files with the package (any number can be specified by repeating the -l option)
staticx -l /path/to/fancy/library /path/to/exe /path/to/output
Run-time Information
StaticX sets the following environment variables for the wrapped user program:
STATICX_BUNDLE_DIR
: The absolute path of the "bundle" directory, the temporary dir where the archive has been extracted.STATICX_PROG_PATH
: The absolute path of the program being executed.
License
This software is released under the GPLv2, with an exception allowing the bootloader to be distributed. See LICENSE.txt for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file staticx-0.9.1.tar.gz
.
File metadata
- Download URL: staticx-0.9.1.tar.gz
- Upload date:
- Size: 56.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95b4390cac7e6c5a460ed24af2cb7d516384fcfecf085af73323c40b58e1aaf3 |
|
MD5 | ada1e58039c4cb8ad5baaa0f54482b4a |
|
BLAKE2b-256 | ebc29cd485aa22131d1836f51315c7d2434b7e161ec118083fd1ad3019127245 |
File details
Details for the file staticx-0.9.1-py2.py3-none-any.whl
.
File metadata
- Download URL: staticx-0.9.1-py2.py3-none-any.whl
- Upload date:
- Size: 146.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adac4edca1ba2e57ee3673a24805d33e6f4bd6ba393014319f1b54409977e59c |
|
MD5 | 379227a011de7ea69c18ab7207e42436 |
|
BLAKE2b-256 | 95636d696e59810ab81a4a4105afb81380dff86f934e9964986b9c6e473137ca |