From 7081e12f6ad76e663dd186a2f62d02d5a3ec0146 Mon Sep 17 00:00:00 2001 From: Abhinav Saxena Date: Sat, 2 Feb 2019 11:42:17 +0530 Subject: [PATCH] always enable-dex when building --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d0b3cda..f614c49 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ from distutils.command.build_ext import build_ext from setuptools import setup, Command, Extension from codecs import open - +from setuptools.command import build_py import distutils.errors import distutils.ccompiler import distutils.sysconfig @@ -31,6 +31,14 @@ import subprocess +class BuildPyCommand(build_py.build_py): + """Custom build command.""" + + def run(self): + self.run_command('enable-dex') + build_py.build_py.run(self) + + OPTIONS = [ ('dynamic-linking', None, 'link dynamically against libyara'), ('enable-cuckoo', None, 'enable "cuckoo" module'), @@ -310,7 +318,9 @@ def run(self): cmdclass={ 'build': BuildCommand, 'build_ext': BuildExtCommand, - 'update': UpdateCommand}, + 'update': UpdateCommand, + 'build_py': BuildPyCommand, + }, ext_modules=[Extension( name='yara', include_dirs=['yara/libyara/include', 'yara/libyara/', '.'],