journalbeat: patchelf the binary instead of using a wrapper

This commit is contained in:
Bas van Dijk 2019-05-10 15:27:45 +02:00
parent 46a869b286
commit 6f0a6bfc60

View File

@ -1,24 +1,9 @@
{ lib, pkgs, buildGoPackage, fetchFromGitHub, makeWrapper }:
let
libPath = lib.makeLibraryPath [ pkgs.systemd.lib ];
in buildGoPackage rec {
{ lib, systemd, buildGoPackage, fetchFromGitHub, makeWrapper }:
buildGoPackage rec {
name = "journalbeat-${version}";
version = "5.6.8";
goPackagePath = "github.com/mheese/journalbeat";
buildInputs = [ makeWrapper pkgs.systemd ];
postInstall = ''
wrapProgram $bin/bin/journalbeat \
--argv0 journalbeat \
--prefix LD_LIBRARY_PATH : ${libPath}
'';
src = fetchFromGitHub {
owner = "mheese";
repo = "journalbeat";
@ -26,6 +11,14 @@ in buildGoPackage rec {
sha256 = "1vgpwnwqjc93nvdpcd52748bwl3r371jb55l17bsgdzrmlcyfm8a";
};
goPackagePath = "github.com/mheese/journalbeat";
buildInputs = [ systemd.dev ];
postFixup = let libPath = lib.makeLibraryPath [ systemd.lib ]; in ''
patchelf --set-rpath ${libPath} "$bin/bin/journalbeat"
'';
meta = with lib; {
homepage = https://github.com/mheese/journalbeat;
description = "Journalbeat is a log shipper from systemd/journald to Logstash/Elasticsearch";