Forráskód Böngészése

Fetch and unpack FLAC source code

DarkMorford 5 éve
szülő
commit
15c0413f30
2 módosított fájl, 54 hozzáadás és 0 törlés
  1. 4 0
      conandata.yml
  2. 50 0
      conanfile.py

+ 4 - 0
conandata.yml

@@ -0,0 +1,4 @@
+sources:
+  1.3.2:
+    url: "http://downloads.xiph.org/releases/flac/flac-1.3.2.tar.xz"
+    sha256: "91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f"

+ 50 - 0
conanfile.py

@@ -0,0 +1,50 @@
+from conans import ConanFile, CMake, tools
+import os
+
+
+class LibFlacConan(ConanFile):
+    name = "libflac"
+    version = "1.3.2"
+    license = "BSD-2-Clause"
+    author = "Shawn Morford <DarkMorford@Gmail.com>"
+    url = "https://code.darkmorford.net/conan-pkg/libflac"
+    description = ("FLAC stands for Free Lossless Audio Codec, an audio format similar to MP3, "
+                   "but lossless, meaning that audio is compressed in FLAC without any loss in quality.")
+    homepage = "https://xiph.org/flac/"
+    topics = ("media", "audio", "lossless", "xiph.org")
+    settings = "os", "compiler", "build_type", "arch"
+    options = {"shared": [True, False]}
+    default_options = {"shared": False}
+    generators = "cmake"
+
+    @property
+    def subfolder(self):
+        return os.path.join(self.source_folder, f"flac-{self.version}")
+
+    def source(self):
+        tools.get(**self.conan_data["sources"][self.version])
+
+    def configure(self):
+        del self.settings.compiler.cppstd
+        del self.settings.compiler.libcxx
+
+    def build(self):
+        cmake = CMake(self)
+        cmake.configure(source_folder="hello")
+        cmake.build()
+
+        # Explicit way:
+        # self.run('cmake %s/hello %s'
+        #          % (self.source_folder, cmake.command_line))
+        # self.run("cmake --build . %s" % cmake.build_config)
+
+    def package(self):
+        self.copy("*.h", dst="include", src="hello")
+        self.copy("*hello.lib", dst="lib", keep_path=False)
+        self.copy("*.dll", dst="bin", keep_path=False)
+        self.copy("*.so", dst="lib", keep_path=False)
+        self.copy("*.dylib", dst="lib", keep_path=False)
+        self.copy("*.a", dst="lib", keep_path=False)
+
+    def package_info(self):
+        self.cpp_info.libs = ["hello"]