Przeglądaj źródła

Add ls-std 2023.2.1 recipe

Patrick-Christopher Mattulat 11 miesięcy temu
rodzic
commit
7305761035
1 zmienionych plików z 44 dodań i 0 usunięć
  1. 44 0
      recipes/ls-std/2023-2-1/conanfile.py

+ 44 - 0
recipes/ls-std/2023-2-1/conanfile.py

@@ -0,0 +1,44 @@
+from conans import ConanFile, CMake
+
+
+class LsStdConan(ConanFile):
+    name = "ls-std"
+    version = "2023.2.1"
+    license = "MIT"
+    url = "<Package recipe repository url here, for issues about the package>"
+    description = "This is a cross-platform standard library written in C++ offering functionalities you would usually miss in C++'s standard template library (STL), especially if you would search for cross-platform implementations."
+    topics = ("boxing", "core", "encoding", "event", "io", "logic", "time")
+    settings = "os", "compiler", "build_type", "arch"
+    options = {"shared": [True, False]}
+    default_options = {"shared": False}
+    generators = "cmake"
+
+    def source(self):
+        self.run("git clone https://vcs.lynarstudios.de/public/ls-standard-library.git --branch v" + self.version +
+                 " --single-branch")
+
+    def build(self):
+        cmake = self.__configure_cmake()
+        cmake.build()
+
+    def package(self):
+        self.copy("*.hpp", dst="include", src="ls-standard-library/include")
+        self.copy("*.lib", dst="lib", keep_path=False)
+        self.copy("*.a", dst="lib", keep_path=False)
+        self.copy("*.so", dst="lib", keep_path=False)
+        self.copy("*.dll", dst="lib", keep_path=False)
+        self.copy("*.dylib", dst="lib", keep_path=False)
+
+    def package_info(self):
+        self.cpp_info.libs = ["ls-std-boxing", "ls-std-core", "ls-std-encoding", "ls-std-event", "ls-std-io", "ls-std-logic", "ls-std-time"]
+
+    def __configure_cmake(self):
+        cmake = CMake(self)
+
+        if self.options.shared:
+            cmake.definitions['LS_STD_BUILD_STATIC'] = "OFF"
+            cmake.definitions['LS_STD_BUILD_SHARED'] = "ON"
+
+        cmake.configure(source_folder="ls-standard-library")
+
+        return cmake