···
···
···
···
98
-
rpath = lib.makeLibraryPath deps;
stdenv.mkDerivation rec {
105
-
url = "https://bin.appgate-sdp.com/${lib.versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb";
94
+
url = "https://bin.appgate-sdp.com/${versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb";
sha256 = "sha256-wAhcTRO/Cd4MG1lfPNDq92yGcu3NOfymucddy92VaXo=";
98
+
# just patch interpreter
99
+
autoPatchelfIgnoreMissingDeps = true;
111
-
enableParallelBuilding = true;
···
···
129
-
ln -s "$out/opt/appgate/appgate" "$out/bin/appgate"
cp -r $out/usr/share $out/share
132
-
for file in $out/opt/appgate/linux/appgate-resolver.pre \
133
-
$out/opt/appgate/linux/appgate-dumb-resolver.pre
135
-
substituteInPlace $file \
136
-
--replace "/bin/sh" "${bash}/bin/sh" \
137
-
--replace "cat" "${coreutils}/bin/cat" \
138
-
--replace "chattr" "${e2fsprogs}/bin/chattr" \
139
-
--replace "mv " "${coreutils}/bin/mv " \
140
-
--replace "pkill" "${procps}/bin/pkill"
121
+
substituteInPlace $out/lib/systemd/system/appgate-dumb-resolver.service \
122
+
--replace "/opt/" "$out/opt/"
143
-
for file in $out/lib/systemd/system/appgatedriver.service \
144
-
$out/lib/systemd/system/appgate-dumb-resolver.service \
145
-
$out/lib/systemd/system/appgate-resolver.service
147
-
substituteInPlace $file \
148
-
--replace "/bin/sh" "${bash}/bin/sh" \
124
+
substituteInPlace $out/lib/systemd/system/appgatedriver.service \
--replace "/opt/" "$out/opt/" \
150
-
--replace "chattr" "${e2fsprogs}/bin/chattr" \
151
-
--replace "mv " "${coreutils}/bin/mv "
154
-
substituteInPlace $out/lib/systemd/system/appgatedriver.service \
--replace "InaccessiblePaths=/mnt /srv /boot /media" "InaccessiblePaths=-/mnt -/srv -/boot -/media"
substituteInPlace $out/lib/systemd/system/appgate-resolver.service \
129
+
--replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq" \
130
+
--replace "/opt/" "$out/opt/"
132
+
substituteInPlace $out/opt/appgate/linux/nm.py \
--replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
160
-
substituteInPlace $out/opt/appgate/linux/nm.py --replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
161
-
substituteInPlace $out/opt/appgate/linux/set_dns --replace "/etc/appgate.conf" "$out/etc/appgate.conf"
135
+
substituteInPlace $out/opt/appgate/linux/set_dns \
136
+
--replace "/etc/appgate.conf" "$out/etc/appgate.conf"
138
+
wrapProgram $out/opt/appgate/service/createdump \
139
+
--set LD_LIBRARY_PATH "${makeLibraryPath [ stdenv.cc.cc ]}"
166
-
find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
167
-
for binary in $out/opt/appgate/appgate-driver \
168
-
$out/opt/appgate/appgate \
169
-
$out/opt/appgate/service/createdump \
170
-
$out/opt/appgate/service/appgateservice.bin
172
-
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "$ORIGIN:$out/opt/appgate/service/:$out/opt/appgate/:${rpath}" $binary
141
+
wrapProgram $out/opt/appgate/appgate-driver \
142
+
--prefix PATH : ${makeBinPath [ iproute2 networkmanager dnsmasq ]} \
143
+
--set LD_LIBRARY_PATH $out/opt/appgate/service
175
-
# fail if there are missing dependencies
176
-
ldd $out/opt/appgate/appgate | grep -i 'not found' && exit 1
177
-
ldd $out/opt/appgate/service/appgateservice.bin | grep -i 'not found' && exit 1
178
-
ldd $out/opt/appgate/appgate-driver | grep -i 'not found' && exit 1
145
+
makeWrapper $out/opt/appgate/Appgate $out/bin/appgate \
146
+
--prefix PATH : ${makeBinPath [ xdg-utils ]} \
147
+
--set LD_LIBRARY_PATH $out/opt/appgate:${makeLibraryPath deps}
180
-
wrapProgram $out/opt/appgate/appgate-driver --prefix PATH : ${lib.makeBinPath [ iproute2 networkmanager dnsmasq ]}
wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH
182
-
wrapProgram $out/bin/appgate --prefix PATH : ${lib.makeBinPath [ xdg-utils ]}
description = "Appgate SDP (Software Defined Perimeter) desktop client";
homepage = "https://www.appgate.com/support/software-defined-perimeter-support";
···
maintainers = with maintainers; [ ymatsiuk ];