Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Update conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Croydon committed May 15, 2019
1 parent fc23160 commit 366819e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .travis/install.sh → .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
eval "$(pyenv init -)"
fi

pyenv install 2.7.10
pyenv virtualenv 2.7.10 conan
pyenv install 3.7.1
pyenv virtualenv 3.7.1 conan
pyenv rehash
pyenv activate conan
fi
Expand Down
File renamed without changes.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
linux: &linux
os: linux
sudo: required
dist: xenial
language: python
python: "3.6"
python: "3.7"
services:
- docker
osx: &osx
Expand Down Expand Up @@ -30,6 +30,8 @@ matrix:
env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60
- <<: *linux
env: CONAN_CLANG_VERSIONS=7.0 CONAN_DOCKER_IMAGE=conanio/clang7
- <<: *linux
env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8
- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3
Expand All @@ -47,9 +49,9 @@ matrix:
env: CONAN_APPLE_CLANG_VERSIONS=10.0

install:
- chmod +x .travis/install.sh
- ./.travis/install.sh
- chmod +x .ci/install.sh
- ./.ci/install.sh

script:
- chmod +x .travis/run.sh
- ./.travis/run.sh
- chmod +x .ci/run.sh
- ./.ci/run.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Bintray | Windows | Linux & macOS |
|:--------:|:---------:|:-----------------:|
|[![Download](https://api.bintray.com/packages/bincrafters/public-conan/pcre%3Abincrafters/images/download.svg)](https://bintray.com/bincrafters/public-conan/pcre%3Abincrafters/_latestVersion)|[![Build status](https://ci.appveyor.com/api/projects/status/github/bincrafters/conan-pcre?svg=true)](https://ci.appveyor.com/project/BinCrafters/conan-pcre)|[![Build Status](https://travis-ci.org/bincrafters/conan-pcre.svg?)](https://travis-ci.org/bincrafters/conan-pcre)|
|[![Download](https://api.bintray.com/packages/bincrafters/public-conan/pcre%3Abincrafters/images/download.svg)](https://bintray.com/bincrafters/public-conan/pcre%3Abincrafters/_latestVersion)|[![Build status](https://ci.appveyor.com/api/projects/status/github/bincrafters/conan-pcre?svg=true)](https://ci.appveyor.com/project/BinCrafters/conan-pcre)|[![Build Status](https://travis-ci.com/bincrafters/conan-pcre.svg?)](https://travis-ci.com/bincrafters/conan-pcre)|

## Conan.io Information

Expand Down
6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
build: false

environment:
PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"
PYTHON_HOME: "C:\\Python37"

matrix:
- MINGW_CONFIGURATIONS: "4.9@x86@dwarf2@posix, 5@x86@dwarf2@posix, 6@x86@dwarf2@posix, 7@x86@dwarf2@posix, 8@x86@dwarf2@posix"
Expand All @@ -28,7 +26,7 @@ environment:
CONAN_BUILD_TYPES: Debug

install:
- set PATH=%PATH%;%PYTHON%/Scripts/
- set PATH=%PYTHON_HOME%;%PYTHON_HOME%/Scripts/;%PATH%
- pip.exe install conan --upgrade
- pip.exe install conan_package_tools bincrafters_package_tools
- conan user # It creates the conan data directory
Expand Down
23 changes: 10 additions & 13 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ class PCREConan(ConanFile):
"with_utf": [True, False],
"with_unicode_properties": [True, False]
}
default_options = ("shared=False", "fPIC=True", "with_bzip2=True",
"with_zlib=True", "with_jit=False", "build_pcrecpp=False",
"build_pcregrep=False", "with_utf=False",
"with_unicode_properties=False")
source_subfolder = "source_subfolder"
build_subfolder = "build_subfolder"
default_options = {'shared': False, 'fPIC': True, 'with_bzip2': True, 'with_zlib': True, 'with_jit': False, 'build_pcrecpp': False, 'build_pcregrep': False, 'with_utf': False, 'with_unicode_properties': False}
_source_subfolder = "source_subfolder"
_build_subfolder = "build_subfolder"

def config_options(self):
if self.settings.os == "Windows":
Expand All @@ -49,7 +46,7 @@ def configure(self):
def patch_cmake(self):
"""Patch CMake file to avoid man and share during install stage
"""
cmake_file = os.path.join(self.source_subfolder, "CMakeLists.txt")
cmake_file = os.path.join(self._source_subfolder, "CMakeLists.txt")
tools.replace_in_file(cmake_file, "INSTALL(FILES ${man1} DESTINATION man/man1)", "")
tools.replace_in_file(cmake_file, "INSTALL(FILES ${man3} DESTINATION man/man3)", "")
tools.replace_in_file(cmake_file, "INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)", "")
Expand All @@ -58,7 +55,7 @@ def source(self):
source_url = "https://ftp.pcre.org"
tools.get("{0}/pub/pcre/pcre-{1}.tar.gz".format(source_url, self.version))
extracted_dir = self.name + "-" + self.version
os.rename(extracted_dir, self.source_subfolder)
os.rename(extracted_dir, self._source_subfolder)
self.patch_cmake()

def requirements(self):
Expand All @@ -67,7 +64,7 @@ def requirements(self):
if self.options.with_zlib:
self.requires.add("zlib/1.2.11@conan/stable")

def configure_cmake(self):
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["PCRE_BUILD_TESTS"] = False
cmake.definitions["PCRE_BUILD_PCREGREP"] = self.options.build_pcregrep
Expand All @@ -81,16 +78,16 @@ def configure_cmake(self):
cmake.definitions["PCRE_SUPPORT_LIBEDIT"] = False
if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio":
cmake.definitions["PCRE_STATIC_RUNTIME"] = not self.options.shared and "MT" in self.settings.compiler.runtime
cmake.configure(build_folder=self.build_subfolder)
cmake.configure(build_folder=self._build_subfolder)
return cmake

def build(self):
cmake = self.configure_cmake()
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy(pattern="LICENCE", dst="licenses", src=self.source_subfolder)
cmake = self.configure_cmake()
self.copy(pattern="LICENCE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()

def package_info(self):
Expand Down

0 comments on commit 366819e

Please sign in to comment.