agbcc: init at unstable-2021-12-31

This commit is contained in:
Simon Bruder 2021-08-07 12:50:45 +02:00
parent a6488246b2
commit f2e86dbd50
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 55 additions and 0 deletions

50
agbcc/default.nix Normal file
View file

@ -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;
};
}

View file

@ -1,4 +1,8 @@
final: prev: {
# tools
agbcc = prev.callPackage ./agbcc { };
# roms
pokegb = prev.recurseIntoAttrs {

View file

@ -45,6 +45,7 @@
packages = flake-utils.lib.flattenTree {
inherit (pkgs)
agbcc
pokegb;
};