Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 rpmextract, 6 patchelf, 7 testers, 8 scaleft, 9}: 10 11stdenv.mkDerivation rec { 12 pname = "scaleft"; 13 version = "1.80.1"; 14 15 src = fetchurl { 16 url = "https://dist.scaleft.com/repos/rpm/stable/centos/9/x86_64/1.80.1/scaleft-client-tools-${version}-1.x86_64.rpm"; 17 sha256 = "sha256-QrkqAgkplFF6Tp6FWKb2TJaqeOw8ec4zd9pymDP2IyY="; 18 }; 19 20 nativeBuildInputs = [ 21 patchelf 22 rpmextract 23 ]; 24 25 libPath = lib.makeLibraryPath [ 26 stdenv.cc 27 stdenv.cc.cc 28 ]; 29 30 buildCommand = '' 31 mkdir -p $out/bin/ 32 cd $out 33 rpmextract $src 34 patchelf \ 35 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 36 usr/bin/sft 37 patchelf \ 38 --set-rpath ${libPath} \ 39 usr/bin/sft 40 ln -s $out/usr/bin/sft $out/bin/sft 41 chmod +x $out/bin/sft 42 patchShebangs $out 43 ''; 44 45 passthru.tests.version = testers.testVersion { 46 package = scaleft; 47 command = "sft -v"; 48 version = "sft version ${version}"; 49 }; 50 51 meta = with lib; { 52 description = "ScaleFT provides Zero Trust software which you can use to secure your internal servers and services"; 53 homepage = "https://www.scaleft.com"; 54 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 55 license = licenses.unfree; 56 maintainers = with maintainers; [ jloyet ]; 57 platforms = [ "x86_64-linux" ]; 58 mainProgram = "sft"; 59 }; 60}