{ lib, stdenv, fetchFromGitHub, bash, gcc-arm-embedded }: stdenv.mkDerivation rec { pname = "agbcc"; version = "unstable-2021-12-31"; src = fetchFromGitHub { owner = "pret"; repo = pname; rev = "bd1b2f511edfb30610b8d88f66f80323b3cc0aee"; sha256 = "sha256-+jHyRkupCge9D0CTck1w2V4SBltCVasL/WiXQPzifqw="; }; postPatch = '' substituteInPlace libc/Makefile \ --replace "/bin/bash" "${bash}/bin/bash" ''; nativeBuildInputs = [ gcc-arm-embedded ]; # toplev.c: In function 'fatal_insn': # toplev.c:1048:5: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;] # 1048 | error(message); # | ^~~~~ hardeningDisable = [ "format" ]; buildPhase = '' runHook preBuild ./build.sh runHook postBuild ''; installPhase = '' runHook preInstall ./install.sh $out runHook postInstall ''; meta = with lib; { description = "C Compiler toolchain for the Game Boy Advance"; homepage = "https://github.com/pret/agbcc"; # The repository includes files from different sources each with different # licenses. I added the catch-alls ‘free’ and ‘unfree’ to account for them, # so please research for yourself if you are allowed to use the code for # your purpose. license = with licenses; [ bsd2 free gpl2Plus lgpl2Plus unfree ]; maintainers = with maintainers; [ sbruder ]; platforms = platforms.unix; }; }