Parcourir la source

[build] Unblock crypto lib install in make install

Romain Rigaux il y a 4 ans
Parent
commit
242cff36c7
2 fichiers modifiés avec 11 ajouts et 4 suppressions
  1. 11 2
      Makefile
  2. 0 2
      Makefile.sdk

+ 11 - 2
Makefile

@@ -218,9 +218,18 @@ install-env:
 	cp $(ROOT)/.babelrc $(INSTALL_DIR)
 	cp $(ROOT)/tsconfig.json $(INSTALL_DIR)
 	$(MAKE) -C $(INSTALL_DIR) npm-install
+	@if [ "$(PYTHON_VER)" = "python2.7" ]; then \
+          $(ENV_PIP) install --upgrade pip; \
+          # Hackish way to get crypto to install with pre-compiled dependencies that now break as of today with Py2.
+	  $(ENV_PIP) install cryptography==3.3.2 future==0.18.2 lockfile==0.8 python-daemon==1.5.1 pytz==2021.1 filelock==3.0.12; \
+        fi
 	@if [ "$(MAKECMDGOALS)" = "install" ]; then \
-	  $(MAKE) -C $(INSTALL_DIR) create-static; \
-	fi
+          # Assumes Py2 as Py3 does not have `install` target anyway.
+	  # This is needed as somehow Hue commands import modules with hard uneeded dependencies on those. 
+	  # We have two virt-env: $(ENV_PIP) aka /build/hue for build and $(PREFIX)/hue/build/env for destination.
+	  $(PREFIX)/hue/build/env/bin/pip install cryptography==3.3.2 future==0.18.2 lockfile==0.8 python-daemon==1.5.1 pytz==2021.1 filelock==3.0.12; \
+          $(MAKE) -C $(INSTALL_DIR) create-static; \
+        fi
 
 
 ###################################

+ 0 - 2
Makefile.sdk

@@ -160,8 +160,6 @@ ext-env-install: ext-eggs $(EXT_PY_ENV_INSTALL_TARGETS)
 	  echo "--- Installing $$i into virtual environment" ; \
 	  $(ENV_EASY_INSTALL) -Z -N $$i 2> /dev/null ; \
 	done
-	@$(ENV_PIP) install --upgrade pip
-	@$(ENV_PIP) install cryptography==3.3.2 future==0.18.2 python-daemon==2.2.4
 
 $(EXT_PY_ENV_INSTALL_TARGETS):
 	@echo '--- Installing $(CUR_EXT_PY) into virtual environment'