-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build static binary #33
Comments
What would I need to do, to provide a static binary for Linux or Windows? Would I be able to pull this off without any knowledge about building static binaries? :D |
No idea. That's why it's still an open issue and "help wanted". |
This is tricky as every linux distribution seems to store the libs at different locations: In case you want to create the new static binary in this repository with ubuntu 16.04 this would be the diff: diff --git a/lib/install.js b/lib/install.js
index ce9fb6d..925c1fe 100644
--- a/lib/install.js
+++ b/lib/install.js
@@ -15,6 +15,8 @@ bin.run(['-version'], err => {
let cfgExtras = '';
if (process.platform === 'darwin') {
cfgExtras = 'libpng_LIBS=\'/usr/local/lib/libpng16.a -lz\' --enable-static';
+ } else if (process.platform === 'linux') {
+ cfgExtras = 'libpng_LIBS=\'/usr/lib/x86_64-linux-gnu/libpng16.a /usr/lib/x86_64-linux-gnu/libz.a\' --enable-static';
}
const cfg = [ |
@danez on debian 8, i cannot locate |
as for the location of libpng, we can use |
I guess https://github.com/mozilla/mozjpeg/blob/master/configure.ac#L109..L112 |
@danez can we use CI to build static library and upload them to github release? because asking user to install autoconf, make and other stuff is a lot. that should be a last resort only. or maybe use |
By default this package will try to download and use one of the precompiled binaries anyway I think, the compiling is only a fallback. |
I dont think it does. It only checks if the binary is good (running |
one question: if we static link it with |
Has checking for the And if not, then downloading the various tarballs ( Depending on the Linux platform and available An easier route being that the user should (if they have Red Hat/Fedora/CentOS/Amazon Linux
Ubuntu
And in regards to libpng, why not do the same, compile from source locally such that one is not trying to find a lib that may or may not exist? |
You can even just download the binary pre-compiled. http://rpm.pbone.net/index.php3/stat/3/srodzaj/2/search/libpng-1.6.3 |
I've done so for macOS (3d422cb), but would be nice to have a static binary for Linux and Windows too, if possible.
See: mozilla/mozjpeg#245
The text was updated successfully, but these errors were encountered: