Skip to content

Commit

Permalink
(conan-io#14490) [doxygen] Add Version 1.9.5 and bump dependency vers…
Browse files Browse the repository at this point in the history
…ions

* add 1.9.5 entries and bump dependeny versions

* Update conanfile.py

* remove unnecessary patch files

* Update conanfile.py

* add m4

* add v1 test package

* remove deps generator

* return to old codebase

* apply patches

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* remove weird cmake configure function

* Update conandata.yml

* remove CONAN_PKG

* remove unused patches

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* use visualmstudio 16

* Update conanfile.py

* remove version 1.9.5

* Update conanfile.py

use 2.0 cmake tools

* use patch file

* Update conanfile.py

* remove unused imports

* make the package v2 compatible

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py

* Update recipes/doxygen/all/conanfile.py

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

* Update conanfile.py

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
  • Loading branch information
2 people authored and StellaSmith committed Feb 2, 2023
1 parent a308ef4 commit 350a1d6
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 1,430 deletions.
7 changes: 0 additions & 7 deletions recipes/doxygen/all/CMakeLists.txt

This file was deleted.

21 changes: 13 additions & 8 deletions recipes/doxygen/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ sources:
patches:
"1.9.2":
- patch_file: "patches/1.9.2-0001-imported-target.patch"
base_path: "source_subfolder"
patch_description: "Fix includes"
patch_type: "portability"
"1.9.1":
- patch_file: "patches/1.9.1-0001-imported-target.patch"
base_path: "source_subfolder"
patch_description: "Fix includes"
patch_type: "portability"
"1.8.20":
- patch_file: "patches/1.8.20-0001-relocatable-cmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/1.8-0001-xapian.patch"
patch_description: "Fix xapian find_package command"
patch_type: "portability"
"1.8.18":
- patch_file: "patches/1.8.18-0001-relocatable-cmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/1.8-0001-xapian.patch"
patch_description: "Fix xapian find_package command"
patch_type: "portability"
"1.8.17":
- patch_file: "patches/1.8.17-0001-relocatable-cmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/1.8-0001-xapian.patch"
patch_description: "Fix xapian find_package command"
patch_type: "portability"
80 changes: 33 additions & 47 deletions recipes/doxygen/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get
from conan.tools.microsoft import is_msvc_static_runtime
from conan.tools.scm import Version
from conan import tools
from conans import CMake
from conan.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.50.2"
required_conan_version = ">=1.52.0"


class DoxygenConan(ConanFile):
Expand All @@ -25,24 +26,16 @@ class DoxygenConan(ConanFile):
"enable_search": True,
}

exports_sources = "CMakeLists.txt", "patches/*"
generators = "cmake", "cmake_find_package"
short_paths = True

_cmake = None

@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)

def layout(self):
cmake_layout(self, src_folder="src")

def export_sources(self):
export_conandata_patches(self)

def _minimum_compiler_version(self):
if Version(self.version) <= "1.9.1":
return {
Expand All @@ -55,17 +48,18 @@ def _minimum_compiler_version(self):

def configure(self):
del self.settings.compiler.cppstd

def requirements(self):
if self.options.enable_search:
self.requires("xapian-core/1.4.19")
self.requires("zlib/1.2.12")
self.requires("zlib/1.2.13")

def build_requirements(self):
if self._settings_build.os == "Windows":
self.build_requires("winflexbison/2.5.24")
self.tool_requires("winflexbison/2.5.24")
else:
self.build_requires("flex/2.6.4")
self.build_requires("bison/3.7.1")
self.tool_requires("flex/2.6.4")
self.tool_requires("bison/3.8.2")

def validate(self):
minimum_compiler_version = self._minimum_compiler_version()
Expand All @@ -79,42 +73,33 @@ def validate(self):

def package_id(self):
del self.info.settings.compiler

# Doxygen doesn't make code. Any package that will run is ok to use.
# It's ok in general to use a release version of the tool that matches the
# build os and architecture.
compatible_pkg = self.info.clone()
compatible_pkg.settings.build_type = "Release"
self.compatible_packages.append(compatible_pkg)

def source(self):
tools.files.get(self, **self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.definitions["build_parse"] = self.options.enable_parse
self._cmake.definitions["build_search"] = self.options.enable_search
self._cmake.definitions["use_libc++"] = self.settings.compiler.get_safe("libcxx") == "libc++"
self._cmake.definitions["win_static"] = "MT" in self.settings.compiler.get_safe("runtime", "")
self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["build_parse"] = self.options.enable_parse
tc.variables["build_search"] = self.options.enable_search
tc.variables["use_libc++"] = self.settings.compiler.get_safe("libcxx") == "libc++"
tc.variables["win_static"] = is_msvc_static_runtime(self)
tc.generate()

deps = CMakeDeps(self)
deps.generate()

def build(self):
if os.path.isfile("Findflex.cmake"):
os.unlink("Findflex.cmake")
if os.path.isfile("Findbison.cmake"):
os.unlink("Findbison.cmake")
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.files.patch(self, **patch)
cmake = self._configure_cmake()
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
cmake = self._configure_cmake()
self.copy("LICENSE", src=self.source_folder, dst="licenses")
cmake = CMake(self)
cmake.install()

def package_info(self):
Expand All @@ -123,3 +108,4 @@ def package_info(self):
bin_path = os.path.join(self.package_folder, "bin")
self.output.info(f"Appending PATH environment variable: {bin_path}")
self.env_info.PATH.append(bin_path)
self.cpp_info.set_property("cmake_find_mode", "none")
13 changes: 13 additions & 0 deletions recipes/doxygen/all/patches/1.8-0001-xapian.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/addon/doxysearch/CMakeLists.txt 2020-08-24 13:12:55.000000000 +0200
+++ b/addon/doxysearch/CMakeLists.txt 2022-12-16 20:41:07.040801300 +0100
@@ -1,8 +1,8 @@
-find_package(Xapian REQUIRED)
+find_package(xapian REQUIRED)
find_package(ZLIB REQUIRED)

if (WIN32)
- set(WIN_EXTRA_LIBS "uuid.lib rpcrt4.lib ws2_32.lib")
+ set(WIN_EXTRA_LIBS uuid.lib rpcrt4.lib ws2_32.lib)
endif()

include_directories(
Loading

0 comments on commit 350a1d6

Please sign in to comment.