Skip to content

Instantly share code, notes, and snippets.

@logarytm
Created December 3, 2017 02:55
Show Gist options
  • Save logarytm/628b111b2739cf64c52eaf7d7b3157e2 to your computer and use it in GitHub Desktop.
Save logarytm/628b111b2739cf64c52eaf7d7b3157e2 to your computer and use it in GitHub Desktop.
with import <nixpkgs> { };
stdenv.mkDerivation {
name = "binutils-2.29-x86_64-elf";
builder = ./build-binutils.sh;
src = fetchurl {
url = https://ftp.gnu.org/gnu/binutils/binutils-2.29.tar.xz;
sha256 = "118ybdwcx3dbfzfqav9h0nill8jd7ca74kr6z1208qjc3hkix1qb";
};
platform = "x86_64-elf";
}
source $stdenv/setup
# I have no idea what it's doing.
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
mkdir $NIX_FIXINC_DUMMY
preConfigure=preConfigure
preConfigure() {
# Cross compiler evilness
mkdir -p $out
mkdir -p $out/x86_64-elf
mkdir -p $out/x86_64-elf/bin
# Perform the build in a different directory.
mkdir ../build
cd ../build
configureScript=../$sourceRoot/configure
configureFlags="--target=$platform --disable-nls --disable-werror"
}
postInstall=postInstall
postInstall() {
:
}
genericBuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment