Skip to content

Commit

Permalink
math/PDL: Update to 2.084
Browse files Browse the repository at this point in the history
- Update WWW
- Convert REINPLACE_CMD to patch files
- Update pkg-descr
- Take maintainership

Changes:	https://metacpan.org/dist/PDL/changes
  • Loading branch information
sunpoet committed Jul 31, 2023
1 parent dd10d24 commit 2827469
Show file tree
Hide file tree
Showing 6 changed files with 447 additions and 74 deletions.
118 changes: 62 additions & 56 deletions math/PDL/Makefile
@@ -1,12 +1,12 @@
PORTNAME= PDL
PORTVERSION= 2.019
PORTREVISION= 10
PORTVERSION= 2.084
CATEGORIES= math perl5
MASTER_SITES= CPAN

MAINTAINER= ports@FreeBSD.org
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Perl Data Language
WWW= https://metacpan.org/release/PDL
WWW= https://metacpan.org/dist/PDL \
https://pdl.perl.org/

LICENSE= ART10 GPLv1+
LICENSE_COMB= dual
Expand All @@ -17,88 +17,94 @@ BROKEN_i386= ld: error: can't create dynamic relocation R_386_32 against local s
BROKEN_aarch64= ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol __stack_chk_guard; recompile with -fPIC

BUILD_DEPENDS= p5-Devel-CheckLib>=1.01:devel/p5-Devel-CheckLib \
p5-Pod-Parser>=0:textproc/p5-Pod-Parser \
p5-ExtUtils-Depends>=0.402:devel/p5-ExtUtils-Depends \
${RUN_DEPENDS}
RUN_DEPENDS= p5-Astro-FITS-Header>=0:astro/p5-Astro-FITS-Header \
p5-Convert-UU>=0:converters/p5-Convert-UU \
p5-File-Map>=0.57:devel/p5-File-Map \
p5-Inline>=0.68:devel/p5-Inline \
p5-Inline>=0.83:devel/p5-Inline \
p5-Inline-C>=0.62:devel/p5-Inline-C \
p5-List-MoreUtils>=0:lang/p5-List-MoreUtils \
p5-Module-Compile>=0.23:devel/p5-Module-Compile
TEST_DEPENDS= p5-Test-Deep>=0:devel/p5-Test-Deep \
p5-Test-Exception>=0:devel/p5-Test-Exception \
p5-Pod-Parser>=0:textproc/p5-Pod-Parser \
p5-Sys-SigAction>=0:devel/p5-Sys-SigAction \
p5-Term-ReadKey>=2.34:devel/p5-Term-ReadKey
TEST_DEPENDS= p5-Test-Exception>=0:devel/p5-Test-Exception \
p5-Test-Warn>=0:devel/p5-Test-Warn

PORTSCOUT= limit:^[0-9]\.[0-9][0-9]+[0-9\.]*$$

USES= gmake perl5
USE_PERL5= configure
MAKE_ENV= PERL5LIB=${WRKSRC}/blib/lib
PLIST_FILES= bin/pdl bin/pdl2 bin/pdldoc bin/perldl bin/pptemplate \
${SITE_ARCH_REL}/Inline/Pdlpp.pm \
${SITE_ARCH_REL}/Inline/MakePdlppInstallable.pm

MAKE_JOBS_UNSAFE= yes

OPTIONS_DEFINE= PGPLOT PLPLOT OPENGL GD FFTW GSL HDF PROJ F77 READLINE SINK
OPTIONS_DEFAULT=PGPLOT FFTW F77
PORTSCOUT= limit:^[0-9]\.[0-9][0-9]+[0-9\.]*$$

OPTIONS_DEFINE= F77 FFTW GD GSL HDF OPENGL PGPLOT PLPLOT PROJ READLINE SINK
OPTIONS_DEFAULT=F77 FFTW PGPLOT
# graphics/p5-OpenGL require manual building
.if empty(PACKAGE_BUILDING)
OPTIONS_DEFAULT+= OPENGL
.endif

PGPLOT_DESC= Enable PDL::Graphics::PGPLOT
PLPLOT_DESC= Enable PDL::Graphics::PLplot
OPENGL_DESC= Enable PDL::Graphics::TriD and OpenGL
GD_DESC= Enable PDL::IO::GD
F77_DESC= Enable PDL::Minuit and PDL::Slatec
FFTW_DESC= Enable PDL::FFTW
GD_DESC= Enable PDL::IO::GD
GSL_DESC= Enable PDL::GSL interface
HDF_DESC= Enable PDL::IO::HDF interface
OPENGL_DESC= Enable PDL::Graphics::TriD and OpenGL
PGPLOT_DESC= Enable PDL::Graphics::PGPLOT
PLPLOT_DESC= Enable PDL::Graphics::PLplot
PROJ_DESC= Enable PDL::GIS::Proj interface
F77_DESC= Enable PDL::Minuit and PDL::Slatec
READLINE_DESC= Use GNU readline
SINK_DESC= Include PDL kitchen sink

