diff --git a/pkgs/tools/bootloaders/refind/0001-toolchain.patch b/pkgs/tools/bootloaders/refind/0001-toolchain.patch new file mode 100644 index 00000000000..13c4c88f95f --- /dev/null +++ b/pkgs/tools/bootloaders/refind/0001-toolchain.patch @@ -0,0 +1,27 @@ +diff --git a/Make.common b/Make.common +index 3f0b919..ee365f5 100644 +--- a/Make.common ++++ b/Make.common +@@ -33,22 +33,6 @@ ARCH ?= $(HOSTARCH) + + # Note: TIANOBASE is defined in master Makefile and exported + GENFW = $(TIANOBASE)/BaseTools/Source/C/bin/GenFw +-prefix = /usr/bin/ +-ifeq ($(ARCH),aarch64) +- CC = $(prefix)aarch64-linux-gnu-gcc +- AS = $(prefix)aarch64-linux-gnu-as +- LD = $(prefix)aarch64-linux-gnu-ld +- AR = $(prefix)aarch64-linux-gnu-ar +- RANLIB = $(prefix)aarch64-linux-gnu-ranlib +- OBJCOPY = $(prefix)aarch64-linux-gnu-objcopy +-else +- CC = $(prefix)gcc +- AS = $(prefix)as +- LD = $(prefix)ld +- AR = $(prefix)ar +- RANLIB = $(prefix)ranlib +- OBJCOPY = $(prefix)objcopy +-endif + + ifeq ($(MAKEWITH),TIANO) + # Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47) diff --git a/pkgs/tools/bootloaders/refind/default.nix b/pkgs/tools/bootloaders/refind/default.nix index bc84edeb21b..0cdcd4c58df 100644 --- a/pkgs/tools/bootloaders/refind/default.nix +++ b/pkgs/tools/bootloaders/refind/default.nix @@ -4,6 +4,7 @@ let archids = { "x86_64-linux" = { hostarch = "x86_64"; efiPlatform = "x64"; }; "i686-linux" = rec { hostarch = "ia32"; efiPlatform = hostarch; }; + "aarch64-linux" = rec { hostarch = "aarch64"; efiPlatform = "aa64"; }; }; inherit @@ -21,6 +22,10 @@ stdenv.mkDerivation rec { sha256 = "1bjd0dl77bc5k6g3kc7s8m57vpbg2zscph9qh84xll9rc10g3fir"; }; + patches = [ + ./0001-toolchain.patch + ]; + buildInputs = [ gnu-efi ]; hardeningDisable = [ "stackprotector" ]; @@ -32,6 +37,7 @@ stdenv.mkDerivation rec { "GNUEFILIB=${gnu-efi}/lib" "EFICRT0=${gnu-efi}/lib" "HOSTARCH=${hostarch}" + "ARCH=${hostarch}" ]; buildFlags = [ "gnuefi" "fs_gnuefi" ]; @@ -116,7 +122,7 @@ stdenv.mkDerivation rec { ''; homepage = http://refind.sourceforge.net/; maintainers = [ maintainers.AndersonTorres ]; - platforms = [ "i686-linux" "x86_64-linux" ]; + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ]; license = licenses.gpl3Plus; };