1{ lib, stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 pname = "sjasmplus";
5 version = "1.18.3";
6
7 src = fetchFromGitHub {
8 owner = "z00m128";
9 repo = "sjasmplus";
10 rev = "v${version}";
11 sha256 = "sha256-+FvNYfJ5I91RfuJTiOPhj5KW8HoOq8OgnnpFEgefSGc=";
12 };
13
14 buildFlags = [
15 "CC=${stdenv.cc.targetPrefix}cc"
16 "CXX=${stdenv.cc.targetPrefix}c++"
17 ];
18
19 installPhase = ''
20 runHook preInstall
21 install -D sjasmplus $out/bin/sjasmplus
22 runHook postInstall
23 '';
24
25 meta = with lib; {
26 homepage = "https://z00m128.github.io/sjasmplus/";
27 description = "Z80 assembly language cross compiler. It is based on the SjASM source code by Sjoerd Mastijn";
28 mainProgram = "sjasmplus";
29 license = licenses.bsd3;
30 platforms = platforms.all;
31 maintainers = with maintainers; [ electrified ];
32 };
33}