diff --git a/recipes/soxr/all/conanfile.py b/recipes/soxr/all/conanfile.py index 505e7d5e58fc6..e075ec16e3d7e 100644 --- a/recipes/soxr/all/conanfile.py +++ b/recipes/soxr/all/conanfile.py @@ -1,3 +1,4 @@ +import itertools import os from conans import ConanFile, CMake, tools @@ -23,7 +24,7 @@ class SoxrConan(ConanFile): "with_lsr_bindings": True } generators = "cmake" - exports_sources = ["patches/**", "licenses/**"] + exports_sources = "patches/**" _cmake = None @@ -69,9 +70,17 @@ def build(self): cmake = self._configure_cmake() cmake.build() + def _extract_pffft_license(self): + # extract license header from pffft.c and store it in the package folder + with open(os.path.join(self._source_subfolder, "src", "pffft.c"), "r") as f: + # the license header starts in line 3 and ends in line 55 + lines = map(lambda line: line.lstrip("/* "), itertools.islice(f, 3, 55)) + with open(os.path.join(self.package_folder, "licenses", "pffft"), "w") as f2: + f2.writelines(lines) + def package(self): self.copy("LICENCE", dst="licenses", src=self._source_subfolder) - self.copy("licenses/pffft", dst="licenses", keep_path=False) + self._extract_pffft_license() cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "doc")) diff --git a/recipes/soxr/all/licenses/pffft b/recipes/soxr/all/licenses/pffft deleted file mode 100644 index fa3a3618b1562..0000000000000 --- a/recipes/soxr/all/licenses/pffft +++ /dev/null @@ -1,52 +0,0 @@ -Copyright (c) 2013 Julien Pommier ( pommier@modartt.com ) - -Based on original fortran 77 code from FFTPACKv4 from NETLIB -(http://www.netlib.org/fftpack), authored by Dr Paul Swarztrauber -of NCAR, in 1985. - -As confirmed by the NCAR fftpack software curators, the following -FFTPACKv5 license applies to FFTPACKv4 sources. My changes are -released under the same terms. - -FFTPACK license: - -http://www.cisl.ucar.edu/css/software/fftpack5/ftpk.html - -Copyright (c) 2004 the University Corporation for Atmospheric -Research ("UCAR"). All rights reserved. Developed by NCAR's -Computational and Information Systems Laboratory, UCAR, -www.cisl.ucar.edu. - -Redistribution and use of the Software in source and binary forms, -with or without modification, is permitted provided that the -following conditions are met: - -- Neither the names of NCAR's Computational and Information Systems -Laboratory, the University Corporation for Atmospheric Research, -nor the names of its sponsors or contributors may be used to -endorse or promote products derived from this Software without -specific prior written permission. - -- Redistributions of source code must retain the above copyright -notices, this list of conditions, and the disclaimer below. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions, and the disclaimer below in the -documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -SOFTWARE. - - -PFFFT : a Pretty Fast FFT. - -This file is largerly based on the original FFTPACK implementation, modified in -order to take advantage of SIMD instructions of modern CPUs.