Skip to content

Instantly share code, notes, and snippets.

@doublec
Created June 5, 2015 14:53
Show Gist options
  • Save doublec/d35ec7214959a74ea013 to your computer and use it in GitHub Desktop.
Save doublec/d35ec7214959a74ea013 to your computer and use it in GitHub Desktop.
Building B2G with Nix package manager
{
allowUnfree = true;
packageOverrides = pkgs : with pkgs; rec {
# Tested with:
# $ nix-env -i b2g-env
# $ b2g-env
# $ git clone https://github.com/mozilla-b2g/B2G b2g
# $ cd b2g
# $ REPO_INIT_FLAGS="--depth=1" ./config.sh nexus-5
# $ ./build.sh
# This build will fail trying to run 'xpcshell' from the
# binary B2G SDK that it downloads. After this failure run:
# $ find ./gaia/b2g_sdk/ -type f -executable -exec patchelf --set-rpath /lib64 {} \;
# Then run the build again. This only needs to be done on the
# initial build when the SDK is downloaded. Need to find a way
# to work around this.
b2g = buildFHSUserEnv {
name = "b2g-env";
targetPkgs = pkgs: with pkgs; [
stdenv pkgconfig gtk glib gobjectIntrospection dbus_libs dbus_glib alsaLib
xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXft xlibs.libXt
xlibs.libXdamage xlibs.libXfixes xlibs.libXcomposite
ats pango freetype fontconfig gdk_pixbuf cairo python
git autoconf213 unzip zip yasm alsaLib dbus_libs which atk
bison bzip2 curl flex gawk gnumake382 gnupatch mesa libxml2
gcc48_multi oraclejdk gnupg1 git ccache perl openssl
file curl wget cacert m4 patchelf
];
multiPkgs = pkgs: with pkgs; [
ncurses zlib
];
runScript = "bash";
profile = ''
export SHELL=/bin/bash
export C_INCLUDE_PATH=/usr/include
export CPLUS_INCLUDE_PATH=/usr/include
export LIBRARY_PATH=/lib:/lib64
export LD_LIBRARY_PATH=/lib:/lib64
export AUTOCONF=autoconf
export GIT_SSL_CAINFO="${cacert}/etc/ca-bundle.crt"
'';
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment