This commit is contained in:
Zied Aouini 2022-08-17 19:49:03 +02:00
parent a782cd7e35
commit 4fc3bfe521
4 changed files with 15 additions and 20 deletions

View file

@ -32,10 +32,6 @@ jobs:
${{ matrix.python-version }} -m pip install --upgrade pip
${{ matrix.python-version }} -m pip install -r dev_requirements.txt
- name: Prepare
run: |
${{ matrix.python-version }} prepare.py
- name: Build
run: |
${{ matrix.python-version }} setup.py build

View file

@ -50,7 +50,7 @@ build_libpcap
build_libndpi
echo ""
echo "---------------------------------------------------------------------------------------------------------------"
echo "Prepare engine_cc"
echo "Preprocessing engine_cc headers"
echo "---------------------------------------------------------------------------------------------------------------"
cd ..
gcc -DNDPI_LIB_COMPILATION -DNDPI_CFFI_PREPROCESSING -DNDPI_CFFI_PREPROCESSING_EXCLUDE_PACKED -E -x c -P -C /tmp/nfstream_build/usr/include/ndpi/ndpi_typedefs.h > /tmp/nfstream_build/ndpi_cdefinitions.h

View file

@ -42,7 +42,7 @@ setup_npcap
build_libndpi
echo ""
echo "---------------------------------------------------------------------------------------------------------------"
echo "Prepare engine_cc"
echo "Preprocessing engine_cc headers"
echo "---------------------------------------------------------------------------------------------------------------"
cd ..
gcc -DNDPI_LIB_COMPILATION -DNDPI_CFFI_PREPROCESSING -DNDPI_CFFI_PREPROCESSING_EXCLUDE_PACKED -E -x c -P -C /tmp/nfstream_build/mingw64/include/ndpi/ndpi_typedefs.h > /tmp/nfstream_build/ndpi_cdefinitions.h

View file

@ -49,20 +49,19 @@ else:
class BuildPyCommand(build_py):
""" Custom build command to compile lib_engine dependencies."""
def run(self):
if not self.dry_run:
if os.name != 'posix': # Windows case
os.environ["MSYSTEM"] = "MINGW64"
msys = os.getenv("MSYS2_PATH")
if msys is None:
os.environ["MSYS2_PATH"] = "C:/msys64"
msys = os.getenv("MSYS2_PATH")
build_script_command = r"""'{}'""".format(str(BUILD_SCRIPT_PATH) + "_windows.sh")
subprocess.check_call(["{msys}/usr/bin/bash".format(msys=msys).replace("/", "\\"),
"-l",
build_script_command, ENGINE_PATH],
shell=True)
else: # Linux, MacOS
subprocess.check_call([str(BUILD_SCRIPT_PATH) + ".sh"], shell=True)
if os.name != 'posix': # Windows case
os.environ["MSYSTEM"] = "MINGW64"
msys = os.getenv("MSYS2_PATH")
if msys is None:
os.environ["MSYS2_PATH"] = "C:/msys64"
msys = os.getenv("MSYS2_PATH")
build_script_command = r"""'{}'""".format(str(BUILD_SCRIPT_PATH) + "_windows.sh")
subprocess.check_call(["{msys}/usr/bin/bash".format(msys=msys).replace("/", "\\"),
"-l",
build_script_command, ENGINE_PATH],
shell=True)
else: # Linux, MacOS
subprocess.check_call([str(BUILD_SCRIPT_PATH) + ".sh"], shell=True)
build_py.run(self)