···
···
···
···
-
rpath = lib.makeLibraryPath deps;
stdenv.mkDerivation rec {
-
url = "https://bin.appgate-sdp.com/${lib.versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb";
sha256 = "sha256-wAhcTRO/Cd4MG1lfPNDq92yGcu3NOfymucddy92VaXo=";
-
enableParallelBuilding = true;
···
···
-
ln -s "$out/opt/appgate/appgate" "$out/bin/appgate"
cp -r $out/usr/share $out/share
-
for file in $out/opt/appgate/linux/appgate-resolver.pre \
-
$out/opt/appgate/linux/appgate-dumb-resolver.pre
-
substituteInPlace $file \
-
--replace "/bin/sh" "${bash}/bin/sh" \
-
--replace "cat" "${coreutils}/bin/cat" \
-
--replace "chattr" "${e2fsprogs}/bin/chattr" \
-
--replace "mv " "${coreutils}/bin/mv " \
-
--replace "pkill" "${procps}/bin/pkill"
-
for file in $out/lib/systemd/system/appgatedriver.service \
-
$out/lib/systemd/system/appgate-dumb-resolver.service \
-
$out/lib/systemd/system/appgate-resolver.service
-
substituteInPlace $file \
-
--replace "/bin/sh" "${bash}/bin/sh" \
--replace "/opt/" "$out/opt/" \
-
--replace "chattr" "${e2fsprogs}/bin/chattr" \
-
--replace "mv " "${coreutils}/bin/mv "
-
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 \
--replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
-
substituteInPlace $out/opt/appgate/linux/nm.py --replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
-
substituteInPlace $out/opt/appgate/linux/set_dns --replace "/etc/appgate.conf" "$out/etc/appgate.conf"
-
find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
-
for binary in $out/opt/appgate/appgate-driver \
-
$out/opt/appgate/appgate \
-
$out/opt/appgate/service/createdump \
-
$out/opt/appgate/service/appgateservice.bin
-
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "$ORIGIN:$out/opt/appgate/service/:$out/opt/appgate/:${rpath}" $binary
-
# fail if there are missing dependencies
-
ldd $out/opt/appgate/appgate | grep -i 'not found' && exit 1
-
ldd $out/opt/appgate/service/appgateservice.bin | grep -i 'not found' && exit 1
-
ldd $out/opt/appgate/appgate-driver | grep -i 'not found' && exit 1
-
wrapProgram $out/opt/appgate/appgate-driver --prefix PATH : ${lib.makeBinPath [ iproute2 networkmanager dnsmasq ]}
wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH
-
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 ];
···
···
···
···
stdenv.mkDerivation rec {
+
url = "https://bin.appgate-sdp.com/${versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb";
sha256 = "sha256-wAhcTRO/Cd4MG1lfPNDq92yGcu3NOfymucddy92VaXo=";
+
# just patch interpreter
+
autoPatchelfIgnoreMissingDeps = true;
···
···
cp -r $out/usr/share $out/share
+
substituteInPlace $out/lib/systemd/system/appgate-dumb-resolver.service \
+
--replace "/opt/" "$out/opt/"
+
substituteInPlace $out/lib/systemd/system/appgatedriver.service \
--replace "/opt/" "$out/opt/" \
--replace "InaccessiblePaths=/mnt /srv /boot /media" "InaccessiblePaths=-/mnt -/srv -/boot -/media"
substituteInPlace $out/lib/systemd/system/appgate-resolver.service \
+
--replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq" \
+
--replace "/opt/" "$out/opt/"
+
substituteInPlace $out/opt/appgate/linux/nm.py \
--replace "/usr/sbin/dnsmasq" "${dnsmasq}/bin/dnsmasq"
+
substituteInPlace $out/opt/appgate/linux/set_dns \
+
--replace "/etc/appgate.conf" "$out/etc/appgate.conf"
+
wrapProgram $out/opt/appgate/service/createdump \
+
--set LD_LIBRARY_PATH "${makeLibraryPath [ stdenv.cc.cc ]}"
+
wrapProgram $out/opt/appgate/appgate-driver \
+
--prefix PATH : ${makeBinPath [ iproute2 networkmanager dnsmasq ]} \
+
--set LD_LIBRARY_PATH $out/opt/appgate/service
+
makeWrapper $out/opt/appgate/Appgate $out/bin/appgate \
+
--prefix PATH : ${makeBinPath [ xdg-utils ]} \
+
--set LD_LIBRARY_PATH $out/opt/appgate:${makeLibraryPath deps}
wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH
description = "Appgate SDP (Software Defined Perimeter) desktop client";
homepage = "https://www.appgate.com/support/software-defined-perimeter-support";
···
maintainers = with maintainers; [ ymatsiuk ];