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 2 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
14 changes: 13 additions & 1 deletion recipes/opusfile/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.android import android_abi
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir
Expand Down Expand Up @@ -75,10 +76,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 @@ -95,11 +103,15 @@ def generate(self):
f"--enable-http={yes_no(self.options.http)}",
"--disable-examples",
])
if self.settings.os == "Android" and int(str(self.settings.os.api_level)) < 24 and "armeabi" in android_abi(self):
tc.extra_defines.extend([
"fseeko=fseek",
"ftello=ftell",
])
tc.generate()
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