Repository: conan-io/conan-center-index

Issue:
Letter misprint in jemalloc recipe
https://github.com/conan-io/conan-center-index/blob/a40f8d2e097ffb1f98797011f7694ba7b9efe91d/recipes/jemalloc/all/conanfile.py#L96

Instead of --enable-initial-exec-tld must be --enbal-initial-exec-tls


Discussion:

Resolving patch:
diff --git a/recipes/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py
--- a/recipes/jemalloc/all/conanfile.py
+++ b/recipes/jemalloc/all/conanfile.py
@@ -41,6 +41,7 @@ class JemallocConan(ConanFile):
         "enable_initial_exec_tls": True,
         "enable_libdl": True,
     }
+    exports_sources = ["patches/**"]
 
     _autotools = None
 
@@ -72,6 +73,8 @@ def configure(self):
             raise ConanInvalidConfiguration("Only Release and Debug build_types are supported")
         if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"):
             raise ConanInvalidConfiguration("Unsupported arch")
+        if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) <= "3.9":
+            raise ConanInvalidConfiguration("Unsupported compiler version")
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
@@ -93,7 +96,7 @@ def _autotools_args(self):
             "--enable-syscall" if self.options.enable_syscall else "--disable-syscall",
             "--enable-lazy-lock" if self.options.enable_lazy_lock else "--disable-lazy-lock",
             "--enable-log" if self.options.enable_debug_logging else "--disable-log",
-            "--enable-initial-exec-tld" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls",
+            "--enable-initial-exec-tls" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls",
             "--enable-libdl" if self.options.enable_libdl else "--disable-libdl",
         ]
         if self.options.shared:
@@ -130,6 +133,9 @@ def _patch_sources(self):
                                   "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n"
                                   "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)")
 
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            tools.patch(**patch)
+
     def build(self):
         self._patch_sources()
         if self.settings.compiler == "Visual Studio":


Test patch:
diff --git a/recipes/jemalloc/all/test_package/CMakeLists.txt b/recipes/jemalloc/all/test_package/CMakeLists.txt
--- a/recipes/jemalloc/all/test_package/CMakeLists.txt
+++ b/recipes/jemalloc/all/test_package/CMakeLists.txt
@@ -1,9 +1,9 @@
 cmake_minimum_required(VERSION 3.1)
-project(test_package)
+project(test_package LANGUAGES CXX)
 
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
 conan_basic_setup()
 
-add_executable(${PROJECT_NAME} test_package.c)
+add_executable(${PROJECT_NAME} test_package.cpp)
 target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
-set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY C_STANDARD 99)
+set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11)
diff --git a/recipes/jemalloc/all/test_package/test_package.c b/recipes/jemalloc/all/test_package/test_package.cpp
similarity index 100%
rename from recipes/jemalloc/all/test_package/test_package.c
rename to recipes/jemalloc/all/test_package/test_package.cpp