2022-04-03 18:54:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeDesktopItem
|
|
|
|
, wrapGAppsHook
|
|
|
|
, atk
|
|
|
|
, at-spi2-atk
|
|
|
|
, at-spi2-core
|
|
|
|
, alsa-lib
|
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, expat
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, freetype
|
|
|
|
, fontconfig
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, pango
|
|
|
|
, udev
|
2024-02-29 20:09:43 +00:00
|
|
|
, libsecret
|
2022-04-03 18:54:34 +00:00
|
|
|
, libuuid
|
|
|
|
, libX11
|
|
|
|
, libxcb
|
|
|
|
, libXi
|
|
|
|
, libXcursor
|
|
|
|
, libXdamage
|
|
|
|
, libXrandr
|
|
|
|
, libXcomposite
|
|
|
|
, libXext
|
|
|
|
, libXfixes
|
|
|
|
, libXrender
|
|
|
|
, libXtst
|
|
|
|
, libXScrnSaver
|
|
|
|
, libxkbcommon
|
|
|
|
, libdrm
|
|
|
|
, mesa
|
2023-10-09 19:29:22 +00:00
|
|
|
# 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
|
2022-04-03 18:54:34 +00:00
|
|
|
, xorg
|
|
|
|
, pname
|
|
|
|
, version
|
|
|
|
, meta
|
|
|
|
, copyDesktopItems
|
2023-10-09 19:29:22 +00:00
|
|
|
, makeWrapper
|
2022-04-03 18:54:34 +00:00
|
|
|
}:
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
let
|
|
|
|
dist = {
|
|
|
|
aarch64-linux = {
|
|
|
|
arch = "arm64";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-esboLFqCziTlCFHyK6GxFq9Rik9jHiqX6ED0D53P1K4=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
x86_64-linux = {
|
|
|
|
arch = "64";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-NH5bfz74/WIXbNdYs6Hoh/FF54v2+b4Ci5T7Y095Akw=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
in
|
2022-04-03 18:54:34 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "https://dl.pstmn.io/download/version/${version}/linux${dist.arch}";
|
|
|
|
inherit (dist) sha256;
|
|
|
|
name = "${pname}-${version}.tar.gz";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "postman";
|
|
|
|
exec = "postman";
|
|
|
|
icon = "postman";
|
|
|
|
comment = "API Development Environment";
|
|
|
|
desktopName = "Postman";
|
|
|
|
genericName = "Postman";
|
|
|
|
categories = [ "Development" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
|
|
|
alsa-lib
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
mesa
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
pango
|
|
|
|
udev
|
|
|
|
libdrm
|
2024-02-29 20:09:43 +00:00
|
|
|
libsecret
|
2022-04-03 18:54:34 +00:00
|
|
|
libuuid
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXrandr
|
|
|
|
libXcomposite
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
libxkbcommon
|
|
|
|
xorg.libxshmfence
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook copyDesktopItems ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/share/postman
|
|
|
|
cp -R app/* $out/share/postman
|
|
|
|
rm $out/share/postman/Postman
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/share/postman/postman $out/bin/postman
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
source "${makeWrapper}/nix-support/setup-hook"
|
|
|
|
wrapProgram $out/bin/${pname} \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
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
|
2023-04-12 12:48:02 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" chrome_crashpad_handler
|
2022-04-03 18:54:34 +00:00
|
|
|
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
|
|
|
|
done
|
|
|
|
popd
|
2023-10-09 19:29:22 +00:00
|
|
|
wrapProgram $out/bin/postman --set PATH ${lib.makeBinPath [ openssl ]}
|
2022-04-03 18:54:34 +00:00
|
|
|
'';
|
|
|
|
}
|