chore(3p/nix): Remove meson build files for core packages

This commit is contained in:
Vincent Ambo 2020-05-27 22:00:00 +01:00
parent abe5df74a8
commit 3d7537da7f
7 changed files with 0 additions and 1188 deletions

View file

@ -1,581 +0,0 @@
project(
'nix',
'cpp',
default_options : [
'cpp_std=c++17',
'warning_level=3',
'optimization=3',
'debug=true'
],
version : run_command('cat', './.version').stdout().strip(),
license : 'MIT'
)
# init compiler
cpp = meson.get_compiler('cpp')
add_project_arguments(get_option('cxxflags'), language : 'cpp')
add_project_link_arguments(get_option('ldflags'), language: 'cpp')
pkg = import('pkgconfig')
cmake = import('cmake')
config_h = configuration_data()
config_h.set(
'HAVE_CXX17', 1,
description : 'Define if the compiler supports basic C++17 syntax')
package_name = meson.project_name()
config_h.set_quoted(
'PACKAGE_NAME', package_name,
description : 'Define to the full name of this package.'
)
package_tarname = meson.project_name()
config_h.set_quoted(
'PACKAGE_TARNAME', package_tarname,
description : 'Define to the one symbol short name of this package.')
package_version = meson.project_version()
config_h.set_quoted(
'PACKAGE_VERSION', package_version,
description : 'Define to the version of this package.')
package_string = '@0@ @1@'.format(package_name, package_version)
config_h.set_quoted(
'PACKAGE_STRING', package_string,
description : 'Define to the full name and version of this package.')
package_url = 'https://nixos.org/nix/'
config_h.set_quoted(
'PACKAGE_URL', package_url,
description : 'Define to the home page for this package.')
package_bug_url = 'https://github.com/nixos/nix/issues'
config_h.set_quoted(
'PACKAGE_BUGREPORT', package_bug_url,
description : 'Define to the address where bug reports for this package should be sent.')
# env
# set install directories
#-------------------------------------------------
prefix = get_option('prefix')
libdir = join_paths(prefix, get_option('libdir'))
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
mandir = join_paths(prefix, get_option('mandir'))
includedir = join_paths(prefix, get_option('includedir'))
# set nix directories
# State should be stored in /nix/var, unless the user overrides it explicitly.
if get_option('normal_var')
localstatedir = '/nix/var'
else
localstatedir = join_paths(prefix, get_option('localstatedir'))
endif
nixstoredir = get_option('nixstoredir')
profiledir = join_paths(sysconfdir, 'profile.d')
# Construct a Nix system name (like "i686-linux").
#-------------------------------------------------
machine_name = host_machine.cpu()
sys_name = host_machine.system().to_lower()
cpu_archs = ['x86_64', 'armv6', 'armv7', '']
foreach cpu : cpu_archs
if (host_machine.cpu().contains(cpu))
if cpu.contains('armv')
machine_name = cpu + '1'
else
machine_name = cpu
endif
break
endif
endforeach
system= '"' + machine_name + '-' + sys_name + '"'
message('system name: ' + system)
config_h.set(
'SYSTEM', system,
description : 'platform identifier (`cpu-os`)')
# checking headers
#============================================================================
if (cpp.has_header('sys/stat.h'))
config_h.set(
'HAVE_SYS_STAT_H', 1,
description : 'Define to 1 if you have the <sys/stat.h> header file.')
endif
if (cpp.has_header('sys/types.h'))
config_h.set(
'HAVE_SYS_TYPES_H', 1,
description : 'Define to 1 if you have the <sys/types.h> header file.')
endif
if (cpp.has_header('sys/dir.h'))
config_h.set(
'HAVE_DIR_H', 1,
description : 'Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR`')
endif
if (cpp.has_header('sys/ndir.h'))
config_h.set(
'HAVE_NDIR_H', 1,
description : 'Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR`')
endif
has_dirent_h = cpp.has_header('dirent.h')
if (has_dirent_h)
config_h.set(
'HAVE_DIRENT_H', 1,
description : 'Define to 1 if you have the <dirent.h> header file, and it defines `DIR`')
endif
if (cpp.has_header('locale.h'))
config_h.set(
'HAVE_LOCALE', 1,
description : 'Define to 1 if you have the <locale.h> header file.')
endif
if (cpp.has_header('unistd.h'))
config_h.set(
'HAVE_UNISTD_H', 1,
description: 'Define to 1 if you have the <unistd.h> header file.')
endif
if (cpp.has_header('stdint.h'))
config_h.set(
'HAVE_STDINT_H', 1,
description: 'Define to 1 if you have the <stdint.h> header file.')
endif
if (cpp.has_header('stdlib.h'))
config_h.set(
'HAVE_STDLIB_H', 1,
description: 'Define to 1 if you have the <stdlib.h> header file.')
endif
if (cpp.has_header('strings.h'))
config_h.set(
'HAVE_STRINGS_H', 1,
description: 'Define to 1 if you have the <strings.h> header file.')
endif
if (cpp.has_header('string.h'))
config_h.set(
'HAVE_STRING_H', 1,
description: 'Define to 1 if you have the <strings.h> header file.')
endif
if (cpp.has_header('bzlib.h'))
config_h.set(
'HAVE_BZLIB_H', 1,
description : 'Define to 1 if you have the <bzlib.h> header file.')
endif
if (cpp.has_header('inttypes.h'))
config_h.set(
'HAVE_INTTYPES_H', 1,
description : 'Define to 1 if you have the <inttypes.h> header file.')
endif
if (cpp.has_header('memory.h'))
config_h.set(
'HAVE_MEMORY_H', 1,
description : 'Define to 1 if you have the <memory.h> header file.')
endif
if (cpp.has_header('editline.h'))
config_h.set(
'HAVE_EDITLINE_H', 1,
description : 'Define to 1 if you have the <editline.h> header file.')
else
error('Nix requires editline.h; however the header was not found.')
endif
# checking functions
#============================================================================
if (cpp.has_function('lutimes'))
config_h.set(
'HAVE_LUTIMES', 1,
description : 'Define to 1 if you have the `lutimes` function.')
endif
if (cpp.has_function('lchown'))
config_h.set(
'HAVE_LCHOWN', 1,
description : 'Define to 1 if you have the `lchown` function.')
endif
if (cpp.has_function('pipe2'))
config_h.set(
'HAVE_PIPE2', 1,
description : 'Define to 1 if you have the `pipe2` function.')
endif
if (cpp.has_function('posix_fallocate'))
config_h.set(
'HAVE_POSIX_FALLOCATE', 1,
description : 'Define to 1 if you have the `posix_fallocate` function.')
endif
if (cpp.has_function('setresuid'))
config_h.set(
'HAVE_SETRESUID', 1,
description : 'Define to 1 if you have the `setresuid` function.')
endif
if (cpp.has_function('setreuid'))
config_h.set(
'HAVE_SETREUID', 1,
description : 'Define to 1 if you have the `setreuid` function.')
endif
if (cpp.has_function('statvfs'))
config_h.set(
'HAVE_STATVFS', 1,
description : 'Define to 1 if you have the `statvfs` function.')
endif
if (cpp.has_function('strsignal'))
config_h.set(
'HAVE_STRSIGNAL', 1,
description : 'Define to 1 if you have the `strsignal` function.')
endif
if (cpp.has_function('sysconf'))
config_h.set(
'HAVE_SYSCONF', 1,
description : 'Define to 1 if you have the `sysconf` function.')
endif
pubsetbuff_c = '''
#include <iostream>
using namespace std;
static char buf[1024];
void func() {
cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));
}'''
if meson.get_compiler('cpp').compiles(
pubsetbuff_c,
name : 'pubsetbuf'
)
config_h.set(
'HAVE_PUBSETBUF', 1,
description : 'Define to 1 if you have the `pubsetbuf` function.')
endif
# checking data types
#============================================================================
dirent_h_prefix = '''
#include <sys/types.h>
#include <dirent.h>
'''
if has_dirent_h and meson.get_compiler('cpp').has_member('struct dirent', 'd_type', prefix: dirent_h_prefix)
config_h.set('HAVE_STRUCT_DIRENT_D_TYPE', 1)
endif
# required dependancies
#============================================================================
# look for required programs
#--------------------------------------------------
cat = find_program('cat', required : true)
ln = find_program('ln', required : true)
cp = find_program('cp', required : true)
rm = find_program('rm', required : true)
bash = find_program('bash', required : true)
echo = find_program('echo', required : true)
patch = find_program('patch', required : true)
xmllint = find_program('xmllint', required : true)
flex = find_program('flex', required : true)
bison = find_program('bison', required : true)
sed = find_program('sed', required : true)
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 : false)
lsof = find_program('lsof', required : false)
tr = find_program('tr', required : true)
coreutils = run_command('dirname', cat.path()).stdout().strip()
# Check whether the store optimiser can optimise symlinks.
#-------------------------------------------------
gen_header = '''
ln -s bla tmp_link
if ln tmp_link tmp_link2 2> /dev/null; then
echo 1
else
echo 0
fi
'''
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
config_h.set('CAN_LINK_SYMLINK', can_link_symlink,
description : 'Whether link() works on symlinks')
# Import the Abseil cmake project from the (symlinked) depot sources.
absl = cmake.subproject('abseil_cpp')
# Bundle all relevant Abseil libraries. Meson is not able to resolve
# the internal dependencies of Abseil, and reconstructing them is more
# work than I am willing to invest at the moment.
absl_deps = [
absl.dependency('algorithm_container'),
absl.dependency('base'),
absl.dependency('bits'),
absl.dependency('btree'),
absl.dependency('city'),
absl.dependency('config'),
absl.dependency('container_common'),
absl.dependency('container_memory'),
absl.dependency('core_headers'),
absl.dependency('debugging_internal'),
absl.dependency('demangle_internal'),
absl.dependency('dynamic_annotations'),
absl.dependency('endian'),
absl.dependency('fixed_array'),
absl.dependency('graphcycles_internal'),
absl.dependency('hash'),
absl.dependency('hash_function_defaults'),
absl.dependency('hashtablez_sampler'),
absl.dependency('int128'),
absl.dependency('malloc_internal'),
absl.dependency('memory'),
absl.dependency('meta'),
absl.dependency('node_hash_policy'),
absl.dependency('node_hash_set'),
absl.dependency('optional'),
absl.dependency('raw_hash_set'),
absl.dependency('raw_logging_internal'),
absl.dependency('spinlock_wait'),
absl.dependency('stacktrace'),
absl.dependency('strings'),
absl.dependency('strings_internal'),
absl.dependency('symbolize'),
absl.dependency('synchronization'),
absl.dependency('throw_delegate'),
absl.dependency('time'),
absl.dependency('time_zone'),
absl.dependency('type_traits'),
absl.dependency('utility'),
absl.dependency('variant'),
]
# Look for boost, a required dependency.
#--------------------------------------------------
boost_dep = declare_dependency(
dependencies : [
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())
config_h.set('HAVE_BOOST', 1, description : 'Define if the Boost library is available.')
endif
# Look for liblzma, a required dependency.
#--------------------------------------------------
liblzma_dep = declare_dependency(
dependencies: dependency('liblzma'),
link_args : get_option('lzma_link_args'))
# Look for libbrotli{enc,dec}.
#--------------------------------------------------
libbrotli_dep = declare_dependency(
dependencies: [
dependency('libbrotlienc'),
dependency('libbrotlidec')],
link_args : get_option('brotli_link_args'))
# Look for OpenSSL, a required dependency.
#--------------------------------------------------
openssl_dep = declare_dependency(
dependencies: cpp.find_library('ssl'),
link_args : get_option('openssl_link_args'))
# Look for SQLite, a required dependency.
#--------------------------------------------------
sqlite3_dep = declare_dependency(
dependencies : dependency('sqlite3', version : '>= 3.6.19'),
link_args : get_option('sqlite3_link_args'))
# Look for libcurl, a required dependency.
#--------------------------------------------------
libcurl_dep = declare_dependency(
dependencies : dependency('libcurl'),
link_args : get_option('curl_link_args'))
# Look for pthread, a required dependency.
#--------------------------------------------------
pthread_dep = declare_dependency(
dependencies : dependency('threads'),
link_args : get_option('pthread_link_args'))
# Look for libdl, a required dependency.
#--------------------------------------------------
libdl_dep = declare_dependency(
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'),
link_args : get_option('bz2_link_args'))
# Look for glog, a required dependency.
#--------------------------------------
glog_dep = declare_dependency(
dependencies : cpp.find_library('glog'),
link_args : get_option('glog_link_args'))
# Look for editline, a required dependency.
#--------------------------------------------------
# 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.
editline_dep = declare_dependency(
dependencies : cpp.find_library('editline'),
link_args : get_option('editline_link_args'))
if not (
cpp.has_function(
'read_history',
prefix : '#include <stdio.h>\n#include "editline.h"',
args : '-lreadline'))
warning('Nix requires libeditline; However, required functions do not work. Maybe ' +\
'it is too old? >= 1.14 is required.')
endif
# Look for libsodium, an optional dependency.
#--------------------------------------------------
libsodium_lib = cpp.find_library('sodium', required: get_option('with_libsodium'))
if (libsodium_lib.found())
libsodium_dep = declare_dependency(
dependencies : libsodium_lib,
link_args : get_option('sodium_link_args'))
config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
else
libsodium_dep = dependency('', required: false)
endif
# Look for Boehm garbage collector, a required dependency.
# TODO(tazjin): Remove option to disable GC
gc_dep = declare_dependency(
dependencies : dependency('bdw-gc'),
link_args : get_option('gc_link_args'))
config_h.set(
'HAVE_BOEHMGC', 1,
description : 'Whether to use the Boehm garbage collector.')
# Look for aws-cpp-sdk-s3.
#--------------------------------------------------
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.')
endif
# OS Specific checks
#============================================================================
# Look for libsecppomp, required for Linux sandboxing.
if sys_name.contains('linux')
libseccomp_dep = dependency(
'libseccomp',
version : '>= 2.3.1',
not_found_message : 'Nix requires libseccomp on a linux host system')
config_h.set(
'HAVE_SECCOMP', 1,
description : 'Whether seccomp is available and should be used for sandboxing.')
else
libseccomp_dep = dependency('', required: false)
endif
if (sys_name.contains('freebsd'))
add_project_arguments('-D_GNU_SOURCE', language : 'cpp')
config_h.set('_GNU_SOURCE', 1)
endif
if (sys_name.contains('sunos'))
# Solaris requires -lsocket -lnsl for network functions
endif
# build
#============================================================================
conf = configure_file(
output : 'config.h',
configuration : config_h)
install_headers(
conf,
install_dir : join_paths(includedir, 'nix'))
add_project_arguments('-include', 'config.h', language : 'cpp')
src_inc = [include_directories('.', 'src')]
project_dirs = [
'src',
'scripts',
'corepkgs',
'misc',
'doc',
'tests'
]
foreach dir : project_dirs
subdir(dir)
endforeach

View file

@ -1,202 +0,0 @@
# Nix project build options
#============================================================================
# dirs
#============================================================================
option(
'nixstoredir',
type : 'string',
value : '/nix/store',
description : 'path of the Nix store (defaults to /nix/store)')
# compiler args
#============================================================================
option(
'ldflags',
type : 'array',
value : [
'-L/usr/local/lib',
'-L/usr/lib',
'-L/lib'],
description : 'Link flags')
option(
'cxxflags',
type : 'array',
value : [
'-Wdeprecated',
'-Wno-non-virtual-dtor',
'-Wno-unused-parameter'],
description : 'C build flags')
# link args
#============================================================================
option(
'boost_link_args',
type : 'array',
value : [
'-L/usr/lib64',
'-lboost_system',
'-lboost_context',
'-lboost_thread'],
description : 'link args for boost')
option(
'brotli_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lbrotlienc',
'-lbrotlidec'],
description : 'link args for libbrotli')
option(
'bz2_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lbz2'],
description : 'link args for libbz2')
option(
'curl_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lcurl'],
description : 'link args for libcurl')
option(
'dl_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-ldl'],
description : 'link args for libdl')
option(
'editline_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-leditline'],
description : 'link args for editline_link_args')
option(
'lzma_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-llzma'],
description : 'link args for liblzma')
option(
'openssl_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lcrypto'],
description : 'link args for openssl')
option(
'pthread_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-pthread'],
description : 'link args for pthread')
option(
'sodium_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lsodium'],
description : 'link args for libsodium')
option(
'sqlite3_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lsqlite3'],
description : 'link args for sqlite3')
option(
'gc_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lgc'],
description : 'link args for boehm garbage collector')
option(
'glog_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lglog'],
description : 'link args for glog')
# optional dependancies
#============================================================================
option(
'with_gc',
type : 'boolean',
value : 'false',
description : 'Build nix with Boehm garbage collector')
option(
'with_libsodium',
type : 'feature',
value : 'auto',
description : 'Build nix with libsodium')
option(
'with_s3',
type : 'boolean',
value : 'false',
description : 'Build nix with s3')
option(
'with_coreutils_bin',
type : 'string',
description : 'path of cat, mkdir, etc.')
# misc
#============================================================================
option(
'disable_doc_gen',
type : 'boolean',
value : 'false',
description : 'disable documentation generation')
option(
'build_shared_libs',
type : 'boolean',
value : 'false',
description : 'Build nix with shared libs')
option(
'sandbox_shell',
type : 'string',
value : '/usr/bin/busybox',
description : 'path of a statically-linked shell to use as /bin/sh in sandboxes')
option(
'normal_var',
type : 'boolean',
value : 'true',
description : 'Whether to use `/nix/var` or the user-overridable `localstatedir`.')

