Skip to content

Instantly share code, notes, and snippets.

@kuzetsa
Last active January 1, 2016 01:39
Show Gist options
  • Save kuzetsa/8074134 to your computer and use it in GitHub Desktop.
Save kuzetsa/8074134 to your computer and use it in GitHub Desktop.
See first comment for usage info.
#!/bin/bash
# kuzetsa's cross-compiler emerge (xmerge) wrapper
ARCH=x86
CHOST="i686-pc-mingw32"
PORTAGE_TMPDIR="$(portageq envvar PORTAGE_TMPDIR)/${CHOST}"
mkdir -p ${PORTAGE_TMPDIR}/portage/
SYSROOT="/usr/${CHOST}/"
PORTAGE_CONFIGROOT="${SYSROOT}"
ROOT="/balloon/crossdev/BUILD"
CBUILD=$(portageq envvar CHOST)
export CBUILD PORTAGE_CONFIGROOT ROOT PORTAGE_TMPDIR
i686-pc-mingw32-emerge $*
@kuzetsa
Copy link
Author

kuzetsa commented Dec 21, 2013

Change the line:

ROOT="/balloon/crossdev/BUILD"

That is where the packages will get "installed" when built using this wrapper script.

I named this file "xmerge" and keep it in my ~/

Whenever I need to cross compile something (such as windows binary for cgminer)

I just do like this:

~/xmerge cgminer

and that's it. it produces the binaries and all the dlls and such and puts them in:

/balloon/crossdev/BUILD

if you're building for something other than windows (mingw32 target) just be sure to change the lines with

CHOST= ...

as well as the last line which does invokes the cross-emerge itself:

i686-pc-mingw32-emerge $*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment