Skip to content

Commit a401adf

Browse files
author
polar
committed
added meson build
1 parent bbd9566 commit a401adf

File tree

106 files changed

+3539
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3539
-0
lines changed

bootstrap.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /usr/bin/env bash
2+
3+
export PKG_CONFIG_PATH="/usr/lib/pkgconfig/;/lib/pkgconfig/;/usr/share/pkgconfig/"
4+
5+
# Delete existing buildfiles
6+
#---------------------------------------------------
7+
rm -rf build
8+
9+
10+
# Call meson
11+
#---------------------------------------------------
12+
meson setup build -Dprefix="/usr"
13+
14+
15+
# Build nix
16+
#---------------------------------------------------
17+
cd build
18+
ninja

dependencies/archive/meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# LibArchive Dependency File
2+
#============================================================================
3+
4+
5+
# Look for libarchive, a required dependency
6+
#--------------------------------------------------
7+
libarchive_dep = cpp.find_library('archive')

dependencies/aws-sdk-cpp/meson.build

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# aws s3 Dependency File
2+
#============================================================================
3+
4+
#--------------------------------------------------
5+
# FIXME: aws-cpp-sdk should be an optional dependency Unfortunately, importing
6+
# it using the pkg-config option, which could be optional, fails because of
7+
# the cflags in the pkg-config. They contain "-fno-exceptions -std=c++11",
8+
# both of which break existing Nix code.
9+
#--------------------------------------------------
10+
11+
# Look for aws-cpp-sdk
12+
#--------------------------------------------------
13+
aws_sdk_cpp_core_dep = declare_dependency(
14+
dependencies : cpp.find_library('aws-cpp-sdk-core',
15+
dirs : get_option('aws_sdk_cpp_lib_dir')),
16+
include_directories : include_directories(
17+
get_option('aws_sdk_cpp_include_dir')))
18+
19+
aws_sdk_cpp_s3_dep = declare_dependency(
20+
dependencies : cpp.find_library('aws-cpp-sdk-s3',
21+
dirs : get_option('aws_sdk_cpp_lib_dir')),
22+
include_directories : include_directories(
23+
get_option('aws_sdk_cpp_include_dir')))
24+
25+
aws_sdk_cpp_transfer_dep = declare_dependency(
26+
dependencies : cpp.find_library('aws-cpp-sdk-transfer',
27+
dirs : get_option('aws_sdk_cpp_lib_dir')),
28+
include_directories : include_directories(
29+
get_option('aws_sdk_cpp_include_dir')))
30+
31+
32+
aws_sdk_cpp_dep = [
33+
aws_sdk_cpp_core_dep,
34+
aws_sdk_cpp_s3_dep,
35+
aws_sdk_cpp_transfer_dep,
36+
]
37+
38+
# check if dependencies are found
39+
#--------------------------------------------------
40+
have_aws_sdk_cpp = true
41+
foreach dep : aws_sdk_cpp_dep
42+
if not dep.found()
43+
have_aws_sdk_cpp = false
44+
endif
45+
endforeach
46+
47+
48+
# set config variable(s)
49+
#--------------------------------------------------
50+
config_h.set(
51+
'ENABLE_S3',
52+
have_aws_sdk_cpp.to_int(),
53+
description : 'Whether to enable S3 support via aws-sdk-cpp.')
54+
55+
if have_aws_sdk_cpp
56+
check_s3client = cpp.check_header(
57+
'aws/s3/S3Client.h',
58+
dependencies: aws_sdk_cpp_dep)
59+
60+
if check_s3client
61+
config_h.set(
62+
'HAVE_AWS_S3_S3CLIENT_H', 1,
63+
description : 'Whether to enable S3 support via aws-sdk-cpp.')
64+
endif
65+
66+
aws_version = meson.get_compiler('cpp').get_define(
67+
'AWS_SDK_VERSION_STRING',
68+
prefix : '#include <aws/core/VersionConfig.h>'
69+
).strip('"').split('.')
70+
71+
config_h.set(
72+
'AWS_VERSION_MAJOR', aws_version[0],
73+
description : 'Major version of aws-sdk-cpp.')
74+
75+
config_h.set(
76+
'AWS_VERSION_MINOR', aws_version[1],
77+
description : 'Minor version of aws-sdk-cpp.')
78+
config_h.set(
79+
'AWS_VERSION_PATCH', aws_version[2],
80+
description : 'Patch version of aws-sdk-cpp.')
81+
82+
endif

