1 |
commit: e46f6618ca90e250deecbe59263fa144f6aa5a30 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 26 16:52:26 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 26 16:56:20 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e46f6618 |
7 |
|
8 |
sci-geosciences/liblas: fix >=GDAL-2.5.0, USE debug, missing return val |
9 |
|
10 |
Closes: https://bugs.gentoo.org/698846 |
11 |
Closes: https://bugs.gentoo.org/668778 |
12 |
Closes: https://bugs.gentoo.org/707706 |
13 |
Package-Manager: Portage-2.3.89, Repoman-2.3.20 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
.../files/liblas-1.8.1-CVE-2018-20540-fixup.patch | 24 ++++++++++ |
17 |
.../liblas/files/liblas-1.8.1-fix-debug.patch | 18 +++++++ |
18 |
.../liblas/files/liblas-1.8.1-gdal-2.5.0.patch | 34 +++++++++++++ |
19 |
sci-geosciences/liblas/liblas-1.8.1-r3.ebuild | 55 ++++++++++++++++++++++ |
20 |
4 files changed, 131 insertions(+) |
21 |
|
22 |
diff --git a/sci-geosciences/liblas/files/liblas-1.8.1-CVE-2018-20540-fixup.patch b/sci-geosciences/liblas/files/liblas-1.8.1-CVE-2018-20540-fixup.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..6f0c132b5c5 |
25 |
--- /dev/null |
26 |
+++ b/sci-geosciences/liblas/files/liblas-1.8.1-CVE-2018-20540-fixup.patch |
27 |
@@ -0,0 +1,24 @@ |
28 |
+From 6a666b9101293b13fde4e4eb1d2c627f7613515e Mon Sep 17 00:00:00 2001 |
29 |
+From: =?UTF-8?q?Felipe=20M=2E=20L=C3=B3pez?= <femulop@×××××.com> |
30 |
+Date: Fri, 19 Jul 2019 08:26:44 +0200 |
31 |
+Subject: [PATCH] Always return NULL when Open() is used (#168) |
32 |
+ |
33 |
+Attempt to open LAS file using standard stream, without |
34 |
+Boost supports built in, always failed with |
35 |
+"Cannot open sample.las for read. Exiting..." |
36 |
+--- |
37 |
+ include/liblas/liblas.hpp | 1 + |
38 |
+ 1 file changed, 1 insertion(+) |
39 |
+ |
40 |
+diff --git a/include/liblas/liblas.hpp b/include/liblas/liblas.hpp |
41 |
+index 325de3ff..5c950ce0 100644 |
42 |
+--- a/include/liblas/liblas.hpp |
43 |
++++ b/include/liblas/liblas.hpp |
44 |
+@@ -138,6 +138,7 @@ inline std::istream* Open(std::string const& filename, std::ios::openmode mode) |
45 |
+ ifs = new std::ifstream(); |
46 |
+ ifs->open(filename.c_str(), mode); |
47 |
+ if (ifs->is_open() == false) return NULL; |
48 |
++ return ifs; |
49 |
+ } |
50 |
+ catch (...) |
51 |
+ { |
52 |
|
53 |
diff --git a/sci-geosciences/liblas/files/liblas-1.8.1-fix-debug.patch b/sci-geosciences/liblas/files/liblas-1.8.1-fix-debug.patch |
54 |
new file mode 100644 |
55 |
index 00000000000..0c3b8ceec26 |
56 |
--- /dev/null |
57 |
+++ b/sci-geosciences/liblas/files/liblas-1.8.1-fix-debug.patch |
58 |
@@ -0,0 +1,18 @@ |
59 |
+Description: Fix compilation with -DDEBUG and GDAL >= 2 |
60 |
+Author: Even Rouault <even.rouault@×××××××××.com> |
61 |
+Origin: https://github.com/libLAS/libLAS/commit/72f7709bf1dfd3473b64cdba0259363d3beea3c3 |
62 |
+ |
63 |
+--- a/src/gt_wkt_srs.cpp |
64 |
++++ b/src/gt_wkt_srs.cpp |
65 |
+@@ -90,7 +90,11 @@ static const char *papszDatumEquiv[] = |
66 |
+ /* LibgeotiffOneTimeInit() */ |
67 |
+ /************************************************************************/ |
68 |
+ |
69 |
++#if GDAL_VERSION_MAJOR >= 2 |
70 |
++static CPLMutex* hMutex = NULL; |
71 |
++#else |
72 |
+ static void* hMutex = NULL; |
73 |
++#endif |
74 |
+ |
75 |
+ void LibgeotiffOneTimeInit() |
76 |
+ { |
77 |
|
78 |
diff --git a/sci-geosciences/liblas/files/liblas-1.8.1-gdal-2.5.0.patch b/sci-geosciences/liblas/files/liblas-1.8.1-gdal-2.5.0.patch |
79 |
new file mode 100644 |
80 |
index 00000000000..0691c16c1b7 |
81 |
--- /dev/null |
82 |
+++ b/sci-geosciences/liblas/files/liblas-1.8.1-gdal-2.5.0.patch |
83 |
@@ -0,0 +1,34 @@ |
84 |
+From 3a572ff7e684668da62c794b37ccccbc169723de Mon Sep 17 00:00:00 2001 |
85 |
+From: Andreas Sturmlechner <asturm@g.o> |
86 |
+Date: Wed, 26 Feb 2020 17:45:30 +0100 |
87 |
+Subject: [PATCH] Fix build against >=GDAL-2.5.0 |
88 |
+ |
89 |
+Signed-off-by: Andreas Sturmlechner <asturm@g.o> |
90 |
+--- |
91 |
+ src/gt_wkt_srs.cpp | 3 --- |
92 |
+ 1 file changed, 3 deletions(-) |
93 |
+ |
94 |
+diff --git a/src/gt_wkt_srs.cpp b/src/gt_wkt_srs.cpp |
95 |
+index 9871aa0..099972d 100755 |
96 |
+--- a/src/gt_wkt_srs.cpp |
97 |
++++ b/src/gt_wkt_srs.cpp |
98 |
+@@ -493,7 +493,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn ) |
99 |
+ { |
100 |
+ char *pszWKT; |
101 |
+ oSRS.morphFromESRI(); |
102 |
+- oSRS.FixupOrdering(); |
103 |
+ if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) |
104 |
+ return pszWKT; |
105 |
+ } |
106 |
+@@ -1094,8 +1093,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn ) |
107 |
+ /* ==================================================================== */ |
108 |
+ char *pszWKT; |
109 |
+ |
110 |
+- oSRS.FixupOrdering(); |
111 |
+- |
112 |
+ if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) |
113 |
+ return pszWKT; |
114 |
+ else |
115 |
+-- |
116 |
+2.25.1 |
117 |
+ |
118 |
|
119 |
diff --git a/sci-geosciences/liblas/liblas-1.8.1-r3.ebuild b/sci-geosciences/liblas/liblas-1.8.1-r3.ebuild |
120 |
new file mode 100644 |
121 |
index 00000000000..30ac4893834 |
122 |
--- /dev/null |
123 |
+++ b/sci-geosciences/liblas/liblas-1.8.1-r3.ebuild |
124 |
@@ -0,0 +1,55 @@ |
125 |
+# Copyright 1999-2020 Gentoo Authors |
126 |
+# Distributed under the terms of the GNU General Public License v2 |
127 |
+ |
128 |
+EAPI=7 |
129 |
+ |
130 |
+inherit cmake |
131 |
+ |
132 |
+DESCRIPTION="C/C++ library for manipulating the LAS LiDAR format common in GIS" |
133 |
+HOMEPAGE="https://github.com/libLAS/libLAS/" |
134 |
+SRC_URI="https://github.com/libLAS/libLAS/archive/${PV}.tar.gz -> ${P}.tar.gz" |
135 |
+ |
136 |
+SLOT="0" |
137 |
+LICENSE="BSD" |
138 |
+KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86" |
139 |
+IUSE="gdal" |
140 |
+ |
141 |
+DEPEND=" |
142 |
+ dev-libs/boost:= |
143 |
+ sci-geosciences/laszip |
144 |
+ sci-libs/libgeotiff:= |
145 |
+ gdal? ( sci-libs/gdal:= ) |
146 |
+" |
147 |
+RDEPEND="${DEPEND}" |
148 |
+ |
149 |
+# tests known to fail due to LD_LIBRARY_PATH issue |
150 |
+RESTRICT="test" |
151 |
+ |
152 |
+S="${WORKDIR}/libLAS-${PV}" |
153 |
+ |
154 |
+PATCHES=( |
155 |
+ "${FILESDIR}"/${PN}-1.8.0_remove-std-c++98.patch |
156 |
+ "${FILESDIR}"/${P}-fix-overload-call.patch # bug 661654 |
157 |
+ "${FILESDIR}"/${P}-CVE-2018-20540.patch # bug 678482 |
158 |
+ "${FILESDIR}"/${P}-CVE-2018-20540-fixup.patch # bug 698846 |
159 |
+ "${FILESDIR}"/${P}-fix-debug.patch # bug 668778 |
160 |
+) |
161 |
+ |
162 |
+src_prepare() { |
163 |
+ use gdal && has_version ">=sci-libs/gdal-2.5.0" && PATCHES+=( |
164 |
+ "${FILESDIR}"/${P}-gdal-2.5.0.patch # bug 707706 |
165 |
+ ) |
166 |
+ cmake_src_prepare |
167 |
+ |
168 |
+ # add missing linkage |
169 |
+ sed -e 's:${LAS2COL} ${LIBLAS_C_LIB_NAME}:& ${CMAKE_THREAD_LIBS_INIT}:' \ |
170 |
+ -i "${S}/apps/CMakeLists.txt" || die |
171 |
+} |
172 |
+ |
173 |
+src_configure() { |
174 |
+ local mycmakeargs=( |
175 |
+ -DLIBLAS_LIB_SUBDIR=$(get_libdir) |
176 |
+ -DWITH_GDAL=$(usex gdal) |
177 |
+ ) |
178 |
+ cmake_src_configure |
179 |
+} |