Skip to content

Commit

Permalink
(conan-io#5588) libsndfile: bump to libsndfile/1.0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jun 21, 2021
1 parent 18061e3 commit ae86df9
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 28 deletions.
20 changes: 13 additions & 7 deletions recipes/libsndfile/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
sources:
"1.0.29":
url: "https://github.com/erikd/libsndfile/archive/v1.0.29.tar.gz"
sha256: "c5541ccfa672b3f461ac21a38cdd37b1fe061cc62a422800b9d53649dee549ee"
"1.0.31":
url: "https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2"
sha256: "a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163"
"1.0.30":
url: "https://github.com/erikd/libsndfile/archive/v1.0.30.tar.gz"
sha256: "5942b963d1db3ed8ab1ffb85708322aa9637df76d9fe84e1dfe49a97a90e8f47"
url: "https://github.com/libsndfile/libsndfile/releases/download/v1.0.30/libsndfile-1.0.30.tar.bz2"
sha256: "9df273302c4fa160567f412e10cc4f76666b66281e7ba48370fb544e87e4611a"
"1.0.29":
url: "https://github.com/libsndfile/libsndfile/releases/download/v1.0.29/libsndfile-1.0.29.tar.bz2"
sha256: "2ba20d44817c8176f097ab25eff44ef0aeec9e00973def5a7174c5ae0764b22f"
patches:
"1.0.31":
- base_path: "source_subfolder"
patch_file: "patches/1.0.31-0001-disable-static-runtime-logic.patch"
"1.0.30":
- base_path: source_subfolder
patch_file: patches/0001-disable-static-runtime-logic.patch
- base_path: "source_subfolder"
patch_file: "patches/1.0.30-0001-disable-static-runtime-logic.patch"
9 changes: 5 additions & 4 deletions recipes/libsndfile/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from conans import ConanFile, CMake, tools
import os

required_conan_version = ">=1.33.0"


class LibsndfileConan(ConanFile):
name = "libsndfile"
Expand Down Expand Up @@ -29,7 +31,7 @@ class LibsndfileConan(ConanFile):
"with_external_libs": True,

}
exports_sources = ["CMakeLists.txt", "patches/**"]
exports_sources = "CMakeLists.txt", "patches/*"
generators = "cmake", "cmake_find_package"

_cmake = None
Expand Down Expand Up @@ -60,8 +62,7 @@ def configure(self):
del self.options.with_sqlite

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)

def _configure_cmake(self):
if self._cmake:
Expand Down Expand Up @@ -107,7 +108,7 @@ def package(self):

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "SndFile"
self.cpp_info.names["cmake_find_package"] = "SndFile"
self.cpp_info.names["cmake_find_package_multi"] = "SndFile"
self.cpp_info.names["pkg_config"] = "sndfile"
self.cpp_info.components["sndfile"].libs = ["sndfile"]
if self.options.with_external_libs:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- cmake/SndFileChecks.cmake
+++ cmake/SndFileChecks.cmake
@@ -222,7 +222,7 @@
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif (MSVC)

-if (DEFINED ENABLE_STATIC_RUNTIME)
+if (FALSE)
if (MSVC)
if (ENABLE_STATIC_RUNTIME)
foreach (flag_var
12 changes: 6 additions & 6 deletions recipes/libsndfile/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.1)
project(PackageTest CXX)
project(test_package CXX)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup(TARGETS)

find_package(SndFile REQUIRED)
find_package(SndFile REQUIRED CONFIG)

add_executable(example example.cpp)
target_link_libraries(example PRIVATE SndFile::sndfile)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE SndFile::sndfile)
9 changes: 4 additions & 5 deletions recipes/libsndfile/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import os

from conans import ConanFile, CMake, tools
import os


class LibsndfileTestConan(ConanFile):
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
Expand All @@ -14,5 +13,5 @@ def build(self):

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "example")
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <iostream>
#include "sndfile.hh"

#include <iostream>

int main(int argc, char *argv[]) {
if (argc < 2) {
std::cout << "Usage: example <file.wav>" << std::endl;
std::cout << "Usage: example <file.wav>\n";
} else {
SndfileHandle handle(argv[1]);
std::cout << "Sample rate: " << handle.samplerate() << std::endl;
std::cout << "Sample rate: " << handle.samplerate() << "\n";
}
return 0;
}
8 changes: 5 additions & 3 deletions recipes/libsndfile/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
versions:
"1.0.28":
folder: "1.0.28"
"1.0.29":
"1.0.31":
folder: "all"
"1.0.30":
folder: "all"
"1.0.29":
folder: "all"
"1.0.28":
folder: "1.0.28"

0 comments on commit ae86df9

Please sign in to comment.