nixpkgs/pkgs/development/compilers/z88dk/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.6 KiB
Nix
Raw Normal View History

{ fetchFromGitHub, lib, stdenv, makeWrapper, unzip, libxml2, gmp, m4, uthash, which, pkg-config }:
stdenv.mkDerivation rec {
2020-10-29 04:04:13 +00:00
pname = "z88dk";
version = "2.3";
src = fetchFromGitHub {
owner = "z88dk";
2020-10-29 04:04:13 +00:00
repo = "z88dk";
rev = "v${version}";
sha256 = "sha256-CHTORgK6FYIO6n+cvTUX4huY2Ek5FuHrs40QN5NZX44=";
2019-05-01 18:21:30 +00:00
fetchSubmodules = true;
};
postPatch = ''
# we dont rely on build.sh :
export PATH="$PWD/bin:$PATH" # needed to have zcc in testsuite
export ZCCCFG=$PWD/lib/config/
2019-05-01 18:21:30 +00:00
# we don't want to build zsdcc since it required network (svn)
# we test in checkPhase
substituteInPlace Makefile \
--replace 'testsuite bin/z88dk-lib$(EXESUFFIX)' 'bin/z88dk-lib$(EXESUFFIX)'\
2019-11-04 12:33:53 +00:00
--replace 'ALL_EXT = bin/zsdcc$(EXESUFFIX)' 'ALL_EXT ='
2019-05-01 18:21:30 +00:00
'';
checkPhase = ''
make testsuite
'';
2019-05-01 18:21:30 +00:00
#failed on Issue_1105_function_pointer_calls
doCheck = stdenv.hostPlatform.system != "aarch64-linux";
#_FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = "-O";
2019-09-08 23:38:31 +00:00
short_rev = builtins.substring 0 7 src.rev;
makeFlags = [
"git_rev=${short_rev}"
"version=${version}"
2021-04-12 16:44:59 +00:00
"DESTDIR=$(out)"
"git_count=0"
];
2019-05-01 18:21:30 +00:00
nativeBuildInputs = [ which makeWrapper unzip pkg-config ];
buildInputs = [ libxml2 m4 uthash gmp ];
preInstall = ''
mkdir -p $out/{bin,share}
'';
2019-11-04 12:33:53 +00:00
installTargets = [ "libs" "install" ];
meta = with lib; {
2020-10-29 04:04:13 +00:00
homepage = "https://www.z88dk.org";
description = "z80 Development Kit";
2020-10-29 04:04:13 +00:00
license = licenses.clArtistic;
maintainers = [ maintainers.siraben ];
platforms = platforms.unix;
};
}