about summary refs log tree commit diff
path: root/third_party/nix
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-10-25T14·39-0400
committerVincent Ambo <tazjin@google.com>2020-05-17T14·56+0100
commit4b50bd28a05b5c6eb05365b3dd3d5fd6739dbb83 (patch)
tree5453b546aca87c6887877b847af08627d690acd3 /third_party/nix
parentd64f60c733980fb18437f41e1bc791a5d1ccb536 (diff)
feat(3p/nix): meson: Don't look for libraries in lib dir r/731
1. First of all, this doesn't work in nixpkgs. Per [1], gcc ignores `-L`
   for purposes of `--print-file-dirs`, which breaks horribly on linux. But
   if we don't pass extra dirs, meosn first just tries `-l...`, which does
   work.

2. Even if it did work, `libdir` means where we are installing libs, not
   where libs are expected to be found. Those are not necessarily the
   same (again, nixpkgs), and even when they are and non-standard, it is
   better to use DESTDIR or have a modified toolchain.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87758

(cherry picked from commit a142164e746644e20f66908c156ca913bef4664f)
Diffstat (limited to 'third_party/nix')
-rw-r--r--third_party/nix/meson.build20
1 files changed, 10 insertions, 10 deletions
diff --git a/third_party/nix/meson.build b/third_party/nix/meson.build
index abfed14cd9c9..a0543d202e01 100644
--- a/third_party/nix/meson.build
+++ b/third_party/nix/meson.build
@@ -348,8 +348,8 @@ tar = find_program('tar', required : true)
 bzip2 = find_program('bzip2', required : true)
 gzip = find_program('gzip', required : true)
 xz = find_program('xz', required : true)
-dot = find_program('dot', required : true)
-lsof = find_program('lsof', required : true)
+dot = find_program('dot', required : false)
+lsof = find_program('lsof', required : false)
 tr = find_program('tr', required : true)
 coreutils = run_command('dirname', cat.path()).stdout().strip()
 
@@ -379,9 +379,9 @@ description : 'Whether link() works on symlinks')
 #--------------------------------------------------
 boost_dep = declare_dependency(
     dependencies : [
-        cpp.find_library('libboost_system', dirs : libdir),
-        cpp.find_library('libboost_context', dirs : libdir),
-        cpp.find_library('libboost_thread', dirs : libdir)],
+        cpp.find_library('boost_system'),
+        cpp.find_library('boost_context'),
+        cpp.find_library('boost_thread')],
     link_args :  get_option('boost_link_args'))
 
 if (boost_dep.found())
@@ -408,7 +408,7 @@ libbrotli_dep = declare_dependency(
 # Look for OpenSSL, a required dependency.
 #--------------------------------------------------
 openssl_dep = declare_dependency(
-    dependencies: cpp.find_library('libssl', dirs : libdir),
+    dependencies: cpp.find_library('ssl'),
     link_args :  get_option('openssl_link_args'))
 
 
@@ -436,14 +436,14 @@ pthread_dep = declare_dependency(
 # Look for libdl, a required dependency.
 #--------------------------------------------------
 libdl_dep = declare_dependency(
-    dependencies : cpp.find_library('dl', dirs : libdir),
+    dependencies : cpp.find_library('dl'),
     link_args :  get_option('dl_link_args'))
 
 
 # Look for libbz2, a required dependency.
 #--------------------------------------------------
 libbz2_dep = declare_dependency(
-    dependencies : cpp.find_library('bz2', dirs : libdir),
+    dependencies : cpp.find_library('bz2'),
     link_args :  get_option('bz2_link_args'))
 
 
@@ -455,7 +455,7 @@ libbz2_dep = declare_dependency(
 # editline.h when the pkg-config approach fails.
 
 editline_dep = declare_dependency(
-    dependencies : cpp.find_library('libeditline'),
+    dependencies : cpp.find_library('editline'),
     link_args :  get_option('editline_link_args'))
 
 if not (
@@ -478,7 +478,7 @@ endif
 #--------------------------------------------------
 if (get_option('with_libsodium'))
     libsodium_dep = declare_dependency(
-        dependencies : cpp.find_library('libsodium', dirs : libdir),
+        dependencies : cpp.find_library('sodium'),
         link_args :  get_option('sodium_link_args'))
     config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
 else