[Nix-dev] OpenSSL

stewart mackenzie setori88 at gmail.com
Mon Dec 15 04:49:55 CET 2014


Hello,

Problem: OpenSSL is no longer found despite it being in my environment.

Here is my config.nix
{
  packageOverrides = pkgs : with pkgs; rec {

    erlEnv = pkgs.myEnvFun {
        name = "erlEnv";
        buildInputs = [
            stdenv automake autoconf erlang git rebar openssl
           ];
        extraCmds = ''
             for i in $nativeBuildInputs; do
               LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$i/lib
          LD_RUN_PATH=\$LD_RUN_PATH:\$i/lib
          done
            export LD_LIBRARY_PATH
       export LD_RUN_PATH
       export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt;
           '';
    };
  };
}

Here is an echo of my $LD_LIBRARY_PATH:

erlEnv:[stewart at rivergod:~] $ echo $LD_LIBRARY_PATH
/run/opengl-driver/lib:/run/opengl-driver-32/lib:/nix/store/2xppxfdg15ra07izp3ww1ddqfywiwf05-stdenv/lib:/nix/store/hqzvkxgg1v9fy6n2a3n5pra1kkh3974f-automake-1.12.6/lib:/nix/store/kslbs5n87i6hlf4a33h7w6fcp2ydv81d-autoconf-2.69/lib:/nix/store/imdrzz8rysdf3c3jsk508zwrxg8cnyal-erlang-17.3/lib:/nix/store/gd0pm9jvvm86xas53r66knlnx4rras6z-git-2.1.3/lib:/nix/store/0kym9svdxa9d501z4dbnc6ajr5gvmsxc-rebar-2.5.1/lib:/nix/store/79r6ys4r2nfv1d5h6ryc1gwc8j25r86w-openssl-1.0.1j/lib

I can run OpenSSL:
erlEnv:[stewart at rivergod:~]$ openssl
OpenSSL >

but I can't compile a project with an OpenSSL dependency:

erlEnv:[stewart at rivergod:~/ejabberd]$ make
....
checking for erl...
/nix/store/imdrzz8rysdf3c3jsk508zwrxg8cnyal-erlang-17.3/lib/erlang/erts-6.2/bin/erl
checking for erlc...
/nix/store/imdrzz8rysdf3c3jsk508zwrxg8cnyal-erlang-17.3/lib/erlang/erts-6.2/bin/erlc
checking for SSL_free in -lssl... no
checking for SHA1_Init in -lcrypto... no
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
checking openssl/err.h usability... no
checking openssl/err.h presence... no
checking for openssl/err.h... no
checking openssl/sha.h usability... no
checking openssl/sha.h presence... no
checking for openssl/sha.h... no
configure: error: OpenSSL 'ssl' library was not found
ERROR: Command ['get-deps'] failed!
make: *** [deps/.got] Error 1

If someone could be so kind as to tell me the correct way of including
libraries into one's environment.

Kind regards
Stewart


More information about the nix-dev mailing list