dependencies/bdw-gc/meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Boehm-gc Dependency File
2+
#============================================================================
3+
4+
5+
# Look for Boehm garbage collector, an optional dependency
6+
#--------------------------------------------------
7+
gc_dep = dependency('bdw-gc', required: get_option('gc'))
8+
9+
10+
config_h.set(
11+
'HAVE_BOEHMGC',
12+
gc_dep.found().to_int(),
13+
description : 'Whether to use the Boehm garbage collector.')

dependencies/boost/meson.build

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Boost Dependency File
2+
#============================================================================
3+
4+
5+
# Look for boost, a required dependency
6+
#----------------------------------------------------
7+
boost_mod_list = [
8+
'system',
9+
'context',
10+
'thread']
11+
12+
13+
boost_dep = dependency(
14+
'boost',
15+
modules: boost_mod_list)
16+
17+
18+
# set config variable(s)
19+
#--------------------------------------------------
20+
config_h.set(
21+
'HAVE_BOOST', 1,
22+
description : 'Define if the Boost library is available.')

dependencies/brotli/meson.build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# LibBrotli Dependency File
2+
#============================================================================
3+
4+
5+
# Look for libbrotli{enc,dec}, a required dependency
6+
#--------------------------------------------------
7+
libbrotli_dep = declare_dependency(
8+
dependencies: [
9+
dependency('libbrotlienc'),
10+
dependency('libbrotlidec')])
11+
12+
13+
# set config variable(s)
14+
#--------------------------------------------------
15+
config_h.set(
16+
'HAVE_BROTLI', 1,
17+
description : 'Define if the brotli library is available.')

dependencies/cpuid/meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# cpuid Dependency File
2+
#============================================================================
3+
4+
5+
# Look for cpuid, a required dependency
6+
#--------------------------------------------------
7+
libcpuid_dep = dependency('libcpuid')
8+
9+
# set config variable(s)
10+
#--------------------------------------------------
11+
config_h.set(
12+
'HAVE_LIBCPUID', 1,
13+
description : 'Define if the CPUID is available.')

dependencies/curl/meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# LibCurl Dependency File
2+
#============================================================================
3+
4+
5+
# Look for libcurl, a required dependency
6+
#--------------------------------------------------
7+
libcurl_dep = dependency('libcurl')
8+
9+
10+
# set config variable(s)
11+
#--------------------------------------------------
12+
config_h.set(
13+
'HAVE_CURL', 1,
14+
description : 'Define if the curl library is available.')

dependencies/dl/meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# libdl Dependency File
2+
#============================================================================
3+
4+
5+
# Look for libdl, a required dependency
6+
#--------------------------------------------------
7+
libdl_dep = cpp.find_library('dl')

dependencies/editline/meson.build

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Editline Dependency File
2+
#============================================================================
3+
4+
5+
# Look for editline, a required dependency
6+
#--------------------------------------------------
7+
# NOTE: The the libeditline.pc file was added only in libeditline >= 1.15.2, see
8+
# https://github.com/troglobit/editline/commit/0a8f2ef4203c3a4a4726b9dd1336869cd0da8607,
9+
# but e.g. Ubuntu 16.04 has an older version, so we fall back to searching for
10+
# editline.h when the pkg-config approach fails.
11+
12+
editline_dep = cpp.find_library('editline')
13+
14+
if not (
15+
cpp.has_header(
16+
'editline.h',
17+
dependencies : editline_dep))
18+
error('Nix requires editline.h; however the header was not found.')
19+
endif
20+
21+
22+
if not (
23+
cpp.has_function(
24+
'read_history',
25+
prefix : '#include <stdio.h>\n#include "editline.h"',
26+
dependencies : editline_dep))
27+
error('Nix requires libeditline; However, required functions do not work.' +\
28+
'Maybe libeditline version is too old? >= 1.14 is required.')
29+
endif
30+
31+
# set config variable(s)
32+
#--------------------------------------------------
33+
config_h.set(
34+
'HAVE_EDITLINE_H', 1,
35+
description : 'Define to 1 if you have the <editline.h> header file.')

0 commit comments

Comments
 (0)