Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion recipes/vorbis/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ sources:
url: "https://github.com/xiph/vorbis/archive/v1.3.6.tar.gz"
sha256: "43fc4bc34f13da15b8acfa72fd594678e214d1cab35fc51d3a54969a725464eb"
patches:
"1.3.7":
- patch_file: "patches/1.3.7-0001-mingw-shared-def.patch"
patch_description: "MinGW: fix .def file for shared lib"
patch_type: "portability"
patch_source: "https://github.com/xiph/vorbis/pull/76"
"1.3.6":
- patch_file: "patches/link-libm-find-package-ogg.patch"
- patch_file: "patches/1.3.6-0001-link-libm-find-package-ogg.patch"
patch_description: "CMake: robust discovery and link of libm and Ogg"
patch_type: "conan"
32 changes: 11 additions & 21 deletions recipes/vorbis/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, get, rmdir
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
import os

required_conan_version = ">=1.52.0"
required_conan_version = ">=1.54.0"


class VorbisConan(ConanFile):
name = "vorbis"
description = "The VORBIS audio codec library"
topics = ("vorbis", "audio", "codec")
topics = ("audio", "codec")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://xiph.org/vorbis/"
license = "BSD-3-Clause"

package_type = "library"
settings = "os", "arch", "build_type", "compiler"
options = {
"shared": [True, False],
Expand All @@ -25,8 +25,7 @@ class VorbisConan(ConanFile):
}

def export_sources(self):
for p in self.conan_data.get("patches", {}).get(self.version, []):
copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder)
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
Expand All @@ -35,31 +34,22 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
try:
del self.settings.compiler.libcxx
except Exception:
pass
try:
del self.settings.compiler.cppstd
except Exception:
pass

def requirements(self):
self.requires("ogg/1.3.5", transitive_headers=True, transitive_libs=True)
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("ogg/1.3.5", transitive_headers=True, transitive_libs=True)

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

def generate(self):
tc = CMakeToolchain(self)
# Relocatable shared lib on Macos
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()
cd = CMakeDeps(self)
cd.generate()
Expand Down
29 changes: 29 additions & 0 deletions recipes/vorbis/all/patches/1.3.7-0001-mingw-shared-def.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/win32/vorbis.def
+++ b/win32/vorbis.def
@@ -1,6 +1,6 @@
; vorbis.def
;
-LIBRARY
+
EXPORTS
_floor_P
_mapping_P
--- a/win32/vorbisenc.def
+++ b/win32/vorbisenc.def
@@ -1,6 +1,5 @@
; vorbisenc.def
;
-LIBRARY

EXPORTS
vorbis_encode_init
--- a/win32/vorbisfile.def
+++ b/win32/vorbisfile.def
@@ -1,6 +1,6 @@
; vorbisfile.def
;
-LIBRARY
+
EXPORTS
ov_clear
ov_open