1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 zlib,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "zasm";
10 version = "4.4.17";
11
12 src = fetchFromGitHub {
13 owner = "megatokio";
14 repo = "zasm";
15 tag = finalAttrs.version;
16 fetchSubmodules = true;
17 hash = "sha256-nc8hlGfix9eVTP5ZimmLKv22cdfsKRfrG70brpUh6CA=";
18 postFetch = ''
19 # remove folder containing files with weird names (causes the hash to turn out differently under macOS vs. Linux)
20 rm -rv $out/Test
21 '';
22 };
23
24 buildInputs = [ zlib ];
25
26 makeFlags = [
27 "CC=${stdenv.cc.targetPrefix}cc"
28 "CXX=${stdenv.cc.targetPrefix}c++"
29 "LINK=${stdenv.cc.targetPrefix}c++"
30 "STRIP=${stdenv.cc.targetPrefix}strip"
31 ];
32
33 installPhase = ''
34 runHook preInstall
35
36 install -Dm755 -t $out/bin zasm
37
38 runHook postInstall
39 '';
40
41 meta = {
42 description = "Z80 / 8080 / Z180 assembler (for unix-style OS)";
43 mainProgram = "zasm";
44 homepage = "https://k1.spdns.de/Develop/Projects/zasm/Distributions/";
45 license = lib.licenses.bsd2;
46 maintainers = [ lib.maintainers.turbomack ];
47 platforms = lib.platforms.unix;
48 badPlatforms = lib.platforms.aarch64;
49 };
50})