Commit 1e97d6dc by Victor Manuel Alvarez

Build jansson library in appveyor

parent f55d7cb1
......@@ -14,26 +14,32 @@ environment:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.x" # currently 2.7.13
PYTHON_ARCH: "32"
JANSSON_VERSION: "2.10"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x" # currently 2.7.13
PYTHON_ARCH: "64"
JANSSON_VERSION: "2.10"
- PYTHON: "C:\\Python33"
PYTHON_VERSION: "3.3.x" # currently 3.3.5
PYTHON_ARCH: "32"
JANSSON_VERSION: "2.10"
- PYTHON: "C:\\Python33-x64"
PYTHON_VERSION: "3.3.x" # currently 3.3.5
PYTHON_ARCH: "64"
JANSSON_VERSION: "2.10"
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.x" # currently 3.4.4
PYTHON_ARCH: "32"
JANSSON_VERSION: "2.10"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x" # currently 3.4.4
PYTHON_ARCH: "64"
JANSSON_VERSION: "2.10"
# Python versions not pre-installed
......@@ -87,13 +93,26 @@ install:
# target Python version and architecture
- "%CMD_IN_ENV% pip install nose wheel"
# Download and build jansson library
- cd ..
-ps: Invoke-WebRequest "https://github.com/akheron/jansson/archive/v%JANSSON_VERSION%.zip" -OutFile "jansson.zip"
-ps: Expand-Archive jansson.zip -DestinationPath .
- cd jansson-%JANSSON_VERSION%
- md build
- cd build
- cmake -DJANSSON_BUILD_DOCS=OFF -G "%VS%" ..
- cmake --build . --config Release
- ctest --output-on-failure
- cd ../../yara-python
clone_script:
- cmd: git clone -q --recursive --branch=%APPVEYOR_REPO_BRANCH% https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER%
- cmd: git checkout -qf %APPVEYOR_REPO_COMMIT%
build_script:
# Build the compiled extension
- "%CMD_IN_ENV% python setup.py build --enable-cuckoo"
- "%CMD_IN_ENV% python setup.py build --enable-cuckoo --library-dir=../jansson-%JANSSON_VERSION%/build/lib/Release --include-dir=../jansson-%JANSSON_VERSION%/build/include"
test_script:
# Run the project tests
......
......@@ -35,7 +35,9 @@ OPTIONS = [
('dynamic-linking', None, 'link dynamically against libyara'),
('enable-cuckoo', None, 'enable "cuckoo" module'),
('enable-magic', None, 'enable "magic" module'),
('enable-profiling', None, 'enable profiling features')]
('enable-profiling', None, 'enable profiling features'),
('library-dir=', None, 'library directory'),
('include-dir=', None, 'include directory')]
BOOLEAN_OPTIONS = [
......@@ -94,6 +96,8 @@ class BuildCommand(build):
self.enable_magic = None
self.enable_cuckoo = None
self.enable_profiling = None
self.library_dir = None
self.include_dir = None
def finalize_options(self):
......@@ -113,6 +117,8 @@ class BuildExtCommand(build_ext):
self.enable_magic = None
self.enable_cuckoo = None
self.enable_profiling = None
self.library_dir = None
self.include_dir = None
def finalize_options(self):
......@@ -125,7 +131,9 @@ class BuildExtCommand(build_ext):
('dynamic_linking', 'dynamic_linking'),
('enable_magic', 'enable_magic'),
('enable_cuckoo', 'enable_cuckoo'),
('enable_profiling', 'enable_profiling'))
('enable_profiling', 'enable_profiling'),
('library_dir', 'library_dir'),
('include_dir', 'include_dir'))
if self.enable_magic and self.dynamic_linking:
raise distutils.errors.DistutilsOptionError(
......@@ -145,6 +153,12 @@ class BuildExtCommand(build_ext):
exclusions = []
if self.library_dir:
module.library_dirs.append(self.library_dir)
if self.include_dir:
module.include_dirs.append(self.include_dir)
if self.plat_name in ('win32','win-amd64'):
building_for_windows = True
bits = '64' if self.plat_name == 'win-amd64' else '32'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment