1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-03-15 08:29:42 +00:00

Build macOS version in Vagrant/macOS 10.13 (WIP). Fixes #273 (#290)

* Build macOS version in Vagrant/macOS 10.13 (WIP). Fixes #273

* Install Vagrant dependencies for darwin64.

* Working version of Vagrant file for macOS 10.13
This commit is contained in:
Manuel Riel 2019-06-11 08:19:25 +08:00 committed by GitHub
parent 23a92e3adb
commit 2b612d5142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 41 deletions

View file

@ -10,8 +10,15 @@ icon-resources: ## Compile SVG icons to importable resource files.
Vorta.app: translations-to-qm
pyinstaller --clean --noconfirm vorta.spec
Vorta.dmg-Vagrant:
vagrant up darwin64
rm -rf dist/*
vagrant scp darwin64:/vagrant/dist/Vorta.app dist/
vagrant halt darwin64
cp -R bin/darwin/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
cd dist; codesign --deep --sign 'Developer ID Application: Manuel Riel (CNMSCAXT48)' Vorta.app
sleep 2; appdmg appdmg.json dist/vorta-0.6.20.dmg
Vorta.dmg: Vorta.app
# sleep 2; cd dist; zip -9rq vorta-0.6.20.zip Vorta.app

85
Vagrantfile vendored
View file

@ -96,11 +96,26 @@ def run_tests(boxname)
EOF
end
def darwin_prepare()
return <<-EOF
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python
echo 'export PATH="/usr/local/opt/qt/bin/:$PATH"' >> ~/.bash_profile
cd /vagrant
pip3 install -e .
pip3 install -r requirements.d/dev.txt
brew bundle --file=requirements.d/Brewfile
EOF
end
def darwin_build()
return <<-EOF
cd /vagrant
make Vorta.app
EOF
end
Vagrant.configure(2) do |config|
# use rsync to copy content to the folder
config.vm.synced_folder ".", "/vagrant/vorta", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
# do not let the VM access . on the host machine via the default shared folder!
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.define "jessie64" do |b|
b.vm.box = "debian/jessie64"
@ -117,19 +132,33 @@ Vagrant.configure(2) do |config|
# b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
end
config.vm.define "darwin64" do |b|
b.vm.box = "monsenso/macos-10.13"
b.vm.provider :virtualbox do |v|
v.memory = 1536 + $wmem
v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
v.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
v.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
# Adjust CPU settings according to
# https://github.com/geerlingguy/macos-virtualbox-vm
# v.customize ['modifyvm', :id, '--cpuidset',
# '00000001', '000306a9', '00020800', '80000201', '178bfbff']
# Disable USB variant requiring Virtualbox proprietary extension pack
v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
end
b.vm.synced_folder ".", "/vagrant", type: "rsync", user: "vagrant", group: "staff"
b.vm.provision "darwin_prepare", :type => :shell, :privileged => false, :inline => darwin_prepare()
b.vm.provision "darwin_build", :type => :shell, :privileged => false, run: "always", :inline => darwin_build()
end
# config.vm.define "arch64" do |b|
# b.vm.box = "terrywang/archlinux"
# b.vm.provider :virtualbox do |v|
# v.memory = 1024 + $wmem
# end
# b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
# b.vm.provision "packages arch", :type => :shell, :privileged => true, :inline => packages_arch
# b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("arch64")
# b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
# b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("arch64")
# end
config.vm.define "win64" do |b|
b.vm.box = "gusztavvargadr/windows-10"
b.vm.provider :virtualbox do |v|
v.memory = 1024 + $wmem
end
end
# config.vm.define "freebsd64" do |b|
# b.vm.box = "freebsd12-amd64"
@ -146,32 +175,6 @@ Vagrant.configure(2) do |config|
# b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd64")
# end
# config.vm.define "darwin64" do |b|
# b.vm.box = "ashiq/osx-10.14"
# b.vm.provider :virtualbox do |v|
# v.memory = 1536 + $wmem
# v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
# v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
# # Adjust CPU settings according to
# # https://github.com/geerlingguy/macos-virtualbox-vm
# v.customize ['modifyvm', :id, '--cpuidset',
# '00000001', '000306a9', '00020800', '80000201', '178bfbff']
# # Disable USB variant requiring Virtualbox proprietary extension pack
# v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
# end
# b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
# b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
# b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
# b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
# b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
# b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
# b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
# b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
# b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
# b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
# end
# TODO: create more VMs with python 3.6 and openssl 1.1.
# See branch 1.1-maint for a better equipped Vagrantfile (but still on py34 and openssl 1.0).
end