karalabe / xgo

Go CGO cross compiler
MIT License
2.14k stars 280 forks source link

Templatize destination path structure, including executable basename #181

Open mcandre opened 4 years ago

mcandre commented 4 years ago

Hi, thank you for maintaining xgo! What an incredibly powerful, fast way to build ports for Go apps!

Could we please get an option similar to gox's -output, for customizing the names of the file tree?

For example, I would prefer to place the OS, arch pair information as directories leading up to the application name: windows/amd64/octane.exe

davidalpert commented 4 years ago

I would also like this ability. wonder where this is set...

davidalpert commented 4 years ago

seems to be set in ./docker/base/build.sh which is a complicated shell script so injecting a template might be tricky:

NAME is first set here:

then used throughout:

which allows the post-build step to simply copy ./build/* out of the container.

one idea is to update build.sh so that:

one of the main reasons I'm interested in this is to be able to generate binaries with a consistent name across platforms.

would be nice to run mytool on every environment after an install rather than mytool-os-arch