postman: 11.50.5 -> 11.56.4

This commit is contained in:
mivorasu
2025-08-02 16:05:14 +08:00
parent 86cae257c9
commit 58a6f2718c
3 changed files with 168 additions and 170 deletions
+22 -40
View File
@@ -1,58 +1,40 @@
{
stdenvNoCC,
fetchurl,
unzip,
pname,
version,
src,
meta,
}:
let
appName = "Postman.app";
dist =
{
aarch64-darwin = {
arch = "arm64";
sha256 = "sha256-KOvYt3VL1hZAyf6T+3whMTyhHgndnlZO0e3L1KtDxqE=";
};
x86_64-darwin = {
arch = "64";
sha256 = "sha256-LCpxbDgcIbVmA7RYykli7gLGb0FWQ4LigxghZYEv1Bk=";
};
}
.${stdenvNoCC.hostPlatform.system}
or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
in
stdenvNoCC.mkDerivation {
inherit pname version meta;
inherit
pname
version
src
meta
;
src = fetchurl {
url = "https://dl.pstmn.io/download/version/${version}/osx_${dist.arch}";
inherit (dist) sha256;
name = "${pname}-${version}.zip";
};
sourceRoot = "Postman.app";
nativeBuildInputs = [ unzip ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications $out/bin
cp --recursive . $out/Applications/Postman.app
cat > $out/bin/postman << EOF
#!${stdenvNoCC.shell}
open -na $out/Applications/Postman.app --args "\$@"
EOF
chmod +x $out/bin/postman
runHook postInstall
'';
# Postman is notarized on macOS. Running the fixup phase will change the shell scripts embedded
# in the bundle, which causes the notarization check to fail on macOS 13+.
# See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
dontFixup = true;
sourceRoot = appName;
installPhase = ''
runHook preInstall
mkdir -p $out/{Applications/${appName},bin}
cp -R . $out/Applications/${appName}
cat > $out/bin/${pname} << EOF
#!${stdenvNoCC.shell}
open -na $out/Applications/${appName} --args "\$@"
EOF
chmod +x $out/bin/${pname}
runHook postInstall
'';
}
+86 -109
View File
@@ -1,82 +1,69 @@
{
lib,
stdenv,
fetchurl,
makeDesktopItem,
wrapGAppsHook3,
atk,
copyDesktopItems,
makeWrapper,
alsa-lib,
at-spi2-atk,
at-spi2-core,
alsa-lib,
atk,
cairo,
cups,
curlWithGnuTls,
dbus,
expat,
fontconfig,
freetype,
gdk-pixbuf,
glib,
gtk3,
freetype,
fontconfig,
nss,
nspr,
pango,
udev,
libsecret,
libuuid,
libX11,
libxcb,
libXi,
libXcomposite,
libXcursor,
libXdamage,
libXrandr,
libXcomposite,
libXext,
libXfixes,
libXi,
libXrandr,
libXrender,
libXtst,
libXScrnSaver,
libxkbcommon,
libXtst,
libdrm,
libgbm,
libGL,
libsecret,
libuuid,
libxkbcommon,
nspr,
nss,
pango,
udev,
xorg,
bintools,
makeDesktopItem,
# It's unknown which version of openssl that postman expects but it seems that
# OpenSSL 3+ seems to work fine (cf.
# https://github.com/NixOS/nixpkgs/issues/254325). If postman breaks apparently
# around OpenSSL stuff then try changing this dependency version.
openssl,
xorg,
pname,
version,
src,
meta,
copyDesktopItems,
makeWrapper,
}:
let
dist =
{
aarch64-linux = {
arch = "arm64";
sha256 = "sha256-XOQam1W7YT0YDesDR51G/cH318DcxpnAEiJg2JZU3Q4=";
};
stdenv.mkDerivation {
inherit
pname
version
src
meta
;
x86_64-linux = {
arch = "64";
sha256 = "sha256-TE/AMWkj80+22WaOG2BK6vt4NnMSpBq9hQMwSPiQ12A=";
};
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec {
inherit pname version meta;
src = fetchurl {
url = "https://dl.pstmn.io/download/version/${version}/linux${dist.arch}";
inherit (dist) sha256;
name = "${pname}-${version}.tar.gz";
};
dontConfigure = true;
nativeBuildInputs = [
copyDesktopItems
makeWrapper
];
desktopItems = [
(makeDesktopItem {
@@ -90,78 +77,68 @@ stdenv.mkDerivation rec {
})
];
buildInputs = [
(lib.getLib stdenv.cc.cc)
atk
at-spi2-atk
at-spi2-core
alsa-lib
cairo
cups
dbus
expat
gdk-pixbuf
glib
gtk3
freetype
fontconfig
libgbm
nss
nspr
pango
udev
libdrm
libsecret
libuuid
libX11
libxcb
libXi
libXcursor
libXdamage
libXrandr
libXcomposite
libXext
libXfixes
libXrender
libXtst
libXScrnSaver
libxkbcommon
xorg.libxshmfence
];
nativeBuildInputs = [
wrapGAppsHook3
copyDesktopItems
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/postman
cp -R app/* $out/share/postman
mkdir -p $out/share $out/bin
cp --recursive app $out/share/postman
rm $out/share/postman/Postman
mkdir -p $out/bin
ln -s $out/share/postman/postman $out/bin/postman
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime=true}}"
makeWrapper $out/share/postman/postman $out/bin/postman \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--prefix PATH : ${lib.makeBinPath [ openssl ]}
mkdir -p $out/share/icons/hicolor/128x128/apps
ln -s $out/share/postman/resources/app/assets/icon.png $out/share/icons/postman.png
ln -s $out/share/postman/resources/app/assets/icon.png $out/share/icons/hicolor/128x128/apps/postman.png
runHook postInstall
'';
postFixup = ''
pushd $out/share/postman
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" postman
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" chrome_crashpad_handler
for file in $(find . -type f \( -name \*.node -o -name postman -o -name \*.so\* \) ); do
ORIGIN=$(patchelf --print-rpath $file); \
patchelf --set-rpath "${lib.makeLibraryPath buildInputs}:$ORIGIN" $file
patchelf --set-interpreter ${bintools.dynamicLinker} --add-needed libGL.so.1 $out/share/postman/postman
patchelf --set-interpreter ${bintools.dynamicLinker} $out/share/postman/chrome_crashpad_handler
for file in $(find $out/share/postman -type f \( -name \*.node -o -name postman -o -name \*.so\* \) ); do
patchelf --add-rpath "${
lib.makeLibraryPath [
(lib.getLib stdenv.cc.cc)
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups
curlWithGnuTls
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libdrm
libgbm
libGL
libsecret
libuuid
libX11
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXScrnSaver
libxkbcommon
libXtst
nspr
nss
pango
udev
xorg.libxcb
xorg.libxshmfence
]
}" $file
done
popd
wrapProgram $out/bin/postman --set PATH ${lib.makeBinPath [ openssl ]}
'';
}
+60 -21
View File
@@ -1,37 +1,76 @@
{
stdenvNoCC,
callPackage,
lib,
stdenvNoCC,
fetchurl,
callPackage,
}:
let
pname = "postman";
version = "11.50.5";
meta = with lib; {
homepage = "https://www.getpostman.com";
version = "11.56.4";
src =
let
selectSystem =
attrs:
attrs.${stdenvNoCC.hostPlatform.system}
or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
system = selectSystem {
aarch64-darwin = "osx_arm64";
aarch64-linux = "linuxarm64";
x86_64-darwin = "osx_64";
x86_64-linux = "linux64";
};
in
fetchurl {
name = "postman-${version}.${if stdenvNoCC.hostPlatform.isLinux then "tar.gz" else "zip"}";
url = "https://dl.pstmn.io/download/version/${version}/${system}";
hash = selectSystem {
aarch64-darwin = "sha256-DNhTzTul3SZSsqc3g1oOSSl1sGQ3t6FD5bbL4dMHzEk=";
aarch64-linux = "sha256-8CaqyMuZEcdgKfE2OxHCEAVsTFBtFDOfdHfTWASJAU4=";
x86_64-darwin = "sha256-cRHyqNBW/1l2VsK89ue2K+X/Uszpzu9wXg4O91Adfy4=";
x86_64-linux = "sha256-bwvNmcSBbwLt3kNbd05Yy2IgNHUJx7qTvDMKrGmOOi0=";
};
};
meta = {
changelog = "https://www.postman.com/release-notes/postman-app/#${
replaceStrings [ "." ] [ "-" ] version
lib.replaceStrings [ "." ] [ "-" ] version
}";
description = "API Development Environment";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.postman;
platforms = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
maintainers = with maintainers; [
johnrichardrinehart
evanjs
tricktron
homepage = "https://www.getpostman.com";
license = lib.licenses.postman;
maintainers = with lib.maintainers; [
Crafter
evanjs
johnrichardrinehart
tricktron
];
platforms = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
in
if stdenvNoCC.hostPlatform.isDarwin then
callPackage ./darwin.nix { inherit pname version meta; }
callPackage ./darwin.nix {
inherit
pname
version
src
meta
;
}
else
callPackage ./linux.nix { inherit pname version meta; }
callPackage ./linux.nix {
inherit
pname
version
src
meta
;
}