Skip to content

Commit

Permalink
astro/geographiclib: Update to 2.2
Browse files Browse the repository at this point in the history
PR:		271800
Reported by:	tatsuki_makino@hotmail.com(maintainer)
  • Loading branch information
tatsuki-makino authored and wenheping committed Jun 6, 2023
1 parent ab62a03 commit 60d4836
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 234 deletions.
71 changes: 34 additions & 37 deletions astro/geographiclib/Makefile
@@ -1,8 +1,7 @@
PORTNAME= geographiclib
DISTVERSION= 1.52
DISTVERSION= 2.2
CATEGORIES= astro
MASTER_SITES= SF/geographiclib/distrib \
SF/geographiclib/distrib/archive \
MASTER_SITES= SF/geographiclib/distrib-C%2B%2B \
SF/geographiclib:geoids,gravity,magnetic
DISTNAME= GeographicLib-${DISTVERSIONFULL}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} #
Expand All @@ -13,58 +12,54 @@ COMMENT= Library for geographic projections
WWW= https://geographiclib.sourceforge.io/

LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE.txt
LICENSE_FILE= ${LICENSE_FILE_MIT}

USES= cmake localbase python:env
.if !exists(/usr/include/omp.h)
USES+= compiler:gcc-c++11-lib
.else
USES+= compiler:c++14-lang
.endif
USES= cmake compiler:c++11-lang localbase:ldflags pathfix
USE_LDCONFIG= yes
USE_PYTHON= optsuffix
CMAKE_ARGS= -DGEOGRAPHICLIB_DATA:STRING=${DATADIR:Q} \
-DGEOGRAPHICLIB_LIB_TYPE:STRING=BOTH \
-DINSTALL_PYTHON_DIR:STRING=${PYTHON_SITELIBDIR:Q} \
-DINSTALL_DOC_DIR:STRING=${DOCSDIR:Q}
CMAKE_ARGS= -DGEOGRAPHICLIB_DATA:STRING=${DATADIR:Q}
CMAKE_ON= BUILD_SHARED_LIBS
CMAKE_OFF= BUILD_BOTH_LIBS \
USE_BOOST_FOR_EXAMPLES \
BUILD_MANPAGES
PORTDOCS= *
PORTEXAMPLES= *

OPTIONS_DEFINE= DOCS DOXYGEN PERL
OPTIONS_DEFAULT= DOXYGEN PERL PREC2
OPTIONS_DEFINE= DOCS DOXYGEN EXAMPLES
OPTIONS_DEFAULT= DOXYGEN PREC2
OPTIONS_GROUP= DATASETS
OPTIONS_GROUP_DATASETS= ${_OPTIONS_GROUP_DATASETS}
OPTIONS_SINGLE= PRECISION
OPTIONS_SINGLE_PRECISION= PREC1 PREC2 PREC3 PREC4 PREC5
OPTIONS_SUB= yes
DATASETS_DESC= geoid datasets, gravity models and magnetic field models
PERL_DESC= Build documentation with pod2man and pod2html
PREC1_DESC= 1 = float
PREC2_DESC= 2 = double
PREC3_DESC= 3 = extended
PREC4_DESC= 4 = quadruple
PREC5_DESC= 5 = variable
PRECISION_DESC= default "real" precision
DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen \
${PYTHON_PKGNAMEPREFIX}sphinx>=0:textproc/py-sphinx@${PY_FLAVOR}
DOXYGEN_CMAKE_BOOL= GEOGRAPHICLIB_DOCUMENTATION
PERL_BUILD_DEPENDS= nroff:textproc/groff
PERL_USES= perl5
PERL_USE= PERL5=build
PERL_CMAKE_BOOL_OFF= GEOGRAPHICLIB_NO_PERL
DOCS_CMAKE_ON= -DDOCDIR:STRING=${DOCSDIR:Q}
DOCS_CMAKE_OFF= -DDOCDIR:STRING=NO
DOXYGEN_IMPLIES= DOCS
DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen
DOXYGEN_CMAKE_BOOL= BUILD_DOCUMENTATION
DOXYGEN_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Doxygen
EXAMPLES_CMAKE_ON= -DEXAMPLEDIR:STRING=${EXAMPLESDIR:Q}
EXAMPLES_CMAKE_OFF= -DEXAMPLEDIR:STRING=NO
PREC1_CMAKE_ON= -DGEOGRAPHICLIB_PRECISION:STRING=1
PREC2_CMAKE_ON= -DGEOGRAPHICLIB_PRECISION:STRING=2
PREC3_CMAKE_ON= -DGEOGRAPHICLIB_PRECISION:STRING=3
PREC4_BUILD_DEPENDS= ${LOCALBASE}/include/boost/version.hpp:devel/boost-libs
PREC4_RUN_DEPENDS= ${LOCALBASE}/include/boost/version.hpp:devel/boost-libs
PREC4_USE= GCC=yes
PREC4_CMAKE_ON= -DGEOGRAPHICLIB_PRECISION:STRING=4
PREC5_BROKEN= error: call of overloaded 'max' is ambiguous\
error: '*' was not declared in this scope
PREC5_BUILD_DEPENDS= ${LOCALBASE}/include/mpreal.h:math/mpfrc++
PREC5_LIB_DEPENDS= libgmp.so:math/gmp \
libmpfr.so:math/mpfr
PREC5_RUN_DEPENDS= ${LOCALBASE}/include/mpreal.h:math/mpfrc++
PREC5_USE= GCC=yes
PREC5_CMAKE_ON= -DGEOGRAPHICLIB_PRECISION:STRING=5
PREC5_VARS= LICENSE+="GPLv3" LICENSE_COMB="multi"

