mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #960] Apple M1 native build #771
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#771
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @senf666 on GitHub (Nov 25, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/960
Would be nice to have a native M1 build please. Is it as simple as recompiling on an M1 machine?
Thanks.
@NikoMuffin commented on GitHub (Nov 27, 2020):
+1000 this
@mdg4486 commented on GitHub (Nov 27, 2020):
+2000 on this.
@ryancnelson commented on GitHub (Dec 1, 2020):
more than being "nice to have", barrier 2.3.3 release will not start on my m1 macbook air. does it work at all for others?
@ryancnelson commented on GitHub (Dec 1, 2020):
... sorry for the distraction: this was a configuration + gatekeeper problem. i've got it running now on my m1 laptop.
@james-womack commented on GitHub (Dec 18, 2020):
I believe https://github.com/Homebrew/brew/issues/7857#issuecomment-748170325 may resolve the
qtdependency used in the build_dist.sh.in for macOS. I might have some time to take a crack at building it on my m1 Mac mini over the holidays. Running on Rosetta 2 seems to be fine so far between my MacOS and Windows machines however.@mcoolidge commented on GitHub (Jan 4, 2021):
I just tried building from source on an M1 but it fails after some time.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/barrier] Error 1
make[1]: *** [src/gui/CMakeFiles/barrier.dir/all] Error 2
make: *** [all] Error 2
@mcoolidge commented on GitHub (Jan 13, 2021):
I have been using barrier mostly fine between windows (server) and mini m1 (client), but the CPU usage spikes sometimes up to 25% and I get severe lag if the CPU is otherwise stressed.
@caparomula commented on GitHub (Jan 22, 2021):
I just built 2.3.3 on my M1 mac. You need to fix the OPENSSL_ROOT definition in CMakeLists.txt. Here's a diff that removes the hard-coded path for homebrew:
Also, I modified clean_build.sh to target 11.1 instead of 10.9. Not sure if it matters; I had just changed that prior to discovering the root cause of the OPENSSL issue, and never bothered changing it back, since I'm just building for my personal M1 MacBook, which obviously does not run MacOS 10.9.
@robcz commented on GitHub (Jan 29, 2021):
I was able to build barrier on my M1 MacBook without making the clean_build.sh changes. It does throw a few warnings related to mismatching build targets between 11.1 and releases in the 10.X series, but it builds and seems to run just fine.
@zachlatta commented on GitHub (Mar 10, 2021):
I was unable to make an M1 native build that launched. I was able to get it to compile, but then got the following error when attempting to launch it (by double clicking on the built
Barrier.app):I needed to make @caparomula's suggested changes to
clean_build.shto get it to build and additionally had to do the following:Install both
qtandqt5. Barrier looks forqt, not justqt5, and will error out if it's not present.Tell CMake about the location of
qt5:Issue both of @caparomula's suggested patches.
Then build!
Any thoughts on how to fix this?
@caparomula commented on GitHub (Mar 11, 2021):
You need to sign the binary. I'm pretty new to development on Apple devices, and it took me a while to figure it out. Unfortunately, I don't recall the actual steps I took to sign my binary. But basically you need to get a certificate from Apple (I think I did this via xcode using my free developer account), then use the 'codesign' command line tool to sign the binary. Be sure to do a 'deep' signing so it gets all of the contents. I wish I could give you more specific details, but it's one of those things I just sort of figured out and then promptly forgot. But you should be able to figure it out with a little googling and experimentation. Or maybe someone with a bit more savvy can chime in.
@fdelucchijr commented on GitHub (Jul 7, 2021):
@zachlatta I'm trying to build it too... gets me to the same error... PD: your building for DEBUG, for release, you really gonna need Signing as @caparomula is saying.
Maybe someone more savvy can help us (im not a PC/Mac programmer so y really don't know).
I'm using this wiki:
https://github.com/debauchee/barrier-wiki/blob/master/Building-on-macOS.md
And this #1162 PR as src.
Same
Namespace CODESIGNING, Code 0x2error.@palkoc commented on GitHub (Aug 27, 2021):
Hi all,
I faced the same problem and the solution stays in what @caporomula says in his note. Once the
clean_build.shis over, go to<barrier_repo>>/build/bundleand signBarrier.app, or install Barrier.app from .dmg and sign it there:Then you can launch /Applications/Barrier.app and everything should work.
@fdelucchijr commented on GitHub (Sep 1, 2021):
YES! It work flawless!!!
@vivaanmathur commented on GitHub (Oct 13, 2021):
Unable to build.
@arthurlockman commented on GitHub (Nov 12, 2021):
I just got it to work with the modifications suggested above.
In
clean_build.sh, change the build target to macOS 12.0:In
CMakeLists.txt, replace:Then once it's built:
Should be all you have to do to get it working. If you enable 20 threads on the
makecommand on an M1 Max, the whole thing builds in under 30 seconds. 😃@Cherrymelon commented on GitHub (Dec 15, 2021):
I run it,but terminal tell me "Please install xcode" ,if i want to build it ,i have to install more than 60gb xocde?
@vivaanmathur commented on GitHub (Dec 15, 2021):
Obviously, you need Xcode for all macOS development.
@Rahul-fix commented on GitHub (Jan 11, 2022):
I am trying to compile it on M1 mac using the instruction above but I am getting the following error:
OS: macOS 12.1 21C52 arm64
Xcode Version: 13.2.1 (13C100)
CMake: 3.22.1
CMakeError.log
CMakeOutput.log
@Rahul-fix commented on GitHub (Jan 16, 2022):
The build is working now after some modification to the path of SDK in
clean_build.sh:From:
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 $B_CMAKE_FLAGS"To:
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 $B_CMAKE_FLAGS"It worked when I build with release which gave the file
Barrier.dmg:In order to build a Barrier.dmg run below command:
export B_BUILD_TYPE=Release ./clean_build.shand then install the application. Also, sign the application with following:
codesign --force --deep --sign - /Applications/Barrier.appNow open the Barrier and Hopefully it will work!
@shaga82 commented on GitHub (Jan 31, 2022):
Would it be possible for those who was able to compile it for apple silicon, to share the dmg version.
Internet connection in my country sucks and downloading full Xcode is problematic here.
I downloaded Xcode command line version, which took me 3 days, but that was not enough apparently.
@thejasonfisher commented on GitHub (Feb 11, 2022):
Added a version/SDK test to this and just opened a pull request for the changes -- works perfectly here on my M1 MacBook Air as an Apple Silicon app in macOS Monterey 12.2.1.
https://github.com/debauchee/barrier/pull/1562
Published a pre-release off my fork that someone can test:
https://github.com/thejasonfisher/barrier/releases/download/macos-monterey-fixes/barrier-2.4.0-macOS-12.0-arm64-test.zip
@shaga82 commented on GitHub (Feb 11, 2022):
thank you Jason. it works perfectly and can confirm that it uses apple silicon on my Macbook Pro with M1 chip in Monterey 12.1.
@anosognosia commented on GitHub (Feb 11, 2022):
@thejasonfisher thank you!
@amalp12 commented on GitHub (Mar 9, 2022):
Please add support as soon as possible. It is showing system call error when I try to use my Macbook air with M1 chip as a server on client's side.
@amalp12 commented on GitHub (Mar 9, 2022):
This works perfectly, Thanks Jason
@warrendt commented on GitHub (Mar 24, 2022):
This works on my Mac M1 Mini running 12.3 Thanks Jason, you are a legend
@emacstheviking commented on GitHub (May 12, 2022):
Confirming Jason is a legend. Feels smoother too, less laggy. @thejasonfisher
@gltanaka commented on GitHub (Sep 15, 2022):
I can confirm it also works on a M1 Max
Here is the exact command sequence:
git clone https://github.com/debauchee/barrier.git
cd barrier
gh pr checkout 1562
xcode-select --install
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
brew install openssl
bash clean_build.sh
Then copy the build/bin/barrier.app to /Applications:
codesign -f -s "TYPE_YOUR_DEVELOPER_SIG_HERE" --deep /Applications/Barrier.app
You might need to go to developer.apple.com and get your developer certificate if you haven't compiled an apple app before.
@richstokes commented on GitHub (Sep 22, 2022):
^^ This seemed to work for me, except I also had to
brew install cmake qt qt5beforebash clean_build.shin the steps above.Then I did:
And seems good!
@zirho commented on GitHub (Sep 30, 2022):
This worked for me combining all above.
Thanks a lot guys!
@jandykwan commented on GitHub (Oct 19, 2022):
how to do if no 'TYPE_YOUR_DEVELOPER_SIG_HERE'
@panoslympe commented on GitHub (Dec 15, 2022):
can someone please, compile it, and upload it to a google drive or whatever? :D
@junbujianwpl commented on GitHub (Apr 18, 2023):
https://github.com/debauchee/barrier/issues/1395.
Maybe everyone who wants an
armrelease should check this thread.Qt5not supportarm. Only by migrating toQt6, anarmrelease can be made. Some comments above may be misleading.Though building on
armmac maybe success, and the executable is runable.@joshin42 commented on GitHub (Apr 18, 2023):
I've successfully built both barrier, and now InputLeap (the supported fork) on M1 Mac w/o too much trouble.
If you have all the bits and pieces needed to build installed with HomeBrew, I think all I had to do was to change the Deployment Target to 13.1 in the "clean_build.sh" file.
Edited to add:
I don't really know what I'm doing, but if you want to join the fun, here's my most recent build: https://1drv.ms/f/s!AioKbdTrI-m1gZxLsCeYXmHIo0wkdQ?e=aLBq78
Download the .app file, and install it in Applications. Please have a backup and don't yell at me if it turns your dog into a sloth
Edit 2: I tried creating a 'Release Build' - DMG file here -> https://1drv.ms/u/s!AioKbdTrI-m1gZ0VfUFNH-fIR2xDog?e=vAimV3
-J
@Traace commented on GitHub (May 25, 2023):
@joshin42 the 'Release Build' crashs for me because the signature is invalid. Didn't tested the debug build tho.
Edit: I just codesign it with my self signed dev certificate. Works fine now.
@AlexandreSout0 commented on GitHub (Jun 6, 2024):
Tanks for its. Works for me.