about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-17T19·45+0100
committerVincent Ambo <tazjin@google.com>2020-05-17T19·45+0100
commit9d865dbb1fed8da4ff471379f803814521298d16 (patch)
tree88dd9f0d9124f25c1247e4d12233e88aebb25b39
parentaa54512ee2fddb0ef0083e8845873363cbe5b50b (diff)
chore(3p/nix): Remove symlink setup from Meson build r/744
This belongs in the derivation itself, IMO.
-rw-r--r--third_party/nix/meson.build22
-rw-r--r--third_party/nix/src/nix/meson.build75
2 files changed, 11 insertions, 86 deletions
diff --git a/third_party/nix/meson.build b/third_party/nix/meson.build
index afa0f3255d51..3f9cfb3d58d8 100644
--- a/third_party/nix/meson.build
+++ b/third_party/nix/meson.build
@@ -13,7 +13,7 @@
 project(
     'nix',
     'cpp',
-    
+
     default_options : [
         'cpp_std=c++17',
         'warning_level=3',
@@ -24,7 +24,7 @@ project(
     license : 'MIT'
 )
 
-# init compiler 
+# init compiler
 #-------------------------------------------------
 cpp = meson.get_compiler('cpp')
 
@@ -116,7 +116,7 @@ sys_name = host_machine.system().to_lower()
 
 cpu_archs = ['x86_64', 'armv6', 'armv7', '']
 
-foreach cpu : cpu_archs 
+foreach cpu : cpu_archs
     if (host_machine.cpu().contains(cpu))
         if cpu.contains('armv')
             machine_name = cpu + '1'
@@ -363,11 +363,11 @@ else
 fi
 '''
 
-run_command('sh', '-c', 'rm tmp_link*') 
+run_command('sh', '-c', 'rm tmp_link*')
 can_link_symlink = run_command('sh', '-c', gen_header).stdout().strip()
 if can_link_symlink.to_int() == 1
     run_command('sh', '-c', 'rm tmp_link*')
-endif 
+endif
 
 config_h.set('CAN_LINK_SYMLINK', can_link_symlink,
 description : 'Whether link() works on symlinks')
@@ -447,7 +447,7 @@ libbz2_dep = declare_dependency(
 
 # Look for editline, a required dependency.
 #--------------------------------------------------
-# NOTE: The the libeditline.pc file was added only in libeditline >= 1.15.2, see 
+# NOTE: The the libeditline.pc file was added only in libeditline >= 1.15.2, see
 # https://github.com/troglobit/editline/commit/0a8f2ef4203c3a4a4726b9dd1336869cd0da8607,
 # but e.g. Ubuntu 16.04 has an older version, so we fall back to searching for
 # editline.h when the pkg-config approach fails.
@@ -503,12 +503,12 @@ endif
 #--------------------------------------------------
 if (get_option('with_s3'))
   enable_s3 = meson.get_compiler('cpp').check_header('aws/s3/S3Client.h')
-  
+
   aws_version = meson.get_compiler('cpp').get_define(
     'AWS_SDK_VERSION_STRING',
     prefix : '#include <aws/core/VersionConfig.h>'
   ).strip('"').split('.')
-  
+
   conf_data.set('ENABLE_S3', 1, description : 'Whether to enable S3 support via aws-sdk-cpp.')
   conf_data.set('AWS_VERSION_MAJOR', aws_version[0], description : 'Major version of aws-sdk-cpp.')
   conf_data.set('AWS_VERSION_MINOR', aws_version[1], description : 'Minor version of aws-sdk-cpp.')
@@ -517,7 +517,7 @@ endif
 
 
 
-# OS Specific checks 
+# OS Specific checks
 #============================================================================
 # Look for libsecppomp, required for Linux sandboxing.
 if sys_name.contains('linux')
@@ -534,11 +534,11 @@ endif
 
 if (sys_name.contains('freebsd'))
     add_project_arguments('-D_GNU_SOURCE', language : 'cpp')
-    config_h.set('_GNU_SOURCE', 1)  
+    config_h.set('_GNU_SOURCE', 1)
 endif
 
 if (sys_name.contains('sunos'))
-    # Solaris requires -lsocket -lnsl for network functions 
+    # Solaris requires -lsocket -lnsl for network functions
 endif
 
 
diff --git a/third_party/nix/src/nix/meson.build b/third_party/nix/src/nix/meson.build
index be7ccb1a28a9..2ccda218d605 100644
--- a/third_party/nix/src/nix/meson.build
+++ b/third_party/nix/src/nix/meson.build
@@ -1,12 +1,3 @@
-# Nix exec build file
-#============================================================================
-
-
-
-
-# src files
-#============================================================================
-
 src_inc += include_directories('.')
 
 nix_src = files(
@@ -53,20 +44,6 @@ nix_src = files(
     join_paths(meson.source_root(), 'src/nix-store/graphml.cc'),
     join_paths(meson.source_root(), 'src/nix-store/nix-store.cc'))
 
-nix_ln_src = [
-    [ bindir, 'nix-build' ],
-    [ bindir, 'nix-channel' ],
-    [ bindir, 'nix-collect-garbage' ],
-    [ bindir, 'nix-copy-closure' ],
-    [ bindir, 'nix-daemon' ],
-    [ bindir, 'nix-env' ],
-    [ bindir, 'nix-hash' ],
-    [ bindir, 'nix-instantiate' ],
-    [ bindir, 'nix-prefetch-url' ],
-    [ bindir, 'nix-shell' ],
-    [ bindir, 'nix-store' ],
-    [ join_paths(libexecdir, 'nix'), 'build-remote' ]]
-
 nix_headers = files (
     join_paths(meson.source_root(), 'src/nix/command.hh'),
     join_paths(meson.source_root(), 'src/nix/legacy.hh'),
@@ -75,9 +52,6 @@ nix_headers = files (
     join_paths(meson.source_root(), 'src/nix-store/dotgraph.hh'),
     join_paths(meson.source_root(), 'src/nix-store/graphml.hh'))
 
-# dependancies
-#============================================================================
-
 nix_dep_list = [
     pthread_dep,
     libdl_dep,
@@ -85,13 +59,6 @@ nix_dep_list = [
     editline_dep,
     libsodium_dep]
 
-
-
-
-
-# Link args
-#============================================================================
-
 nix_link_list = [
     libutil_lib,
     libstore_lib,
@@ -99,28 +66,6 @@ nix_link_list = [
     libexpr_lib
 ]
 
-nix_link_args = []
-
-
-
-
-# compiler args
-#============================================================================
-
-nix_cxx_args = []
-
-
-
-
-# targets
-#============================================================================
-
-
-
-
-# build
-#============================================================================
-
 nix_bin = executable(
     'nix',
     install : true,
@@ -130,23 +75,3 @@ nix_bin = executable(
     sources : nix_src,
     link_with : nix_link_list,
     dependencies : nix_dep_list)
-
-
-# meson does not yet support installing symlink files.
-# this is a simple workaround
-foreach name : nix_ln_src
-    meson.add_install_script(
-        'ln',
-        '-sf',
-        join_paths(bindir, 'nix'),
-        name[1])
-    meson.add_install_script(
-        'cp',
-        '-r',
-        name[1],
-        join_paths(name[0], name[1]))   
-endforeach
-
-install_headers(
-    nix_headers,
-    install_dir : join_paths(includedir, 'nix'))