View file

@ -1,97 +0,0 @@
src_inc += include_directories('.', 'primops')
libexpr_src = files(
join_paths(meson.source_root(), 'src/libexpr/primops/context.cc'),
join_paths(meson.source_root(), 'src/libexpr/primops/fetchGit.cc'),
join_paths(meson.source_root(), 'src/libexpr/primops/fetchMercurial.cc'),
join_paths(meson.source_root(), 'src/libexpr/primops/fromTOML.cc'),
join_paths(meson.source_root(), 'src/libexpr/attr-path.cc'),
join_paths(meson.source_root(), 'src/libexpr/attr-set.cc'),
join_paths(meson.source_root(), 'src/libexpr/common-eval-args.cc'),
join_paths(meson.source_root(), 'src/libexpr/eval.cc'),
join_paths(meson.source_root(), 'src/libexpr/function-trace.cc'),
join_paths(meson.source_root(), 'src/libexpr/get-drvs.cc'),
join_paths(meson.source_root(), 'src/libexpr/json-to-value.cc'),
join_paths(meson.source_root(), 'src/libexpr/names.cc'),
join_paths(meson.source_root(), 'src/libexpr/nixexpr.cc'),
join_paths(meson.source_root(), 'src/libexpr/primops.cc'),
join_paths(meson.source_root(), 'src/libexpr/symbol-table.cc'),
join_paths(meson.source_root(), 'src/libexpr/value-to-json.cc'),
join_paths(meson.source_root(), 'src/libexpr/value-to-xml.cc'),
)
libexpr_headers = files(
join_paths(meson.source_root(), 'src/libexpr/attr-path.hh'),
join_paths(meson.source_root(), 'src/libexpr/attr-set.hh'),
join_paths(meson.source_root(), 'src/libexpr/common-eval-args.hh'),
join_paths(meson.source_root(), 'src/libexpr/eval.hh'),
join_paths(meson.source_root(), 'src/libexpr/eval-inline.hh'),
join_paths(meson.source_root(), 'src/libexpr/function-trace.hh'),
join_paths(meson.source_root(), 'src/libexpr/get-drvs.hh'),
join_paths(meson.source_root(), 'src/libexpr/json-to-value.hh'),
join_paths(meson.source_root(), 'src/libexpr/names.hh'),
join_paths(meson.source_root(), 'src/libexpr/nixexpr.hh'),
join_paths(meson.source_root(), 'src/libexpr/primops.hh'),
join_paths(meson.source_root(), 'src/libexpr/symbol-table.hh'),
join_paths(meson.source_root(), 'src/libexpr/value.hh'),
join_paths(meson.source_root(), 'src/libexpr/value-to-json.hh'),
join_paths(meson.source_root(), 'src/libexpr/value-to-xml.hh'))
libexpr_dep_list = [
gc_dep,
glog_dep,
libdl_dep,
libsodium_dep,
] + absl_deps
libexpr_link_list = [
libutil_lib,
libstore_lib,
libmain_lib,
]
libexpr_link_args = [
'-lpthread',
'-lgccpp',
]
libexpr_cxx_args = []
libexpr_src += custom_target(
'parser_tab.[cchh]',
output : [
'parser-tab.cc',
'parser-tab.hh'],
input : 'parser.y',
command : [
bison,
'-v',
'--output=@OUTPUT0@',
'@INPUT@',
'-d'])
libexpr_src += custom_target(
'lexer_tab.[cchh]',
output : ['lexer-tab.cc', 'lexer-tab.hh'],
input : 'lexer.l',
command : [
flex,
'--outfile=@OUTPUT0@',
'--header-file=@OUTPUT1@',
'@INPUT@'])
libexpr_lib = library(
'nixexpr',
install : true,
install_mode : 'rwxr-xr-x',
install_dir : libdir,
include_directories : src_inc,
link_with : libexpr_link_list,
sources : libexpr_src,
link_args : libexpr_link_args,
dependencies : libexpr_dep_list)
install_headers(
libexpr_headers,
install_dir : join_paths(includedir, 'nix'))

