Ticket #6433: 0001-Unpack-sources-to-temporary-dirs.patch

File 0001-Unpack-sources-to-temporary-dirs.patch, 6.7 KB (added by Shondoit, 7 years ago)
  • build-scripts/versions-alpha.mk

    From 36c554efdbc53ce9d78ef4c49c55ac881904eca8 Mon Sep 17 00:00:00 2001
    From: Shondoit Walker <shondoit@gmail.com>
    Date: Fri, 20 Jul 2012 12:46:30 +0200
    Subject: [PATCH] Unpack sources to temporary dirs.
    
    Since we patch these targets, we don't want it to unpack to the target dir immediately.
    When we unpack to a temp dir then we force a rerun if the patching fails instead of silently continuing.
    ---
     build-scripts/versions-alpha.mk |   36 ++++++++++++++++++++----------------
     build-scripts/versions.mk       |   36 ++++++++++++++++++++----------------
     2 files changed, 40 insertions(+), 32 deletions(-)
    
    diff --git a/build-scripts/versions-alpha.mk b/build-scripts/versions-alpha.mk
    index 461ebc5..36e56b5 100644
    a b $(QT_DIR): $(FETCH_DIR)/$(QT_PACKAGE) | $(BUILD_DIR) 
    178178        mv $(BUILD_DIR)/qt-everywhere-opensource-src-$(QT_VER) $(QT_DIR)
    179179
    180180$(OPENSSL_DIR): $(FETCH_DIR)/$(OPENSSL_PACKAGE) ../src/current-patches/openssl/*patch | $(BUILD_DIR)
    181         rm -rf $(OPENSSL_DIR)
    182         cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE) -C $(BUILD_DIR)/
    183         cp ../src/current-patches/openssl/*patch $(OPENSSL_DIR)
    184         cp patch-any-src.sh $(OPENSSL_DIR)
    185         cd $(OPENSSL_DIR) && ./patch-any-src.sh
     181        rm -rf $(OPENSSL_DIR)~ $(OPENSSL_DIR)
     182        mkdir -p $(OPENSSL_DIR)~
     183        cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE) -C $(OPENSSL_DIR)~ --strip 1
     184        cp ../src/current-patches/openssl/*patch $(OPENSSL_DIR)~
     185        cp patch-any-src.sh $(OPENSSL_DIR)~
     186        cd $(OPENSSL_DIR)~ && ./patch-any-src.sh
     187        mv $(OPENSSL_DIR)~ $(OPENSSL_DIR)
    186188
    187189$(VIDALIA_DIR): $(FETCH_DIR)/$(VIDALIA_PACKAGE) | $(BUILD_DIR)
    188190        rm -rf $(VIDALIA_DIR)
    $(TOR_DIR): $(FETCH_DIR)/$(TOR_PACKAGE) | $(BUILD_DIR) 
    197199        cd $(FETCH_DIR) && tar -xmf $(TOR_PACKAGE) -C $(BUILD_DIR)/
    198200
    199201$(FIREFOX_DIR): $(FETCH_DIR)/$(FIREFOX_PACKAGE) ../src/current-patches/firefox/alpha/* | $(BUILD_DIR)
    200         rm -rf $(FIREFOX_DIR) $(FETCH_DIR)/mozilla-release
     202        rm -rf $(FIREFOX_DIR)~ $(FIREFOX_DIR) $(FETCH_DIR)/mozilla-release
    201203        cd $(FETCH_DIR) && tar -xmf $(FIREFOX_PACKAGE) -C $(BUILD_DIR)/
    202         mv $(BUILD_DIR)/mozilla-release $(FIREFOX_DIR)
    203         cp ../src/current-patches/firefox/alpha/* $(FIREFOX_DIR)
    204         cp patch-any-src.sh $(FIREFOX_DIR)
    205         cd $(FIREFOX_DIR) && ./patch-any-src.sh
     204        mv $(BUILD_DIR)/mozilla-release $(FIREFOX_DIR)~
     205        cp ../src/current-patches/firefox/alpha/*.patch $(FIREFOX_DIR)~
     206        cp patch-any-src.sh $(FIREFOX_DIR)~
     207        cd $(FIREFOX_DIR)~ && ./patch-any-src.sh
     208        mv $(FIREFOX_DIR)~ $(FIREFOX_DIR)
    206209
    207210$(MOZBUILD_DIR): $(FETCH_DIR)/$(MOZBUILD_PACKAGE) ../src/current-patches/mozilla-build/start-msvc.patch ../src/current-patches/mozilla-build/guess-msvc-x64.bat patch-mozilla-build.sh | $(BUILD_DIR)
    208         rm -rf $(MOZBUILD_DIR) /c/mozilla-build
    209         cmd.exe //c "$(PWD)/install-mozbuild.bat" "$(abspath $(FETCH_DIR)/$(MOZBUILD_PACKAGE))" "$(abspath $(MOZBUILD_DIR))"
     211        rm -rf $(MOZBUILD_DIR)~ $(MOZBUILD_DIR) /c/mozilla-build
     212        cmd.exe //c "$(PWD)/install-mozbuild.bat" "$(abspath $(FETCH_DIR)/$(MOZBUILD_PACKAGE))" "$(abspath $(MOZBUILD_DIR)~)"
    210213# We have to patch mozillabuild
    211         cp ../src/current-patches/mozilla-build/start-msvc.patch $(MOZBUILD_DIR)
    212         cp ../src/current-patches/mozilla-build/guess-msvc-x64.bat $(MOZBUILD_DIR)
    213         cp patch-mozilla-build.sh $(MOZBUILD_DIR)
    214         cd $(MOZBUILD_DIR) && ./patch-mozilla-build.sh $(MSVC_VER)
     214        cp ../src/current-patches/mozilla-build/start-msvc.patch $(MOZBUILD_DIR)~
     215        cp ../src/current-patches/mozilla-build/guess-msvc-x64.bat $(MOZBUILD_DIR)~
     216        cp patch-mozilla-build.sh $(MOZBUILD_DIR)~
     217        cd $(MOZBUILD_DIR)~ && ./patch-mozilla-build.sh $(MSVC_VER)
     218        mv $(MOZBUILD_DIR)~ $(MOZBUILD_DIR)
    215219
    216220$(PYMAKE_DIR): $(FETCH_DIR)/$(PYMAKE_PACKAGE) | $(BUILD_DIR)
    217221        rm -rf $(PYMAKE_DIR)
  • build-scripts/versions.mk

    diff --git a/build-scripts/versions.mk b/build-scripts/versions.mk
    index 0563102..d0180ec 100644
    a b $(QT_DIR): $(FETCH_DIR)/$(QT_PACKAGE) | $(BUILD_DIR) 
    178178        mv $(BUILD_DIR)/qt-everywhere-opensource-src-$(QT_VER) $(QT_DIR)
    179179
    180180$(OPENSSL_DIR): $(FETCH_DIR)/$(OPENSSL_PACKAGE) ../src/current-patches/openssl/*patch | $(BUILD_DIR)
    181         rm -rf $(OPENSSL_DIR)
    182         cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE) -C $(BUILD_DIR)/
    183         cp ../src/current-patches/openssl/*patch $(OPENSSL_DIR)
    184         cp patch-any-src.sh $(OPENSSL_DIR)
    185         cd $(OPENSSL_DIR) && ./patch-any-src.sh
     181        rm -rf $(OPENSSL_DIR)~ $(OPENSSL_DIR)
     182        mkdir -p $(OPENSSL_DIR)~
     183        cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE) -C $(OPENSSL_DIR)~ --strip 1
     184        cp ../src/current-patches/openssl/*patch $(OPENSSL_DIR)~
     185        cp patch-any-src.sh $(OPENSSL_DIR)~
     186        cd $(OPENSSL_DIR)~ && ./patch-any-src.sh
     187        mv $(OPENSSL_DIR)~ $(OPENSSL_DIR)
    186188
    187189$(VIDALIA_DIR): $(FETCH_DIR)/$(VIDALIA_PACKAGE) | $(BUILD_DIR)
    188190        rm -rf $(VIDALIA_DIR)
    $(TOR_DIR): $(FETCH_DIR)/$(TOR_PACKAGE) | $(BUILD_DIR) 
    197199        cd $(FETCH_DIR) && tar -xmf $(TOR_PACKAGE) -C $(BUILD_DIR)/
    198200
    199201$(FIREFOX_DIR): $(FETCH_DIR)/$(FIREFOX_PACKAGE) ../src/current-patches/firefox/* | $(BUILD_DIR)
    200         rm -rf $(FIREFOX_DIR) $(FETCH_DIR)/mozilla-esr10
     202        rm -rf $(FIREFOX_DIR)~ $(FIREFOX_DIR) $(FETCH_DIR)/mozilla-esr10
    201203        cd $(FETCH_DIR) && tar -xmf $(FIREFOX_PACKAGE) -C $(BUILD_DIR)/
    202         mv $(BUILD_DIR)/mozilla-esr10 $(FIREFOX_DIR)
    203         cp ../src/current-patches/firefox/* $(FIREFOX_DIR)
    204         cp patch-any-src.sh $(FIREFOX_DIR)
    205         cd $(FIREFOX_DIR) && ./patch-any-src.sh
     204        mv $(BUILD_DIR)/mozilla-esr10 $(FIREFOX_DIR)~
     205        cp ../src/current-patches/firefox/*.patch $(FIREFOX_DIR)~
     206        cp patch-any-src.sh $(FIREFOX_DIR)~
     207        cd $(FIREFOX_DIR)~ && ./patch-any-src.sh
     208        mv $(FIREFOX_DIR)~ $(FIREFOX_DIR)
    206209
    207210$(MOZBUILD_DIR): $(FETCH_DIR)/$(MOZBUILD_PACKAGE) ../src/current-patches/mozilla-build/start-msvc.patch ../src/current-patches/mozilla-build/guess-msvc-x64.bat patch-mozilla-build.sh | $(BUILD_DIR)
    208         rm -rf $(MOZBUILD_DIR) /c/mozilla-build
    209         cmd.exe //c "$(PWD)/install-mozbuild.bat" "$(abspath $(FETCH_DIR)/$(MOZBUILD_PACKAGE))" "$(abspath $(MOZBUILD_DIR))"
     211        rm -rf $(MOZBUILD_DIR)~ $(MOZBUILD_DIR) /c/mozilla-build
     212        cmd.exe //c "$(PWD)/install-mozbuild.bat" "$(abspath $(FETCH_DIR)/$(MOZBUILD_PACKAGE))" "$(abspath $(MOZBUILD_DIR)~)"
    210213# We have to patch mozillabuild
    211         cp ../src/current-patches/mozilla-build/start-msvc.patch $(MOZBUILD_DIR)
    212         cp ../src/current-patches/mozilla-build/guess-msvc-x64.bat $(MOZBUILD_DIR)
    213         cp patch-mozilla-build.sh $(MOZBUILD_DIR)
    214         cd $(MOZBUILD_DIR) && ./patch-mozilla-build.sh $(MSVC_VER)
     214        cp ../src/current-patches/mozilla-build/start-msvc.patch $(MOZBUILD_DIR)~
     215        cp ../src/current-patches/mozilla-build/guess-msvc-x64.bat $(MOZBUILD_DIR)~
     216        cp patch-mozilla-build.sh $(MOZBUILD_DIR)~
     217        cd $(MOZBUILD_DIR)~ && ./patch-mozilla-build.sh $(MSVC_VER)
     218        mv $(MOZBUILD_DIR)~ $(MOZBUILD_DIR)
    215219
    216220$(PYMAKE_DIR): $(FETCH_DIR)/$(PYMAKE_PACKAGE) | $(BUILD_DIR)
    217221        rm -rf $(PYMAKE_DIR)