1###############################################################################
2##  This file is part of GammaRay, the Qt application inspection and
3##  manipulation tool.
4##
5##  Copyright (C) 2019-2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
6##  Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
7##
8##  Licensees holding valid commercial KDAB GammaRay licenses may use this file in
9##  accordance with GammaRay Commercial License Agreement provided with the Software.
10##
11##  Contact info@kdab.com if any conditions of this licensing are not clear to you.
12##
13##  This program is free software; you can redistribute it and/or modify
14##  it under the terms of the GNU General Public License as published by
15##  the Free Software Foundation, either version 2 of the License, or
16##  (at your option) any later version.
17##
18##  This program is distributed in the hope that it will be useful,
19##  but WITHOUT ANY WARRANTY; without even the implied warranty of
20##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21##  GNU General Public License for more details.
22##
23##  You should have received a copy of the GNU General Public License
24##  along with this program.  If not, see <http://www.gnu.org/licenses/>.
25###############################################################################
26
27from conans import ConanFile, CMake, tools
28
29class KSyntaxHighlightingConan(ConanFile):
30    name = "KSyntaxHighlighting"
31    version = "5.64.0"
32    license = "https://cgit.kde.org/syntax-highlighting.git/plain/COPYING"
33    url = "git://anongit.kde.org/syntax-highlighting.git"
34    description = "This is a stand-alone implementation of the Kate syntax highlighting engine."
35    generators = "cmake"
36
37    def requirements(self):
38        self.requires("qt/5.13.2@kdab/stable")
39        self.requires("ECM/5.64.0@kdab/stable")
40
41    def source(self):
42        git = tools.Git(folder="")
43        git.clone(self.url)
44        git.checkout("v%s"%self.version)
45
46    def configure(self):
47        # Use kdab flags to match qt package hash
48        # ~$ conan create -ks -o qt:qttools=True -o qt:qtsvg=True -o qt:qtdeclarative=True -o qt:qtremoteobjects=True -o qt:qtscxml=True . 5.13.2@kdab/stable
49        self.options["qt"].qtsvg = True
50        self.options["qt"].qtdeclarative = True
51        self.options["qt"].qtremoteobjects = True
52        self.options["qt"].qtscxml = True
53        self.options["qt"].qttools = True
54
55    def build(self):
56        self.cmake = CMake(self)
57        self.cmake.configure()
58        self.cmake.build()
59
60    def package(self):
61        self.cmake.install()
62
63    def package_info(self):
64        self.env_info.CMAKE_PREFIX_PATH.append(self.package_folder)
65