GEOID_NAMES= egm84-30 egm84-15 egm96-15 egm96-5\
egm2008-5 egm2008-2_5 egm2008-1
Expand All @@ -77,10 +72,11 @@ DEFAULT_GRAVITY_NAMES= egm96 wgs84
DEFAULT_MAGNETIC_NAMES= wmm2020 igrf13
DEPRECATED_NAMES= wmm2015

.ifnmake portclippy
.for n in ${GEOID_NAMES}
GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DESC= Install ${n} geoid dataset\
${"${DEPRECATED_NAMES:M${n}}"!="":?(deprecated):}
OPTIONS_GROUP_DATASETS+= GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}
_OPTIONS_GROUP_DATASETS+= GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}
GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DISTFILES= geoids-distrib/${n}.tar.bz2:geoids
ALL_DATASETS_OPTIONS+= GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}
. if !empty(DEFAULT_GEOID_NAMES:M${n})
Expand All @@ -90,7 +86,7 @@ DEF_DATASETS_OPTIONS+= GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}
.for n in ${GRAVITY_NAMES}
GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DESC= Install ${n} gravity model\
${"${DEPRECATED_NAMES:M${n}}"!="":?(deprecated):}
OPTIONS_GROUP_DATASETS+= GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}
_OPTIONS_GROUP_DATASETS+= GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}
GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DISTFILES= gravity-distrib/${n}.tar.bz2:gravity
ALL_DATASETS_OPTIONS+= GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}
. if !empty(DEFAULT_GRAVITY_NAMES:M${n})
Expand All @@ -100,13 +96,14 @@ DEF_DATASETS_OPTIONS+= GRAVITY_${n:C/[^0-9A-Z_a-z]/_/g:tu}
.for n in ${MAGNETIC_NAMES}
MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DESC= Install ${n} magnetic model\
${"${DEPRECATED_NAMES:M${n}}"!="":?(deprecated):}
OPTIONS_GROUP_DATASETS+= MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}
_OPTIONS_GROUP_DATASETS+= MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}
MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}_DISTFILES= magnetic-distrib/${n}.tar.bz2:magnetic
ALL_DATASETS_OPTIONS+= MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}
. if !empty(DEFAULT_MAGNETIC_NAMES:M${n})
DEF_DATASETS_OPTIONS+= MAGNETIC_${n:C/[^0-9A-Z_a-z]/_/g:tu}
. endif
.endfor
.endif

# list of targets that require all distfiles
.ifmake makesum || makeplist || distclean
Expand All @@ -118,12 +115,10 @@ OPTIONS_DEFAULT+= ${DEF_DATASETS_OPTIONS}
.endif

post-patch:
${REINPLACE_CMD} -e 's/\(tail\) --lines/\1 -n/g'\
-e "s,head --lines -4,${SED} -e '\$$d' | ${SED} -e '\$$d' | ${SED} -e '\$$d' | ${SED} -e '\$$d',"\
${WRKSRC}/man/makeusage.sh
${REINPLACE_CMD} -e '/wget/s,wget -O,${FETCH_BINARY} -o ,'\
${WRKSRC}/tools/geographiclib-get-*.sh
${FIND} -- ${WRKSRC}/tools -name geographiclib-get-\*.sh \
-exec ${REINPLACE_CMD} -e '/wget/s,wget -O,${FETCH_BINARY} -o ,' -- {} \;

.ifnmake portclippy
.for n in ${GEOID_NAMES}
post-install-GEOID_${n:C/[^0-9A-Z_a-z]/_/g:tu}-on: install-datasets-geoids
.endfor
Expand All @@ -144,7 +139,8 @@ install-datasets-${n}: .NOTMAIN

