Unsatisfied dependency

I’m attempting to write a nix expression to install globuspersonalconnect, available only as a binary, by following

https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos/522823#522823

I run it like this:

nix-build -E ‘with import {}; callPackage ./default.nix {}’

and it ends with:

autoPatchelfHook could not satisfy dependency libaudit.so.1 wanted by /nix/store/b6h0pcqnwbdmxl26381mzsk5nvb9apws-globusconnectpersonal-3.1.5/gt_amd64/lib/libpam_misc.so.0.82.0
Add the missing dependencies to the build inputs or set autoPatchelfIgnoreMissingDeps=true
builder for ‘/nix/store/z01b86cqfp746v921f57zp5l9plarpk6-globusconnectpersonal-3.1.5.drv’ failed with exit code 1

I’ve tried putting audit or libaudit in the buildinputs = section but that just results in an ‘undefined variable’ error.

Can someone help me out?

Thanks,
Roger

nixos 21.05 on x86_64.

Seems to be available as audit

Did you remember to also ad it to the argset?

Hello,

Norbert Melzer via NixOS Discourse writes:

Did you remember to also ad it to the argset?

That was it. Thank you.

I can build it using

nix-build -E ‘with import {}; callPackage ./default.nix {}’

but using

nix-build -A default.nix

results in:

error: cannot auto-call a function that has an argument without a
default value (‘stdenv’)

What is required to prevent this error?

Thanks,
Roger

For completeness I’m appending the current default.nix:

{ stdenv, glibc, gcc-unwrapped, autoPatchelfHook, audit }:
let
pkgs = import {};

See: Different methods to run a non-nixos executable on Nixos - Unix & Linux Stack Exchange

version = “3.1.5”;

in stdenv.mkDerivation {
name = “globusconnectpersonal-${version}”;

system = “x86_64-linux”;
src = ./globusconnectpersonal-latest.tgz;

inherit src;

Required for compilation

nativeBuildInputs = [
autoPatchelfHook # Automatically setup the loader, and do the magic
];

Required at running time

buildInputs = [
glibc
gcc-unwrapped
audit
];

unpackPhase = “true”;

Extract and copy executable in $out/bin

installPhase = ‘’
mkdir -p $out
tar xvzf $src -C $out
cp -av $out/$name/* $out
rm -rf $out/$name
‘’;

meta = with stdenv.lib; {
description = "globuspersonalconnect";
homepage = https://www.globus.org/globus-connect-personal/;
license = licenses.unfree;  # export NIXPKGS_ALLOW_UNFREE=1 
maintainers = with stdenv.lib.maintainers; [ rmason ]; # This is probably incorrect, but harmless.
platforms = [ "x86_64-linux" ];
};

}

Use --args though thats not very user friendly. Either use --eval or provide an additional nix file that wraps the callPackage, and then nix-build the-wrapper.nix.

Also, -A default.nix would try to build the attribute default.nix as returned from the attribute set, if there wasn’t the function call in the way. So its probably not what you meant.

Hello,

Norbert Melzer via NixOS Discourse writes:

Use --args though thats not very user friendly. Either use --eval or provide an additional nix file that wraps the callPackage, and then nix-build the-wrapper.nix.

Also, -A default.nix would try to build the attribute default.nix as returned from the attribute set, if there wasn’t the function call in the way. So its probably not what you
meant.

Unfortunately, as a newbie, I don’t know what any of that means, but I
have at least managed to get a working build.

Now I’m attempting to install globus-cli (python package) using pip but
running into a compilation error. I’ll open a separate topic for that.

Thanks again,
Roger