From 123af3e57df64369be9631b1cb197e44cc84b648 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 15:08:33 +0100 Subject: [PATCH 01/12] proj: update to 9.1.1. --- common/shlibs | 2 +- srcpkgs/proj/template | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/shlibs b/common/shlibs index 7a0b6a98a6d2..2cfa1748ac42 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3064,7 +3064,7 @@ libwithsctp.so.1 lksctp-tools-1.0.17_1 libnss_ldap.so.2 nss-pam-ldapd-0.9.7_4 libunshield.so.0 libunshield-0.6_1 libMyGUIEngine.so.3.4.1 libmygui-3.4.1_1 -libproj.so.18 proj-6.3.0_1 +libproj.so.25 proj-9.1.1_1 libnlopt.so.0 nlopt-2.4.2_1 libeb.so.16 libeb-4.3.3_1 libchipcard.so.6 libchipcard-5.0.4_1 diff --git a/srcpkgs/proj/template b/srcpkgs/proj/template index 51c4638234bd..451606a453c2 100644 --- a/srcpkgs/proj/template +++ b/srcpkgs/proj/template @@ -1,28 +1,27 @@ # Template file for 'proj' pkgname=proj -version=6.3.2 +version=9.1.1 revision=1 build_style=cmake -configure_args="-DPROJ_TESTS=OFF" +configure_args="-DBUILD_TESTING=OFF" hostmakedepends="python3" -makedepends="sqlite-devel" +makedepends="libcurl-devel sqlite-devel tiff-devel" short_desc="Cartographic Projections Library" maintainer="John " license="MIT" -homepage="https://proj4.org" +homepage="https://proj.org" distfiles="https://download.osgeo.org/proj/proj-${version}.tar.gz" -checksum=cb776a70f40c35579ae4ba04fb4a388c1d1ce025a1df6171350dc19f25b80311 +checksum=003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39 post_install() { vlicense COPYING } proj-devel_package() { - depends="${sourcepkg}-${version}_${revision}" + depends="${sourcepkg}-${version}_${revision} libcurl-devel" short_desc+=" - development files" pkg_install() { vmove usr/include - vmove usr/share/man/man3 vmove usr/lib/cmake vmove "usr/lib/*.so" } From 9970c369d81a212d16084c97c4977916cd3cc63c Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sun, 20 Nov 2022 19:40:30 +0100 Subject: [PATCH 02/12] libgdal: rebuild for proj 9.1 --- srcpkgs/libgdal/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/libgdal/template b/srcpkgs/libgdal/template index d6a527322ec3..0f13822bfbe2 100644 --- a/srcpkgs/libgdal/template +++ b/srcpkgs/libgdal/template @@ -1,7 +1,7 @@ # Template file for 'libgdal' pkgname=libgdal version=3.5.3 -revision=4 +revision=5 build_style=cmake build_helper=python3 configure_args="-DGDAL_USE_OPENCL=ON From ef2add9203c1f271057cb9f6634375251d8842ac Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 16:12:34 +0100 Subject: [PATCH 03/12] libspatialite: rebuild for proj 9.1 --- srcpkgs/libspatialite/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/libspatialite/template b/srcpkgs/libspatialite/template index 54885e5e8b8c..ec03354fdfe7 100644 --- a/srcpkgs/libspatialite/template +++ b/srcpkgs/libspatialite/template @@ -1,7 +1,7 @@ # Template file for 'libspatialite' pkgname=libspatialite version=5.0.1 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="pkg-config geos-devel" makedepends="sqlite-devel zlib-devel proj-devel freexl-devel From c32008052388cf52a03140ef2fc53f3611f77dd7 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 16:21:32 +0100 Subject: [PATCH 04/12] postgis-postgresql14: rebuild for proj 9.1 --- srcpkgs/postgis-postgresql14/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/postgis-postgresql14/template b/srcpkgs/postgis-postgresql14/template index c1d68a3c9dee..5b07a5bd027d 100644 --- a/srcpkgs/postgis-postgresql14/template +++ b/srcpkgs/postgis-postgresql14/template @@ -1,7 +1,7 @@ # Template file for 'postgis-postgresql14' pkgname=postgis-postgresql14 version=3.2.1 -revision=3 +revision=4 build_style=gnu-configure configure_args=" --with-projdir=${XBPS_CROSS_BASE}/usr From 74c0d56cb2359ee4c1be0c98e755aa6c33f8ee01 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 16:24:22 +0100 Subject: [PATCH 05/12] postgis-postgresql13: rebuild for proj 9.1 --- srcpkgs/postgis-postgresql13/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/postgis-postgresql13/template b/srcpkgs/postgis-postgresql13/template index 6a6cedb505e7..b95707840357 100644 --- a/srcpkgs/postgis-postgresql13/template +++ b/srcpkgs/postgis-postgresql13/template @@ -1,7 +1,7 @@ # Template file for 'postgis-postgresql13' pkgname=postgis-postgresql13 version=3.2.1 -revision=2 +revision=3 build_style=gnu-configure configure_args=" --with-projdir=${XBPS_CROSS_BASE}/usr From f34287e16364e74346acf09c9fc0538424e0d8a3 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 16:25:40 +0100 Subject: [PATCH 06/12] merkaartor: rebuild for proj 9.1 --- srcpkgs/merkaartor/template | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/srcpkgs/merkaartor/template b/srcpkgs/merkaartor/template index 6603376111f2..c5848acf7d22 100644 --- a/srcpkgs/merkaartor/template +++ b/srcpkgs/merkaartor/template @@ -1,7 +1,7 @@ # Template file for 'merkaartor' pkgname=merkaartor version=0.19.0 -revision=2 +revision=3 build_style=qmake configure_args="SYSTEM_QUAZIP=1 SYSTEM_QUAZIP_LDFLAGS=-lquazip5" hostmakedepends="qt5-qmake libgdal-tools qt5-host-tools" @@ -13,5 +13,3 @@ license="GPL-2.0-or-later" homepage="http://merkaartor.be" distfiles="https://github.com/openstreetmap/merkaartor/archive/${version}.tar.gz" checksum=f538d1eb380005cbd5d047070b276da59c58bb7ff47218e20a080b893d0ba457 - -CXXFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" From 3006cdb4ab70b8e280262c74e2fbbf429c807c6b Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sat, 5 Nov 2022 16:29:13 +0100 Subject: [PATCH 07/12] sumo: rebuild for proj 9.1 --- srcpkgs/sumo/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template index dfc342f19a51..595a4d4e4c4e 100644 --- a/srcpkgs/sumo/template +++ b/srcpkgs/sumo/template @@ -1,7 +1,7 @@ # Template file for 'sumo' pkgname=sumo version=1.12.0 -revision=3 +revision=4 build_style=cmake hostmakedepends="libgdal-tools pkg-config swig python3-setuptools" makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel From 563ee2e983da8554c113d2210e40a84e5822fd07 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Tue, 8 Nov 2022 17:39:17 +0100 Subject: [PATCH 08/12] osm2pgsql: rebuild for proj 9.1 --- srcpkgs/osm2pgsql/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/osm2pgsql/template b/srcpkgs/osm2pgsql/template index e67e67513b8f..c3cd45f42116 100644 --- a/srcpkgs/osm2pgsql/template +++ b/srcpkgs/osm2pgsql/template @@ -1,7 +1,7 @@ # Template file for 'osm2pgsql' pkgname=osm2pgsql version=1.6.0 -revision=3 +revision=4 build_style=cmake hostmakedepends="boost" makedepends="expat-devel proj-devel bzip2-devel zlib-devel boost-devel From 335832abfe4f4a975d8934e61d73fa80dedefcac Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Tue, 8 Nov 2022 14:08:01 +0300 Subject: [PATCH 09/12] grass: update to 7.8.7; rebuild for proj 9.1 --- srcpkgs/grass/patches/c99-bool.patch | 157 ------------------ .../grass/patches/fix-gettext-python.patch | 18 ++ srcpkgs/grass/patches/fix-locale-python.patch | 130 +++++++++++++++ srcpkgs/grass/template | 25 +-- 4 files changed, 161 insertions(+), 169 deletions(-) delete mode 100644 srcpkgs/grass/patches/c99-bool.patch create mode 100644 srcpkgs/grass/patches/fix-gettext-python.patch create mode 100644 srcpkgs/grass/patches/fix-locale-python.patch diff --git a/srcpkgs/grass/patches/c99-bool.patch b/srcpkgs/grass/patches/c99-bool.patch deleted file mode 100644 index ce0cdfcd6928..000000000000 --- a/srcpkgs/grass/patches/c99-bool.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 1e0c11f526f64755f877957ce6c14b2159c3823f Mon Sep 17 00:00:00 2001 -From: nilason -Date: Wed, 19 May 2021 11:38:49 +0200 -Subject: [PATCH] libgis: Enable the C99 bool type (#1567) - -Enables globally the C99 'bool' type with its values 'true' and 'false'. - -The old boolean constants 'TRUE' and 'FALSE' are still valid but -redefined to 'true' and 'false' to emphasize their equivalence. - -(Re-)definitions of TRUE/FALSE in modules are removed. - -This change was originally triggered by a conflict of v.hull -- defining -a local bool type -- with GDAL 3.3 which introduced the inclusion of -stdbool.h (#1563). ---- - lib/lidar/lidar.h | 3 --- - raster/r.param.scale/param.h | 2 -- - raster/r.surf.idw/main.h | 2 -- - raster3d/r3.showdspf/Ball.c | 2 -- - raster3d/r3.showdspf/togif.c | 3 --- - vector/v.hull/chull.c | 20 ++++++++------------ - 7 files changed, 14 insertions(+), 27 deletions(-) - -diff --git a/lib/lidar/lidar.h b/lib/lidar/lidar.h -index 89a25de3bf..978894ea74 100644 ---- a/lib/lidar/lidar.h -+++ b/lib/lidar/lidar.h -@@ -62,9 +62,6 @@ - /* INTERPOLATOR */ - #define P_BILINEAR 1 - #define P_BICUBIC 0 -- /* Boolean definitions */ --#define TRUE 1 --#define FALSE 0 - - /*----------------------------------------------------------------------------------------------------------*/ - /*STRUCTS DECLARATION */ -diff --git a/raster/r.param.scale/param.h b/raster/r.param.scale/param.h -index 9c1dab4e81..2512fedaa2 100644 ---- a/raster/r.param.scale/param.h -+++ b/raster/r.param.scale/param.h -@@ -18,8 +18,6 @@ - /* 'blank' edge around raster. */ - #define MAX_WSIZE 499 /* Maximum dimensions of window. */ - /* Some useful labels. */ --#define TRUE 1 --#define FALSE 0 - - #define RAD2DEG M_R2D - #define DEG2RAD M_D2R -diff --git a/raster/r.surf.idw/main.h b/raster/r.surf.idw/main.h -index 33164f43cb..47028e7444 100644 ---- a/raster/r.surf.idw/main.h -+++ b/raster/r.surf.idw/main.h -@@ -1,8 +1,6 @@ - #include - - #define SHORT short --#define TRUE 1 --#define FALSE 0 - - #define MELEMENT struct Melement - MELEMENT { -diff --git a/raster3d/r3.showdspf/Ball.c b/raster3d/r3.showdspf/Ball.c -index fb3b79882f..ae3ec3933a 100644 ---- a/raster3d/r3.showdspf/Ball.c -+++ b/raster3d/r3.showdspf/Ball.c -@@ -7,8 +7,6 @@ - #include "Ball.h" - #include "BallMath.h" - #include --#define TRUE 1 --#define FALSE 0 - - HMatrix mId = { {1, 0, 0, 0} - , {0, 1, 0, 0} -diff --git a/raster3d/r3.showdspf/togif.c b/raster3d/r3.showdspf/togif.c -index 589f243a8d..b48236b33f 100644 ---- a/raster3d/r3.showdspf/togif.c -+++ b/raster3d/r3.showdspf/togif.c -@@ -324,9 +324,6 @@ static int ditherrow(unsigned short *r, unsigned short *g, unsigned short *b, - * - *****************************************************************************/ - --#define TRUE 1 --#define FALSE 0 -- - - /************************** BumpPixel() ********************************/ - /* -diff --git a/vector/v.hull/chull.c b/vector/v.hull/chull.c -index 1ad97396fa..584af5d8ba 100644 ---- a/vector/v.hull/chull.c -+++ b/vector/v.hull/chull.c -@@ -29,10 +29,6 @@ - - #include "globals.h" - --/*Define Boolean type */ --typedef enum --{ BFALSE, BTRUE } bool; -- - /* Define vertex indices. */ - #define X 0 - #define Y 1 -@@ -76,10 +72,10 @@ struct tFaceStructure - }; - - /* Define flags */ --#define ONHULL BTRUE --#define REMOVED BTRUE --#define VISIBLE BTRUE --#define PROCESSED BTRUE -+#define ONHULL true -+#define REMOVED true -+#define VISIBLE true -+#define PROCESSED true - - /* Global variable definitions */ - tVertex vertices = NULL; -@@ -436,7 +432,7 @@ bool AddOne(tVertex p) - tFace f; - tEdge e, temp; - long int vol; -- bool vis = BFALSE; -+ bool vis = false; - - - /* Mark faces visible from p. */ -@@ -446,7 +442,7 @@ bool AddOne(tVertex p) - - if (vol < 0) { - f->visible = VISIBLE; -- vis = BTRUE; -+ vis = true; - } - f = f->next; - } while (f != faces); -@@ -454,7 +450,7 @@ bool AddOne(tVertex p) - /* If no faces are visible from p, then p is inside the hull. */ - if (!vis) { - p->onhull = !ONHULL; -- return BFALSE; -+ return false; - } - - /* Mark edges in interior of visible region for deletion. -@@ -470,7 +466,7 @@ bool AddOne(tVertex p) - e->newface = MakeConeFace(e, p); - e = temp; - } while (e != edges); -- return BTRUE; -+ return true; - } - - /*--------------------------------------------------------------------- diff --git a/srcpkgs/grass/patches/fix-gettext-python.patch b/srcpkgs/grass/patches/fix-gettext-python.patch new file mode 100644 index 000000000000..bb407fc8bcdf --- /dev/null +++ b/srcpkgs/grass/patches/fix-gettext-python.patch @@ -0,0 +1,18 @@ +"codeset" in gettext.install() is deprecated with python 3.11 + +Backported from https://github.com/OSGeo/grass/pull/2539 + +--- a/lib/init/grass.py ++++ b/lib/init/grass.py +@@ -1392,10 +1392,7 @@ + del os.environ['LC_ALL'] # Remove LC_ALL to not override LC_NUMERIC + + # From now on enforce the new language +- if encoding: +- gettext.install('grasslibs', gpath('locale'), codeset=encoding) +- else: +- gettext.install('grasslibs', gpath('locale')) ++ gettext.install('grasslibs', gpath('locale')) + + + # TODO: grass_gui parameter is a hack and should be removed, see below diff --git a/srcpkgs/grass/patches/fix-locale-python.patch b/srcpkgs/grass/patches/fix-locale-python.patch new file mode 100644 index 000000000000..a8a0529b2013 --- /dev/null +++ b/srcpkgs/grass/patches/fix-locale-python.patch @@ -0,0 +1,130 @@ +locale.getdefaultlocale() is deprecated with python 3.11 + +Adapted from https://github.com/OSGeo/grass/pull/2550 + +diff a/gui/wxpython/core/gcmd.py +--- a/gui/wxpython/core/gcmd.py ++++ b/gui/wxpython/core/gcmd.py +@@ -773,7 +773,7 @@ + + :return: system encoding (can be None) + """ +- enc = locale.getdefaultlocale()[1] ++ enc = locale.getencoding() + if forceUTF8 and (enc is None or enc == 'UTF8'): + return 'UTF-8' + +diff a/gui/wxpython/core/gconsole.py b/gui/wxpython/core/gconsole.py +--- a/gui/wxpython/core/gconsole.py ++++ b/gui/wxpython/core/gconsole.py +@@ -399,7 +399,7 @@ + sys.stdout = self.cmdStdOut + sys.stderr = self.cmdStdErr + else: +- enc = locale.getdefaultlocale()[1] ++ enc = locale.getencoding() + if enc: + if sys.version_info.major == 2: + sys.stdout = codecs.getwriter(enc)(sys.__stdout__) +diff a/gui/wxpython/gui_core/forms.py b/gui/wxpython/gui_core/forms.py +--- a/gui/wxpython/gui_core/forms.py ++++ b/gui/wxpython/gui_core/forms.py +@@ -1858,7 +1858,7 @@ + size=(-1, 75)) + if p.get('value', '') and os.path.isfile(p['value']): + ifbb.Clear() +- enc = locale.getdefaultlocale()[1] ++ enc = locale.getencoding() + with codecs.open(p['value'], encoding=enc, errors='ignore') as f: + nonascii = bytearray(range(0x80, 0x100)) + for line in f.readlines(): +@@ -2389,7 +2389,7 @@ + + if dlg.ShowModal() == wx.ID_OK: + path = dlg.GetPath() +- enc = locale.getdefaultlocale()[1] ++ enc = locale.getencoding() + f = codecs.open(path, encoding=enc, mode='w', errors='replace') + try: + f.write(text + os.linesep) +diff a/gui/wxpython/gui_core/ghelp.py b/gui/wxpython/gui_core/ghelp.py +--- a/gui/wxpython/gui_core/ghelp.py ++++ b/gui/wxpython/gui_core/ghelp.py +@@ -234,7 +234,7 @@ + self.langUsed = grass.gisenv().get('LANG', None) + if not self.langUsed: + import locale +- loc = locale.getdefaultlocale() ++ loc = locale.getlocale() + if loc == (None, None): + self.langUsed = _('unknown') + else: +diff a/gui/wxpython/rlisetup/frame.py b/gui/wxpython/rlisetup/frame.py +--- a/gui/wxpython/rlisetup/frame.py ++++ b/gui/wxpython/rlisetup/frame.py +@@ -49,7 +49,7 @@ + self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose) + self.btn_ok.Bind(wx.EVT_BUTTON, self.OnOk) + self._layout() +- self.enc = locale.getdefaultlocale()[1] ++ self.enc = locale.getencoding() + + def _layout(self): + """Set the layout""" +diff a/lib/init/grass.py b/lib/init/grass.py +--- a/lib/init/grass.py ++++ b/lib/init/grass.py +@@ -62,7 +62,7 @@ + # for wxpath + _WXPYTHON_BASE = None + +-ENCODING = locale.getdefaultlocale()[1] ++ENCODING = locale.getencoding() + if ENCODING is None: + ENCODING = 'UTF-8' + print("Default locale not found, using UTF-8") # intentionally not translatable +@@ -1278,7 +1278,7 @@ + locale.setlocale(locale.LC_ALL, 'C') + sys.stderr.write("Default locale settings are missing. GRASS running with C locale.\n") + +- language, encoding = locale.getdefaultlocale() ++ language, encoding = locale.getlocale() + if not language: + sys.stderr.write("Default locale settings are missing. GRASS running with C locale.\n") + install_notranslation() +diff a/lib/python/gunittest/multirunner.py b/lib/python/gunittest/multirunner.py +--- a/lib/python/gunittest/multirunner.py ++++ b/lib/python/gunittest/multirunner.py +@@ -28,7 +28,7 @@ + + + def _get_encoding(): +- encoding = locale.getdefaultlocale()[1] ++ encoding = locale.getencoding() + if not encoding: + encoding = 'UTF-8' + return encoding +diff a/lib/python/script/utils.py b/lib/python/script/utils.py +--- a/lib/python/script/utils.py ++++ b/lib/python/script/utils.py +@@ -160,7 +160,7 @@ + + + def _get_encoding(): +- encoding = locale.getdefaultlocale()[1] ++ encoding = locale.getencoding() + if not encoding: + encoding = 'UTF-8' + return encoding +diff a/tools/mkhtml.py b/tools/mkhtml.py +--- a/tools/mkhtml.py ++++ b/tools/mkhtml.py +@@ -91,7 +91,7 @@ + + + def _get_encoding(): +- encoding = locale.getdefaultlocale()[1] ++ encoding = locale.getencoding() + if not encoding: + encoding = 'UTF-8' + return encoding diff --git a/srcpkgs/grass/template b/srcpkgs/grass/template index 5863a61a300d..b7048806554d 100644 --- a/srcpkgs/grass/template +++ b/srcpkgs/grass/template @@ -1,30 +1,31 @@ # Template file for 'grass' pkgname=grass -version=7.6.1 -revision=5 +version=7.8.7 +revision=1 _binver=${version//./} _binver=${_binver:0:2} build_style=gnu-configure -configure_args="--prefix=\${DESTDIR}/usr/share --bindir=\${DESTDIR}/usr/bin +configure_args="--prefix=/usr/share --bindir=/usr/bin --with-freetype-includes=${XBPS_CROSS_BASE}/usr/include/freetype2" -hostmakedepends="flex libgdal-tools pkg-config python-numpy tar" +hostmakedepends="flex libgdal-tools pkg-config python3-numpy python3-six tar" makedepends="proj-devel tiff-devel libgdal-devel sqlite-devel fftw-devel cairo-devel glu-devel wxPython-devel" -depends="python-numpy wxPython" +depends="python3-numpy python3-dateutil python3-Pillow python3-matplotlib + python3-six python3-ply wxPython4" short_desc="Geographic Resources Analysis Support System - GIS" maintainer="Alex Jarosch " license="GPL-2.0-or-later" homepage="https://grass.osgeo.org/" -distfiles="https://grass.osgeo.org/grass${_binver}/source/${pkgname}-${version}.tar.gz" -checksum=9e25c99cafd16ed8f5e2dca75b5a10dc2af0568dbedf3fc39f1c5a0a9c840b0b -python_version=2 +distfiles="https://grass.osgeo.org/grass${_binver}/source/grass-${version}.tar.gz" +checksum=4fff7be556d820ed81704bb27fe3ed913c173076bb3ed036bcc3a49bd4027f69 +python_version=3 nocross="tries to execute target binaries" post_install() { - # move grass76 libraries from /usr/share to /usr/lib + # move grass libraries from /usr/share to /usr/lib vmkdir usr/lib - mv ${DESTDIR}/usr/share/grass* ${DESTDIR}/usr/lib + mv ${DESTDIR}/usr/share/grass${_binver} ${DESTDIR}/usr/lib # fixes a todo in GISBASE - sed -i ${DESTDIR}/usr/bin/grass${_binver} \ - -e "105s;\(gisbase =\).*;\1 \"/usr/lib/grass-${version}\";" + vsed -i ${DESTDIR}/usr/bin/grass${_binver} \ + -e "87s;\(GISBASE =\).*;\1 \"/usr/lib/grass${_binver}\";" } From 5b8b80ffdb1d6e031289e4e3ea9e0ac3475d68d7 Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Sun, 6 Nov 2022 23:20:14 +0300 Subject: [PATCH 10/12] XyGrib: revbump for proj, fix build The current release does not support the new API of PROJ (>=8.0.0); included patch aims to solve the issue. Conditional make_build_args prevents crossbuilding with failing ninja ("unknown target LINK=${XBPS_CROSS_TRIPLET}-c++"). I suspect that this approach is a relique of the past and therefore is removed from the template. No other issues did arise due to this change. --- srcpkgs/XyGrib/patches/proj8_port.patch | 301 ++++++++++++++++++++++++ srcpkgs/XyGrib/template | 6 +- 2 files changed, 302 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/XyGrib/patches/proj8_port.patch diff --git a/srcpkgs/XyGrib/patches/proj8_port.patch b/srcpkgs/XyGrib/patches/proj8_port.patch new file mode 100644 index 000000000000..9d7b08f74c9c --- /dev/null +++ b/srcpkgs/XyGrib/patches/proj8_port.patch @@ -0,0 +1,301 @@ +reference: https://github.com/opengribs/XyGrib/pull/289 + +diff a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,11 +124,11 @@ + include_directories(${OPENJPEG_INCLUDE_DIR}) + + if(NOT WIN32) +- include(cmake/FindPROJ4.cmake) +- if(NOT PROJ4_FOUND) +- message(FATAL_ERROR "PROJ.4 library not found!") ++ include(cmake/FindPROJ.cmake) ++ if(NOT PROJ_FOUND) ++ message(FATAL_ERROR "PROJ library not found!") + endif() +- include_directories(${PROJ4_INCLUDE_DIRS}) ++ include_directories(${PROJ_INCLUDE_DIRS}) + endif() + if(WIN32) + find_library(PROJ4_LIBRARIES +diff a/src/CMakeLists.txt b/src/CMakeLists.txt +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -122,7 +122,7 @@ + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/map ${MAP_GENERATED_HEADERS}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/GUI ${GUI_GENERATED_HEADERS}) + +-target_link_libraries(${CMAKE_PROJECT_NAME} g2clib gui util map ${LIBNOVA_LIBRARY} ${OPENJPEG_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${PROJ4_LIBRARIES} ${PNG_LIBRARIES}) ++target_link_libraries(${CMAKE_PROJECT_NAME} g2clib gui util map ${LIBNOVA_LIBRARY} ${OPENJPEG_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${PROJ_LIBRARIES} ${PNG_LIBRARIES}) + + # Sanitizers, part 2/2 + if ( CMAKE_VERSION VERSION_GREATER 3.4 ) +diff a/src/map/Projection.h b/src/map/Projection.h +--- a/src/map/Projection.h ++++ b/src/map/Projection.h +@@ -21,10 +21,7 @@ + #include + #include + +-#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H +-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H +-#endif +-#include "proj_api.h" ++#include "proj.h" + + class Projection : public QObject + { +@@ -141,7 +138,7 @@ + int getProjection() {return currentProj;} + + private : +- projPJ libProj; ++ PJ * libProj; + int currentProj; + }; + +diff a/src/map/Projection_libproj.cpp b/src/map/Projection_libproj.cpp +--- a/src/map/Projection_libproj.cpp ++++ b/src/map/Projection_libproj.cpp +@@ -92,10 +92,9 @@ + params[nbpar++] = "ellps=WGS84"; + params[nbpar++] = "no_defs"; + params[nbpar++] = "over"; // allow longitude > 180° +- // XXX ouch pj_init +- libProj = pj_init(nbpar, (char **)params); ++ libProj = proj_create_argv(PJ_DEFAULT_CTX, nbpar, (char **)params); + if (!libProj) +- printf("proj error: %s\n", pj_strerrno(pj_errno)); ++ printf("proj error: %s\n", proj_errno_string(proj_errno(libProj))); + assert(libProj); + currentProj = code; + // libProj->over = 1; // allow longitude > 180° +@@ -106,23 +105,23 @@ + Projection_libproj::~Projection_libproj() + { + if (libProj != nullptr) { +- pj_free(libProj); ++ proj_destroy(libProj); + } + } + + //------------------------------------------------------------------------------- + void Projection_libproj::map2screen(double x, double y, int *i, int *j) const + { +- projUV data, res; ++ PJ_COORD data, res; + if (y <= -90.0) + y = -90.0+1e-5; + if (y >= 90.0) + y = 90.0-1e-5; +- data.v = y * DEG_TO_RAD; +- data.u = x * DEG_TO_RAD; +- res = pj_fwd(data, libProj); +- *i = (int) (W/2.0 + scale * (res.u/111319.0-CX) + 0.5); +- *j = (int) (H/2.0 - scale * (res.v/111319.0-CY) + 0.5); ++ data.uv.v = y; ++ data.uv.u = x; ++ res = proj_trans(libProj, PJ_FWD, data); ++ *i = (int) (W/2.0 + scale * (res.uv.u/111319.0-CX) + 0.5); ++ *j = (int) (H/2.0 - scale * (res.uv.v/111319.0-CY) + 0.5); + //printf("PROJ map2screen (%f %f) -> (%3d %3d)\n", x,y, *i,*j); + } + +@@ -130,12 +129,12 @@ + //------------------------------------------------------------------------------- + void Projection_libproj::screen2map(int i, int j, double *x, double *y) const + { +- projUV data, res; +- data.u = ((i-W/2.0)/scale+ CX)*111319.0 ; +- data.v = ((H/2.0-j)/scale+ CY)*111319.0 ; +- res = pj_inv(data, libProj); +- *x = (double)(res.u*RAD_TO_DEG); +- *y = (double)(res.v*RAD_TO_DEG); ++ PJ_COORD data, res; ++ data.uv.u = ((i-W/2.0)/scale+ CX)*111319.0 ; ++ data.uv.v = ((H/2.0-j)/scale+ CY)*111319.0 ; ++ res = proj_trans(libProj, PJ_INV, data); ++ *x = (double)(res.uv.u); ++ *y = (double)(res.uv.v); + //printf("PROJ screen2map (%3d %3d) -> (%f %f)\n", i,j, *x,*y); + } + //-------------------------------------------------------------- +--- a/cmake/FindPROJ4.cmake ++++ /dev/null +@@ -1,76 +0,0 @@ +-# - Find PROJ4 +-# Find the PROJ4 includes and library +-# +-# PROJ4_INCLUDE_DIR - Where to find PROJ4 includes +-# PROJ4_LIBRARIES - List of libraries when using PROJ4 +-# PROJ4_FOUND - True if PROJ4 was found +- +-IF(PROJ4_INCLUDE_DIR) +- SET(PROJ4_FIND_QUIETLY TRUE) +-ENDIF(PROJ4_INCLUDE_DIR) +- +-FIND_PATH(PROJ4_INCLUDE_DIR "proj_api.h" +- PATHS +- $ENV{EXTERNLIBS}/include +- $ENV{EXTERNLIBS}/proj4/include +- ~/Library/Frameworks/include +- /Library/Frameworks/include +- /usr/local/include +- /usr/include +- /sw/include # Fink +- /opt/local/include # DarwinPorts +- /opt/csw/include # Blastwave +- /opt/include +- DOC "PROJ4 - Headers" +-) +- +-SET(PROJ4_NAMES Proj4 proj proj_4_9) +-SET(PROJ4_DBG_NAMES Proj4D projD proj_4_9_D) +- +-FIND_LIBRARY(PROJ4_LIBRARY NAMES ${PROJ4_NAMES} +- PATHS +- $ENV{EXTERNLIBS} +- $ENV{EXTERNLIBS}/proj4 +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local +- /usr +- /sw +- /opt/local +- /opt/csw +- /opt +- PATH_SUFFIXES lib lib64 +- DOC "PROJ4 - Library" +-) +- +-INCLUDE(FindPackageHandleStandardArgs) +- +-IF(MSVC) +- # VisualStudio needs a debug version +- FIND_LIBRARY(PROJ4_LIBRARY_DEBUG NAMES ${PROJ4_DBG_NAMES} +- PATHS +- $ENV{EXTERNLIBS}/proj4/lib +- DOC "PROJ4 - Library (Debug)" +- ) +- +- IF(PROJ4_LIBRARY_DEBUG AND PROJ4_LIBRARY) +- SET(PROJ4_LIBRARIES optimized ${PROJ4_LIBRARY} debug ${PROJ4_LIBRARY_DEBUG}) +- ENDIF(PROJ4_LIBRARY_DEBUG AND PROJ4_LIBRARY) +- +- FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROJ4 DEFAULT_MSG PROJ4_LIBRARY PROJ4_LIBRARY_DEBUG PROJ4_INCLUDE_DIR) +- +- MARK_AS_ADVANCED(PROJ4_LIBRARY PROJ4_LIBRARY_DEBUG PROJ4_INCLUDE_DIR) +- +-ELSE(MSVC) +- # rest of the world +- SET(PROJ4_LIBRARIES ${PROJ4_LIBRARY}) +- +- FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROJ4 DEFAULT_MSG PROJ4_LIBRARY PROJ4_INCLUDE_DIR) +- +- MARK_AS_ADVANCED(PROJ4_LIBRARY PROJ4_INCLUDE_DIR) +- +-ENDIF(MSVC) +- +-IF(PROJ4_FOUND) +- SET(PROJ4_INCLUDE_DIRS ${PROJ4_INCLUDE_DIR}) +-ENDIF(PROJ4_FOUND) +--- /dev/null ++++ b/cmake/FindPROJ.cmake +@@ -0,0 +1,96 @@ ++# - Find PROJ ++# Find the PROJ includes and library ++# ++# PROJ_INCLUDE_DIR - Where to find PROJ includes ++# PROJ_LIBRARIES - List of libraries when using PROJ ++# PROJ_FOUND - True if PROJ was found ++ ++IF(PROJ_INCLUDE_DIR) ++ SET(PROJ_FIND_QUIETLY TRUE) ++ENDIF(PROJ_INCLUDE_DIR) ++ ++FIND_PATH(PROJ_INCLUDE_DIR "proj.h" ++ PATHS ++ $ENV{EXTERNLIBS}/include ++ $ENV{EXTERNLIBS}/PROJ/include ++ ~/Library/Frameworks/include ++ /Library/Frameworks/include ++ /usr/local/include ++ /usr/include ++ /sw/include # Fink ++ /opt/local/include # DarwinPorts ++ /opt/csw/include # Blastwave ++ /opt/include ++ DOC "PROJ - Headers" ++) ++ ++IF(PROJ_INCLUDE_DIR) ++ SET(PROJ_NAMES PROJ proj proj_8_0) ++ SET(PROJ_DBG_NAMES PROJD projD proj_8_0_1) ++ELSE(PROJ_INCLUDE_DIR) ++ FIND_PATH(PROJ_INCLUDE_DIR "proj_api.h" ++ PATHS ++ $ENV{EXTERNLIBS}/include ++ $ENV{EXTERNLIBS}/PROJ/include ++ ~/Library/Frameworks/include ++ /Library/Frameworks/include ++ /usr/local/include ++ /usr/include ++ /sw/include # Fink ++ /opt/local/include # DarwinPorts ++ /opt/csw/include # Blastwave ++ /opt/include ++ DOC "PROJ - Headers" ++ ) ++ ADD_DEFINITIONS(-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1) ++ SET(PROJ_NAMES PROJ proj proj_4_9) ++ SET(PROJ_DBG_NAMES PROJD projD proj_4_9_D) ++ENDIF(PROJ_INCLUDE_DIR) ++ ++FIND_LIBRARY(PROJ_LIBRARY NAMES ${PROJ_NAMES} ++ PATHS ++ $ENV{EXTERNLIBS} ++ $ENV{EXTERNLIBS}/PROJ ++ ~/Library/Frameworks ++ /Library/Frameworks ++ /usr/local ++ /usr ++ /sw ++ /opt/local ++ /opt/csw ++ /opt ++ PATH_SUFFIXES lib lib64 ++ DOC "PROJ - Library" ++) ++ ++INCLUDE(FindPackageHandleStandardArgs) ++ ++IF(MSVC) ++ # VisualStudio needs a debug version ++ FIND_LIBRARY(PROJ_LIBRARY_DEBUG NAMES ${PROJ_DBG_NAMES} ++ PATHS ++ $ENV{EXTERNLIBS}/PROJ/lib ++ DOC "PROJ - Library (Debug)" ++ ) ++ ++ IF(PROJ_LIBRARY_DEBUG AND PROJ_LIBRARY) ++ SET(PROJ_LIBRARIES optimized ${PROJ_LIBRARY} debug ${PROJ_LIBRARY_DEBUG}) ++ ENDIF(PROJ_LIBRARY_DEBUG AND PROJ_LIBRARY) ++ ++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROJ DEFAULT_MSG PROJ_LIBRARY PROJ_LIBRARY_DEBUG PROJ_INCLUDE_DIR) ++ ++ MARK_AS_ADVANCED(PROJ_LIBRARY PROJ_LIBRARY_DEBUG PROJ_INCLUDE_DIR) ++ ++ELSE(MSVC) ++ # rest of the world ++ SET(PROJ_LIBRARIES ${PROJ_LIBRARY}) ++ ++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROJ DEFAULT_MSG PROJ_LIBRARY PROJ_INCLUDE_DIR) ++ ++ MARK_AS_ADVANCED(PROJ_LIBRARY PROJ_INCLUDE_DIR) ++ ++ENDIF(MSVC) ++ ++IF(PROJ_FOUND) ++ SET(PROJ_INCLUDE_DIRS ${PROJ_INCLUDE_DIR}) ++ENDIF(PROJ_FOUND) diff --git a/srcpkgs/XyGrib/template b/srcpkgs/XyGrib/template index e4aa3a2e0265..b2a1272d5a9f 100644 --- a/srcpkgs/XyGrib/template +++ b/srcpkgs/XyGrib/template @@ -1,7 +1,7 @@ # Template file for 'XyGrib' pkgname=XyGrib version=1.2.6.1 -revision=3 +revision=4 build_style=cmake hostmakedepends="qt5-devel pkg-config" makedepends="jasper-devel libnova-devel nettle-devel proj-devel qt5-devel @@ -13,10 +13,6 @@ homepage="https://opengribs.org/" distfiles="https://github.com/opengribs/XyGrib/archive/v${version}.tar.gz" checksum=2dc6099293ae6f7a4bfbfc0cab590cf7ad48241d608e6d7a76e35961b9fc2157 -if [ "$CROSS_BUILD" ]; then - make_build_args="LINK=${XBPS_CROSS_TRIPLET}-c++" -fi - post_patch() { vsed -i -e '\!/usr/include/openjpeg-2.3!i /usr/include/openjpeg-2.4' \ CMakeLists.txt From 40f3571d9a03119ea4a2e2bee368bd9c38ae8687 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sun, 20 Nov 2022 18:20:06 +0100 Subject: [PATCH 11/12] OpenOrienteering-Mapper: rebuild for proj 9.1 --- .../accept-transformation-authorities.patch | 35 ++ .../patches/fix-proj-cmake.patch | 321 ++++++++++++++++++ srcpkgs/OpenOrienteering-Mapper/template | 2 +- 3 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/OpenOrienteering-Mapper/patches/accept-transformation-authorities.patch create mode 100644 srcpkgs/OpenOrienteering-Mapper/patches/fix-proj-cmake.patch diff --git a/srcpkgs/OpenOrienteering-Mapper/patches/accept-transformation-authorities.patch b/srcpkgs/OpenOrienteering-Mapper/patches/accept-transformation-authorities.patch new file mode 100644 index 000000000000..f20b4843694c --- /dev/null +++ b/srcpkgs/OpenOrienteering-Mapper/patches/accept-transformation-authorities.patch @@ -0,0 +1,35 @@ +https://github.com/OpenOrienteering/mapper/pull/2024/commits/40cddb15d316ec90fe1207b737afade7b382457a + +From 40cddb15d316ec90fe1207b737afade7b382457a Mon Sep 17 00:00:00 2001 +From: Scott Turner +Date: Sun, 9 Jan 2022 13:53:09 -0500 +Subject: [PATCH] Georeferencing: Choose transformations without restricting + authority + +When using PROJ to set up a transformation between two CRSes, use +an AUTHORITY=any option to allow all transformations to be considered. +In particular, an ESRI datum transformation between WGS84 and NAD83 +is not available from EPSG, and provides a more accurate result. +--- + src/core/georeferencing.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/core/georeferencing.cpp b/src/core/georeferencing.cpp +index 43b28fec6..57a4d7b74 100644 +--- a/src/core/georeferencing.cpp ++++ b/src/core/georeferencing.cpp +@@ -383,7 +383,14 @@ ProjTransform::ProjTransform(const QString& crs_spec) + // Cf. https://github.com/OSGeo/PROJ/pull/1573 + crs_spec_utf8.replace("+datum=potsdam", "+ellps=bessel +nadgrids=@BETA2007.gsb"); + #endif ++#if defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) || (PROJ_VERSION_MAJOR) < 8 + pj = proj_create_crs_to_crs(PJ_DEFAULT_CTX, geographic_crs_spec_utf8, crs_spec_utf8, nullptr); ++#else ++ static auto const geographic_crs = crs(Georeferencing::geographic_crs_spec); ++ auto const projected_crs = crs(crs_spec); ++ static const char* const options[] = {"AUTHORITY=any", nullptr}; ++ pj = proj_create_crs_to_crs_from_pj(PJ_DEFAULT_CTX, geographic_crs.pj, projected_crs.pj, nullptr, options); ++#endif + if (pj) + operator=({proj_normalize_for_visualization(PJ_DEFAULT_CTX, pj)}); + } diff --git a/srcpkgs/OpenOrienteering-Mapper/patches/fix-proj-cmake.patch b/srcpkgs/OpenOrienteering-Mapper/patches/fix-proj-cmake.patch new file mode 100644 index 000000000000..31311fc3585d --- /dev/null +++ b/srcpkgs/OpenOrienteering-Mapper/patches/fix-proj-cmake.patch @@ -0,0 +1,321 @@ +From 08cc5e4c73175ebf3e9bb2295f718e914366d51b Mon Sep 17 00:00:00 2001 +From: Kai Pastor +Date: Wed, 15 Dec 2021 09:32:10 +0100 +Subject: [PATCH] Find PROJ via cmake config or via pkg-config + +Drop the custom find module for PROJ. Cmake config or pkg-config data +is provided from PROJ's build system. This covers PROJ 4.9 to 8.2, +dynamic and static linkage, including transitive dependencies. +--- + CMakeLists.txt | 23 ++-- + cmake/FindPROJ4.cmake | 152 ------------------------- + doc/licensing/linux-distribution.cmake | 5 +- + packaging/CMakeLists.txt | 25 ++-- + packaging/android/Mapper.pro.in | 2 +- + src/CMakeLists.txt | 2 +- + test/CMakeLists.txt | 2 +- + 7 files changed, 31 insertions(+), 180 deletions(-) + delete mode 100644 cmake/FindPROJ4.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index da5ad1e7b..e6a6ddeaa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -203,20 +203,27 @@ endif() + + # We must not require a minimum version of PROJ via find_package + # because PROJ config requires the major version to match exactly. +-find_package(PROJ4 REQUIRED) +-if(NOT TARGET PROJ4::proj) +- include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindPROJ.cmake") ++find_package(PROJ CONFIG) ++if(NOT PROJ_LIBRARIES) ++ find_package(PkgConfig REQUIRED) ++ if(PKG_CONFIG_FOUND) ++ pkg_check_modules(PROJ4_PC IMPORTED_TARGET proj) ++ endif() ++ if(TARGET PkgConfig::PROJ4_PC) ++ set(PROJ_LIBRARIES PkgConfig::PROJ4_PC) ++ set(PROJ_VERSION "${PROJ4_PC_VERSION}") ++ endif() + endif() +-if(NOT PROJ4_VERSION OR PROJ4_VERSION VERSION_LESS 4.9) ++if(NOT PROJ_VERSION OR PROJ_VERSION VERSION_LESS 4.9) + message(FATAL_ERROR "At least PROJ 4.9 is required") +-elseif(PROJ4_VERSION VERSION_LESS 6.1) ++elseif(PROJ_VERSION VERSION_LESS 6.1) + # New PROJ API missing or incomplete. + # (proj_normalize_for_visualization() came in 6.1.) +- set_property(TARGET PROJ4::proj APPEND PROPERTY ++ set_property(TARGET "${PROJ_LIBRARIES}" APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) +-elseif(PROJ4_VERSION VERSION_LESS 6.2.1) ++elseif(PROJ_VERSION VERSION_LESS 6.2.1) + # Datum Potsdam issue, https://github.com/OSGeo/PROJ/pull/1573 +- set_property(TARGET PROJ4::proj APPEND PROPERTY ++ set_property(TARGET "${PROJ_LIBRARIES}" APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS PROJ_ISSUE_1573) + endif() + +diff --git a/cmake/FindPROJ4.cmake b/cmake/FindPROJ4.cmake +deleted file mode 100644 +index 093deaa79..000000000 +--- a/cmake/FindPROJ4.cmake ++++ /dev/null +@@ -1,152 +0,0 @@ +-#.rst: +-# FindPROJ4 +-# -------- +-# +-# Find the proj includes and library. +-# +-# IMPORTED Targets +-# ^^^^^^^^^^^^^^^^ +-# +-# This module defines :prop_tgt:`IMPORTED` target ``PROJ4::proj``, +-# if Proj.4 has been found. +-# +-# Result Variables +-# ^^^^^^^^^^^^^^^^ +-# +-# This module defines the following variables: +-# +-# :: +-# +-# PROJ4_INCLUDE_DIRS - where to find proj_api.h, etc. +-# PROJ4_LIBRARIES - List of libraries when using libproj. +-# PROJ4_FOUND - True if libproj found. +-# +-# :: +-# +-# PROJ4_VERSION - The version of libproj found (x.y.z) +-# PROJ4_VERSION_MAJOR - The major version of libproj +-# PROJ4_VERSION_MINOR - The minor version of libproj +-# PROJ4_VERSION_PATCH - The patch version of libproj +-# PROJ4_VERSION_TWEAK - always 0 +-# PROJ4_VERSION_COUNT - The number of version components, always 3 +-# +-# Hints +-# ^^^^^ +-# +-# A user may set ``PROJ4_ROOT`` to a libproj installation root to tell this +-# module where to look exclusively. +- +-#============================================================================= +-# Copyright 2016 Kai Pastor +-# +-# +-# This file was derived from CMake 3.5's module FindZLIB.cmake +-# which has the following terms: +-# +-# Copyright 2001-2011 Kitware, Inc. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are +-# met: +-# +-# * Redistributions of source code must retain the above copyright notice, +-# this list of conditions and the following disclaimer. +-# +-# * Redistributions in binary form must reproduce the above copyright notice, +-# this list of conditions and the following disclaimer in the documentation +-# and/or other materials provided with the distribution. +-# +-# * The names of Kitware, Inc., the Insight Consortium, or the names of +-# any consortium members, or of any contributors, may not be used to +-# endorse or promote products derived from this software without +-# specific prior written permission. +-# +-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' +-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-#============================================================================= +- +-# Search PROJ4_ROOT exclusively if it is set. +-if(PROJ4_ROOT) +- set(_PROJ4_SEARCH PATHS ${PROJ4_ROOT} NO_DEFAULT_PATH) +-else() +- set(_PROJ4_SEARCH) +-endif() +- +-find_path(PROJ4_INCLUDE_DIR NAMES proj_api.h ${_PROJ4_SEARCH} PATH_SUFFIXES include) +-mark_as_advanced(PROJ4_INCLUDE_DIR) +- +-if(PROJ4_INCLUDE_DIR AND EXISTS "${PROJ4_INCLUDE_DIR}/proj_api.h") +- file(STRINGS "${PROJ4_INCLUDE_DIR}/proj_api.h" PROJ4_H REGEX "^#define PJ_VERSION [0-9]+$") +- +- string(REGEX REPLACE "^.*PJ_VERSION ([0-9]).*$" "\\1" PROJ4_VERSION_MAJOR "${PROJ4_H}") +- string(REGEX REPLACE "^.*PJ_VERSION [0-9]([0-9]).*$" "\\1" PROJ4_VERSION_MINOR "${PROJ4_H}") +- string(REGEX REPLACE "^.*PJ_VERSION [0-9][0-9]([0-9]).*$" "\\1" PROJ4_VERSION_PATCH "${PROJ4_H}") +- set(PROJ4_VERSION "${PROJ4_VERSION_MAJOR}.${PROJ4_VERSION_MINOR}.${PROJ4_VERSION_PATCH}") +- set(PROJ4_VERSION_COUNT 3) +-endif() +- +-# Allow PROJ4_LIBRARY to be set manually, as the location of the proj library +-if(NOT PROJ4_LIBRARY) +- set(PROJ4_NAMES proj) +- set(PROJ4_NAMES_DEBUG projd) +- if(WIN32 AND DEFINED PROJ4_VERSION_MAJOR AND DEFINED PROJ4_VERSION_MINOR) +- list(APPEND PROJ4_NAMES proj_${PROJ4_VERSION_MAJOR}_${PROJ4_VERSION_MINOR}) +- list(APPEND PROJ4_NAMES projd_${PROJ4_VERSION_MAJOR}_${PROJ4_VERSION_MINOR}) +- endif() +- find_library(PROJ4_LIBRARY_RELEASE NAMES ${PROJ4_NAMES} ${_PROJ4_SEARCH} PATH_SUFFIXES lib) +- find_library(PROJ4_LIBRARY_DEBUG NAMES ${PROJ4_NAMES_DEBUG} ${_PROJ4_SEARCH} PATH_SUFFIXES lib) +- include(SelectLibraryConfigurations) +- select_library_configurations(PROJ4) +-endif() +- +-# handle the QUIETLY and REQUIRED arguments and set PROJ4_FOUND to TRUE if +-# all listed variables are TRUE +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(PROJ4 +- REQUIRED_VARS +- PROJ4_LIBRARY +- PROJ4_INCLUDE_DIR +- VERSION_VAR +- PROJ4_VERSION +-) +- +-if(PROJ4_FOUND) +- set(PROJ4_INCLUDE_DIRS ${PROJ4_INCLUDE_DIR}) +- +- if(NOT PROJ4_LIBRARIES) +- set(PROJ4_LIBRARIES ${PROJ4_LIBRARY}) +- endif() +- +- if(NOT TARGET PROJ4::proj) +- add_library(PROJ4::proj UNKNOWN IMPORTED) +- set_target_properties(PROJ4::proj PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${PROJ4_INCLUDE_DIRS}") +- +- if(PROJ4_LIBRARY_RELEASE) +- set_property(TARGET PROJ4::proj APPEND PROPERTY +- IMPORTED_CONFIGURATIONS RELEASE) +- set_target_properties(PROJ4::proj PROPERTIES +- IMPORTED_LOCATION_RELEASE "${PROJ4_LIBRARY_RELEASE}") +- endif() +- +- if(PROJ4_LIBRARY_DEBUG) +- set_property(TARGET PROJ4::proj APPEND PROPERTY +- IMPORTED_CONFIGURATIONS DEBUG) +- set_target_properties(PROJ4::proj PROPERTIES +- IMPORTED_LOCATION_DEBUG "${PROJ4_LIBRARY_DEBUG}") +- endif() +- +- if(NOT PROJ4_LIBRARY_RELEASE AND NOT PROJ4_LIBRARY_DEBUG) +- set_property(TARGET PROJ4::proj APPEND PROPERTY +- IMPORTED_LOCATION "${PROJ4_LIBRARY}") +- endif() +- endif() +-endif() +diff --git a/doc/licensing/linux-distribution.cmake b/doc/licensing/linux-distribution.cmake +index b2bc5d72c..7a1d39f7b 100644 +--- a/doc/licensing/linux-distribution.cmake ++++ b/doc/licensing/linux-distribution.cmake +@@ -106,9 +106,8 @@ foreach(dependency ${easy_dependencies}) + elseif(dependency STREQUAL "libpolyclipping") + find_package(Polyclipping) + list(APPEND explicit_copyright_${dependency} "${POLYCLIPPING_VERSION}") +- elseif(dependency STREQUAL "proj") +- find_package(PROJ4) +- list(APPEND explicit_copyright_${dependency} "${PROJ4_VERSION}") ++ elseif(dependency STREQUAL "proj" AND PROJ_VERSION) ++ list(APPEND explicit_copyright_${dependency} "${PROJ_VERSION}") + elseif(dependency STREQUAL "zlib") + find_package(ZLIB) + list(APPEND explicit_copyright_${dependency} "${ZLIB_VERSION_STRING}") +diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt +index 4a981c681..eabb4bb14 100644 +--- a/packaging/CMakeLists.txt ++++ b/packaging/CMakeLists.txt +@@ -235,25 +235,22 @@ unset(MAPPER_LIBS) + + if(Mapper_PACKAGE_PROJ) + if(NOT PROJ_DATA_DIR) +- unset(PROJ_DATA_DIR CACHE) +- if(PROJ4_ROOT) +- set(proj_data_paths "${PROJ4_ROOT}/share/proj") +- elseif(PROJ4_DIR) ++ if(PROJ_DIR) + # Cf. find_package documentation +- string(REGEX REPLACE "/CMake$|/cmake$" "" proj_data_paths "${PROJ4_DIR}") # U +- string(REGEX REPLACE "/PROJ4[^/]*$|/proj4[^/]*$" "" proj_data_paths "${proj_data_paths}") # U, W +- string(REGEX REPLACE "/cmake$" "" proj_data_paths "${proj_data_paths}") # U +- string(REGEX REPLACE "/lib/[^/]*$|/lib$|/share$" "" proj_data_paths "${proj_data_paths}") # U, W +- set(proj_data_paths "${proj_data_paths}/share/proj") +- elseif(PROJ4_INCLUDE_DIRS) +- string(REGEX REPLACE "/include$" "/share/proj" proj_data_paths ${PROJ4_INCLUDE_DIRS}) # MSYS2 et al. ++ string(REGEX REPLACE "/CMake$|/cmake$" "" proj_prefix "${PROJ_DIR}") # U ++ string(REGEX REPLACE "/PROJ[^/]*$|/proj[^/]*$" "" proj_prefix "${proj_prefix}") # U, W ++ string(REGEX REPLACE "/cmake$" "" proj_prefix "${proj_prefix}") # U ++ string(REGEX REPLACE "/lib/[^/]*$|/lib$|/share$" "" proj_prefix "${proj_prefix}") # U, W ++ elseif(PROJ4_PC_PREFIX) ++ set(proj_prefix "${PROJ4_PC_PREFIX}") + else() +- set(proj_data_paths PATHS "${CMAKE_INSTALL_PREFIX}/share/proj") ++ set(proj_prefix "${CMAKE_INSTALL_PREFIX}") + endif() + find_path(PROJ_DATA_DIR + DOC "The PROJ data files directory" + NAMES epsg proj.db +- PATHS ${proj_data_paths} ++ PATHS ${proj_prefix} ++ PATH_SUFFIXES "share/proj" "share" + NO_DEFAULT_PATH + ) + endif() +@@ -266,7 +263,7 @@ if(Mapper_PACKAGE_PROJ) + install( + DIRECTORY "${PROJ_DATA_DIR}" + DESTINATION "${MAPPER_DATA_DESTINATION}") +- list(APPEND MAPPER_LIB_HINTS ${PROJ4_ROOT}/bin) ++ list(APPEND MAPPER_LIB_HINTS "${proj_prefix}/bin") + endif() + + if(Mapper_PACKAGE_GDAL) +diff --git a/packaging/android/Mapper.pro.in b/packaging/android/Mapper.pro.in +index b3e88ca11..2017e3933 100644 +--- a/packaging/android/Mapper.pro.in ++++ b/packaging/android/Mapper.pro.in +@@ -38,7 +38,7 @@ PROJECT_BINARY_DIR = "@PROJECT_BINARY_DIR@" + # in CPackConfig.cmake when a package version changes. + CPACK_CONFIG_CLEANUP_TRIGGER = \ + GDAL: @GDAL_VERSION@ \ +- PROJ: @PROJ4_VERSION@ \ ++ PROJ: @PROJ_VERSION@ \ + Qt5: @Qt5Core_VERSION@ + + # For the generated .pro file to be used in Qt Creator, +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a4b7d1454..aff2fa8e4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -301,7 +301,7 @@ add_dependencies(Mapper_Common + ) + target_link_libraries(Mapper_Common + Polyclipping::Polyclipping +- PROJ4::proj ++ ${PROJ_LIBRARIES} + Qt5::Widgets + ) + foreach(lib +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 37d5278da..19b2567d9 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -65,7 +65,7 @@ function(add_test_helper testname autorun) + endforeach() + add_executable(${testname} ${testname}.cpp ${TEST_${testname}_SRCS}) + target_link_libraries(${testname} PRIVATE +- PROJ4::proj ++ ${PROJ_LIBRARIES} + Qt5::Test + Qt5::Gui + Polyclipping::Polyclipping diff --git a/srcpkgs/OpenOrienteering-Mapper/template b/srcpkgs/OpenOrienteering-Mapper/template index e725ac02dff9..dd2ae82385e3 100644 --- a/srcpkgs/OpenOrienteering-Mapper/template +++ b/srcpkgs/OpenOrienteering-Mapper/template @@ -1,7 +1,7 @@ # Template file for 'OpenOrienteering-Mapper' pkgname=OpenOrienteering-Mapper version=0.9.5 -revision=2 +revision=3 build_style=cmake hostmakedepends="doxygen qt5-host-tools qt5-plugin-sqlite qt5-qmake qt5-tools" makedepends="qt5-devel clipper-devel proj-devel zlib-devel libgdal-devel From 1b08cd9ddc8e75e13abcbc4bae1fc31b6329cdb8 Mon Sep 17 00:00:00 2001 From: Arjan Mossel Date: Sun, 4 Dec 2022 00:16:39 +0100 Subject: [PATCH 12/12] vtk: rebuild for proj 9.1 --- srcpkgs/vtk/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/vtk/template b/srcpkgs/vtk/template index 6870bdcf0857..d448f31fa762 100644 --- a/srcpkgs/vtk/template +++ b/srcpkgs/vtk/template @@ -1,7 +1,7 @@ # Template file for 'vtk' pkgname=vtk version=9.2.2 -revision=1 +revision=2 build_style=cmake # vtk can be huge, especially with -DVTK_BUILD_ALL_MODULES=ON" # Build only the core modules plus python bindings for now