Commit 1510e0f8 authored by Michael J. Hammel's avatar Michael J. Hammel

RM #687: Add support for building either from master.zip or a specific git...

RM #687: Add support for building either from master.zip or a specific git commit.  This became necessary when use of V4L2_EVENT_SOURCE_CHANGE was added to the master branch.  I suspect support for this #define will show up with a kernel bump, but until then we can build using USEGIT=1 to use the last known commit that builds.
parent a8fbf00c
......@@ -21,10 +21,29 @@ DIR_MJPG := $(SRCDIR)/$(PK)
# Main version, with Raspberry Pi support
RASPI_CMAKELIST := plugins/input_raspicam/CMakeLists.txt
DIR_PATCH := $(SRCDIR)/patches/jacksonliam
ifeq ($(USEGIT),)
MJPG_VERSION := master
MJPG_ARCHIVE_DIR := mjpeg-streamer-experimental
MJPG_ARCHIVE := $(MJPG_VERSION).zip
MJPG_URL := https://github.com/jacksonliam/mjpg-streamer/archive/$(MJPG_ARCHIVE)
UNPACK_CMD := unzip -d $(BLDDIR) $(MJPG_ARCHIVE)
GET_CMD := wget $(MJPG_URL)
REAL_DIR := "mjpg-streamer-master/mjpg-streamer-experimental"
UNZIP_CMD := unzip -d $(BLDDIR) $(MJPG_ARCHIVE) "$(REAL_DIR)/*"
MV_CMD := mv $(BLDDIR)/$(REAL_DIR) $(BLDDIR)/mjpg-streamer
RM_CMD := rmdir $(BLDDIR)/mjpg-streamer-master
UNPACK_CMD := $(UNZIP_CMD) && $(MV_CMD) && $(RM_CMD)
else
# This version is prior to the addition of V4L2_EVENT_SOURCE_CHANGE
MJPG_ARCHIVE := mjpg-streamer
MJPG_ARCHIVE_DIR := $(MJPG_ARCHIVE)
MJPG_VERSION := f387bb44e6c087271b763b27da998bf2e06c4f5d
MJPG_URL := https://github.com/jacksonliam/mjpg-streamer.git
GET_CMD := git clone $(MJPG_URL) && cd mjpg-streamer && git checkout $(MJPG_VERSION)
CP_CMD := cp -r $(MJPG_ARCHIVE)/mjpg-streamer-experimental $(BLDDIR)
MV_CMD := mv $(BLDDIR)/mjpg-streamer-experimental $(BLDDIR)/mjpg-streamer
UNPACK_CMD := $(CP_CMD) && $(MV_CMD)
endif
# MJPG related directories
MJPG_SRCDIR := $(BLDDIR)/$(PK)-$(MJPG_VERSION)
......
......@@ -32,12 +32,12 @@ build-verify:
$(MJPG_T)-get: .$(MJPG_T)-get
.$(MJPG_T)-get:
@if [ ! -f $(ARCDIR)/$(MJPG_ARCHIVE) ]; then \
@if [ ! -e $(ARCDIR)/$(MJPG_ARCHIVE) ]; then \
$(MSG) "================================================================"; \
$(MSG2) "Retrieving files" $(EMSG); \
$(MSG) "================================================================"; \
mkdir -p $(ARCDIR); \
cd $(ARCDIR) && wget $(MJPG_URL); \
cd $(ARCDIR) && $(GET_CMD) ; \
else \
$(MSG3) "MJPG source is cached" $(EMSG); \
fi
......@@ -60,7 +60,7 @@ $(MJPG_T)-unpack: .$(MJPG_T)-unpack
$(MJPG_T)-patch: .$(MJPG_T)-patch
.$(MJPG_T)-patch: .$(MJPG_T)-unpack
@if [ -d $(DIR_PATCH) ]; then \
@if [ -d $(DIR_PATCH) ] && [ -n "$(ls -A "$(DIR_PATCH)")" ]; then \
$(MSG) "================================================================"; \
$(MSG2) "Patching source" $(EMSG); \
$(MSG) "================================================================"; \
......@@ -76,9 +76,7 @@ $(MJPG_T)-init: .$(MJPG_T)-init
.$(MJPG_T)-init:
@make build-verify
@make .$(MJPG_T)-patch
cd $(BLDDIR) && \
mv $(PK)-$(MJPG_VERSION) tmp && \
mv tmp/$(PK)-experimental $(PK)-$(MJPG_VERSION)
cd $(BLDDIR) && mv mjpg-streamer $(PK)-$(MJPG_VERSION)
cp $(SRCDIR)/files/jacksonliam/CMakeLists.txt $(MJPG_SRCDIR)/$(RASPI_CMAKELIST)
sed -i 's%\[STAGING\]%$(TD)%g' $(MJPG_SRCDIR)/$(RASPI_CMAKELIST)
@touch .$(subst .,,$@)
......
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