ly: 1.0.2 -> 1.0.3

This commit is contained in:
Vonfry 2025-04-02 22:38:49 +08:00
parent 5897ff97e2
commit 6e3de73b9f
No known key found for this signature in database
GPG Key ID: 3DA5AB76AF957A27
2 changed files with 34 additions and 29 deletions

View File

@ -5,25 +5,25 @@
linux-pam, linux-pam,
libxcb, libxcb,
makeBinaryWrapper, makeBinaryWrapper,
zig_0_12, zig_0_13,
callPackage, callPackage,
nixosTests, nixosTests,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "ly"; pname = "ly";
version = "1.0.2"; version = "1.0.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "fairyglade"; owner = "fairyglade";
repo = "ly"; repo = "ly";
rev = "v1.0.2"; rev = "v1.0.3";
hash = "sha256-VUtNEL7Te/ba+wvL0SsUHlyv2NPmkYKs76TnW8r3ysw="; hash = "sha256-TsEn0kH7j4myjjgwHnbOUmIZjHn8A1d/7IjamoWxpXQ=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
makeBinaryWrapper makeBinaryWrapper
zig_0_12.hook zig_0_13.hook
]; ];
buildInputs = [ buildInputs = [
libxcb libxcb
@ -33,7 +33,7 @@ stdenv.mkDerivation {
postPatch = '' postPatch = ''
ln -s ${ ln -s ${
callPackage ./deps.nix { callPackage ./deps.nix {
zig = zig_0_12; zig = zig_0_13;
} }
} $ZIG_GLOBAL_CACHE_DIR/p } $ZIG_GLOBAL_CACHE_DIR/p
''; '';

View File

@ -10,6 +10,9 @@
name ? "zig-packages", name ? "zig-packages",
}: }:
with builtins;
with lib;
let let
unpackZigArtifact = unpackZigArtifact =
{ name, artifact }: { name, artifact }:
@ -35,15 +38,16 @@ let
name, name,
url, url,
hash, hash,
rev ? throw "rev is required, remove and regenerate the zon2json-lock file",
}: }:
let let
parts = lib.splitString "#" url; parts = splitString "#" url;
base = lib.elemAt parts 0; url_base = elemAt parts 0;
rev = lib.elemAt parts 1; url_without_query = elemAt (splitString "?" url_base) 0;
in in
fetchgit { fetchgit {
inherit name rev hash; inherit name rev hash;
url = base; url = url_without_query;
deepClone = false; deepClone = false;
}; };
@ -52,20 +56,25 @@ let
name, name,
url, url,
hash, hash,
}: ...
}@args:
let let
parts = lib.splitString "://" url; parts = splitString "://" url;
proto = lib.elemAt parts 0; proto = elemAt parts 0;
path = lib.elemAt parts 1; path = elemAt parts 1;
fetcher = { fetcher = {
"git+http" = fetchGitZig { "git+http" = fetchGitZig (
inherit name hash; args
url = "http://${path}"; // {
}; url = "http://${path}";
"git+https" = fetchGitZig { }
inherit name hash; );
url = "https://${path}"; "git+https" = fetchGitZig (
}; args
// {
url = "https://${path}";
}
);
http = fetchZig { http = fetchZig {
inherit name hash; inherit name hash;
url = "http://${path}"; url = "http://${path}";
@ -74,21 +83,17 @@ let
inherit name hash; inherit name hash;
url = "https://${path}"; url = "https://${path}";
}; };
file = unpackZigArtifact {
inherit name;
artifact = /. + path;
};
}; };
in in
fetcher.${proto}; fetcher.${proto};
in in
linkFarm name [ linkFarm name [
{ {
name = "122014e73fd712190e109950837b97f6143f02d7e2b6986e1db70b6f4aadb5ba6a0d"; name = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "clap"; name = "clap";
url = "https://github.com/Hejsil/zig-clap/archive/8c98e6404b22aafc0184e999d8f068b81cc22fa1.tar.gz"; url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.9.1.tar.gz";
hash = "sha256-3P9LyIlq4eNMOe+/jdVJgECfzveSUuRzTf9yhT4t8Zo="; hash = "sha256-7qxm/4xb+58MGG+iUzssUtR97OG2dRjAqyS0BAet4HY=";
}; };
} }
{ {