View file

@ -1,40 +0,0 @@
src_inc += include_directories('.')
libmain_src = files(
join_paths(meson.source_root(), 'src/libmain/common-args.cc'),
join_paths(meson.source_root(), 'src/libmain/shared.cc'),
join_paths(meson.source_root(), 'src/libmain/stack.cc'))
libmain_headers = files(
join_paths(meson.source_root(), 'src/libmain/common-args.hh'),
join_paths(meson.source_root(), 'src/libmain/shared.hh'))
libmain_dep_list = [
glog_dep,
pthread_dep,
openssl_dep,
libsodium_dep,
]
libmain_link_list = [
libutil_lib,
libstore_lib,
]
libmain_link_args = []
libstore_cxx_args = []
libmain_lib = library(
'nixmain',
install : true,
install_mode : 'rwxr-xr-x',
install_dir : libdir,
include_directories : src_inc,
link_with : libmain_link_list,
sources : libmain_src,
link_args : libmain_link_args,
dependencies : libmain_dep_list)
install_headers(
libmain_headers,
install_dir : join_paths(includedir, 'nix'))

View file

@ -1,153 +0,0 @@
# Nix lib store build file
#============================================================================
src_inc += include_directories('.')
libstore_src = files(
join_paths(meson.source_root(), 'src/libstore/binary-cache-store.cc'),
join_paths(meson.source_root(), 'src/libstore/build.cc'),
join_paths(meson.source_root(), 'src/libstore/crypto.cc'),
join_paths(meson.source_root(), 'src/libstore/derivations.cc'),
join_paths(meson.source_root(), 'src/libstore/download.cc'),
join_paths(meson.source_root(), 'src/libstore/export-import.cc'),
join_paths(meson.source_root(), 'src/libstore/gc.cc'),
join_paths(meson.source_root(), 'src/libstore/globals.cc'),
join_paths(meson.source_root(), 'src/libstore/http-binary-cache-store.cc'),
join_paths(meson.source_root(), 'src/libstore/legacy-ssh-store.cc'),
join_paths(meson.source_root(), 'src/libstore/local-binary-cache-store.cc'),
join_paths(meson.source_root(), 'src/libstore/local-fs-store.cc'),
join_paths(meson.source_root(), 'src/libstore/local-store.cc'),
join_paths(meson.source_root(), 'src/libstore/machines.cc'),
join_paths(meson.source_root(), 'src/libstore/misc.cc'),
join_paths(meson.source_root(), 'src/libstore/nar-accessor.cc'),
join_paths(meson.source_root(), 'src/libstore/nar-info.cc'),
join_paths(meson.source_root(), 'src/libstore/nar-info-disk-cache.cc'),
join_paths(meson.source_root(), 'src/libstore/optimise-store.cc'),
join_paths(meson.source_root(), 'src/libstore/parsed-derivations.cc'),
join_paths(meson.source_root(), 'src/libstore/pathlocks.cc'),
join_paths(meson.source_root(), 'src/libstore/profiles.cc'),
join_paths(meson.source_root(), 'src/libstore/references.cc'),
join_paths(meson.source_root(), 'src/libstore/remote-fs-accessor.cc'),
join_paths(meson.source_root(), 'src/libstore/remote-store.cc'),
join_paths(meson.source_root(), 'src/libstore/s3-binary-cache-store.cc'),
join_paths(meson.source_root(), 'src/libstore/sqlite.cc'),
join_paths(meson.source_root(), 'src/libstore/ssh.cc'),
join_paths(meson.source_root(), 'src/libstore/ssh-store.cc'),
join_paths(meson.source_root(), 'src/libstore/store-api.cc'),
join_paths(meson.source_root(), 'src/libstore/builtins/buildenv.cc'),
join_paths(meson.source_root(), 'src/libstore/builtins/fetchurl.cc'))
libstore_headers = files(
join_paths(meson.source_root(), 'src/libstore/binary-cache-store.hh'),
join_paths(meson.source_root(), 'src/libstore/builtins.hh'),
join_paths(meson.source_root(), 'src/libstore/crypto.hh'),
join_paths(meson.source_root(), 'src/libstore/derivations.hh'),
join_paths(meson.source_root(), 'src/libstore/download.hh'),
join_paths(meson.source_root(), 'src/libstore/fs-accessor.hh'),
join_paths(meson.source_root(), 'src/libstore/globals.hh'),
join_paths(meson.source_root(), 'src/libstore/local-store.hh'),
join_paths(meson.source_root(), 'src/libstore/machines.hh'),
join_paths(meson.source_root(), 'src/libstore/nar-accessor.hh'),
join_paths(meson.source_root(), 'src/libstore/nar-info-disk-cache.hh'),
join_paths(meson.source_root(), 'src/libstore/nar-info.hh'),
join_paths(meson.source_root(), 'src/libstore/parsed-derivations.hh'),
join_paths(meson.source_root(), 'src/libstore/pathlocks.hh'),
join_paths(meson.source_root(), 'src/libstore/profiles.hh'),
join_paths(meson.source_root(), 'src/libstore/references.hh'),
join_paths(meson.source_root(), 'src/libstore/remote-fs-accessor.hh'),
join_paths(meson.source_root(), 'src/libstore/remote-store.hh'),
join_paths(meson.source_root(), 'src/libstore/s3-binary-cache-store.hh'),
join_paths(meson.source_root(), 'src/libstore/s3.hh'),
join_paths(meson.source_root(), 'src/libstore/serve-protocol.hh'),
join_paths(meson.source_root(), 'src/libstore/sqlite.hh'),
join_paths(meson.source_root(), 'src/libstore/ssh.hh'),
join_paths(meson.source_root(), 'src/libstore/store-api.hh'),
join_paths(meson.source_root(), 'src/libstore/worker-protocol.hh'))
libstore_data = files(
join_paths(meson.source_root(), 'src/libstore/sandbox-defaults.sb'),
join_paths(meson.source_root(), 'src/libstore/sandbox-minimal.sb'),
join_paths(meson.source_root(), 'src/libstore/sandbox-network.sb'))
# dependancies
#============================================================================
libstore_dep_list = [
glog_dep,
libbz2_dep,
libcurl_dep,
libdl_dep,
pthread_dep,
sqlite3_dep,
libsodium_dep
] + absl_deps
if sys_name.contains('linux')
libstore_dep_list += libseccomp_dep
endif
if sys_name.contains('freebsd')
libstore_dep_list += libdl_dep
endif
# Link args
#============================================================================
libstore_link_list = [
libutil_lib]
libstore_link_args = []
# compiler args
#============================================================================
libstore_cxx_args = [
'-DNIX_PREFIX="@0@" '.format(prefix),
'-DNIX_STORE_DIR="@0@" '.format(nixstoredir),
'-DNIX_DATA_DIR="@0@" '.format(datadir),
'-DNIX_STATE_DIR="@0@" '.format(join_paths(localstatedir, 'nix')),
'-DNIX_LOG_DIR="@0@" '.format(join_paths(localstatedir, 'log/nix')),
'-DNIX_CONF_DIR="@0@" '.format(join_paths(sysconfdir, 'nix')),
'-DNIX_LIBEXEC_DIR="@0@" '.format(libexecdir),
'-DNIX_BIN_DIR="@0@" '.format(bindir),
'-DNIX_MAN_DIR="@0@" '.format(mandir),
'-DSANDBOX_SHELL="@0@" '.format(get_option('sandbox_shell')),
'-DLSOF="@0@" '.format(lsof)]
# targets
#============================================================================
gen_header = '''
echo 'R"foo(' >> "$1"
cat @INPUT@ >> "$1"
echo ')foo"' >> "$1"
'''
libstore_src += custom_target(
'schema.sql.gen.hh',
output : 'schema.sql.gen.hh',
input : 'schema.sql',
command : [bash, '-c', gen_header, 'sh', '@OUTPUT@'])
# build
#============================================================================
libstore_lib = library(
'nixstore',
install : true,
install_mode : 'rwxr-xr-x',
install_dir : libdir,
include_directories : src_inc,
link_with : libstore_link_list,
sources : libstore_src,
cpp_args : libstore_cxx_args,
link_args : libstore_link_args,
dependencies : libstore_dep_list)
install_headers(
libstore_headers,
install_dir : join_paths(includedir, 'nix'))
install_data(
libstore_data,
install_dir : join_paths(datadir, 'nix/sandbox'))

