Alien-UDUNITS2

 view release on metacpan or  search on metacpan

lib/Alien/UDUNITS2.pm  view on Meta::CPAN


	# Use static linking instead of dynamic linking. This works
	# better on some platforms. On macOS, to use dynamic linking,
	# the `install_name` of the library must be set, but since this
	# is the final path by default, linking to the `.dylib` under
	# `blib/` at test time does not work without using `@rpath`.
	if( $^O eq 'darwin' and $class->install_type eq 'share' ) {
		$params->{MYEXTLIB} .= ' ' .
			join( " ",
				map { File::Spec->catfile(
					File::Spec->rel2abs($class->dist_dir),
					'lib',  $_ ) }
				qw(libudunits2.a)
			);
		$params->{LIBS} =~ s/-ludunits2//g;
	}

	$params;
}

sub units_xml {
	my ($self) = @_;

	my ($file) = grep
		{ -f }
		map {
			(
				"$_/share/xml/udunits/udunits2.xml",
				"$_/share/udunits/udunits2.xml",
				"$_/lib/udunits2.xml"
			)
		} (
			$self->install_type eq 'share'
			? $self->dist_dir
			: "/usr"
		);

	$file;
}

1;

=pod

=encoding UTF-8

=head1 NAME

Alien::UDUNITS2 - Alien package for the UDUNITS-2 physical unit manipulation and conversion library

=head1 VERSION

version 0.008

=head1 Inline support

This module supports L<Inline's with functionality|Inline/"Playing 'with' Others">.

=head1 SEE ALSO

L<UDUNITS-2|http://www.unidata.ucar.edu/software/udunits/>

=head1 AUTHOR

Zakariyya Mughal <zmughal@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Zakariyya Mughal.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

__END__
# ABSTRACT: Alien package for the UDUNITS-2 physical unit manipulation and conversion library



( run in 1.906 second using v1.01-cache-2.11-cpan-df04353d9ac )