picgo: 2.5.3 -> 3.0.0 (#539811)

This commit is contained in:
nixpkgs-ci[bot]
2026-07-13 04:04:34 +00:00
committed by GitHub
+27 -6
View File
@@ -6,7 +6,7 @@
pnpm_10,
fetchPnpmDeps,
pnpmConfigHook,
electron_40,
electron_41,
makeWrapper,
copyDesktopItems,
makeDesktopItem,
@@ -18,20 +18,20 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "picgo";
version = "2.5.3";
version = "3.0.0";
src = fetchFromGitHub {
owner = "Molunerfinn";
repo = "PicGo";
tag = "v${finalAttrs.version}";
hash = "sha256-4Ih7PPBo6scJoUS8yTAR0iyG5vxNc/c0CCw5FGaIbHM=";
hash = "sha256-ruTgNgZsjpdu2Cc2Q4HxPdoQHUww1UTbvLazglaz75c=";
};
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) version src;
inherit pnpm;
pname = "picgo";
hash = "sha256-tILvWDoHAN5XT1F/cJYgfeMzowuO/fhiughI+0FvHzc=";
hash = "sha256-IAuTtI0Ljm4+xCeMGIQAf7lK37CQ6qf7PJsksLIti7Q=";
fetcherVersion = 3; # lockfileVersion 9.0 corresponds to fetcherVersion 3
};
@@ -56,6 +56,17 @@ stdenv.mkDerivation (finalAttrs: {
runHook postBuild
'';
postBuild = ''
cp -r src/renderer/public/. dist_electron/renderer/
# Renderer assets are loaded from a file:// URL, so root-relative paths like
# /squareLogo.png resolve to the filesystem root. Copy the renderer public assets
# next to index.html and rewrite those references to relative paths.
# https://github.com/Molunerfinn/PicGo/blob/dev/src/renderer/components/independent-window/mini/picgo-mini-page.tsx
substituteInPlace dist_electron/renderer/assets/mini-*.js \
--replace-fail '"/squareLogo.png"' '"./squareLogo.png"'
'';
installPhase = ''
runHook preInstall
@@ -73,10 +84,20 @@ stdenv.mkDerivation (finalAttrs: {
# Create startup script
mkdir -p $out/bin
makeWrapper ${lib.getExe electron_40} $out/bin/picgo \
# PicGo uses app.isPackaged to decide whether it is running in development mode.
# With the nixpkgs Electron wrapper the executable is still the generic electron
# binary, so app.isPackaged is false unless we force the packaged code path.
# https://github.com/Molunerfinn/PicGo/blob/4d92ca199b7afead168785d7375a525ca156b25f/src/main/utils/env.ts#L17-L22
# ELECTRON_FORCE_IS_PACKAGED makes PicGo use its production resource path,
# but with the nixpkgs Electron wrapper process.resourcesPath points to Electron
# itself, so point PicGo at the installed public assets
makeWrapper ${lib.getExe electron_41} $out/bin/picgo \
--add-flags "--class=picgo" \
--add-flags "$out/lib/picgo/.launcher.cjs" \
--add-flags "--name picgo" \
--set NODE_ENV production \
--set ELECTRON_FORCE_IS_PACKAGED 1 \
--set STATIC_PATH "$out/lib/picgo/public" \
--set-default ELECTRON_OZONE_PLATFORM_HINT auto \
--chdir "$out/lib/picgo"