PGPLOT_BUILD_DEPENDS= p5-PGPLOT>=0:graphics/p5-PGPLOT
PLPLOT_LIB_DEPENDS= libplplotd.so:math/plplot
OPENGL_BUILD_DEPENDS= p5-OpenGL>=0.65:graphics/p5-OpenGL
OPENGL_RUN_DEPENDS:= ${OPENGL_BUILD_DEPENDS}
OPENGL_USES= gl
OPENGL_USE= gl=glu
GD_LIB_DEPENDS= libgd.so:graphics/gd
F77_BUILD_DEPENDS= p5-ExtUtils-F77>=0:lang/p5-ExtUtils-F77
F77_BUILD_DEPENDS= p5-ExtUtils-F77>=1.26:lang/p5-ExtUtils-F77
F77_RUN_DEPENDS= p5-ExtUtils-F77>=1.26:lang/p5-ExtUtils-F77
FFTW_LIB_DEPENDS= libfftw.so:math/fftw
GD_LIB_DEPENDS= libgd.so:graphics/gd
GSL_LIB_DEPENDS= libgsl.so:math/gsl
HDF_LIB_DEPENDS= libdf.so:science/hdf
OPENGL_BUILD_DEPENDS= p5-OpenGL>=0.70:graphics/p5-OpenGL
OPENGL_RUN_DEPENDS= p5-OpenGL>=0.70:graphics/p5-OpenGL
OPENGL_USE= gl=glu
OPENGL_USES= gl
PGPLOT_BUILD_DEPENDS= p5-PGPLOT>=0:graphics/p5-PGPLOT
PLPLOT_LIB_DEPENDS= libplplotd.so:math/plplot
PROJ_LIB_DEPENDS= libproj.so:graphics/proj
READLINE_RUN_DEPENDS= p5-Term-ReadLine-Gnu>=0:devel/p5-Term-ReadLine-Gnu
READLINE_RUN_DEPENDS_OFF= p5-Term-ReadLine-Perl>=0:devel/p5-Term-ReadLine-Perl
SINK_RUN_DEPENDS= ppmtogif:graphics/netpbm \
mpeg_encode:multimedia/mpeg_encode
SINK_RUN_DEPENDS= mpeg_encode:multimedia/mpeg_encode \
ppmtogif:graphics/netpbm

.include <bsd.port.pre.mk>

post-patch:
@${GREP} -lR '#!/.*bin/perl' ${WRKSRC}/ | ${XARGS} ${SED} -e 's|#!/.*bin/perl|#!${PERL}|' -i ''
@${GREP} -lR 'x86_64' ${WRKSRC}/ | ${XARGS} ${SED} -e 's|x86_64|amd64|g' -i ''
@${REINPLACE_CMD} -e "/POSIX_THREADS_LIBS/ s|undef|'-lpthread'|" \
${WRKSRC}/perldl.conf
.if ${PERL_LEVEL} < 503800
BUILD_DEPENDS+= p5-Text-Balanced>=2.05:textproc/p5-Text-Balanced
RUN_DEPENDS+= p5-Text-Balanced>=2.05:textproc/p5-Text-Balanced
.endif

post-install:
${FIND} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL -name '*.so' \
| ${XARGS} ${STRIP_CMD}
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pdl
# autogen plist
@(cd ${WRKSRC}; ${PERL} -Iblib/lib -Iblib/arch Doc/scantree.pl)
@(cd ${WRKSRC}/blib/man3 ; \
${FIND} *.3 | ${SED} "s,^,${MAN3PREFIX}/man/man3/,;s/3$$/3.gz/" \
>> ${TMPPLIST} ; \
cd ${WRKSRC}/blib/man1 ; \
${FIND} *.1 | ${SED} "s,^,${MAN1PREFIX}/man/man1/,;s/1$$/1.gz/" \
>> ${TMPPLIST})
@(${FIND} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/PDL* -type f | \
${SED} "s,^${STAGEDIR}${PREFIX}/,," >> ${TMPPLIST} ; \
${FIND} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL -type f \
-name "[A-Z]*" | ${SED} "s,^${STAGEDIR}${PREFIX}/,," \
>> ${TMPPLIST})
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Bad/Bad.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/CallExt/CallExt.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Complex/Complex.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Compression/Compression.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Core/Core.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/FFT/FFT.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Fit/Gaussian/Gaussian.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Graphics/IIS/IIS.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Graphics/PGPLOT/Window/Window.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/IO/Browser/Browser.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/IO/Misc/Misc.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/IO/Pnm/Pnm.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/IO/Storable/Storable.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Image2D/Image2D.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/ImageND/ImageND.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/ImageRGB/ImageRGB.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Math/Math.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/MatrixOps/MatrixOps.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Minuit/Minuit.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Ops/Ops.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Primitive/Primitive.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Slatec/Slatec.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Slices/Slices.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Transform/Transform.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Ufunc/Ufunc.so

