mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
support MacOS build
This commit is contained in:
parent
c714c28be3
commit
b27e6817b0
30
.macos_bintray.json
Normal file
30
.macos_bintray.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"package": {
|
||||||
|
"name": "vnote",
|
||||||
|
"repo": "vnote",
|
||||||
|
"subject": "tamlok",
|
||||||
|
"desc": "Continuous deployment by Travis-CI",
|
||||||
|
"website_url": "https://github.com/tamlok/vnote",
|
||||||
|
"issue_tracker_url": "https://github.com/tamlok/vnote/issues",
|
||||||
|
"vcs_url": "https://github.com/tamlok/vnote.git",
|
||||||
|
"github_use_tag_release_notes": false,
|
||||||
|
"github_release_notes_file": "",
|
||||||
|
"licenses": ["MIT"],
|
||||||
|
"labels": ["Markdown", "Note-Taking", "Office", "Utils", "Efficiency"],
|
||||||
|
"public_download_numbers": true,
|
||||||
|
"public_stats": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"version": {
|
||||||
|
"name": "1.0",
|
||||||
|
"desc": "VNote v1.0",
|
||||||
|
"released": "2017-01-25",
|
||||||
|
"vcs_tag": "1.0",
|
||||||
|
"gpgSign": false
|
||||||
|
},
|
||||||
|
|
||||||
|
"files":
|
||||||
|
[{"includePattern": "build/distrib/(VNote_.*\\.dmg)", "uploadPattern": "$1"}],
|
||||||
|
|
||||||
|
"publish": true
|
||||||
|
}
|
65
.travis.yml
65
.travis.yml
@ -3,36 +3,55 @@ sudo: required
|
|||||||
git:
|
git:
|
||||||
depth: 1
|
depth: 1
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: osx
|
||||||
|
compiler: clang
|
||||||
|
osx_image: xcode8
|
||||||
|
- os: linux
|
||||||
compiler: g++
|
compiler: g++
|
||||||
env:
|
|
||||||
- version="1.0"
|
branches:
|
||||||
addons:
|
only:
|
||||||
apt:
|
- master
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- gcc-6
|
|
||||||
- g++-6
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get -qq update
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
|
||||||
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get -qq update ; fi
|
||||||
|
- export version="1.0"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install p7zip-full ; fi
|
||||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install chrpath ; fi
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install tree ; fi
|
||||||
p7zip-full
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get install -qq gcc-6; sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100 ; fi
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get install -qq g++-6; sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100 ; fi
|
||||||
chrpath
|
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
|
|
||||||
tree
|
|
||||||
before_script:
|
before_script:
|
||||||
- chmod +x .travis_linux.sh
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then chmod +x .travis_linux.sh ; fi
|
||||||
|
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then chmod +x .travis_macos.sh ; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- TAG_NAME=${TRAVIS_TAG} CXX="g++-6" CC="gcc-6" ./.travis_linux.sh
|
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then CXX="g++-6" CC="gcc-6" ./.travis_linux.sh ; fi
|
||||||
|
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then ./.travis_macos.sh ; fi
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: bintray
|
- provider: bintray
|
||||||
file: "./.linux_bintray.json"
|
file: "./.linux_bintray.json"
|
||||||
user: tamlok
|
user: tamlok
|
||||||
key:
|
key:
|
||||||
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
|
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
|
||||||
dry-run: true
|
dry-run: false
|
||||||
on: master
|
on:
|
||||||
|
condition: $TRAVIS_OS_NAME = linux
|
||||||
|
branch: master
|
||||||
|
- provider: bintray
|
||||||
|
file: "./.macos_bintray.json"
|
||||||
|
user: tamlok
|
||||||
|
key:
|
||||||
|
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
|
||||||
|
dry-run: false
|
||||||
|
on:
|
||||||
|
condition: $TRAVIS_OS_NAME = osx
|
||||||
|
branch: master
|
||||||
|
50
.travis_macos.sh
Normal file
50
.travis_macos.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
project_dir=$(pwd)
|
||||||
|
version="${version}.${TRAVIS_BUILD_NUMBER}"
|
||||||
|
|
||||||
|
brew update > /dev/null
|
||||||
|
brew install qt@5.7
|
||||||
|
QTDIR="/usr/local/opt/qt@5.7"
|
||||||
|
PATH="$QTDIR/bin:$PATH"
|
||||||
|
LDFLAGS=-L$QTDIR/lib
|
||||||
|
CPPFLAGS=-I$QTDIR/include
|
||||||
|
|
||||||
|
# Build your app
|
||||||
|
cd ${project_dir}
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
qmake -v
|
||||||
|
qmake -config release ../VNote.pro
|
||||||
|
make -j2
|
||||||
|
|
||||||
|
git clone https://github.com/aurelien-rainone/macdeployqtfix.git
|
||||||
|
|
||||||
|
# Package DMG from build/src/VNote.app directory
|
||||||
|
cd src/
|
||||||
|
|
||||||
|
sed -i -e 's/com.yourcompany.VNote/com.tamlok.VNote/g' VNote.app/Contents/Info.plist
|
||||||
|
$QTDIR/bin/macdeployqt VNote.app
|
||||||
|
python ../macdeployqtfix/macdeployqtfix.py VNote.app/Contents/MacOS/VNote $QTDIR
|
||||||
|
|
||||||
|
# Fix Helpers/QtWebEngineProcess.app
|
||||||
|
cd VNote.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/Helpers
|
||||||
|
$QTDIR/bin/macdeployqt QtWebEngineProcess.app
|
||||||
|
python ${project_dir}/build/macdeployqtfix/macdeployqtfix.py QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess $QTDIR
|
||||||
|
|
||||||
|
cd ${project_dir}/build
|
||||||
|
mkdir -p distrib/VNote
|
||||||
|
cd distrib/VNote
|
||||||
|
mv ../../src/VNote.app ./
|
||||||
|
cp "${project_dir}/LICENSE" "LICENSE"
|
||||||
|
cp "${project_dir}/README.md" "README.md"
|
||||||
|
echo "${version}" > version
|
||||||
|
echo "${TRAVIS_COMMIT}" >> version
|
||||||
|
|
||||||
|
ln -s /Applications ./Applications
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
hdiutil create -srcfolder ./VNote -format UDBZ ./VNote.dmg
|
||||||
|
mv VNote.dmg VNote_${version}_mac_X64.dmg
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
exit 0
|
Binary file not shown.
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui webenginewidgets webchannel network
|
QT += core gui webenginewidgets webchannel network svg
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ TARGET = VNote
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
RC_ICONS = resources/icons/vnote.ico
|
RC_ICONS = resources/icons/vnote.ico
|
||||||
|
ICON = resources/icons/vnote.icns
|
||||||
|
|
||||||
TRANSLATIONS += translations/vnote_zh_CN.ts
|
TRANSLATIONS += translations/vnote_zh_CN.ts
|
||||||
|
|
||||||
@ -97,6 +98,11 @@ RESOURCES += \
|
|||||||
vnote.qrc \
|
vnote.qrc \
|
||||||
translations.qrc
|
translations.qrc
|
||||||
|
|
||||||
|
macx {
|
||||||
|
LIBS += -L/usr/local/lib
|
||||||
|
INCLUDEPATH += /usr/local/include
|
||||||
|
}
|
||||||
|
|
||||||
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../hoedown/release/ -lhoedown
|
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../hoedown/release/ -lhoedown
|
||||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../hoedown/debug/ -lhoedown
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../hoedown/debug/ -lhoedown
|
||||||
else:unix: LIBS += -L$$OUT_PWD/../hoedown/ -lhoedown
|
else:unix: LIBS += -L$$OUT_PWD/../hoedown/ -lhoedown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user