diff --git a/packages/genodelabs/default.nix b/packages/genodelabs/default.nix index 0348c2f..fdfe6d3 100644 --- a/packages/genodelabs/default.nix +++ b/packages/genodelabs/default.nix @@ -123,6 +123,63 @@ let ports = lib.mapAttrs preparePort (import ./ports.nix { inherit buildPackages; }); + toolchain' = buildPackages.stdenv.mkDerivation rec { + pname = "toolchain"; + version = "19.05"; + # use the sources of the last toolchain update + src = fetchurl { + url = "https://github.com/genodelabs/genode/archive/${version}.tar.gz"; + hash = "sha256-nK+smAvxbbcQQ3gY7BmFvnQ6MjNbbUfvcU5qXxAKKNc="; + }; + + nativeBuildInputs = with buildPackages; [ + autoconf264 + autogen + expat + expect + gnupg + ncurses + pkg-config + texinfo + tcl + wget + which + ]; + + portInputs = with ports; [ gmp mpfr mpc gcc binutils gdb ]; + + patches = [ ./toolchain-ada.patch ]; + + configurePhase = let + linkPorts = toString + (builtins.map (drv: " ln -sv ${drv}/* $CONTRIB_DIR/;") portInputs); + in '' + runHook preConfigure + export GENODE_DIR="$(pwd)" + export CONTRIB_DIR=$GENODE_DIR/contrib + export BUILD_DIR=$GENODE_DIR/build + echo true > tool/ports/prepare_port + patchShebangs tool + mkdir $CONTRIB_DIR; ${linkPorts} + runHook postConfigure + ''; + + makefile = "tool/tool_chain"; + buildFlags = let + arch = with platform; + if isx86 then + "x86" + else if isAarch32 then + "arm" + else if isAarch64 then + "aarch64" + else + throw "unknown toolchain for platform ${platform.system}"; + in [ "INSTALL_LOCATION=$out" "VERBOSE=" arch ]; + + dontInstall = true; + }; + toolchain = callPackage ./toolchain.nix { }; stdenv' = @@ -281,7 +338,7 @@ let }; in genodeSources // { - inherit buildUpstream buildDepot ports specs toolchain genodeBase; + inherit buildUpstream buildDepot ports specs toolchain genodeBase toolchain'; make = target: let diff --git a/packages/genodelabs/gcc-port.patch b/packages/genodelabs/gcc-port.patch new file mode 100644 index 0000000..69ee4dc --- /dev/null +++ b/packages/genodelabs/gcc-port.patch @@ -0,0 +1,22 @@ +commit 30d76a7231701e20e82ee025a36541e3bbc7276a +Author: Emery Hemingway +Date: Sat Aug 15 17:19:10 2020 +0200 + + gcc.port: remove check_tool tests + +diff --git a/repos/ports/ports/gcc.port b/repos/ports/ports/gcc.port +index 5a6c6bb683..39fecd2fee 100644 +--- a/repos/ports/ports/gcc.port ++++ b/repos/ports/ports/gcc.port +@@ -14,11 +14,6 @@ PATCH_OPT := -p1 -d ${DIR(gcc)} + + HASH_INPUT += $(REP_DIR)/${DIR(gcc)}/patches/series + +-AUTOCONF := autoconf2.64 +- +-$(call check_tool,$(AUTOCONF)) +-$(call check_tool,autogen) +- + default: _patch + @# + @# Re-generate configure scripts diff --git a/packages/genodelabs/toolchain-ada.patch b/packages/genodelabs/toolchain-ada.patch new file mode 100644 index 0000000..2e23c79 --- /dev/null +++ b/packages/genodelabs/toolchain-ada.patch @@ -0,0 +1,37 @@ +commit 1b6e706b705e48dd2741c8263b8df953b1863260 +Author: Emery Hemingway +Date: Sat Aug 15 16:34:16 2020 +0200 + + toolchain: remove ada support + + Gnat and gprbuild not conveniently available for aarch64. + +diff --git a/tool/tool_chain b/tool/tool_chain +index 038147e7d6..4e94d210df 100755 +--- a/tool/tool_chain ++++ b/tool/tool_chain +@@ -172,8 +172,7 @@ GPRBUILD_OK = $(call check_nonempty_f,$(shell which gprbuild),\ + Need to have 'gprbuild' installed.) + + TOOLS_OK = $(AUTOCONF_OK) $(AUTOCONFINST_OK) $(PKG_CONFIG_OK) $(CURSES_OK) \ +- $(TEXINFO_OK) $(WGET_OK) $(AUTOGEN_OK) $(GPG_OK) $(EXPAT_OK) \ +- $(GNAT_OK) $(GPRBUILD_OK) ++ $(TEXINFO_OK) $(WGET_OK) $(AUTOGEN_OK) $(GPG_OK) $(EXPAT_OK) + + ifneq ($(strip $(TOOLS_OK)),) + $(error Please install missing tools.) +@@ -221,12 +220,12 @@ LANGUAGES = c,c++ + LIB_GCC = cd $(INSTALL_LOCATION)/lib/gcc/riscv64-unknown-elf/$(GCC_VERSION)/rv64imac/lp64 && \ + $(SUDO) ln -sf ../../include include + else +-LANGUAGES = c,c++,ada ++LANGUAGES = c,c++ + LIB_GCC = + endif + + GCC_BOOTSTRAP_CONFIG += $(COMMON_BOOTSTRAP_CONFIG) \ +- --enable-languages=c,c++,ada \ ++ --enable-languages=c,c++ \ + --disable-bootstrap \ + --disable-libatomic \ + --disable-libcilkrts \