andrew-d / static-binaries

Various *nix tools built as statically-linked binaries
Other
3.15k stars 570 forks source link

git statically linked #1

Closed mschaefers closed 9 years ago

mschaefers commented 9 years ago

Hi Andrew,

I'd love to have a statically compiled git, that can be used on a 64bit SuSE Enterprise Linux 11. Would that be a big hassle for you? (it would definitey be for me...).

Kind regards, Michael

andrew-d commented 9 years ago

Hi there,

Sure, that sounds like it'd be useful. I've actually started working on a pseudo-package manager here, so I just added a build script for git. If you trust me, I've also uploaded the resulting statically-linked binaries here. If you'd rather build yourself, here's (approximately) what you need to do:

  1. Grab my musl-cross docker container: docker pull andrewd/musl-cross
  2. Clone the bbuild repository
  3. Inside the bbuild directory, run the following:

    docker run --rm -t -i -v `pwd`:/make andrewd/musl-cross /bin/bash

The next instructions are from within the container:

$ apt-get update && apt-get install -yy gettext tcl
$ cd /make
$ ./bbuild -b /tmp/build -k git

That last command should build the statically-linked version of git and put it in /make/out/git. And due to the -v flag you gave docker, it should also be under the out directory on your host machine.

Hope this helps, and let me know if you have any problems!

mschaefers commented 9 years ago

Hi Andrew,

thank you so much for your support - your instructions are perfectly accurate.

There is only one issue I can not fix: when using the git binary, it can not clone http s repositories, but fails with "fatal: Unable to find remote helper for 'https'"

Reproducable by simply calling "./git clone https://foo.bar"

According to google, there is a curl library missing.

Running "apt-get install -yy libcurl4-openssl-dev" within the container before building did not help. As I am not that much into linux compiling, do you have an idea what to try?

Cheers, Michael

Von: "Andrew" notifications@github.com An: "andrew-d/static-binaries" static-binaries@noreply.github.com CC: "Michael Schaefers" mschaefers@scoop-gmbh.de Gesendet: Sonntag, 13. September 2015 22:45:33 Betreff: Re: [static-binaries] git statically linked (#1)

Hi there,

Sure, that sounds like it'd be useful. I've actually started working on a pseudo-package manager here , so I just added a build script for git. If you trust me, I've also uploaded the resulting statically-linked binaries here . If you'd rather build yourself, here's (approximately) what you need to do:

1. Grab my musl-cross docker container: docker pull andrewd/musl-cross 
2. Clone the bbuild repository 
3. Inside the bbuild directory, run the following: docker run --rm -t -i -v pwd :/make andrewd/musl-cross /bin/bash 

The next instructions are from within the container: $ apt-get update && apt-get install -yy gettext tcl $ cd /make $ ./bbuild -b /tmp/build -k git

That last command should build the statically-linked version of git and put it in /make/out/git . And due to the -v flag you gave docker, it should also be under the out directory on your host machine.

Hope this helps, and let me know if you have any problems!

— Reply to this email directly or view it on GitHub .

SCOOP Software GmbH - Gut Maarhausen - Eiler Straße 3P - D-51107 Köln Michael Schaefers

T +49 221 801916-128 - F +49 221 801916-1728 - M +49 151 12520933 michael.schaefers@scoop-software.de - www.scoop-software.de

Sitz der Gesellschaft: Köln, Handelsregister: Köln, Handelsregisternummer: HRB 36625 Geschäftsführung: Dr. Oleg Balovnev, Frank Heinen, Dr. Wolfgang Reddig, Roland Scheel

andrew-d commented 9 years ago

Hey, thanks for letting me know. I've updated the recipe to link in curl (statically), so things should work. The downside is that the entire git build is now about 350MB when uncompressed (though you can compress it down to a 135MB tar.bz2).

I've also updated the README in the bbuild repository with information on some additional steps you may need in order to get everything working correctly.

Let me know if you still have any problems!

andrew-d commented 9 years ago

@mschaefers Hi there - did the updated recipe work correctly? If not, please let me know and I'd be happy to make whatever fixes are necessary.

mschaefers commented 9 years ago

Hi Andrew,

Yes everything worked like a charm. Thanks for your Support

Michael

Am 21.09.2015 um 06:41 schrieb Andrew notifications@github.com:

@mschaefers Hi there - did the updated recipe work correctly? If not, please let me know and I'd be happy to make whatever fixes are necessary.

— Reply to this email directly or view it on GitHub.

andrew-d commented 9 years ago

Awesome, good to hear. I'm going to close this issue for now - let me know if you have any more problems!