Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

5.9.2 #43

Open
wants to merge 16 commits into
base: release/5.9.2
Choose a base branch
from
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
env:
global:
- CONAN_REFERENCE: "Qt/5.8.0"
- CONAN_REFERENCE: "Qt/5.9.2"
- CONAN_USERNAME: "osechet"
- CONAN_CHANNEL: "testing"
- CONAN_CHANNEL: "stable"
- CONAN_TOTAL_PAGES: 2

linux: &linux
Expand Down
Empty file modified .travis/before_script.sh
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion .travis/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
fi

pip install conan_package_tools # It install conan too
conan user
Empty file modified .travis/run.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@Library('jenkins-pipeline') _

// Implementation at:
// https://github.com/ufz/jenkins-pipeline-library/blob/master/vars/conanBuild.groovy
conanBuild("Qt/5.9.2")
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Conan package for Qt
--------------------------------------------

[![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=testing/5.8.0)](https://travis-ci.org/osechet/conan-qt)
[![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=stable/5.9.2)](https://travis-ci.org/osechet/conan-qt)

[![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw/branch/testing/5.8.0?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt)
[![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw/branch/release/5.9.2?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt)

[ ![Download](https://api.bintray.com/packages/osechet/Conan/Qt%3Aosechet/images/download.svg?version=5.8.0%3Atesting) ](https://bintray.com/osechet/Conan/Qt%3Aosechet/5.8.0%3Atesting/link)
[ ![Download](https://api.bintray.com/packages/osechet/Conan/Qt%3Aosechet/images/download.svg?version=5.9.2%3Astable) ](https://bintray.com/osechet/Conan/Qt%3Aosechet/5.9.2%3Astable/link)

[Conan.io](https://conan.io) package for [Qt](https://www.qt.io) library. This package includes by default the Qt Base module (Core, Gui, Widgets, Network, ...). Others modules can be added using options.

Expand All @@ -16,7 +16,7 @@ The packages generated with this **conanfile** can be found in [bintray.com](htt
### Basic setup

```
$ conan install Qt/5.8.0@osechet/testing
$ conan install Qt/5.9.2@osechet/stable
```

### Project setup
Expand All @@ -25,7 +25,7 @@ If you handle multiple dependencies in your project is better to add a *conanfil

```
[requires]
Qt/5.8.0@osechet/testing
Qt/5.9.2@osechet/stable

[options]
Qt:shared=true # false
Expand Down Expand Up @@ -57,4 +57,4 @@ Project setup installs the library (and all his dependencies) and generates the

### Upload packages to server

$ conan upload Qt/5.8.0@osechet/testing --all
$ conan upload Qt/5.9.2@osechet/stable --all
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ environment:
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"

CONAN_REFERENCE: "Qt/5.8.0"
CONAN_REFERENCE: "Qt/5.9.2"
CONAN_USERNAME: "osechet"
CONAN_CHANNEL: "testing"
CONAN_CHANNEL: "stable"
VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"

matrix:
Expand Down
16 changes: 7 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@

from conan.packager import ConanMultiPackager
import copy

def main():
"""
Main function.
"""

builder = ConanMultiPackager(username="osechet", channel="testing")
builder.add_common_builds()
builder = ConanMultiPackager(username="osechet", archs = ["x86_64"])
builder.add_common_builds(pure_c=False)
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
if settings["compiler"] == "Visual Studio":
if settings["compiler.runtime"] == "MT" or settings["compiler.runtime"] == "MTd":
# Ignore MT runtime
continue
if settings["arch"] != "x86_64":
continue

new_options = copy.copy(options)
new_options["Qt:xmlpatterns"] = True

filtered_builds.append([settings, new_options, env_vars, build_requires])
filtered_builds.append([settings, options, env_vars, build_requires])

builder.builds = filtered_builds
Expand Down
112 changes: 50 additions & 62 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import os
from distutils.spawn import find_executable
from conans import AutoToolsBuildEnvironment, ConanFile, tools, VisualStudioBuildEnvironment
from conans.tools import cpu_count, os_info, SystemPackageTool
from distutils.util import strtobool

def which(program):
"""
Expand Down Expand Up @@ -31,7 +31,7 @@ class QtConan(ConanFile):
""" Qt Conan package """

name = "Qt"
version = "5.8.0"
version = "5.9.2"
description = "Conan.io package for Qt library."
source_dir = "qt5"
settings = "os", "arch", "compiler", "build_type"
Expand All @@ -49,9 +49,13 @@ class QtConan(ConanFile):
"webengine": [True, False],
"websockets": [True, False],
"xmlpatterns": [True, False],
"x11extras": [True, False],
"openssl": ["no", "yes", "linked"]
}
default_options = "shared=True", "opengl=desktop", "canvas3d=False", "gamepad=False", "graphicaleffects=False", "imageformats=False", "location=False", "serialport=False", "svg=False", "tools=False", "webengine=False", "websockets=False", "xmlpatterns=False", "openssl=no"
default_options = ("shared=True", "opengl=desktop", "canvas3d=False", "gamepad=False",
"graphicaleffects=False", "imageformats=False", "location=False",
"serialport=False", "svg=False", "tools=False", "webengine=False",
"websockets=False", "xmlpatterns=False", "x11extras=True", "openssl=no")
url = "http://github.com/osechet/conan-qt"
license = "http://doc.qt.io/qt-5/lgpl.html"
short_paths = True
Expand All @@ -74,18 +78,23 @@ def system_requirements(self):
full_pack_names += [pack_name + ":i386"]
pack_names = full_pack_names

if os_info.linux_distro == "debian":
pack_names = ["libx11-dev", "libxext-dev", "libglu-dev"]

if pack_names:
installer = SystemPackageTool()
installer.update() # Update the package database
installer.install(" ".join(pack_names)) # Install the package

def config_options(self):
if self.settings.os != "Windows":
if not os_info.is_windows:
del self.options.opengl
del self.options.openssl
if not os_info.is_linux:
del self.options.x11extras

def requirements(self):
if self.settings.os == "Windows":
if os_info.is_windows:
if self.options.openssl == "yes":
self.requires("OpenSSL/1.0.2l@conan/stable", dev=True)
elif self.options.openssl == "linked":
Expand All @@ -94,38 +103,21 @@ def requirements(self):
def source(self):
submodules = ["qtbase"]

if self.options.canvas3d:
submodules.append("qtcanvas3d")
if self.options.gamepad:
submodules.append("qtgamepad")
if self.options.graphicaleffects:
submodules.append("qtgraphicaleffects")
if self.options.imageformats:
submodules.append("qtimageformats")
if self.options.location:
submodules.append("qtlocation")
if self.options.serialport:
submodules.append("qtserialport")
if self.options.svg:
submodules.append("qtsvg")
if self.options.tools:
submodules.append("qttools")
if self.options.webengine:
submodules.append("qtwebengine")
if self.options.websockets:
submodules.append("qtwebsockets")
if self.options.xmlpatterns:
submodules.append("qtxmlpatterns")
for key, value in self.options.items():
if key in ["shared"]:
continue
if (value == "False" or value == "True") and strtobool(value) == True:
submodules.append('qt' + key)

major = ".".join(self.version.split(".")[:2])
self.run("git clone https://code.qt.io/qt/qt5.git")
self.run("git clone http://code.qt.io/qt/qt5.git")
self.run("cd %s && git checkout %s" % (self.source_dir, major))
self.run("cd %s && perl init-repository --no-update --module-subset=%s"
% (self.source_dir, ",".join(submodules)))
self.run("cd %s && git checkout v%s && git submodule update"
% (self.source_dir, self.version))

if self.settings.os != "Windows":
if not os_info.is_windows:
self.run("chmod +x ./%s/configure" % self.source_dir)
else:
# Fix issue with sh.exe and cmake on Windows
Expand All @@ -140,15 +132,15 @@ def build(self):
to reuse it later in any other project.
"""
args = ["-opensource", "-confirm-license", "-nomake examples", "-nomake tests",
"-prefix %s" % self.package_folder]
"-qt-zlib", "-prefix %s" % self.package_folder]
if not self.options.shared:
args.insert(0, "-static")
if self.settings.build_type == "Debug":
args.append("-debug")
else:
args.append("-release")

if self.settings.os == "Windows":
if os_info.is_windows:
if self.settings.compiler == "Visual Studio":
self._build_msvc(args)
else:
Expand All @@ -166,9 +158,9 @@ def _build_msvc(self, args):
self.output.info("Using '%s %s' to build" % (build_command, " ".join(build_args)))

env = {}
env.update({'PATH': ['%s/qtbase/bin' % self.conanfile_directory,
'%s/gnuwin32/bin' % self.conanfile_directory,
'%s/qtrepotools/bin' % self.conanfile_directory]})
env.update({'PATH': ['%s/qtbase/bin' % self.source_folder,
'%s/gnuwin32/bin' % self.source_folder,
'%s/qtrepotools/bin' % self.source_folder]})
# it seems not enough to set the vcvars for older versions
if self.settings.compiler == "Visual Studio":
if self.settings.compiler.version == "14":
Expand All @@ -186,35 +178,29 @@ def _build_msvc(self, args):

env_build = VisualStudioBuildEnvironment(self)
env.update(env_build.vars)
vcvars = tools.vcvars_command(self.settings)

# Workaround for conan-io/conan#1408
for name, value in env.items():
if not value:
del env[name]
with tools.environment_append(env):
vcvars = tools.vcvars_command(self.settings)

args += ["-opengl %s" % self.options.opengl]
if self.options.openssl == "no":
args += ["-no-openssl"]
elif self.options.openssl == "yes":
args += ["-openssl"]
else:
args += ["-openssl-linked"]
args += ["-opengl %s" % self.options.opengl]
if self.options.openssl == "no":
args += ["-no-openssl"]
elif self.options.openssl == "yes":
args += ["-openssl"]
else:
args += ["-openssl-linked"]

self.run("cd %s && %s && set" % (self.source_dir, vcvars))
self.run("cd %s && %s && configure %s"
% (self.source_dir, vcvars, " ".join(args)))
self.run("cd %s && %s && %s %s"
% (self.source_dir, vcvars, build_command, " ".join(build_args)))
self.run("cd %s && %s && %s install" % (self.source_dir, vcvars, build_command))
self.run("%s && cd %s && set" % (vcvars, self.source_dir))
self.run("%s && cd %s && configure %s"
% (vcvars, self.source_dir, " ".join(args)))
self.run("%s && cd %s && %s %s"
% (vcvars, self.source_dir, build_command, " ".join(build_args)))
self.run("%s && cd %s && %s install" % (vcvars, self.source_dir, build_command))

def _build_mingw(self, args):
env_build = AutoToolsBuildEnvironment(self)
env = {'PATH': ['%s/bin' % self.conanfile_directory,
'%s/qtbase/bin' % self.conanfile_directory,
'%s/gnuwin32/bin' % self.conanfile_directory,
'%s/qtrepotools/bin' % self.conanfile_directory],
env = {'PATH': ['%s/bin' % self.source_folder,
'%s/qtbase/bin' % self.source_folder,
'%s/gnuwin32/bin' % self.source_folder,
'%s/qtrepotools/bin' % self.source_folder],
'QMAKESPEC': 'win32-g++'}
env.update(env_build.vars)
with tools.environment_append(env):
Expand All @@ -237,7 +223,7 @@ def _build_mingw(self, args):
self.run("cd %s && mingw32-make install" % (self.source_dir))

def _build_unix(self, args):
if self.settings.os == "Linux":
if os_info.is_linux:
args += ["-silent", "-xcb"]
if self.settings.arch == "x86":
args += ["-platform linux-g++-32"]
Expand All @@ -255,19 +241,21 @@ def package_info(self):
libs = ['Concurrent', 'Core', 'DBus',
'Gui', 'Network', 'OpenGL',
'Sql', 'Test', 'Widgets', 'Xml']
if 'x11extras' in self.options and self.options.x11extras == True:
libs += ['X11Extras']

self.cpp_info.libs = []
self.cpp_info.includedirs = ["include"]
for lib in libs:
if self.settings.os == "Windows" and self.settings.build_type == "Debug":
if os_info.is_windows and self.settings.build_type == "Debug":
suffix = "d"
elif self.settings.os == "Macos" and self.settings.build_type == "Debug":
elif os_info.is_macos and self.settings.build_type == "Debug":
suffix = "_debug"
else:
suffix = ""
self.cpp_info.libs += ["Qt5%s%s" % (lib, suffix)]
self.cpp_info.includedirs += ["include/Qt%s" % lib]

if self.settings.os == "Windows":
if os_info.is_windows:
# Some missing shared libs inside QML and others, but for the test it works
self.env_info.path.append(os.path.join(self.package_folder, "bin"))
2 changes: 1 addition & 1 deletion test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(APPLE)
set(CMAKE_SKIP_RPATH 0)
endif(APPLE)

configure_file(qt.conf.in ${CMAKE_BINARY_DIR}/bin/qt.conf)
configure_file(qt.conf.in ${PROJECT_BINARY_DIR}/bin/qt.conf)

find_package(Qt5Core REQUIRED)

Expand Down
25 changes: 15 additions & 10 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@

from conans.model.conan_file import ConanFile
from conans import CMake
import os
from conans import ConanFile, CMake

# This easily allows to copy the package in other user or channel
CHANNEL = os.getenv("CONAN_CHANNEL", "testing")
USERNAME = os.getenv("CONAN_USERNAME", "osechet")
############### CONFIGURE THESE VALUES ##################
default_user = "osechet"
default_channel = "stable"
#########################################################

channel = os.getenv("CONAN_CHANNEL", default_channel)
username = os.getenv("CONAN_USERNAME", default_user)

class QtTestConan(ConanFile):
""" Qt Conan package test """

requires = "Qt/5.8.0@%s/%s" % (USERNAME, CHANNEL)
name = "DefaultName"
version = "0.1"
requires = "Qt/5.9.2@%s/%s" % (username, channel)
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "virtualenv"

def build(self):
cmake = CMake(self.settings)
self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
self.run("cmake --build . %s" % cmake.build_config)
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if self.settings.os == "Windows":
Expand Down