From 88b0658b53f628f4ce1f3272fb723b95e57631c6 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Thu, 3 May 2018 19:33:55 +0300 Subject: [PATCH 1/3] Fix rebuild reversion --- ffsengine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ffsengine.cpp b/ffsengine.cpp index 0747e90..3d09216 100644 --- a/ffsengine.cpp +++ b/ffsengine.cpp @@ -2662,6 +2662,17 @@ UINT8 FfsEngine::rebuild(const QModelIndex & index) return ERR_SUCCESS; } +UINT8 FfsEngine::doNotRebuild(const QModelIndex & index) +{ + if (!index.isValid()) + return ERR_INVALID_PARAMETER; + + // Set action for the item + model->setAction(index, Actions::DoNotRebuild); + + return ERR_SUCCESS; +} + // Compression routines UINT8 FfsEngine::decompress(const QByteArray & compressedData, const UINT8 compressionType, QByteArray & decompressedData, UINT8 * algorithm) { From a9629c0400874332d88bc0843ac6c313317f3dd3 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Thu, 3 May 2018 21:12:24 +0300 Subject: [PATCH 2/3] Implement mac builds with deploy --- .travis.yml | 50 +++++++++++++++++++++++++++++++-------- macbuild.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 10 deletions(-) create mode 100755 macbuild.sh diff --git a/.travis.yml b/.travis.yml index bd25b50..80c26e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,44 @@ language: cpp +matrix: + include: + - os: osx + osx_image: xcode9.2 -compiler: - - clang - - gcc + compiler: clang -before_install: - - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa - - sudo apt-get update -qq - - sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev + script: + - ./macbuild.sh -script: - - qmake -qt=qt5 uefitool.pro - - make + deploy: + provider: releases + skip_cleanup: true + file: "dist/*.zip" + file_glob: true + api_key: + secure: "TODO" + on: + tags: true + + - os: linux + compiler: clang + + before_install: + - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa + - sudo apt-get update -qq + - sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev + + script: + - qmake -qt=qt5 uefitool.pro + - make + + - os: linux + compiler: gcc + + before_install: + - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa + - sudo apt-get update -qq + - sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev + + script: + - qmake -qt=qt5 uefitool.pro + - make diff --git a/macbuild.sh b/macbuild.sh new file mode 100755 index 0000000..d3e9964 --- /dev/null +++ b/macbuild.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +if [ ! -d /opt/qt56sm ]; then + curl -L -o /tmp/qt-5.6.3-static-mac.zip https://github.com/distdb/qtbuilds/blob/master/qt-5.6.3-static-mac.zip?raw=true || exit 1 + qtsum=$(shasum -a 256 /tmp/qt-5.6.3-static-mac.zip | cut -f1 -d' ') + qtexpsum="214d22d8572ea6162753c8dd251d79275f3b22d49204718c637d722409e0cfcb" + if [ "$qtsum" != "$qtexpsum" ]; then + echo "Qt hash $qtsum does not match $qtexpsum" + exit 1 + fi + sudo mkdir -p /opt || exit 1 + cd /opt || exit 1 + sudo unzip -q /tmp/qt-5.6.3-static-mac.zip || exit 1 + cd - || exit 1 +fi + +export PATH="/opt/qt56sm/bin:$PATH" + +echo "Attempting to build UEFITool for macOS..." + +UEFITOOL_VER=$(cat uefitool.cpp | grep ^version | cut -d'"' -f2) +UEFIEXTRACT_VER=$(cat UEFIExtract/uefiextract_main.cpp | grep '"UEFIExtract [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) +UEFIFIND_VER=$(cat UEFIFind/uefifind_main.cpp | grep '"UEFIFind [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) +UEFIPATCH_VER=$(cat UEFIPatch/uefipatch_main.cpp | grep '"UEFIPatch [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) +UEFIREPLACE_VER=$(cat UEFIReplace/uefireplace_main.cpp | grep '"UEFIReplace [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) + +build_tool() { + echo "Building $1 $2" + # Check version + if [ "$(echo "$2" | grep '^[0-9]*\.[0-9]*\.[0-9]*$')" != "$2" ]; then + echo "Invalid $1 version!" + exit 1 + fi + # Tools are in subdirectories + if [ "$1" != "UEFITool" ]; then + cd "$1" || exit 1 + fi + + # Build + qmake $3 QMAKE_CXXFLAGS+=-flto QMAKE_LFLAGS+=-flto CONFIG+=optimize_size || exit 1 + make || exit 1 + + # Archive + if [ "$1" = "UEFITool" ]; then + strip -x UEFITool.app/Contents/MacOS/UEFITool || exit 1 + zip -qry dist/"UEFITool_${UEFITOOL_VER}_mac.zip" UEFITool.app "${4}" || exit 1 + else + strip -x "$1" || exit 1 + zip -qry ../dist/"${1}_${2}_mac.zip" "${1}" "${4}" || exit 1 + fi + + # Return to parent + if [ "$1" != "UEFITool" ]; then + cd - || exit 1 + fi +} + +rm -rf dist +mkdir -p dist || exit 1 + +build_tool UEFITool "$UEFITOOL_VER" uefitool.pro +build_tool UEFIExtract "$UEFIEXTRACT_VER" uefiextract.pro +build_tool UEFIFind "$UEFIFIND_VER" uefifind.pro +build_tool UEFIPatch "$UEFIPATCH_VER" uefipatch.pro patches.txt +build_tool UEFIReplace "$UEFIREPLACE_VER" uefireplace.pro + +exit 0 From 15b606f924aec9f399647b68376a79bb21984c91 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Fri, 4 May 2018 06:40:04 +0300 Subject: [PATCH 3/3] Add deploy key --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 80c26e8..99a9946 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ matrix: file: "dist/*.zip" file_glob: true api_key: - secure: "TODO" + secure: "WjYd93lVLKHULBpUXS/WtGrkdXyAwxHOUnLJotyDmQipAQP5Ox7Kj12JwkSJGEmVOEdcbIQJyi0QxPjn1UYbYsAt6Op8zrjnYLS4G4fMdBtcxprWzid85uTW7oAAIFs7ygMVhpzxRKpu70yNb683vbThqNmaOu6RyG9aJOLtPAg=" on: tags: true