-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gobject-introspection 1.66.1 #4254
Merged
conan-center-bot
merged 2 commits into
conan-io:master
from
bincrafters:gobject-introspection
Jan 19, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"1.66.1": | ||
url: "https://download.gnome.org/sources/gobject-introspection/1.66/gobject-introspection-1.66.1.tar.xz" | ||
sha256: "dd44a55ee5f426ea22b6b89624708f9e8d53f5cc94e5485c15c87cb30e06161d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment | ||
from conans.errors import ConanInvalidConfiguration | ||
import os | ||
import shutil | ||
import glob | ||
|
||
|
||
class GobjectIntrospectionConan(ConanFile): | ||
name = "gobject-introspection" | ||
description = "GObject introspection is a middleware layer between C libraries (using GObject) and language bindings" | ||
topics = ("conan", "gobject-instrospection") | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://gitlab.gnome.org/GNOME/gobject-introspection" | ||
license = "LGPL-2.1" | ||
settings = "os", "arch", "compiler", "build_type" | ||
options = {"shared": [True, False], "fPIC": [True, False]} | ||
default_options = {"shared": False, "fPIC": True} | ||
_source_subfolder = "source_subfolder" | ||
_build_subfolder = "build_subfolder" | ||
generators = "pkg_config" | ||
|
||
@property | ||
def _is_msvc(self): | ||
return self.settings.compiler == "Visual Studio" | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
del self.settings.compiler.libcxx | ||
del self.settings.compiler.cppstd | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
if self.settings.os == "Windows": | ||
raise ConanInvalidConfiguration("%s recipe does not support windows. Contributions are welcome!", self.name) | ||
|
||
def build_requirements(self): | ||
self.build_requires("meson/0.56.1") | ||
self.build_requires("pkgconf/1.7.3") | ||
if self.settings.os == "Windows": | ||
self.build_requires("winflexbison/2.5.22") | ||
else: | ||
self.build_requires("flex/2.6.4") | ||
self.build_requires("bison/3.7.1") | ||
|
||
def requirements(self): | ||
self.requires("glib/2.67.1") | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version]) | ||
extracted_dir = self.name + "-" + self.version | ||
os.rename(extracted_dir, self._source_subfolder) | ||
|
||
def _configure_meson(self): | ||
meson = Meson(self) | ||
defs = dict() | ||
defs["build_introspection_data"] = self.options["glib"].shared | ||
|
||
meson.configure( | ||
source_folder=self._source_subfolder, | ||
args=["--wrap-mode=nofallback"], | ||
build_folder=self._build_subfolder, | ||
defs=defs, | ||
) | ||
return meson | ||
|
||
def build(self): | ||
tools.replace_in_file( | ||
os.path.join(self._source_subfolder, "meson.build"), | ||
"subdir('tests')", | ||
"#subdir('tests')", | ||
) | ||
tools.replace_in_file( | ||
os.path.join(self._source_subfolder, "meson.build"), | ||
"if meson.version().version_compare('>=0.54.0')", | ||
"if false", | ||
) | ||
|
||
with tools.environment_append( | ||
VisualStudioBuildEnvironment(self).vars | ||
if self._is_msvc | ||
else {"PKG_CONFIG_PATH": self.build_folder} | ||
): | ||
meson = self._configure_meson() | ||
meson.build() | ||
|
||
def package(self): | ||
self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) | ||
with tools.environment_append( | ||
VisualStudioBuildEnvironment(self).vars | ||
) if self._is_msvc else tools.no_op(): | ||
meson = self._configure_meson() | ||
meson.install() | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
shutil.move( | ||
os.path.join(self.package_folder, "share"), | ||
os.path.join(self.package_folder, "res"), | ||
) | ||
for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): | ||
os.unlink(pdb_file) | ||
|
||
def package_info(self): | ||
self.cpp_info.names["pkg_config"] = "gobject-introspection-1.0" | ||
self.cpp_info.libs = ["girepository-1.0"] | ||
self.cpp_info.includedirs.append( | ||
os.path.join("include", "gobject-introspection-1.0") | ||
) | ||
|
||
bin_path = os.path.join(self.package_folder, "bin") | ||
self.output.info("Appending PATH env var with: {}".format(bin_path)) | ||
self.env_info.PATH.append(bin_path) |
8 changes: 8 additions & 0 deletions
8
recipes/gobject-introspection/all/test_package/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) |
25 changes: 25 additions & 0 deletions
25
recipes/gobject-introspection/all/test_package/conanfile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package", "pkg_config" | ||
|
||
def build(self): | ||
if self.settings.os != 'Windows': | ||
self.run('g-ir-annotation-tool --version', run_environment=True) | ||
self.run('g-ir-compiler --version', run_environment=True) | ||
self.run('g-ir-generate --version', run_environment=True) | ||
self.run('g-ir-inspect -h', run_environment=True) | ||
self.run('g-ir-scanner --version', run_environment=True) | ||
|
||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
|
12 changes: 12 additions & 0 deletions
12
recipes/gobject-introspection/all/test_package/test_package.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <stdio.h> | ||
|
||
#include "girepository.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
printf("gobject introspection version %d.%d.%d\n", | ||
gi_get_major_version(), | ||
gi_get_minor_version(), | ||
gi_get_micro_version()); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"1.66.1": | ||
folder: all |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had very strange bugs on CCI when using validate(self) the last days:
eg #4181 (comment) or #4182 (comment)
so I'm not very inclined to use it until we understand what happened. Can we wait to introduce it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4193 too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough,
validate
is experimental and even missing from the Conan changelog :) Hope we would refactor recipes to usevalidate
later.