Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opusfile: fix building for Android with http=True #26245

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions recipes/opusfile/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from conan.tools.microsoft import is_msvc, MSBuild, MSBuildDeps, MSBuildToolchain
import os

required_conan_version = ">=1.54.0"
required_conan_version = ">=2.4"


class OpusFileConan(ConanFile):
Expand All @@ -20,6 +20,7 @@ class OpusFileConan(ConanFile):
license = "BSD-3-Clause"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
languages = "C"
options = {
"shared": [True, False],
"fPIC": [True, False],
Expand Down Expand Up @@ -49,8 +50,6 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

def layout(self):
basic_layout(self, src_folder="src")
Expand All @@ -75,10 +74,17 @@ def build_requirements(self):
if not self.conf.get("tools.microsoft.bash:path", check_type=str):
self.tool_requires("msys2/cci.latest")

def _patch_sources(self):
apply_conandata_patches(self)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
self._patch_sources()

def generate(self):
if self.settings.os == "Android":
replace_in_file(self, os.path.join(self.source_folder, "configure.ac"), "c89", "c99")

if is_msvc(self):
tc = MSBuildToolchain(self)
tc.configuration = self._msbuild_configuration
Expand All @@ -99,7 +105,6 @@ def generate(self):
PkgConfigDeps(self).generate()

def build(self):
apply_conandata_patches(self)
if is_msvc(self):
sln_folder = os.path.join(self.source_folder, "win32", "VS2015")
vcxproj = os.path.join(sln_folder, "opusfile.vcxproj")
Expand Down