<commit_before>package Pakket::Role::Builder;

# ABSTRACT: A role for all builders

use Moose::Role;

with qw<Pakket::Role::RunCommand>;

requires qw<build_package>;

sub generate_env_vars {
    my ( $self, $prefix ) = @_;
    my $lib_path = $self->generate_lib_path($prefix);
    my $bin_path = $self->generate_bin_path($prefix);

    return (
        'CPATH'           => $prefix->child('include'),
        'LD_LIBRARY_PATH' => $lib_path,
        'LIBRARY_PATH'    => $lib_path,
        'PATH'            => $bin_path,
    );
}

sub generate_lib_path {
    my ( $self, $prefix ) = @_;

    my $lib_path = $prefix->child('lib')->absolute->stringify;
    if ( defined( my $env_library_path = $ENV{'LD_LIBRARY_PATH'} ) ) {
        $lib_path .= ":$env_library_path";
    }

    return $lib_path;
}

sub generate_bin_path {
    my ( $self, $prefix ) = @_;

    my $bin_path = $prefix->child('bin')->absolute->stringify;
    if ( defined( my $env_bin_path = $ENV{'PATH'} ) ) {
        $bin_path .= ":$env_bin_path";
    }

    return $bin_path;
}

no Moose::Role;

1;
<commit_msg>Provide CPATH string, not object<commit_after>package Pakket::Role::Builder;

# ABSTRACT: A role for all builders

use Moose::Role;

with qw<Pakket::Role::RunCommand>;

requires qw<build_package>;

sub generate_env_vars {
    my ( $self, $prefix ) = @_;
    my $lib_path = $self->generate_lib_path($prefix);
    my $bin_path = $self->generate_bin_path($prefix);

    return (
        'CPATH'           => $prefix->child('include')->stringify,
        'LD_LIBRARY_PATH' => $lib_path,
        'LIBRARY_PATH'    => $lib_path,
        'PATH'            => $bin_path,
    );
}

sub generate_lib_path {
    my ( $self, $prefix ) = @_;

    my $lib_path = $prefix->child('lib')->absolute->stringify;
    if ( defined( my $env_library_path = $ENV{'LD_LIBRARY_PATH'} ) ) {
        $lib_path .= ":$env_library_path";
    }

    return $lib_path;
}

sub generate_bin_path {
    my ( $self, $prefix ) = @_;

    my $bin_path = $prefix->child('bin')->absolute->stringify;
    if ( defined( my $env_bin_path = $ENV{'PATH'} ) ) {
        $bin_path .= ":$env_bin_path";
    }

    return $bin_path;
}

no Moose::Role;

1;

{'fraction_non_alphanumeric': 0.1681943171402383, 'fraction_numerical': 0.0009165902841429881, 'mean_word_length': 2.9835766423357666, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078849', 'n_tokens_mistral': 806, 'n_tokens_neox': 783, 'n_words': 146}