18 # Perl packages used by this project.
19 # TODO: put these into global perl-packages.nix once this is submitted.
20 ObjectTinyRW = perlPackages.buildPerlPackage {
21 pname = "Object-Tiny-RW";
24 url = "mirror://cpan/authors/id/S/SC/SCHWIGON/object-tiny-rw/Object-Tiny-RW-1.07.tar.gz";
25 hash = "sha256-NbQIy9d4ZcMnRJJApPBSej+W6e/aJ8rkb5E7rD7GVgs=";
28 description = "A date object with as little code as possible (and rw accessors)";
29 license = with lib.licenses; [ artistic1 gpl1Plus ];
33 IteratorSimpleLookahead = perlPackages.buildPerlPackage {
34 pname = "Iterator-Simple-Lookahead";
37 url = "mirror://cpan/authors/id/P/PS/PSCUST/Iterator-Simple-Lookahead-0.09.tar.gz";
38 hash = "sha256-FmPE1xdU8LAXS21+H4DJaQ87qDi4Q4UkLawsUAqseZw=";
40 propagatedBuildInputs = with perlPackages; [
41 ClassAccessor IteratorSimple
44 description = "Simple iterator with lookahead and unget";
45 license = with lib.licenses; [ artistic1 gpl2Only ];
49 AsmPreproc = perlPackages.buildPerlPackage {
50 pname = "Asm-Preproc";
53 url = "mirror://cpan/authors/id/P/PS/PSCUST/Asm-Preproc-1.03.tar.gz";
54 hash = "sha256-pVTpIqGxZpBxZlAbXuGDapuOxsp3uM/AM5dKUxlej1M=";
56 propagatedBuildInputs = [
57 IteratorSimpleLookahead
58 ] ++ (with perlPackages; [
65 description = "Preprocessor to be called from an assembler";
66 license = with lib.licenses; [ artistic1 gpl2Only ];
70 CPUZ80Assembler = perlPackages.buildPerlPackage {
71 pname = "CPU-Z80-Assembler";
74 url = "mirror://cpan/authors/id/P/PS/PSCUST/CPU-Z80-Assembler-2.25.tar.gz";
75 hash = "sha256-cJ8Fl2KZw9/bnBDUzFuwwdw9x23OUvcftk78kw7abdU=";
77 buildInputs = [ AsmPreproc ] ++ (with perlPackages; [
84 description = "Functions to assemble a set of Z80 assembly instructions";
85 license = with lib.licenses; [ artistic1 gpl2Only ];
89 stdenv.mkDerivation (finalAttrs: {
93 src = fetchFromGitHub {
96 rev = "v${finalAttrs.version}";
97 hash = "sha256-CHTORgK6FYIO6n+cvTUX4huY2Ek5FuHrs40QN5NZX44=";
98 fetchSubmodules = true;
102 # we dont rely on build.sh :
103 export PATH="$PWD/bin:$PATH" # needed to have zcc in testsuite
104 export ZCCCFG=$PWD/lib/config/
106 # we don't want to build zsdcc since it required network (svn)
107 # we test in checkPhase
108 substituteInPlace Makefile \
109 --replace 'testsuite bin/z88dk-lib$(EXESUFFIX)' 'bin/z88dk-lib$(EXESUFFIX)'\
110 --replace 'ALL_EXT = bin/zsdcc$(EXESUFFIX)' 'ALL_EXT ='
112 # rc2014.lib not created, making corresponding tests fail. Comment out.
113 substituteInPlace test/suites/make.config \
114 --replace 'zcc +rc2014' '#zcc +rc2014' \
115 --replace '@$(MACHINE) -pc 0x9000' '#@$(MACHINE) -pc 0x9000'
117 # The following tests don't pass.
118 rm src/z80asm/t/issue_0341.t
119 rm src/z80asm/t/z80asm_lib.t
122 # Parallel building is not working yet with the upstream Makefiles.
123 # Explicitly switch this off for now.
124 enableParallelBuilding = false;
128 # Need to build libs first, Makefile deps not fully defined
130 make testsuite $makeFlags
131 make -k test $makeFlags
134 short_rev = builtins.substring 0 7 finalAttrs.src.rev;
136 "git_rev=${finalAttrs.short_rev}"
137 "version=${finalAttrs.version}"
142 nativeBuildInputs = [
149 # Local perl packages
153 ] ++ (with perlPackages; [
171 mkdir -p $out/{bin,share}
180 homepage = "https://www.z88dk.org";
181 description = "z80 Development Kit";
182 license = licenses.clArtistic;
183 maintainers = [ maintainers.siraben ];
184 platforms = platforms.unix;