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

add minimp3/20200221 #938

Merged
merged 1 commit into from
Mar 2, 2020
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
4 changes: 4 additions & 0 deletions recipes/minimp3/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"20200221":
url: "https://github.com/lieff/minimp3/archive/9229f280ad475a434d7592255dc01534db65504f.zip"
sha256: "263dd1b9538780ae5489dddb4ab0397aa2d2c6ea7783bef4c7a0aad9555569ec"
29 changes: 29 additions & 0 deletions recipes/minimp3/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

from conans import ConanFile, tools

class Minimp3Conan(ConanFile):
name = "minimp3"
description = "Minimalistic MP3 decoder single header library."
license = "CC0-1.0"
topics = ("conan", "minimp3", "decoder", "mp3", "header-only")
homepage = "https://github.com/lieff/minimp3"
url = "https://github.com/conan-io/conan-center-index"
no_copy_source = True

@property
def _source_subfolder(self):
return "source_subfolder"

def source(self):
tools.get(**self.conan_data["sources"][self.version])
url = self.conan_data["sources"][self.version]["url"]
extracted_dir = "minimp3-" + os.path.splitext(os.path.basename(url))[0]
os.rename(extracted_dir, self._source_subfolder)

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="minimp3*.h", dst="include", src=self._source_subfolder)

def package_id(self):
self.info.header_only()
8 changes: 8 additions & 0 deletions recipes/minimp3/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 2.8.11)
project(test_package C)

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

add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
17 changes: 17 additions & 0 deletions recipes/minimp3/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

from conans import ConanFile, CMake, tools

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

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
9 changes: 9 additions & 0 deletions recipes/minimp3/all/test_package/test_package.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#define MINIMP3_IMPLEMENTATION
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
#include <minimp3.h>

int main() {
static mp3dec_t mp3d;
mp3dec_init(&mp3d);

return 0;
}
3 changes: 3 additions & 0 deletions recipes/minimp3/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"20200221":
folder: all