View file

@ -1,68 +0,0 @@
src_inc += include_directories('.')
libutil_src = files(
join_paths(meson.source_root(), 'src/libutil/affinity.cc'),
join_paths(meson.source_root(), 'src/libutil/archive.cc'),
join_paths(meson.source_root(), 'src/libutil/args.cc'),
join_paths(meson.source_root(), 'src/libutil/compression.cc'),
join_paths(meson.source_root(), 'src/libutil/config.cc'),
join_paths(meson.source_root(), 'src/libutil/hash.cc'),
join_paths(meson.source_root(), 'src/libutil/json.cc'),
join_paths(meson.source_root(), 'src/libutil/serialise.cc'),
join_paths(meson.source_root(), 'src/libutil/thread-pool.cc'),
join_paths(meson.source_root(), 'src/libutil/util.cc'),
join_paths(meson.source_root(), 'src/libutil/xml-writer.cc'),
)
libutil_headers = files(
join_paths(meson.source_root(), 'src/libutil/affinity.hh'),
join_paths(meson.source_root(), 'src/libutil/archive.hh'),
join_paths(meson.source_root(), 'src/libutil/args.hh'),
join_paths(meson.source_root(), 'src/libutil/compression.hh'),
join_paths(meson.source_root(), 'src/libutil/config.hh'),
join_paths(meson.source_root(), 'src/libutil/finally.hh'),
join_paths(meson.source_root(), 'src/libutil/hash.hh'),
join_paths(meson.source_root(), 'src/libutil/istringstream_nocopy.hh'),
join_paths(meson.source_root(), 'src/libutil/json.hh'),
join_paths(meson.source_root(), 'src/libutil/lazy.hh'),
join_paths(meson.source_root(), 'src/libutil/lru-cache.hh'),
join_paths(meson.source_root(), 'src/libutil/monitor-fd.hh'),
join_paths(meson.source_root(), 'src/libutil/pool.hh'),
join_paths(meson.source_root(), 'src/libutil/prefork-compat.hh'),
join_paths(meson.source_root(), 'src/libutil/ref.hh'),
join_paths(meson.source_root(), 'src/libutil/serialise.hh'),
join_paths(meson.source_root(), 'src/libutil/sync.hh'),
join_paths(meson.source_root(), 'src/libutil/thread-pool.hh'),
join_paths(meson.source_root(), 'src/libutil/types.hh'),
join_paths(meson.source_root(), 'src/libutil/util.hh'),
join_paths(meson.source_root(), 'src/libutil/xml-writer.hh'),
)
libutil_dep_list = [
glog_dep,
boost_dep,
libbz2_dep,
liblzma_dep,
libbrotli_dep,
openssl_dep,
pthread_dep,
libsodium_dep,
] + absl_deps
libutil_link_list = []
libutil_link_args = []
libutil_lib = library(
'nixutil',
install : true,
install_mode : 'rwxr-xr-x',
install_dir : libdir,
include_directories : src_inc,
sources : libutil_src,
link_args : libutil_link_args,
# cpp_args : [ '-E' ],
dependencies : libutil_dep_list)
install_headers(
libutil_headers,
install_dir : join_paths(includedir, 'nix'))

View file

@ -1,47 +0,0 @@
# nix src build file
#============================================================================
src_dirs = [
'libutil',
'libstore',
'libmain',
'libexpr',
'nix',
]
foreach dir : src_dirs
subdir(dir)
endforeach
libstore_config = pkg.generate(
libstore_lib,
libraries : [
libutil_lib],
version : meson.project_version(),
name : 'Nix',
subdirs : ['nix/'],
filebase : 'nix-store',
extra_cflags : '-std=c++17',
description : 'Nix Package Manager.')
libmain_config = pkg.generate(
libmain_lib,
version : meson.project_version(),
name : 'Nix',
subdirs : ['nix/'],
filebase : 'nix-main',
extra_cflags : '-std=c++17',
description : 'Nix Package Manager.')
libexpr_config = pkg.generate(
libexpr_lib,
libraries : [
libstore_lib],
version : meson.project_version(),
name : 'Nix',
subdirs : ['nix/'],
filebase : 'nix-expr',
extra_cflags : '-std=c++17',
description : 'Nix Package Manager.')