1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
{ 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
, libsecret
, libuuid
, libX11
, libxcb
, libXi
, libXcursor
, libXdamage
, libXrandr
, libXcomposite
, libXext
, libXfixes
, libXrender
, libXtst
, libXScrnSaver
, libxkbcommon
, libdrm
, mesa
# 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
, meta
, copyDesktopItems
, makeWrapper
}:
let
dist = {
aarch64-linux = {
arch = "arm64";
sha256 = "sha256-esboLFqCziTlCFHyK6GxFq9Rik9jHiqX6ED0D53P1K4=";
};
x86_64-linux = {
arch = "64";
sha256 = "sha256-NH5bfz74/WIXbNdYs6Hoh/FF54v2+b4Ci5T7Y095Akw=";
};
}.${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;
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
libsecret
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
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
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
done
popd
wrapProgram $out/bin/postman --set PATH ${lib.makeBinPath [ openssl ]}
'';
}
|