mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
flow-control: switch to zig.fetchDeps, switch update script to nix-update-script (#546296)
This commit is contained in:
@@ -1,254 +0,0 @@
|
||||
# generated by zon2nix (https://github.com/Cloudef/zig2nix)
|
||||
|
||||
{
|
||||
lib,
|
||||
linkFarm,
|
||||
fetchurl,
|
||||
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,
|
||||
rev ? throw "rev is required, remove and regenerate the zon2json-lock file",
|
||||
}:
|
||||
let
|
||||
parts = lib.splitString "#" url;
|
||||
url_base = lib.elemAt parts 0;
|
||||
url_without_query = lib.elemAt (lib.splitString "?" url_base) 0;
|
||||
in
|
||||
fetchgit {
|
||||
inherit name rev hash;
|
||||
url = url_without_query;
|
||||
deepClone = false;
|
||||
};
|
||||
|
||||
fetchZigArtifact =
|
||||
{
|
||||
name,
|
||||
url,
|
||||
hash,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
parts = lib.splitString "://" url;
|
||||
proto = lib.elemAt parts 0;
|
||||
path = lib.elemAt parts 1;
|
||||
fetcher = {
|
||||
"git+http" = fetchGitZig (
|
||||
args
|
||||
// {
|
||||
url = "http://${path}";
|
||||
}
|
||||
);
|
||||
"git+https" = fetchGitZig (
|
||||
args
|
||||
// {
|
||||
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 [
|
||||
{
|
||||
name = "flow_syntax-0.6.0-X8jOoWgVAQBBTuGGE9r1ECSDFzi8z6_XNCW1oF5B4fL8";
|
||||
path = fetchZigArtifact {
|
||||
name = "syntax";
|
||||
url = "git+https://github.com/neurocyte/flow-syntax?ref=master#6992eddeb9a4a013886db0cbca2156686d01efe4";
|
||||
hash = "sha256-TJJTGiQbdzVNQAjKg9R1NP9kXqEcMNy33rwqnQG8se4=";
|
||||
rev = "6992eddeb9a4a013886db0cbca2156686d01efe4";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "tree_sitter-0.22.4-150-g7e3f5726-z0LhyGeG1y67PeOltaplVkxRNT2jMMexQhbUlrh0vdxM";
|
||||
path = fetchZigArtifact {
|
||||
name = "tree_sitter";
|
||||
url = "https://github.com/neurocyte/tree-sitter/releases/download/master-6e2827ee231e220467bf04d2a2746faff5cb204a/source.tar.gz";
|
||||
hash = "sha256-k8eOWun2ANzWJOa8XAakXN4Vldgwzly3FESYAlsbVVw=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "cbor-1.0.0-RcQE_AswAQAPlqBCZXYQf9DZXn-0Ubt8Mk03ZcJWcsAG";
|
||||
path = fetchZigArtifact {
|
||||
name = "cbor";
|
||||
url = "git+https://github.com/neurocyte/cbor?ref=master#7d2eeb68c8a2fb3f4d6baad6cc04c521b92974c0";
|
||||
hash = "sha256-EWOz+BPxRB5NxmqNzrJcdcaoGH6PdgeU4KI9IjJqar8=";
|
||||
rev = "7d2eeb68c8a2fb3f4d6baad6cc04c521b92974c0";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "flags-0.10.0-a_9h3gB4AADAYn0XaZuUqH1jKRmy6dqvAIbomtTIF6V1";
|
||||
path = fetchZigArtifact {
|
||||
name = "flags";
|
||||
url = "git+https://github.com/neurocyte/flags?ref=main#984b27948da3e4e40a253f76c85b51ec1a9ada11";
|
||||
hash = "sha256-PnR8RI1Rp1FxtjzBYcLCWi6zXykSsHVYnNkmI2XVxh4=";
|
||||
rev = "984b27948da3e4e40a253f76c85b51ec1a9ada11";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "dizzy-1.0.0-q40X4YCRAAAGYO9QOZiYYSOwiiFlqZlecMuQcxPiBcXM";
|
||||
path = fetchZigArtifact {
|
||||
name = "dizzy";
|
||||
url = "https://github.com/neurocyte/dizzy/archive/c9219d23daccd9aa226cfde754fea278cb516459.tar.gz";
|
||||
hash = "sha256-lFtDVVlIYt/5lCCTTOEfEFd8w1osV8JSvreMmK3YtIc=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "libfuzzer_kit-0.0.0-i7XWVl2PBwC3r18KoW8xTU05KyWEMj6RfBpAXd3CQqt7";
|
||||
path = fetchZigArtifact {
|
||||
name = "libfuzzer_kit";
|
||||
url = "git+https://github.com/SuperAuguste/zig-libfuzzer-kit.git#a27221dda33b232e65504766294ea4c7c079c3f0";
|
||||
hash = "sha256-yxhiP2kJYli5VjF0uMJcDM0ByFIRmSxnwnMy0JwQxmU=";
|
||||
rev = "a27221dda33b232e65504766294ea4c7c079c3f0";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "thespian-0.0.1-owFOjlgiBgC8w4XqkCOegxz5vMy6kNErcssWQWf2QHeE";
|
||||
path = fetchZigArtifact {
|
||||
name = "thespian";
|
||||
url = "git+https://github.com/neurocyte/thespian?ref=master#7da13f44e8462d1ac0cac87c6f00cc4fcb62b0f9";
|
||||
hash = "sha256-FDrgVtZQg+sFsMYE2TGOv1Xl6QqzE8+WtuKRulVnKjo=";
|
||||
rev = "7da13f44e8462d1ac0cac87c6f00cc4fcb62b0f9";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "cbor-1.0.0-RcQE_HwwAQAiNkKC9ezLxHUMkWgHeVa3QyTfv4hi3VZR";
|
||||
path = fetchZigArtifact {
|
||||
name = "cbor";
|
||||
url = "git+https://github.com/neurocyte/cbor?ref=master#b6fc137250b7d3f70459652ee78c7b6cd9ad2826";
|
||||
hash = "sha256-axyiz0+WqM9HCz9xbyl/UtdwJsKC/LIiQPZn/SdzxDU=";
|
||||
rev = "b6fc137250b7d3f70459652ee78c7b6cd9ad2826";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "asio-1.30.2-tLhDd0SB4QB1041_DEW_1cvEw8eMfBYLAwjN_G53Fn66";
|
||||
path = fetchZigArtifact {
|
||||
name = "asio";
|
||||
url = "git+https://github.com/neurocyte/asio#0f1cbf24e5fb6fabe7078a20b76452f42e24a0df";
|
||||
hash = "sha256-H3y7CTAlEpl0y3ERrNht8KabDRqvNDE+MzK4Uud2wAQ=";
|
||||
rev = "0f1cbf24e5fb6fabe7078a20b76452f42e24a0df";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zig_tracy-0.0.3-5-cp3Ht3AAAfHqShKfTK7waFK3Wjd3l2NheiqxvRRAdo";
|
||||
path = fetchZigArtifact {
|
||||
name = "tracy";
|
||||
url = "git+https://github.com/neurocyte/zig-tracy#67070c146104d93fd3bed5091738f22e33e13bce";
|
||||
hash = "sha256-YcSgPAQo/4+mrKkJS5UAn7z5xZjeb8kKIWrBK3yXhQ4=";
|
||||
rev = "67070c146104d93fd3bed5091738f22e33e13bce";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "N-V-__8AAO2QjgFRswZWFwtGKFgOVx2Ysf5F18DVgbwtReiU";
|
||||
path = fetchZigArtifact {
|
||||
name = "tracy_src";
|
||||
url = "https://github.com/neurocyte/tracy/archive/0ff0a1b324f497cf313a445637b7df25aabefb47.tar.gz";
|
||||
hash = "sha256-dzMilJsOSdjNyvhyDb1v5dPWcR5uvhnQmsBynAJH74I=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "N-V-__8AAOKzJACguNxU76WX9M7RIhOYGuLnlasJ1-GDdhqT";
|
||||
path = fetchZigArtifact {
|
||||
name = "themes";
|
||||
url = "https://github.com/neurocyte/flow-themes/releases/download/master-c6c7f18cfb2e3945cd0b71dab24271465074dbc3/flow-themes.tar.gz";
|
||||
hash = "sha256-h4oVrZqXwsQa57ywc8Ez7c2Fur4MhyJ8xyRTpKUJh9E=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "fuzzig-0.1.1-Ji0xivxIAQBD0g8O_NV_0foqoPf3elsg9Sc3pNfdVH4D";
|
||||
path = fetchZigArtifact {
|
||||
name = "fuzzig";
|
||||
url = "https://github.com/fjebaker/fuzzig/archive/4251fe4230d38e721514394a485db62ee1667ff3.tar.gz";
|
||||
hash = "sha256-VBkKxu+JdPzYRvANLX4/o3Mgl3Ojt1so99D8VNrSbTA=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "vaxis-0.5.1-BWNV_PJJCQArtOy_n76jGWoqoBpnM5FKElA_i1IaYYcF";
|
||||
path = fetchZigArtifact {
|
||||
name = "vaxis";
|
||||
url = "git+https://github.com/neurocyte/libvaxis?ref=main#95034c7114601178467b42e69588cdd4c1d39eb1";
|
||||
hash = "sha256-IuToUtK3WdoOy+UzYy5OlXNR5E3DUSO5VwZvSIF28qc=";
|
||||
rev = "95034c7114601178467b42e69588cdd4c1d39eb1";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zigimg-0.1.0-8_eo2vUZFgAAtN1c6dAO5DdqL0d4cEWHtn6iR5ucZJti";
|
||||
path = fetchZigArtifact {
|
||||
name = "zigimg";
|
||||
url = "git+https://github.com/zigimg/zigimg#eab2522c023b9259db8b13f2f90d609b7437e5f6";
|
||||
hash = "sha256-e42T/ZmRzuzWAhwWkcWScukcOd6rNZ1VK1wk0XGTVKs=";
|
||||
rev = "eab2522c023b9259db8b13f2f90d609b7437e5f6";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "uucode-0.1.0-ZZjBPj96QADXyt5sqwBJUnhaDYs_qBeeKijZvlRa0eqM";
|
||||
path = fetchZigArtifact {
|
||||
name = "uucode";
|
||||
url = "git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732";
|
||||
hash = "sha256-sHPh+TQSdUGus/QTbj7KSJJkTuNTrK4VNmQDjS30Lf8=";
|
||||
rev = "5f05f8f83a75caea201f12cc8ea32a2d82ea9732";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zeit-0.6.0-5I6bk0J9AgCVa0nnyL0lNY9Xa9F68hHq-ZarhuXNV-Jb";
|
||||
path = fetchZigArtifact {
|
||||
name = "zeit";
|
||||
url = "git+https://github.com/rockorager/zeit?ref=zig-0.15#ed2ca60db118414bda2b12df2039e33bad3b0b88";
|
||||
hash = "sha256-IvXaqAzaWi3E1XBqQltCBFoRmXehZkVol3/RZwOsAKg=";
|
||||
rev = "ed2ca60db118414bda2b12df2039e33bad3b0b88";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zigwin32-25.0.28-preview-AAAAAICM5AMResOGQnQ85mfe60TTOQeMtt7GRATUOKoP";
|
||||
path = fetchZigArtifact {
|
||||
name = "win32";
|
||||
url = "git+https://github.com/marlersoft/zigwin32?ref=main#5587b16fa040573846a6bf531301f6206d31a6bf";
|
||||
hash = "sha256-GIH6aO8yEWKKvIr4syG6aYViXi2whIg4feWox7f9ZSM=";
|
||||
rev = "5587b16fa040573846a6bf531301f6206d31a6bf";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "diffz-0.0.1-G2tlIezMAQBwGNGDs7Hn_N25dWSjEzgR_FAx9GFAvCuZ";
|
||||
path = fetchZigArtifact {
|
||||
name = "diffz";
|
||||
url = "git+https://github.com/ziglibs/diffz.git#fbdf690b87db6b1142bbce6d4906f90b09ce60bb";
|
||||
hash = "sha256-zzKnlKQ0Sz8aqJifSSlZImU3jY3QXLBDIfVDBmKcpVc=";
|
||||
rev = "fbdf690b87db6b1142bbce6d4906f90b09ce60bb";
|
||||
};
|
||||
}
|
||||
]
|
||||
@@ -3,9 +3,11 @@
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
zig_0_15,
|
||||
callPackage,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
let
|
||||
zig = zig_0_15;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "flow-control";
|
||||
version = "0.7.2";
|
||||
@@ -17,24 +19,29 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-5+F0DKb4LXtcMXNutUSJuIe7cdBoFUoJhCs8vbm20jg=";
|
||||
};
|
||||
|
||||
deps = callPackage ./build.zig.zon.nix {
|
||||
zig = zig_0_15;
|
||||
zigDeps = zig.fetchDeps {
|
||||
inherit (finalAttrs) src pname version;
|
||||
fetchAll = true;
|
||||
hash = "sha256-+07sJAnfB+mKziC5j8QfbL/YzjvRLxqRvpuxGKK7/nA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ zig_0_15 ];
|
||||
nativeBuildInputs = [ zig ];
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
dontSetZigDefaultFlags = true;
|
||||
zigBuildFlags = [
|
||||
"--system"
|
||||
"${finalAttrs.deps}"
|
||||
"${finalAttrs.zigDeps}"
|
||||
"-Dcpu=baseline"
|
||||
"-Doptimize=ReleaseFast"
|
||||
];
|
||||
|
||||
env.VERSION = finalAttrs.version;
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
meta = {
|
||||
description = "Programmer's text editor";
|
||||
homepage = "https://github.com/neurocyte/flow";
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash wget common-updater-scripts gnused
|
||||
|
||||
latest_tag=$(list-git-tags --url=https://github.com/neurocyte/flow | sed 's/^v//' | tail -n 1)
|
||||
|
||||
update-source-version flow-control "$latest_tag"
|
||||
|
||||
mkdir -p src/syntax
|
||||
|
||||
wget "https://raw.githubusercontent.com/neurocyte/flow/v${latest_tag}/build.zig.zon"
|
||||
wget -P src/syntax "https://raw.githubusercontent.com/neurocyte/flow/v${latest_tag}/src/syntax/build.zig.zon"
|
||||
|
||||
nix --extra-experimental-features 'nix-command flakes' run github:Cloudef/zig2nix#zon2nix -- build.zig.zon
|
||||
mv build.zig.zon.nix pkgs/by-name/fl/flow-control/build.zig.zon.nix
|
||||
|
||||
# strip file protocol
|
||||
sed -i '\|file = unpackZigArtifact { inherit name; artifact = /. + path; };|d' pkgs/by-name/fl/flow-control/build.zig.zon.nix
|
||||
nixfmt pkgs/by-name/fl/flow-control/build.zig.zon.nix
|
||||
|
||||
rm -rf build.zig.zon build.zig.zon2json-lock src/
|
||||
Reference in New Issue
Block a user