Skip to content

New: Usr: Added gtkmm/2.24.5 #3410

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/gtkmm/2.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"2.24.5":
sha256: 0680a53b7bf90b4e4bf444d1d89e6df41c777e0bacc96e9c09fc4dd2f5fe6b72
url: https://download.gnome.org/sources/gtkmm/2.24/gtkmm-2.24.5.tar.xz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually co-operate with the current cci gtk/system recipe?
We don't have a gtk recipe built from sources (yet).

80 changes: 80 additions & 0 deletions recipes/gtkmm/2.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import os

from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanException

class ConanGTK(ConanFile):
name = "gtkmm"
url = "https://github.com/conan-io/conan-center-index"
license = "LGPL-2.1-or-later"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a COPYING.tools license (GPL-2.0-or-later) for the tools

homepage = "https://www.gtk.org"
description = "The C++ API for GTK."
settings = {"os": "Linux"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings = {"os": "Linux"}

options = {"version": [2]}
default_options = {"version": 2}
Comment on lines +13 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option depends on the value self.options["gtk"].version, and is thus not choose-able freely.
Having -o gtk:version=2 -o gtkmm:version=3 is an invalid configuration.

Also, I don't see you using this gtk version value anywhere in the recipe.
How does it choose between gtk-2 and gtk-3?

I would do the following:

Suggested change
options = {"version": [2]}
default_options = {"version": 2}
options = {"version": "auto"}
default_options = {"version": "auto"}
@property
def _gtk_version(self):
return self.options["gtk"].version
def package_id(self):
self.info.options.version = self._gtk_version

and use self._gtk_version anywhere.

topics = ("gui", "widget", "graphical")

settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False],
"fPIC": [True, False],
}
default_options = {"shared": False,
"fPIC": True}
generators = "pkg_config"
_autoconf = None

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

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

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.settings.compiler == "Visual Studio" and \
"MT" in str(self.settings.compiler.runtime) and self.options.shared:
raise ConanInvalidConfiguration("Visual Studio and Runtime MT is not supported for shared library.")
if self.options.shared:
del self.options.fPIC

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 requirements(self):
self.requires('gtk/system')
self.requires('libsigcpp/3.0.0')

def _configure_build(self):
if self._autoconf:
return self._autoconf

self._autoconf = AutoToolsBuildEnvironment(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gtkmm has meson support.
Is that working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred to use Meson too, but the meson.build files in the source repository are not in the official release tar balls. Their README talks about separate release tar balls based on autoconf and meson.build, but on their own website, I only found the ones supporting autoconf. Ergo, I went with AutoTools for the package.

return self._autoconf

def build(self):
tools.replace_in_file(self._source_subfolder + '/configure', "gtk+-2.0 >= 2.24.0", "gtk+-2.0")

autoconf = self._configure_build()
autoconf.configure(configure_dir=self._source_subfolder,
vars = {
'cross_compiling': 'no'
}
)
autoconf.make()

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
autoconf = self._configure_build()
autoconf.install()
tools.rmdir(os.path.join(self.package_folder, "share"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tools.rmdir(os.path.join(self.package_folder, "share"))
tools.rmdir(os.path.join(self.package_folder, "share"))
tools.rmdir(os.path.join(self.package_folder, "res"))

I see a lot of html files in res/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not. Are we talking about the same package?


def package_info(self):
self.cpp_info.includedirs = ['include', 'include/gtkmm-2.4', 'include/gdkmm-2.4']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how this 2.4 suffix is calculated? It is not equal to gtkmm's version.

self.cpp_info.libs = tools.collect_libs(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libdirs.append(os.path.join(self.package_folder, "lib", "cairo"))
ls /home/conan/.conan/data/cairo/1.17.2/_/_/package/8d0b5f353aa5e0e4f75b6ab896cdd7f05569992f/lib/cairo/
libcairo-trace.a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see that file. Are we talking about the same package (gtkmm)? Your path seems to suggest otherwise.

4 changes: 2 additions & 2 deletions recipes/gtkmm/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
versions:
"system":
folder: "system"
"2.24.5":
folder: "2.x.x"
66 changes: 0 additions & 66 deletions recipes/gtkmm/system/conanfile.py

This file was deleted.