2
0
Fork 0
genodepkgs/depot/default.nix

46 lines
1.3 KiB
Nix

# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ stdenvNoCC, fetchurl }:
let
stdenv = stdenvNoCC;
unpack = baseUrl: { name, value }: {
inherit name;
value = stdenv.mkDerivation {
pname = name;
inherit (value) version;
preferLocalBuild = true;
src = fetchurl {
url =
"${baseUrl}${name}/${value.version}.tar.xz";
inherit (value) sha256;
};
phases = [ "unpackPhase" "installPhase" "fixupPhase" "distPhase" ];
installPhase = ''
find . -type f | while read FILE; do
local DEST=$out/bin
case $FILE in
*.a) DEST=$out/lib ;;
*.o) DEST=$out/lib ;;
*.so) DEST=$out/lib ;;
*.tar) DEST=$out/tar ;;
esac
install -Dm444 -t $DEST $FILE
done
'';
meta = {
license = [ "LicenseRef-Genode" ];
downloadPage = "${baseUrl}${name}/";
};
};
};
expand = baseUrl: listing: builtins.listToAttrs (map (unpack baseUrl) listing);
genodelabs = expand "http://depot.hq.c3d2.de/user/bin/x86_64/" (import ./base-list.nix);
base = expand "http://depot.genode.org/genodelabs/bin/x86_64/" (import ./genodelabs-list.nix);
in (base // genodelabs)