diff --git a/perl/.yath.rc b/perl/.yath.rc deleted file mode 100644 index 118bf80c8..000000000 --- a/perl/.yath.rc +++ /dev/null @@ -1,2 +0,0 @@ -[test] --I=rel(lib/Nix) diff --git a/perl/.yath.rc.in b/perl/.yath.rc.in new file mode 100644 index 000000000..e6f5f93ec --- /dev/null +++ b/perl/.yath.rc.in @@ -0,0 +1,2 @@ +[test] +-I=rel(@lib_dir@) diff --git a/perl/default.nix b/perl/default.nix index 185c8126f..45682381e 100644 --- a/perl/default.nix +++ b/perl/default.nix @@ -26,7 +26,7 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: { ./meson.build ./meson_options.txt ] ++ lib.optionals finalAttrs.doCheck [ - ./.yath.rc + ./.yath.rc.in ./t ]); }; diff --git a/perl/meson.build b/perl/meson.build index bbeb0afa1..350e5bd67 100644 --- a/perl/meson.build +++ b/perl/meson.build @@ -138,15 +138,23 @@ nix_perl_store_dep_list = [ # # build # #------------------------------------------------- -subdir('lib/Nix') +lib_dir = join_paths('lib', 'Nix') +subdir(lib_dir) if get_option('tests').enabled() + yath_rc_conf = configuration_data() + yath_rc_conf.set('lib_dir', lib_dir) + yath_rc = configure_file( + output : '.yath.rc', + input : '.yath.rc.in', + configuration : yath_rc_conf, + ) subdir('t') test( 'nix-perl-test', yath, - args : [ - '-I=@0@'.format( join_paths( meson.current_build_dir(), 'lib', 'Nix') ), - ], + args : ['test'], + workdir : meson.current_build_dir(), + depends : [nix_perl_store_lib], ) endif