2019-05-01 19:21:30 +01:00
|
|
|
{ fetchFromGitHub, stdenv, makeWrapper, unzip, libxml2, m4, uthash, which }:
|
2018-02-20 22:06:25 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-01-28 13:07:58 +00:00
|
|
|
pname = "z88dk-unstable";
|
|
|
|
version = "2020-01-27";
|
2018-02-20 22:06:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "z88dk";
|
|
|
|
repo = "z88dk";
|
2020-01-28 13:07:58 +00:00
|
|
|
rev = "efdd07c2e2229cac7cfef97ec01f478004846e39";
|
|
|
|
sha256 = "0jcks5ygp256lmzmllffp4yb38cxjgdyqnnimkj4s65095cfasyb";
|
2019-05-01 19:21:30 +01:00
|
|
|
fetchSubmodules = true;
|
2018-02-20 22:06:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 19:21:30 +01: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 19:21:30 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make testsuite
|
2018-02-20 22:06:25 +00:00
|
|
|
'';
|
2019-05-01 19:21:30 +01:00
|
|
|
#failed on Issue_1105_function_pointer_calls
|
|
|
|
doCheck = stdenv.hostPlatform.system != "aarch64-linux";
|
|
|
|
|
|
|
|
#_FORTIFY_SOURCE requires compiling with optimization (-O)
|
|
|
|
NIX_CFLAGS_COMPILE = "-O";
|
2018-02-20 22:06:25 +00:00
|
|
|
|
2019-09-09 00:38:31 +01:00
|
|
|
short_rev = builtins.substring 0 7 src.rev;
|
2018-02-20 22:06:25 +00:00
|
|
|
makeFlags = [
|
|
|
|
"git_rev=${short_rev}"
|
|
|
|
"version=${version}"
|
2019-05-01 19:21:30 +01:00
|
|
|
"prefix=$(out)"
|
2018-02-20 22:06:25 +00:00
|
|
|
"git_count=0"
|
|
|
|
];
|
2019-05-01 19:21:30 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ which makeWrapper unzip ];
|
2018-02-20 22:06:25 +00:00
|
|
|
buildInputs = [ libxml2 m4 uthash ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/{bin,share}
|
|
|
|
'';
|
|
|
|
|
2019-11-04 12:33:53 +00:00
|
|
|
installTargets = [ "libs" "install" ];
|
2018-02-20 22:06:25 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2019-05-01 19:21:30 +01:00
|
|
|
homepage = "https://www.z88dk.org";
|
2018-02-20 22:06:25 +00:00
|
|
|
description = "z80 Development Kit";
|
|
|
|
license = licenses.clArtistic;
|
|
|
|
maintainers = [ maintainers.genesis ];
|
2019-05-01 19:21:30 +01:00
|
|
|
platforms = platforms.linux;
|
2018-02-20 22:06:25 +00:00
|
|
|
};
|
|
|
|
}
|