2022-05-18 14:49:53 +00:00
|
|
|
{ fetchFromGitHub, lib, stdenv, cmake, buildPackages, asciidoc, libxslt }:
|
|
|
|
|
|
|
|
let
|
|
|
|
isCrossCompiling = stdenv.hostPlatform != stdenv.buildPlatform;
|
|
|
|
in
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "scas";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "0.5.5";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KnightOS";
|
|
|
|
repo = "scas";
|
|
|
|
rev = version;
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "sha256-JGQE+orVDKKJsTt8sIjPX+3yhpZkujISroQ6g19+MzU=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
cmakeFlags = [ "-DSCAS_LIBRARY=1" ];
|
2022-05-18 14:49:53 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "TARGETS scas scdump scwrap" "TARGETS scas scdump scwrap generate_tables"
|
|
|
|
'';
|
2021-02-17 17:02:09 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
depsBuildBuild = lib.optionals isCrossCompiling [ buildPackages.knightos-scas ];
|
|
|
|
nativeBuildInputs = [ asciidoc libxslt.bin cmake ];
|
|
|
|
postInstall = ''
|
|
|
|
cd ..
|
|
|
|
make DESTDIR=$out install_man
|
|
|
|
'';
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://knightos.org/";
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "Assembler and linker for the Z80";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ siraben ];
|
2021-02-22 21:28:39 +00:00
|
|
|
platforms = platforms.all;
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|