creek: change dependency-management tool
This commit is contained in:
@@ -1,110 +1,31 @@
|
||||
# generated by zon2nix (https://github.com/Cloudef/zig2nix)
|
||||
# generated by zon2nix (https://github.com/nix-community/zon2nix)
|
||||
|
||||
{
|
||||
lib,
|
||||
linkFarm,
|
||||
fetchurl,
|
||||
fetchzip,
|
||||
fetchgit,
|
||||
runCommandLocal,
|
||||
zig,
|
||||
name ? "zig-packages",
|
||||
}:
|
||||
let
|
||||
unpackZigArtifact =
|
||||
{
|
||||
name,
|
||||
artifact,
|
||||
}:
|
||||
runCommandLocal name { nativeBuildInputs = [ zig ]; } ''
|
||||
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
|
||||
mv "$TMPDIR/p/$hash" "$out"
|
||||
chmod 755 "$out"
|
||||
'';
|
||||
|
||||
fetchZig =
|
||||
{
|
||||
name,
|
||||
url,
|
||||
hash,
|
||||
}:
|
||||
let
|
||||
artifact = fetchurl { inherit url hash; };
|
||||
in
|
||||
unpackZigArtifact { inherit name artifact; };
|
||||
|
||||
fetchGitZig =
|
||||
{
|
||||
name,
|
||||
url,
|
||||
hash,
|
||||
}:
|
||||
let
|
||||
parts = lib.splitString "#" url;
|
||||
url_base = builtins.elemAt parts 0;
|
||||
url_without_query = builtins.elemAt (lib.splitString "?" url_base) 0;
|
||||
rev_base = builtins.elemAt parts 1;
|
||||
rev =
|
||||
if builtins.match "^[a-fA-F0-9]{40}$" rev_base != null then rev_base else "refs/heads/${rev_base}";
|
||||
in
|
||||
fetchgit {
|
||||
inherit name rev hash;
|
||||
url = url_without_query;
|
||||
deepClone = false;
|
||||
};
|
||||
|
||||
fetchZigArtifact =
|
||||
{
|
||||
name,
|
||||
url,
|
||||
hash,
|
||||
}:
|
||||
let
|
||||
parts = lib.splitString "://" url;
|
||||
proto = builtins.elemAt parts 0;
|
||||
path = builtins.elemAt parts 1;
|
||||
fetcher = {
|
||||
"git+http" = fetchGitZig {
|
||||
inherit name hash;
|
||||
url = "http://${path}";
|
||||
};
|
||||
"git+https" = fetchGitZig {
|
||||
inherit name hash;
|
||||
url = "https://${path}";
|
||||
};
|
||||
http = fetchZig {
|
||||
inherit name hash;
|
||||
url = "http://${path}";
|
||||
};
|
||||
https = fetchZig {
|
||||
inherit name hash;
|
||||
url = "https://${path}";
|
||||
};
|
||||
};
|
||||
in
|
||||
fetcher.${proto};
|
||||
in
|
||||
linkFarm name [
|
||||
linkFarm "zig-packages" [
|
||||
{
|
||||
name = "12209db20ce873af176138b76632931def33a10539387cba745db72933c43d274d56";
|
||||
path = fetchZigArtifact {
|
||||
name = "zig-pixman";
|
||||
url = "https://codeberg.org/ifreund/zig-pixman/archive/v0.2.0.tar.gz";
|
||||
hash = "sha256-CYgFIOR9H5q8UUpFglaixOocCMT6FGpcKQQBUVWpDKQ=";
|
||||
name = "1220687c8c47a48ba285d26a05600f8700d37fc637e223ced3aa8324f3650bf52242";
|
||||
path = fetchzip {
|
||||
url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.2.0.tar.gz";
|
||||
hash = "sha256-dvit+yvc0MnipqWjxJdfIsA6fJaJZOaIpx4w4woCxbE=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "1220687c8c47a48ba285d26a05600f8700d37fc637e223ced3aa8324f3650bf52242";
|
||||
path = fetchZigArtifact {
|
||||
name = "zig-wayland";
|
||||
url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.2.0.tar.gz";
|
||||
hash = "sha256-gxzkHLCq2NqX3l4nEly92ARU5dqP1SqnjpGMDgx4TXA=";
|
||||
name = "12209db20ce873af176138b76632931def33a10539387cba745db72933c43d274d56";
|
||||
path = fetchzip {
|
||||
url = "https://codeberg.org/ifreund/zig-pixman/archive/v0.2.0.tar.gz";
|
||||
hash = "sha256-zcfZEMnipWDPuptl9UN0PoaJDjy2EHc7Wwi4GQq3hkY=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "1220a4029ee3ee70d3175c69878e2b70dccd000c4324bc74ba800d8a143b7250fb38";
|
||||
path = fetchZigArtifact {
|
||||
name = "zig-fcft";
|
||||
path = fetchzip {
|
||||
url = "https://git.sr.ht/~novakane/zig-fcft/archive/1.1.0.tar.gz";
|
||||
hash = "sha256-osL/zsXqa8tC/Qvzf0/wXeNCzw02F2viCo+d8Gh2S7U=";
|
||||
hash = "sha256-JAR6Ticav9l/3aemJWGsjXMEUyHjuhUr3L0fznnLoEY=";
|
||||
};
|
||||
}
|
||||
]
|
||||
|
||||
@@ -40,9 +40,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
wayland-protocols
|
||||
];
|
||||
|
||||
deps = callPackage ./build.zig.zon.nix {
|
||||
inherit zig;
|
||||
};
|
||||
deps = callPackage ./build.zig.zon.nix { };
|
||||
|
||||
zigBuildFlags = [
|
||||
"--system"
|
||||
|
||||
Reference in New Issue
Block a user