1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 21:46:01 +01:00

meson: Apply formatting universally

Now that we have applied the [1] patch, the diff is much
nicer and less noisy.

[1]: https://www.github.com/mesonbuild/meson/pull/14861
This commit is contained in:
Sergei Zimmerman 2025-08-07 02:52:13 +03:00
parent bf80696ed9
commit 385e2c3542
No known key found for this signature in database
62 changed files with 444 additions and 454 deletions

View file

@ -34,7 +34,7 @@ nix_perl_store_cc = custom_target(
'Store.cc',
output : 'Store.cc',
input : nix_perl_store_xs,
command : [xsubpp, '@INPUT@', '-output', '@OUTPUT@'],
command : [ xsubpp, '@INPUT@', '-output', '@OUTPUT@' ],
)
# Build Nix::Store Library
@ -42,7 +42,7 @@ nix_perl_store_cc = custom_target(
nix_perl_store_lib = library(
'Store',
sources : nix_perl_store_cc,
name_prefix : '',
name_prefix : '',
prelink : true, # For C++ static initializers
install : true,
install_mode : 'rwxr-xr-x',
@ -56,5 +56,5 @@ nix_perl_store_lib = library(
install_data(
nix_perl_scripts,
install_mode : 'rw-r--r--',
install_dir : join_paths(nix_perl_install_dir,'Nix'),
install_dir : join_paths(nix_perl_install_dir, 'Nix'),
)

View file

@ -4,7 +4,7 @@
# init project
#============================================================================
project (
project(
'nix-perl',
'cpp',
version : files('.version'),
@ -65,7 +65,7 @@ yath = find_program('yath', required : false)
# Required Libraries
#-------------------------------------------------
bzip2_dep = dependency('bzip2', required: false)
bzip2_dep = dependency('bzip2', required : false)
if not bzip2_dep.found()
bzip2_dep = cpp.find_library('bz2')
if not bzip2_dep.found()
@ -87,15 +87,36 @@ nix_store_dep = dependency('nix-store')
# the perl bindings does not appear to be possible.
#-------------------------------------------------
perl_archname = run_command(
perl, '-e', 'use Config; print $Config{archname};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{archname};',
check : true,
).stdout()
perl_version = run_command(
perl, '-e', 'use Config; print $Config{version};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{version};',
check : true,
).stdout()
perl_archlibexp = run_command(
perl, '-e', 'use Config; print $Config{archlibexp};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{archlibexp};',
check : true,
).stdout()
perl_site_libdir = run_command(
perl, '-e', 'use Config; print $Config{installsitearch};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{installsitearch};',
check : true,
).stdout()
nix_perl_install_dir = join_paths(
libdir, 'perl5', 'site_perl', perl_version, perl_archname)
libdir,
'perl5',
'site_perl',
perl_version,
perl_archname,
)
# print perl hints for logs
@ -110,10 +131,11 @@ message('Assumed Nix-Perl install dir: @0@'.format(nix_perl_install_dir))
#-------------------------------------------------
perl_check_dbi = run_command(
perl,
'-e', 'use DBI; use DBD::SQLite;',
'-e',
'use DBI; use DBD::SQLite;',
'-I@0@'.format(get_option('dbi_path')),
'-I@0@'.format(get_option('dbd_sqlite_path')),
check: true
check : true,
)
if perl_check_dbi.returncode() == 2
@ -128,10 +150,11 @@ endif
#-------------------------------------------------
perl_dep = declare_dependency(
dependencies : cpp.find_library(
'perl',
has_headers : [
join_paths(perl_archlibexp, 'CORE', 'perl.h'),
join_paths(perl_archlibexp, 'CORE', 'EXTERN.h')],
'perl',
has_headers : [
join_paths(perl_archlibexp, 'CORE', 'perl.h'),
join_paths(perl_archlibexp, 'CORE', 'EXTERN.h'),
],
dirs : [
join_paths(perl_archlibexp, 'CORE'),
],
@ -166,8 +189,8 @@ if get_option('tests').enabled()
test(
'nix-perl-test',
yath,
args : ['test'],
args : [ 'test' ],
workdir : meson.current_build_dir(),
depends : [nix_perl_store_lib],
depends : [ nix_perl_store_lib ],
)
endif

View file

@ -9,7 +9,8 @@ option(
'tests',
type : 'feature',
value : 'disabled',
description : 'run nix-perl tests')
description : 'run nix-perl tests',
)
# Location of Perl Modules
@ -18,10 +19,12 @@ option(
'dbi_path',
type : 'string',
value : '/usr',
description : 'path to perl::dbi')
description : 'path to perl::dbi',
)
option(
'dbd_sqlite_path',
type : 'string',
value : '/usr',
description : 'path to perl::dbd-SQLite')
description : 'path to perl::dbd-SQLite',
)