Skip to content

Commit b192c59

Browse files
authored
Merge pull request #178 from serpent7776/fix-freebsd
FreeBSD support for conan-center hook
2 parents 3d487ef + 9951702 commit b192c59

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

hooks/conan-center.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,16 +649,18 @@ def _files_match_settings(conanfile, folder, output):
649649
mingw_extensions = ["a", "a.dll", "dll", "exe", "sh"]
650650
# The "" extension is allowed to look for possible executables
651651
linux_extensions = ["a", "so", "sh", ""]
652+
freebsd_extensions = ["a", "so", "sh", ""]
652653
macos_extensions = ["a", "dylib", ""]
653654

654655
has_header = _get_files_with_extensions(folder, header_extensions)
655656
has_visual = _get_files_with_extensions(folder, visual_extensions)
656657
has_mingw = _get_files_with_extensions(folder, mingw_extensions)
657658
has_linux = _get_files_with_extensions(folder, linux_extensions)
659+
has_freebsd = _get_files_with_extensions(folder, freebsd_extensions)
658660
has_macos = _get_files_with_extensions(folder, macos_extensions)
659661
os = _get_os(conanfile)
660662

661-
if not has_header and not has_visual and not has_mingw and not has_linux and not has_macos:
663+
if not has_header and not has_visual and not has_mingw and not has_linux and not has_freebsd and not has_macos:
662664
output.error("Empty package")
663665
return False
664666
if _is_recipe_header_only(conanfile):
@@ -686,18 +688,25 @@ def _files_match_settings(conanfile, folder, output):
686688
output.error("Package for Linux does not contain artifacts with these extensions: "
687689
"%s" % linux_extensions)
688690
return has_linux
691+
if os == "FreeBSD":
692+
if not has_freebsd:
693+
output.error("Package for FreeBSD does not contain artifacts with these extensions: "
694+
"%s" % freebsd_extensions)
695+
return has_freebsd
689696
if os == "Macos":
690697
if not has_macos:
691698
output.error("Package for Macos does not contain artifacts with these extensions: "
692699
"%s" % macos_extensions)
693700
return has_macos
694701
if os is None:
695-
if not has_header and (has_visual or has_mingw or has_linux or has_macos):
702+
if not has_header and (has_visual or has_mingw or has_linux or has_freebsd or has_macos):
696703
output.error("Package for Header Only does not contain artifacts with these extensions: "
697704
"%s" % header_extensions)
698705
return False
699706
else:
700707
return True
708+
709+
output.error("OS %s might not be supported" % os)
701710
return False
702711

703712

0 commit comments

Comments
 (0)