diff --git a/pkgs/by-name/op/openlist/frontend.nix b/pkgs/by-name/op/openlist/frontend.nix index 85eeb706d3fa..b1705127ab80 100644 --- a/pkgs/by-name/op/openlist/frontend.nix +++ b/pkgs/by-name/op/openlist/frontend.nix @@ -1,52 +1,54 @@ { lib, - stdenvNoCC, + buildNpmPackage, fetchFromGitHub, + fetchPnpmDeps, fetchzip, nodejs, - pnpm_9, - fetchPnpmDeps, + openlistPnpm ? pnpm_10, pnpmConfigHook, + pnpm_10, }: -stdenvNoCC.mkDerivation (finalAttrs: { +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; }; + postPatch = '' + cp -r ${finalAttrs.i18n}/* src/lang/ + ''; + nativeBuildInputs = [ nodejs - pnpmConfigHook - 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="; }; - buildPhase = '' - runHook preBuild + npmConfigHook = pnpmConfigHook; - cp -r ${finalAttrs.i18n}/* src/lang/ - pnpm build - - runHook postBuild - ''; + # [plugin vite:legacy-generate-polyfill-chunk] + # Error: getaddrinfo ENOTFOUND localhost + __darwinAllowLocalNetworking = true; installPhase = '' runHook preInstall @@ -62,5 +64,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { homepage = "https://github.com/OpenListTeam/OpenList-Frontend"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ moraxyc ]; + inherit (nodejs.meta) platforms; }; }) diff --git a/pkgs/by-name/op/openlist/package.nix b/pkgs/by-name/op/openlist/package.nix index c58851312b57..f49df3ded44f 100644 --- a/pkgs/by-name/op/openlist/package.nix +++ b/pkgs/by-name/op/openlist/package.nix @@ -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=$( $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 { });