summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-06-11 23:08:38 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-06-11 23:08:38 (GMT)
commitaab2b702534827d49a84975ad586a8a0ca303004 (patch)
treee816e73190d3fd5ea577991aa6b6f119e730e5b2 /Makefile
parentd6ddf0f589b30e0a36c130fb44ca9813d2545d8d (diff)
downloadmxe-aab2b702534827d49a84975ad586a8a0ca303004.zip
mxe-aab2b702534827d49a84975ad586a8a0ca303004.tar.gz
mxe-aab2b702534827d49a84975ad586a8a0ca303004.tar.bz2
create tmp-*/readonly instead of usr/readonly
Removing MXE directory with "rm -rf" used to fail on file usr/readonly/.gitkeep because directory usr/readonly was readonly. Now readonly directory is created in tmp-* directory and .gitkeep is not created for it (because tmp-* is not under usr/). Problems with removing MXE directory are fixed even in case of interrupted build. fix #1221
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index b3275a7..cd45f8c 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ PRELOAD_VARS := LD_PRELOAD DYLD_FORCE_FLAT_NAMESPACE DYLD_INSERT_LIBRARIES
# basic working shell environment and mxe variables
# see http://www.linuxfromscratch.org/lfs/view/stable/chapter04/settingenvironment.html
ENV_WHITELIST := EDITOR HOME LANG PATH %PROXY %proxy PS1 TERM
-ENV_WHITELIST += MAKE% MXE% $(PRELOAD_VARS)
+ENV_WHITELIST += MAKE% MXE% $(PRELOAD_VARS) WINEPREFIX
# OS/Distro related issues - "unsafe" but practical
# 1. https://github.com/mxe/mxe/issues/697
@@ -166,10 +166,6 @@ ENV_WHITELIST += ACLOCAL_PATH LD_LIBRARY_PATH
unexport $(filter-out $(ENV_WHITELIST),$(shell env | cut -d '=' -f1))
-# disable wine with readonly directory (created by mxe-conf)
-# see https://github.com/mxe/mxe/issues/841
-export WINEPREFIX=$(PREFIX)/readonly
-
SHORT_PKG_VERSION = \
$(word 1,$(subst ., ,$($(1)_VERSION))).$(word 2,$(subst ., ,$($(1)_VERSION)))
@@ -494,7 +490,7 @@ $(PREFIX)/$(3)/installed/$(1): $(PKG_MAKEFILES) \
@$(PRINTF_FMT) '[message]' '$(1)' '$(3) $($(call LOOKUP_PKG_RULE,$(1),MESSAGE,$(3)))')
@touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)_$(3)'
@ln -sf '$(TIMESTAMP)/$(1)_$(3)' '$(LOG_DIR)/$(1)_$(3)'
- @if ! (time $(PRELOAD) $(MAKE) -f '$(MAKEFILE)' 'build-only-$(1)_$(3)' WGET=false) &> '$(LOG_DIR)/$(TIMESTAMP)/$(1)_$(3)'; then \
+ @if ! (time $(PRELOAD) WINEPREFIX='$(2)/readonly' $(MAKE) -f '$(MAKEFILE)' 'build-only-$(1)_$(3)' WGET=false) &> '$(LOG_DIR)/$(TIMESTAMP)/$(1)_$(3)'; then \
echo; \
echo 'Failed to build package $(1) for target $(3)!'; \
echo '------------------------------------------------------------'; \
@@ -535,6 +531,12 @@ build-only-$(1)_$(3):
perl --version 2>&1 | head -3
rm -rf '$(2)'
mkdir -p '$(2)'
+
+ # disable wine with readonly directory
+ # see https://github.com/mxe/mxe/issues/841
+ mkdir -p '$(2)/readonly'
+ chmod 0555 '$(2)/readonly'
+
$$(if $(value $(call LOOKUP_PKG_RULE,$(1),FILE,$(3))),\
$$(call PREPARE_PKG_SOURCE,$(1),$(2)))
$$(call $(call LOOKUP_PKG_RULE,$(1),BUILD,$(3)),$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test)
@@ -634,7 +636,6 @@ BUILD_PKG_TMP_FILES := *-*.list mxe-*.tar.xz mxe-*.deb* wheezy jessie
.PHONY: clean
clean:
- @[ -d "$$WINEPREFIX" ] && chmod 0755 "$$WINEPREFIX" || true
rm -rf $(call TMP_DIR,*) $(PREFIX) \
$(addprefix $(TOP_DIR)/, $(BUILD_PKG_TMP_FILES))