From f2e86dbd504071312c2b7afdc8dd680443738291 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 7 Aug 2021 12:50:45 +0200 Subject: [PATCH] agbcc: init at unstable-2021-12-31 --- agbcc/default.nix | 50 +++++++++++++++++++++++++++++++++++++++++++++++ default.nix | 4 ++++ flake.nix | 1 + 3 files changed, 55 insertions(+) create mode 100644 agbcc/default.nix diff --git a/agbcc/default.nix b/agbcc/default.nix new file mode 100644 index 0000000..11c10ed --- /dev/null +++ b/agbcc/default.nix @@ -0,0 +1,50 @@ +{ 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; + }; +} diff --git a/default.nix b/default.nix index 9da8a8e..9b470bb 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,8 @@ final: prev: { + # tools + + agbcc = prev.callPackage ./agbcc { }; + # roms pokegb = prev.recurseIntoAttrs { diff --git a/flake.nix b/flake.nix index fcab22b..fd3d8bc 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ packages = flake-utils.lib.flattenTree { inherit (pkgs) + agbcc pokegb; };