openlist: 4.1.10 -> 4.2.1

This commit is contained in:
Moraxyc
2026-04-26 10:48:57 +08:00
parent 8771a9c4a6
commit dd64cb0a6d
2 changed files with 31 additions and 17 deletions
+14 -9
View File
@@ -2,27 +2,28 @@
lib,
buildNpmPackage,
fetchFromGitHub,
fetchPnpmDeps,
fetchzip,
nodejs,
pnpm_9,
fetchPnpmDeps,
openlistPnpm ? pnpm_10,
pnpmConfigHook,
pnpm_10,
}:
buildNpmPackage (finalAttrs: {
pname = "openlist-frontend";
version = "4.1.10";
version = "4.2.1";
src = fetchFromGitHub {
owner = "OpenListTeam";
repo = "OpenList-Frontend";
tag = "v${finalAttrs.version}";
hash = "sha256-V8nfQsGLhd7eERF0/ly3sRdGmffYa9r6GhtjciOXxMU=";
hash = "sha256-4WSL6j0dANUNlHFkMBb8j/KyNHWDQmLnC1y2FFJiBEI=";
};
i18n = fetchzip {
url = "https://github.com/OpenListTeam/OpenList-Frontend/releases/download/v${finalAttrs.version}/i18n.tar.gz";
hash = "sha256-VdNqXdLXs2n/ikUDm1YQRNAXqYqFjMWRGLPRpmJVoaI=";
hash = "sha256-VzHNZh0ZA2FncAkyozHeBilN4KKsPqbpMESx4QCppW0=";
stripRoot = false;
};
@@ -32,19 +33,23 @@ buildNpmPackage (finalAttrs: {
nativeBuildInputs = [
nodejs
pnpm_9
openlistPnpm
];
npmDeps = null;
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pnpm_9;
fetcherVersion = 2;
hash = "sha256-xylF+Z7Fkx/bFYPlzqfGrl051ZLKzPgdlF7U8vKtQq8=";
pnpm = openlistPnpm;
fetcherVersion = 3;
hash = "sha256-rTDk1p568AKim+ZD00uq1q4XNNMeUFL1rGDBWx2C6DQ=";
};
npmConfigHook = pnpmConfigHook;
# [plugin vite:legacy-generate-polyfill-chunk]
# Error: getaddrinfo ENOTFOUND localhost
__darwinAllowLocalNetworking = true;
installPhase = ''
runHook preInstall
+17 -8
View File
@@ -2,22 +2,24 @@
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
callPackage,
fetchFromGitHub,
iana-etc,
installShellFiles,
libredirect,
versionCheckHook,
fuse,
}:
buildGoModule (finalAttrs: {
pname = "openlist";
version = "4.1.10";
version = "4.2.1";
src = fetchFromGitHub {
owner = "OpenListTeam";
repo = "OpenList";
tag = "v${finalAttrs.version}";
hash = "sha256-+B3ea0LvzpRll9HpfEU6RkSgnQtVprSlrO+Tq07T0eQ=";
hash = "sha256-9MDcAQh06W6mOhYpFR49bxvTTrIoJnKY9P3WRVWsujI=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
@@ -33,7 +35,12 @@ buildGoModule (finalAttrs: {
frontend = callPackage ./frontend.nix { };
proxyVendor = true;
vendorHash = "sha256-xUTTVejCDDMfzWdmtXiWcc0/hzhniZJcNzPFFFiNnJk=";
vendorHash = "sha256-Ho9zVKdzpGKZ/ftJmidUkMBsN4qfvLa96Fg3ayTfYac=";
nativeBuildInputs = [
installShellFiles
]
++ lib.optional stdenv.hostPlatform.isDarwin libredirect.hook;
buildInputs = [ fuse ];
@@ -56,6 +63,10 @@ buildGoModule (finalAttrs: {
ldflags+=" -X github.com/OpenListTeam/OpenList/v4/internal/conf.GitCommit=$(<COMMIT)"
'';
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services
'';
checkFlags =
let
# Skip tests that require network access
@@ -74,8 +85,6 @@ buildGoModule (finalAttrs: {
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd OpenList \
--bash <($out/bin/OpenList completion bash) \
@@ -86,9 +95,9 @@ buildGoModule (finalAttrs: {
$out/bin/OpenList completion powershell > $out/share/powershell/OpenList.Completion.ps1
'';
doInstallCheck = true;
# panic: open /etc/protocols: operation not permitted
doInstallCheck = !stdenv.hostPlatform.isDarwin;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/OpenList";
versionCheckProgramArg = "version";
passthru.updateScript = lib.getExe (callPackage ./update.nix { });