x-tool-plist: .NOTMAIN .PHONY ${PLIST}
${REINPLACE_CMD}\
-e '/^%%PORTDOCS%%/d'\
-e '/^%%PORTDOCS%%%%DOCSDIR%%/d'\
-e '/^%%PORTEXAMPLES%%%%EXAMPLESDIR%%/d'\
-e '/^%%DATADIR%%\/geoids\/[^.]/{\
h;s|^%%DATADIR%%/geoids/\([^.]\{1,\}\).*|GEOID_\1|;\
s/[^0-9A-Za-z]/_/g;\
Expand All @@ -161,5 +157,6 @@ x-tool-plist: .NOTMAIN .PHONY ${PLIST}
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;\
s/^/%%/;s/$$/%%/;G;s/\n//;}'\
${PLIST}
.endif

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions astro/geographiclib/distinfo
@@ -1,6 +1,6 @@
TIMESTAMP = 1624849200
SHA256 (GeographicLib/GeographicLib-1.52.tar.gz) = 5d4145cd16ebf51a2ff97c9244330a340787d131165cfd150e4b2840c0e8ac2b
SIZE (GeographicLib/GeographicLib-1.52.tar.gz) = 2432658
TIMESTAMP = 1685761200
SHA256 (GeographicLib/GeographicLib-2.2.tar.gz) = 96bd68ae77288fbbffd854c1c8f2c2981dbdbc7670753013fe5ce9ce86d8a125
SIZE (GeographicLib/GeographicLib-2.2.tar.gz) = 1682259
SHA256 (GeographicLib/geoids-distrib/egm2008-1.tar.bz2) = bdb382d0be7ece9142450eacc24b7b7f0889ee3e0ba4f535b04ec383f94c0fb5
SIZE (GeographicLib/geoids-distrib/egm2008-1.tar.bz2) = 162388303
SHA256 (GeographicLib/geoids-distrib/egm2008-2_5.tar.bz2) = d602e13446a4a4a23f39aecfe6a2a0760a1bc6c1b497482c2ebc9f7d513be699
Expand Down
23 changes: 0 additions & 23 deletions astro/geographiclib/files/patch-CMakeLists.txt

This file was deleted.

8 changes: 0 additions & 8 deletions astro/geographiclib/files/patch-cmake_CMakeLists.txt

This file was deleted.

14 changes: 0 additions & 14 deletions astro/geographiclib/files/patch-doc_CMakeLists.txt

This file was deleted.

This file was deleted.

11 changes: 6 additions & 5 deletions astro/geographiclib/pkg-descr
@@ -1,6 +1,7 @@
GeographicLib is a small set of C++ classes for performing conversions
between geographic, UTM, UPS, MGRS, geocentric, and local cartesian
coordinates, for gravity (e.g., EGM2008), geoid height, and geomagnetic
field (e.g., WMM2020) calculations, and for solving geodesic problems.
GeographicLib is a small C++ library for

It is a suitable replacement for the core functionality provided by geotrans.
* geodesic and rhumb line calculations;
* conversions between geographic, UTM, UPS, MGRS, geocentric, and local
cartesian coordinates;
* gravity (e.g., EGM2008) and geomagnetic field (e.g., WMM2020)
calculations.
16 changes: 8 additions & 8 deletions astro/geographiclib/pkg-help
@@ -1,7 +1,7 @@
Geoid datasets used by the GeographicLib::Geoid class and the GeoidEval
geoid datasets used by the GeographicLib::Geoid class and the GeoidEval
tool to compute geoid heights.

Available geoid data files
Available geoid
size (MB)
name geoid grid tar.bz2 disk
egm84-30 EGM84 30' 0.5 0.6
Expand All @@ -12,10 +12,10 @@ tool to compute geoid heights.
egm2008-2_5 EGM2008 2.5' 35 75
egm2008-1 EGM2008 1' 170 470

Gravity models used by the GeographicLib::GravityModel class and the
Gravity tool to compute gravity fields.
gravitymodel datasets used by the GeographicLib::GravityModel class and
the Gravity tool to compute gravity fields.

Available gravity models
Available gravitymodel
size (kB)
name degree tar.bz2 disk
egm84 18 27 26
Expand All @@ -24,10 +24,10 @@ Gravity tool to compute gravity fields.
wgs84 20 1 1
grs80 20 1 1

Magnetic models used by the GeographicLib::MagneticModel class and the
MagneticField tool to compute magnetic fields.
magneticmodel datasets used by the GeographicLib::MagneticModel class
and the MagneticField tool to compute magnetic fields.

Available magnetic models
Available magneticmodel
size (kB)
name degree years tar.bz2 disk
wmm2010 12 2010-2015 2 3
Expand Down

0 comments on commit 60d4836

Please sign in to comment.