From a7bee7331b4a3ed18ac51a3a8545a6e758546b22 Mon Sep 17 00:00:00 2001 From: L-Nafaryus Date: Wed, 31 Jul 2024 00:58:40 +0500 Subject: [PATCH] fix binary wrapper --- flake.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 1792fdb..dcf9bc4 100644 --- a/flake.nix +++ b/flake.nix @@ -36,9 +36,6 @@ packages.x86_64-linux = rec { oscuro = let common = { - pname = "oscuro"; - version = "0.1.0"; - src = pkgs.lib.cleanSourceWith { src = ./.; filter = path: type: (craneLib.filterCargoSources path type); @@ -46,14 +43,23 @@ strictDeps = true; - nativeBuildInputs = [pkgs.pkg-config]; + nativeBuildInputs = [pkgs.pkg-config pkgs.makeWrapper]; buildInputs = [pkgs.openssl]; }; cargoArtifacts = craneLib.buildDepsOnly common; in - craneLib.buildPackage (common // {inherit cargoArtifacts;}); + craneLib.buildPackage (common + // rec { + pname = "oscuro"; + version = "0.1.0"; + inherit cargoArtifacts; + postInstall = '' + wrapProgram $out/bin/${pname} \ + --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath common.buildInputs} \ + ''; + }); default = oscuro; };