Merge pull request #131826 from siraben/scas-cross

knightos-scas: fix cross compilation and enable documentation
This commit is contained in:
Rick van Schijndel 2022-05-09 21:04:04 +02:00 committed by GitHub
commit 837538f567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,8 @@
{ fetchFromGitHub, lib, stdenv, cmake }:
{ fetchFromGitHub, lib, stdenv, cmake, buildPackages, asciidoc, libxslt }:
let
isCrossCompiling = stdenv.hostPlatform != stdenv.buildPlatform;
in
stdenv.mkDerivation rec {
pname = "scas";
@ -12,10 +16,18 @@ stdenv.mkDerivation rec {
};
cmakeFlags = [ "-DSCAS_LIBRARY=1" ];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "TARGETS scas scdump scwrap" "TARGETS scas scdump scwrap generate_tables"
'';
strictDeps = true;
nativeBuildInputs = [ cmake ];
depsBuildBuild = lib.optionals isCrossCompiling [ buildPackages.knightos-scas ];
nativeBuildInputs = [ asciidoc libxslt.bin cmake ];
postInstall = ''
cd ..
make DESTDIR=$out install_man
'';
meta = with lib; {
homepage = "https://knightos.org/";