From 8eb036b187954282740f7c1d895781383de2b379 Mon Sep 17 00:00:00 2001 From: Francois Wautier Date: Mon, 19 Feb 2024 22:34:13 +0700 Subject: [PATCH] We need to install swig when using docker. So rearrange make file to support that. --- .github/workflows/UnitTests.yml | 2 +- python/Makefile | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index ce79b6e35..3c197b6b9 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -14,7 +14,7 @@ jobs: - name: Run tools unit tests run: (cd tools; make run_tests) - name: Build swig extension and run simple test - run: (cd python; make test) + run: (apt-get -y install libpcre2-dev python3-dev; cd python; make testdocker) Unit_Tests: runs-on: ubuntu-latest diff --git a/python/Makefile b/python/Makefile index b229ccd69..70fca0e3f 100644 --- a/python/Makefile +++ b/python/Makefile @@ -37,8 +37,8 @@ all : _irhvac.so library : $(objects) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,lib_irhvac.so -o _irhvac.so $(COMMON_OBJ) -swig : libirhvac_wrap.cxx swig-4.2.0/swig - swig-4.2.0/swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i +swig : libirhvac_wrap.cxx + swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i clean : rm -f *.o *.pyc *.cxx *.cpp rm -rf swig-4.2.0 @@ -46,14 +46,15 @@ distclean : rm -f *.o *.pyc libirhvac_wrap.cxx irhvac.py _irhvac.so rm -rf swig-4.2.0 -install-swig : swig-4.2.0/swig - rm -rf swig-4.2.0 - curl -s -L -o - http://downloads.sourceforge.net/project/swig/swig/swig-4.2.0/swig-4.2.0.tar.gz | tar xfz - - ( cd swig-4.2.0; ./configure ; make ) test : _irhvac.so python test_lib.py +docker : swig-4.2.0/swig _irhvac.so + +testdocker : swig-4.2.0/swig _irhvac.so + python test_lib.py + # Keep all intermediate files. .SECONDARY: @@ -86,8 +87,8 @@ IRrecv.o : $(SRC_DIR)/IRrecv.cpp $(SRC_DIR)/IRrecv.h $(SRC_DIR)/IRremoteESP8266. libirhvac_wrap.o : libirhvac_wrap.cxx $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $(PYTHONINCL) -c libirhvac_wrap.cxx -libirhvac_wrap.cxx : swig-4.2.0/swig - swig-4.2.0/swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i +libirhvac_wrap.cxx : + swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i _irhvac.so : $(COMMON_OBJ) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,lib_irhvac.so -o _irhvac.so $(COMMON_OBJ) @@ -95,7 +96,7 @@ _irhvac.so : $(COMMON_OBJ) swig-4.2.0/swig : rm -rf swig-4.2.0 curl -s -L -o - http://downloads.sourceforge.net/project/swig/swig/swig-4.2.0/swig-4.2.0.tar.gz | tar xfz - - ( cd swig-4.2.0; ./configure ; make ) + ( cd swig-4.2.0; ./configure ; make; make install ) # new specific targets goes above this line $(objects) : %: $(COMMON_OBJ)