zf: patch to fix Zig 0.15.2 compatibility
This commit is contained in:
113
pkgs/by-name/zf/zf/deps.nix
generated
113
pkgs/by-name/zf/zf/deps.nix
generated
@@ -1,32 +1,115 @@
|
|||||||
# generated by zon2nix (https://github.com/nix-community/zon2nix)
|
# generated by zon2nix (https://github.com/jcollie/zon2nix)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
linkFarm,
|
linkFarm,
|
||||||
fetchzip,
|
fetchurl,
|
||||||
fetchgit,
|
fetchgit,
|
||||||
|
runCommandLocal,
|
||||||
|
zig_0_15,
|
||||||
|
name ? "zig-packages",
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
unpackZigArtifact =
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
artifact,
|
||||||
|
}:
|
||||||
|
runCommandLocal name
|
||||||
|
{
|
||||||
|
nativeBuildInputs = [ zig_0_15 ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
|
||||||
|
mv "$TMPDIR/p/$hash" "$out"
|
||||||
|
chmod 755 "$out"
|
||||||
|
'';
|
||||||
|
|
||||||
linkFarm "zig-packages" [
|
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;
|
||||||
|
fetchSubmodules = 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 [
|
||||||
{
|
{
|
||||||
name = "vaxis-0.5.1-BWNV_BMgCQDXdZzABeY4F_xwgE7nHFtYEP07KgEwJWo8";
|
name = "uucode-0.1.0-ZZjBPj96QADXyt5sqwBJUnhaDYs_qBeeKijZvlRa0eqM";
|
||||||
path = fetchgit {
|
path = fetchZigArtifact {
|
||||||
url = "https://github.com/rockorager/libvaxis";
|
name = "uucode";
|
||||||
rev = "6eb16bb4190dc074dafaf4f0ce7dadd50e81192a";
|
url = "git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732";
|
||||||
hash = "sha256-5c+TjmiH4071lKI+U8SIJ0M+4ezzcAtLI2ZSfZYdXSA=";
|
hash = "sha256-sHPh+TQSdUGus/QTbj7KSJJkTuNTrK4VNmQDjS30Lf8=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "zg-0.15.1-oGqU3M0-tALZCy7boQS86znlBloyKx6--JriGlY0Paa9";
|
name = "vaxis-0.5.1-BWNV_LosCQAGmCCNOLljCIw6j6-yt53tji6n6rwJ2BhS";
|
||||||
path = fetchzip {
|
path = fetchZigArtifact {
|
||||||
url = "https://codeberg.org/chaten/zg/archive/749197a3f9d25e211615960c02380a3d659b20f9.tar.gz";
|
name = "vaxis";
|
||||||
hash = "sha256-wzGMfN9Qa3bQRK50p12pdxsSBEVtp2K0gFQFJm7wYMo=";
|
url = "https://github.com/rockorager/libvaxis/archive/7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz";
|
||||||
|
hash = "sha256-LnIzK8icW1Qexua9SHaeHz+3V8QAbz0a+UC1T5sIjvY=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms";
|
name = "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms";
|
||||||
path = fetchzip {
|
path = fetchZigArtifact {
|
||||||
|
name = "zigimg";
|
||||||
url = "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz";
|
url = "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz";
|
||||||
hash = "sha256-vkcTloGX+vRw7e6GYJLO9eocYaEOYjXYE0dT7jscZ4A=";
|
hash = "sha256-LB7Xa6KzVRRUSwwnyWM+y6fDG+kIDjfnoBDJO1obxVM=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -10,26 +10,36 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
zig = zig_0_15;
|
zig = zig_0_15;
|
||||||
|
zig_hook = zig.hook.overrideAttrs {
|
||||||
|
zig_default_flags = "-Dcpu=baseline -Doptimize=ReleaseFast --color off";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "zf";
|
pname = "zf";
|
||||||
version = "0.10.3";
|
upstreamVersion = "0.10.3";
|
||||||
|
version = "${finalAttrs.upstreamVersion}-unstable-2025-10-14";
|
||||||
|
rev = "3c52637b7e937c5ae61fd679717da3e276765b23";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "natecraddock";
|
owner = "natecraddock";
|
||||||
repo = "zf";
|
repo = "zf";
|
||||||
tag = finalAttrs.version;
|
rev = finalAttrs.rev;
|
||||||
hash = "sha256-RHGck3cZx9hzh+z5BexO3k9thda73qSq5ugy0Ouh2QI=";
|
hash = "sha256-BfAZILill3I/nBf1oWwol77N34Jcpm4hudC+XSeMgZY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
installShellFiles
|
installShellFiles
|
||||||
zig.hook
|
zig_hook
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
deps = callPackage ./deps.nix {
|
||||||
cp -a ${callPackage ./deps.nix { }}/. $ZIG_GLOBAL_CACHE_DIR/p
|
name = "${finalAttrs.pname}-cache-${finalAttrs.version}";
|
||||||
'';
|
};
|
||||||
|
|
||||||
|
zigBuildFlags = [
|
||||||
|
"--system"
|
||||||
|
"${finalAttrs.deps}"
|
||||||
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
installManPage doc/zf.1
|
installManPage doc/zf.1
|
||||||
@@ -39,7 +49,14 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
--zsh complete/_zf
|
--zsh complete/_zf
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
zigCheckFlags = finalAttrs.zigBuildFlags;
|
||||||
|
doCheck = true;
|
||||||
|
doInstallCheck = true;
|
||||||
|
|
||||||
|
passthru.tests.version = testers.testVersion {
|
||||||
|
package = finalAttrs.finalPackage;
|
||||||
|
version = finalAttrs.upstreamVersion;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/natecraddock/zf";
|
homepage = "https://github.com/natecraddock/zf";
|
||||||
|
|||||||
Reference in New Issue
Block a user