2
0
Fork 0

Add nic_bus

20.02
Emery Hemingway 3 years ago
parent f63364b9fe
commit 7b7af23809

@ -8,7 +8,9 @@ let
with self; {
depot = callPackage ./depot { };
dhallPackages = super.dhallPackages // (callPackage ./dhall { });
genode = callPackage ./upstream { };
genode = (callPackage ./upstream { } // {
nic_bus = callPackage ./pkgs/nic_bus { };
});
nova = callPackage ./NOVA { };
solo5 = callPackage ./solo5 { };
};

@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ stdenv, buildPackages, fetchgit, genode, pkgconfig, tup }:
let
tupArch = with stdenv.targetPlatform;
if isAarch32 then "arm" else
if isAarch64 then "arm64" else
if isx86_32 then "i386" else
if isx86_64 then "x86_64" else
abort "unhandled targetPlatform";
toTupConfig = attrs:
with builtins;
let op = config: name: "${config}CONFIG_${name}=${getAttr name attrs} ";
in foldl' op "" (attrNames attrs);
in stdenv.mkDerivation rec {
name = "nic_bus";
version = "1.0";
src = fetchgit {
url = "https://git.sr.ht/~ehmry/nic_bus";
rev = "76881b4fbb99e9a995d1f35a33529ff8f38c89bc";
sha256 = "08fcbfnlg0ljbgv95yd5q70c7xa0sg2k0njv4ygancs7d7f7q4bb";
};
nativeBuildInputs = [ pkgconfig tup ];
buildInputs = [ genode.base genode.os ];
tupConfig = toTupConfig {
TUP_ARCH = tupArch;
VERSION = version;
};
configurePhase = ''
cp -v ${genode.base.src}/Tuprules.tup .
# Configure Tup
echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > tup.config
echo CONFIG_NIX_OUTPUTS_OUT=$out >> tup.config
echo CONFIG_NIX_OUTPUTS_DEV=$dev >> tup.config
# Scan repository and generate script
tup init
tup generate buildPhase.sh
# Redirect artifacts to Nix store
mkdir -p $out
ln -s $out out
'';
buildPhase = ''
test -d repos/$repo/src/ld && cp -rv repos/$repo/src/ld $dev/
pushd .
set -v
source buildPhase.sh
set +v
popd
'';
dontInstall = true;
meta = with stdenv.lib; {
license = licenses.agpl3;
maintainers = [ maintainers.ehmry ];
};
}
Loading…
Cancel
Save