| 1 | #! perl | ||
| 2 | |||
| 3 | 1 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use alienfile; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use Path::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Sort::Versions; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use File::Which; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | #<<< | ||
| 13 | 1 | ▶ | use constant PACKAGE_VERSION => '8.0.2'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | #>>> | ||
| 15 | |||
| 16 | 1 | our $VERSION = 'v8.0.2.2'; | |
| 17 | |||
| 18 | 1 | ▶ | use constant PACKAGE_NAME_R => 'qhull_r'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 1 | ▶ | use constant PACKAGE_NAME_STATIC_R => 'qhullstatic_r'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | ########################################################################################## | ||
| 22 | # Some system installations (e.g. Debian 12) compile their static libraries in such a way | ||
| 23 | # that linking the Perl .so XS module against it fails with something like: | ||
| 24 | |||
| 25 | # relocation R_X86_64_PC32 against symbol `qh_version2' can not be | ||
| 26 | # used when making a shared object; recompile with -fPIC' | ||
| 27 | |||
| 28 | # As far as I can tell, Alien::Build is passing -fPIC, but the system | ||
| 29 | # library hasn't been compiled with it. So, need to use dynamic | ||
| 30 | # linking against the system library, but want to use static linking | ||
| 31 | # for a share install. | ||
| 32 | |||
| 33 | # However, qhull uses separate .pc files for dynamic and static | ||
| 34 | # linking, and the PkgConfig plugin really wants to use a single file | ||
| 35 | # for both. | ||
| 36 | |||
| 37 | # I haven't figured out how to make that happen portably, so instead | ||
| 38 | # force a static share install by using the PkgConfig plugin specifying the | ||
| 39 | # static .pc file and ensuring that it always fails by requiring a non-existent version. | ||
| 40 | |||
| 41 | 1 | plugin PkgConfig => ( pkg_name => PACKAGE_NAME_STATIC_R, exact_version => 0 ); | |
| 42 | |||
| 43 | 1 | ▶ | share { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 44 | 1 | plugin 'Build::CMake'; | |
| 45 | |||
| 46 | # start_url 'http://www.qhull.org/download/'; | ||
| 47 | 1 | start_url( ( path( 'src' )->children( qr/qhull.*-@{[PACKAGE_VERSION]}/ ) )[0] ); | |
| 48 | |||
| 49 | 1 | plugin Download => ( | |
| 50 | filter => qr/(?:\d+[.]\d+[.]\d+)[.]tgz*$/, | ||
| 51 | version => qr/(\d+[.]\d+[.]\d+)[.]tgz*$/, | ||
| 52 | ); | ||
| 53 | |||
| 54 | 1 | plugin Extract => 'tar.gz'; | |
| 55 | |||
| 56 | build [ [ | ||
| 57 | 1 | '%{cmake}', @{ meta->prop->{plugin_build_cmake}->{args} }, | |
| 58 | '-D', 'BUILD_SHARED_LIBS=OFF', | ||
| 59 | '%{.install.extract}', | ||
| 60 | ], | ||
| 61 | '%{make}', | ||
| 62 | '%{make} install', | ||
| 63 | ]; | ||
| 64 | |||
| 65 | 1 | }; | |