Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

journalbeat: patchelf the binary instead of using a wrapper

(cherry picked from commit 6f0a6bfc60206bfadb5e75cf106ca584355de590)

+10 -17
+10 -17
pkgs/tools/system/journalbeat/default.nix
··· 1 - { lib, pkgs, buildGoPackage, fetchFromGitHub, makeWrapper }: 2 - 3 - let 4 - 5 - libPath = lib.makeLibraryPath [ pkgs.systemd.lib ]; 6 - 7 - in buildGoPackage rec { 1 + { lib, systemd, buildGoPackage, fetchFromGitHub, makeWrapper }: 8 2 3 + buildGoPackage rec { 9 4 name = "journalbeat-${version}"; 10 5 version = "5.6.8"; 11 6 12 - goPackagePath = "github.com/mheese/journalbeat"; 13 - 14 - buildInputs = [ makeWrapper pkgs.systemd ]; 15 - 16 - postInstall = '' 17 - wrapProgram $bin/bin/journalbeat \ 18 - --argv0 journalbeat \ 19 - --prefix LD_LIBRARY_PATH : ${libPath} 20 - ''; 21 - 22 7 src = fetchFromGitHub { 23 8 owner = "mheese"; 24 9 repo = "journalbeat"; 25 10 rev = "v${version}"; 26 11 sha256 = "1vgpwnwqjc93nvdpcd52748bwl3r371jb55l17bsgdzrmlcyfm8a"; 27 12 }; 13 + 14 + goPackagePath = "github.com/mheese/journalbeat"; 15 + 16 + buildInputs = [ systemd.dev ]; 17 + 18 + postFixup = let libPath = lib.makeLibraryPath [ systemd.lib ]; in '' 19 + patchelf --set-rpath ${libPath} "$bin/bin/journalbeat" 20 + ''; 28 21 29 22 meta = with lib; { 30 23 homepage = https://github.com/mheese/journalbeat;