Repository: conan-io/conan-center-index

Issue:
[request] <pkgconf>/<1.7.4>
The above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.

The pkgconf recipe retrieves the sources from [https://distfiles.dereferenced.org/pkgconf](https://distfiles.dereferenced.org/pkgconf) but a git repo is available: https://github.com/pkgconf/pkgconf/tree/pkgconf-1.7.4 

The distfiles website is reporting an expired SSL cerrtificate if I try to install pkgconf/1.7.3



Discussion:
https://github.com/pkgconf/pkgconf/issues/221

Resolving patch:
diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py
--- a/recipes/pkgconf/all/conanfile.py
+++ b/recipes/pkgconf/all/conanfile.py
@@ -47,7 +47,7 @@ def source(self):
         os.rename("pkgconf-{}".format(self.version), self._source_subfolder)
 
     def build_requirements(self):
-        self.build_requires("meson/0.56.2")
+        self.build_requires("meson/0.57.2")
 
     @property
     def _sharedstatedir(self):
@@ -65,12 +65,16 @@ def _configure_meson(self):
     def _patch_sources(self):
         for patch in self.conan_data["patches"][self.version]:
             tools.patch(**patch)
-        tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"),
-                              "shared_library(", "library(")
+        if tools.Version(self.version) < "1.7.4":
+            tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"),
+                                "shared_library(", "library(")
         if not self.options.shared:
             tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"),
                                   "'-DLIBPKGCONF_EXPORT'",
                                   "'-DPKGCONFIG_IS_STATIC'")
+        tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"),
+            "project('pkgconf', 'c',",
+            "project('pkgconf', 'c',\ndefault_options : ['c_std=gnu99'],")
 
     def build(self):
         self._patch_sources()
@@ -92,9 +96,14 @@ def package(self):
         os.rename(os.path.join(self.package_folder, "share", "aclocal"),
                   os.path.join(self.package_folder, "bin", "aclocal"))
         tools.rmdir(os.path.join(self.package_folder, "share"))
+        tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
 
     def package_info(self):
-        self.cpp_info.includedirs.append(os.path.join("include", "libpkgconf"))
+        if tools.Version(self.version) < "1.7.4":
+            self.cpp_info.includedirs.append("include")
+        else:
+            self.cpp_info.includedirs.append(os.path.join("include", "pkgconf"))
+        self.cpp_info.names["pkg_config"] = "libpkgconf"
         self.cpp_info.libs = ["pkgconf"]
         if not self.options.shared:
             self.cpp_info.defines = ["PKGCONFIG_IS_STATIC"]


Test patch:
diff --git a/recipes/pkgconf/all/test_package/conanfile.py b/recipes/pkgconf/all/test_package/conanfile.py
--- a/recipes/pkgconf/all/test_package/conanfile.py
+++ b/recipes/pkgconf/all/test_package/conanfile.py
@@ -9,10 +9,10 @@ class TestPackageConan(ConanFile):
     generators = "cmake"
 
     def build_requirements(self):
-        self.build_requires("automake/1.16.2")
+        self.build_requires("automake/1.16.3")
         if tools.os_info.is_windows and not tools.get_env("CONAN_BASH_PATH") \
                 and tools.os_info.detect_windows_subsystem() != "msys2":
-            self.build_requires("msys2/20190524")
+            self.build_requires("msys2/cci.latest")
 
     def build(self):
         # Test pkg.m4 integration into automake
diff --git a/recipes/pkgconf/all/test_package/test_package.c b/recipes/pkgconf/all/test_package/test_package.c
--- a/recipes/pkgconf/all/test_package/test_package.c
+++ b/recipes/pkgconf/all/test_package/test_package.c
@@ -1,4 +1,4 @@
-#include "libpkgconf.h"
+#include "libpkgconf/libpkgconf.h"
 
 #include <stdio.h>
 #include <stdlib.h>