nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit b95ecaf18b27933bc6f7f967a983379fabaf85f0
parent ba0bcaf57474c2459ad580cc97ba7559acd61a64
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Tue, 10 Aug 2021 01:33:28 +0300

embox: fix build on darwin

Diffstat:
Mpkgs/default.nix | 4+++-
Mpkgs/embox/default.nix | 68+++++++++++++++++++++++++++++++++++---------------------------------
2 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -143,7 +143,9 @@ lib.makeScope newScope ( embox-arm = callPackage ./embox { arch = "arm"; }; embox-ppc = callPackage ./embox { arch = "ppc"; }; embox-riscv64 = callPackage ./embox { arch = "riscv64"; }; - embox-x86 = callPackage ./embox { }; + embox-x86 = callPackage ./embox { + stdenv = pkgs.gccMultiStdenv; + }; ### GARMIN diff --git a/pkgs/embox/default.nix b/pkgs/embox/default.nix @@ -1,5 +1,5 @@ { lib -, multiStdenv +, stdenv , fetchFromGitHub , fetchurl , makeWrapper @@ -20,15 +20,15 @@ let (name: spec: fetchurl spec) (builtins.fromJSON (builtins.readFile ./third-party.json)); in -multiStdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "embox-${arch}-qemu"; - version = "0.5.3"; + version = "2021-08-09"; src = fetchFromGitHub { owner = "embox"; - repo = pname; - rev = "v${version}"; - hash = "sha256-UIYtkKdAtbINPYJyJeuizSNOpzSla7OWfxBndN5RjTk="; + repo = "embox"; + rev = "591d94e2ac037df5f4a7a50aec54d02ef6b7aa15"; + hash = "sha256-Tsw20gJvVqn8SvS5C1qi4ztJNIY6EeHwvu76KaiEbTs"; }; patches = [ ./0001-fix-build.patch ]; @@ -60,35 +60,37 @@ multiStdenv.mkDerivation rec { ln -s ${third-party.acpica-unix} ./download/acpica-unix-20210331.tar.gz ''; - installPhase = let - platform_args = { - aarch64 = "-M virt -cpu cortex-a53 -m 1024"; - arm = "-M integratorcp -m 256"; - ppc = "-M virtex-ml507 -m 64"; - riscv64 = "-M virt -m 512"; - x86 = "-enable-kvm -device pci-ohci,id=ohci -m 256"; - }.${arch}; - net_args = { - aarch64 = "model=e1000"; - arm = "model=smc91c111"; - x86 = "model=virtio"; - }; - withNetwork = lib.hasAttr arch net_args; - in '' - mkdir -p $out/bin + installPhase = + let + platform_args = { + aarch64 = "-M virt -cpu cortex-a53 -m 1024"; + arm = "-M integratorcp -m 256"; + ppc = "-M virtex-ml507 -m 64"; + riscv64 = "-M virt -m 512"; + x86 = "-enable-kvm -device pci-ohci,id=ohci -m 256"; + }.${arch}; + net_args = { + aarch64 = "model=e1000"; + arm = "model=smc91c111"; + x86 = "model=virtio"; + }; + withNetwork = (lib.hasAttr arch net_args) && stdenv.isLinux; + in + '' + mkdir -p $out/bin - makeWrapper ${qemu}/bin/qemu-system-${if arch == "x86" then "i386" else arch} $out/bin/embox \ - --add-flags "${platform_args}" \ - --add-flags "-kernel $out/share/embox/images/embox.img" \ - --add-flags "${lib.optionalString withNetwork "-net nic,netdev=n0,${net_args.${arch}},macaddr=AA:BB:CC:DD:EE:02"}" \ - --add-flags "${lib.optionalString withNetwork "-netdev tap,script=$out/share/embox/scripts/start_script,downscript=$out/share/embox/scripts/stop_script,id=n0"}" \ - --add-flags "-nographic" + makeWrapper ${qemu}/bin/qemu-system-${if arch == "x86" then "i386" else arch} $out/bin/embox \ + --add-flags "${platform_args}" \ + --add-flags "-kernel $out/share/embox/images/embox.img" \ + --add-flags "${lib.optionalString withNetwork "-net nic,netdev=n0,${net_args.${arch}},macaddr=AA:BB:CC:DD:EE:02"}" \ + --add-flags "${lib.optionalString withNetwork "-netdev tap,script=$out/share/embox/scripts/start_script,downscript=$out/share/embox/scripts/stop_script,id=n0"}" \ + --add-flags "-nographic" - install -Dm644 build/base/bin/embox $out/share/embox/images/embox.img - install -Dm644 conf/*.conf* -t $out/share/embox/conf - '' + lib.optionalString withNetwork '' - install -Dm755 scripts/qemu/{start,stop}_script -t $out/share/embox/scripts - ''; + install -Dm644 build/base/bin/embox $out/share/embox/images/embox.img + install -Dm644 conf/*.conf* -t $out/share/embox/conf + '' + lib.optionalString withNetwork '' + install -Dm755 scripts/qemu/{start,stop}_script -t $out/share/embox/scripts + ''; meta = with lib; { description = "Modular and configurable OS for embedded applications";