Nix flake of prebuilt Genode binaries
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

flake.nix 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. description = "Cache of pre-built Genode binaries";
  3. edition = 201909;
  4. outputs = { self, nixpkgs }:
  5. let
  6. localSystem = "x86_64-linux";
  7. localPackages = nixpkgs.legacyPackages.${localSystem};
  8. unpack = baseUrl:
  9. { name, value }: {
  10. inherit name;
  11. value = localPackages.stdenvNoCC.mkDerivation {
  12. pname = name;
  13. inherit (value) version;
  14. outputs = [ "out" "manifest" ];
  15. preferLocalBuild = true;
  16. src = localPackages.fetchurl {
  17. url = "${baseUrl}${name}/${value.version}.tar.xz";
  18. inherit (value) sha256;
  19. };
  20. dontConfigure = true;
  21. dontBuild = true;
  22. installPhase = ''
  23. find . -type f | while read FILE; do
  24. case $FILE in
  25. *.a | *.o) install -Dm444 -t $out/lib $FILE;;
  26. *.so) install -Dm555 -t $out/lib $FILE;;
  27. *.tar) install -Dm444 -t $out/tar $FILE;;
  28. *) install -Dm555 -t $out/bin $FILE;;
  29. esac
  30. done
  31. local drv=$out
  32. echo -n '[' >> $manifest
  33. find $out/ -type f -printf ',{mapKey= "%f",mapValue="%p"}' >> $manifest
  34. echo -n ']' >> $manifest
  35. '';
  36. meta = {
  37. license = [ "LicenseRef-Genode" ];
  38. downloadPage = "${baseUrl}${name}/";
  39. };
  40. };
  41. };
  42. expand = baseUrl: listing:
  43. builtins.listToAttrs (map (unpack baseUrl) listing);
  44. pkgs = expand "http://depot.genode.org/genodelabs/bin/x86_64/"
  45. (import ./genodelabs-list.nix);
  46. in {
  47. packages = {
  48. x86_64-linux-x86_64-genode = pkgs;
  49. x86_64-linux = pkgs;
  50. };
  51. checks = self.packages;
  52. };
  53. }