.include <bsd.port.mk>
.include <bsd.port.post.mk>
6 changes: 3 additions & 3 deletions math/PDL/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1526505125
SHA256 (PDL-2.019.tar.gz) = 51a47beedb1dd5bb4b6f6441a0ad38d4c95d7cbf3bf6b1b4c9128732ea2d77fe
SIZE (PDL-2.019.tar.gz) = 2900275
TIMESTAMP = 1689398783
SHA256 (PDL-2.084.tar.gz) = 96256439f3a2501ffa93b3cc7c8cadbf91aabf6cb5f874624917833656006468
SIZE (PDL-2.084.tar.gz) = 3064351
33 changes: 33 additions & 0 deletions math/PDL/files/patch-amd64
@@ -0,0 +1,33 @@
--- Libtmp/Minuit/Makefile.PL.orig 2022-02-14 10:02:23 UTC
+++ Libtmp/Minuit/Makefile.PL
@@ -120,7 +120,7 @@ undef &MY::postamble; # suppress warning
my $mycompiler = $f77->compiler();
my $mycflags = $f77->cflags();
my $orig = pdlpp_postamble_int(@pack);
- my $hack_64bit = ($Config{archname}=~m/x86_64|i686/ ?" -fPIC " : "");
+ my $hack_64bit = ($Config{archname}=~m/amd64|i686|x86_64/ ?" -fPIC " : "");
$orig =~ s/:\s*minuit\.pd/: minuit.pd/;
$orig .= "FFLAGS = $hack_64bit $mycflags \$(OPTIMIZE)\n";
$orig .= join "\n",map {
--- Libtmp/Slatec/Makefile.PL.orig 2022-02-14 10:02:23 UTC
+++ Libtmp/Slatec/Makefile.PL
@@ -81,7 +81,7 @@ undef &MY::postamble; # suppress warning
my $mycompiler = $f77->compiler();
my $mycflags = $f77->cflags();
my $orig = pdlpp_postamble_int(@pack);
- my $hack_64bit = $Config{archname}=~m/x86_64|i686/ ?" -fPIC " : "";
+ my $hack_64bit = $Config{archname}=~m/amd64|i686|x86_64/ ?" -fPIC " : "";
$orig =~ s/:\s*slatec\.pd/: slatec.pd/;
$orig .= "FFLAGS = $hack_64bit $mycflags \$(OPTIMIZE)\n";
join "\n", $orig, map "$_\$(OBJ_EXT): $_.f
--- Makefile.PL.orig 2023-03-31 16:48:47 UTC
+++ Makefile.PL
@@ -160,7 +160,7 @@ my @cleanup = ("pdl$Config{exe_ext}", qw(
# use similar mods to affect CCFLAGS on other systems as needed...

my $ccflags = $Config{ccflags};
-if($Config{archname}=~m/x86_64/) {
+if($Config{archname}=~m/amd64|i686|x86_64/) {
$ccflags .= " -fPIC";
}

11 changes: 11 additions & 0 deletions math/PDL/files/patch-perldl.conf
@@ -0,0 +1,11 @@
--- perldl.conf.orig 2023-03-31 16:25:25 UTC
+++ perldl.conf
@@ -46,7 +46,7 @@
WITH_POSIX_THREADS => undef,

POSIX_THREADS_INC => undef, # '-I/usr/pthread/include'
- POSIX_THREADS_LIBS => undef, # '-L/usr/pthread -lpthreadGC2'
+ POSIX_THREADS_LIBS => '-lpthread', # '-L/usr/pthread -lpthreadGC2'

MALLOCDBG => undef,
# {
23 changes: 8 additions & 15 deletions math/PDL/pkg-descr
@@ -1,16 +1,9 @@
PDL (``Perl Data Language'') gives standard perl the ability to
COMPACTLY store and SPEEDILY manipulate the large N-dimensional data
arrays which are the bread and butter of scientific computing.
PDL ("Perl Data Language") gives standard Perl the ability to compactly store
and speedily manipulate the large N-dimensional data arrays which are the bread
and butter of scientific computing.

The idea is to turn perl in to a free, array-oriented, numerical
language in the same sense as commerical packages like IDL and
MatLab. One can write simple perl expressions to manipulate entire
numerical arrays all at once. For example, using PDL the perl variable
$a can hold a 1024x1024 floating point image, it only takes 4Mb of
memory to store it and expressions like $a=sqrt($a)+2 would manipulate
the whole image in a few seconds.

A simple interactive shell (perldl) is provided for command line use
together with a module (PDL) for use in perl scripts.

See also: https://pdl.perl.org/
PDL turns Perl into a free, array-oriented, numerical language similar to (but,
we believe, better than) such commercial packages as IDL and MatLab. One can
write simple perl expressions to manipulate entire numerical arrays all at once.
Simple interactive shells, pdl2 and perldl, are provided for use from the
command line along with the PDL module for use in Perl scripts.

0 comments on commit 2827469

Please sign in to comment.