2023-12-10 20:57:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, acpica-tools
|
|
|
|
, python3
|
|
|
|
, writeText
|
|
|
|
}:
|
2015-01-26 20:13:31 +00:00
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "seabios";
|
2023-11-29 15:10:33 +00:00
|
|
|
version = "1.16.3";
|
2015-01-26 20:13:31 +00:00
|
|
|
|
2022-03-03 07:43:46 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.seabios.org/seabios.git";
|
2023-12-10 20:57:46 +00:00
|
|
|
rev = "rel-${finalAttrs.version}";
|
|
|
|
hash = "sha256-hWemj83cxdY8p+Jhkh5GcPvI0Sy5aKYZJCsKDjHTUUk=";
|
2015-01-26 20:13:31 +00:00
|
|
|
};
|
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2021-03-25 09:16:52 +00:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
|
2021-08-08 11:59:48 +01:00
|
|
|
buildInputs = [ acpica-tools ];
|
2021-03-25 09:16:52 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
2015-01-26 20:13:31 +00:00
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
makeFlags = [
|
|
|
|
# https://www.seabios.org/Build_overview#Distribution_builds
|
|
|
|
"EXTRAVERSION=\"-nixpkgs\""
|
|
|
|
];
|
2016-02-10 22:28:44 +00:00
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
hardeningDisable = [ "pic" "stackprotector" "fortify" ];
|
2015-01-26 20:13:31 +00:00
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
postConfigure = let
|
|
|
|
config = writeText "config.txt" (lib.generators.toKeyValue { } {
|
|
|
|
# SeaBIOS with CSM (Compatible Support Module) support; learn more at
|
|
|
|
# https://www.electronicshub.org/what-is-csm-bios/
|
|
|
|
"CONFIG_CSM" = "y";
|
|
|
|
"CONFIG_PERMIT_UNALIGNED_PCIROM" = "y";
|
|
|
|
"CONFIG_QEMU_HARDWARE" = "y";
|
|
|
|
});
|
|
|
|
in ''
|
|
|
|
cp ${config} .config
|
2015-01-26 20:13:31 +00:00
|
|
|
make olddefconfig
|
2016-02-10 22:28:44 +00:00
|
|
|
'';
|
2015-01-26 20:13:31 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-12-10 20:57:46 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -pv $doc/share/doc/seabios-${finalAttrs.version}/
|
|
|
|
cp -v docs/* $doc/share/doc/seabios-${finalAttrs.version}/
|
|
|
|
install -Dm644 out/Csm16.bin -t $out/share/seabios/
|
|
|
|
|
|
|
|
runHook postInstall
|
2016-02-10 22:28:44 +00:00
|
|
|
'';
|
2015-01-26 20:13:31 +00:00
|
|
|
|
2023-12-10 20:57:46 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://www.seabios.org";
|
|
|
|
description = "Open source implementation of a 16bit x86 BIOS";
|
2015-01-26 20:13:31 +00:00
|
|
|
longDescription = ''
|
2023-12-10 20:57:46 +00:00
|
|
|
SeaBIOS is an open source implementation of a 16bit x86 BIOS.
|
|
|
|
It can run in an emulator or it can run natively on x86 hardware with the
|
|
|
|
use of coreboot.
|
2015-01-26 20:13:31 +00:00
|
|
|
'';
|
2023-12-10 20:57:46 +00:00
|
|
|
license = with lib.licenses; [ lgpl3Plus ];
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.systems.inspect.patternLogicalAnd
|
|
|
|
lib.systems.inspect.patterns.isUnix
|
|
|
|
lib.systems.inspect.patterns.isx86;
|
2023-12-10 21:43:10 +00:00
|
|
|
badPlatforms = [ lib.systems.inspect.patterns.isDarwin ];
|
2015-01-26 20:13:31 +00:00
|
|
|
};
|
2023-12-10 20:57:46 +00:00
|
|
|
})
|