transmission-remote-gui / transgui

🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
GNU General Public License v2.0
3.22k stars 280 forks source link

M1 macOS build? #1355

Open Willian-Zhang opened 3 years ago

Willian-Zhang commented 3 years ago

Apple m1 lines Macs are out, is there a easy way to build a m1 native app?

Operating system: macOS Big Sur 11.0.1 (20B29)

shermanikk commented 2 years ago

If anyone was having issue #1378 I rebuilt transgui with fpc 3.3.1 and lazarus 2.3.0 and kanji/chinese/korean characters are showing up correctly again. Not sure what the deal was but hey, it works!

Same link as the old build, and I make no promises or guarantees this won't cause bodily injury or constitute a fire hazard: https://shermanikk.net/stuff/transgui-macosx-arm64.zip

alfenheim commented 2 years ago

If anyone was having issue #1378 I rebuilt transgui with fpc 3.3.1 and lazarus 2.3.0 and kanji/chinese/korean characters are showing up correctly again. Not sure what the deal was but hey, it works!

Same link as the old build, and I make no promises or guarantees this won't cause bodily injury or constitute a fire hazard: https://shermanikk.net/stuff/transgui-macosx-arm64.v2.zip

The link is not working anymore to download, can you please upload/share again?

shermanikk commented 2 years ago

If anyone was having issue #1378 I rebuilt transgui with fpc 3.3.1 and lazarus 2.3.0 and kanji/chinese/korean characters are showing up correctly again. Not sure what the deal was but hey, it works! Same link as the old build, and I make no promises or guarantees this won't cause bodily injury or constitute a fire hazard: https://shermanikk.net/stuff/transgui-macosx-arm64.zip

The link is not working anymore to download, can you please upload/share again?

Apologies, edited my post with the correct link.

flying-sausages commented 2 years ago

@shermanikk could you try rebuild it with these patches please? #1306

aniqueta commented 2 years ago

@shermanikk Trying this a few months later than others here. I have the the above SSL error that @tcurdt has experienced. Environment does not have Homebrew, and reading this thread it seems openssl should be compiled with the build? Would appreciate an Apple Silicon build. Thanks!

shermanikk commented 2 years ago

@shermanikk Trying this a few months later than others here. I have the the above SSL error that @tcurdt has experienced. Environment does not have Homebrew, and reading this thread it seems openssl should be compiled with the build? Would appreciate an Apple Silicon build. Thanks!

I'm glad you said something, I didn't realize it still wasn't working properly! So, it turns out that libssl.1.1.dylib included an LC_LOAD_DYLIB command that was still referencing the original install location of libcrypto in the homebrew directory, and that was why despite the fact that transgui was loading both libcrypto.1.1.dylib and libssl.1.1.dylib from it's own directory, it still required the homebrew install location to have libcrypto.1.1.dylib (/opt/homebrew/Cellar/openssl@1.1/1.1.1o/lib/libcrypto.1.1.dylib in this case). So, after a quick few edits using install_name_tool to both dylibs and a resigning of the entire .app bundle, I believe it should be working without requiring any homebrew installs!

I've updated the .zip linked before, but here it is again: https://shermanikk.net/stuff/transgui-macosx-arm64.zip

Please let me know if this works for you, it's built using fpc 3.3.1 and lazarus 2.3.0 on MacOS 12.3.1 on a 2020 M1 MacBook Air.

shermanikk commented 2 years ago

@tcurdt @flying-sausages

I know it's been a while, but I have finally figured out the OpenSSL issue, see the above post! Try downloading my latest build and see if it's working for you.

nickv2002 commented 2 years ago

Seems like @shermanikk's new build is working great for me at least.

Can we get a GitHub PR to get this back into the main project or, barring that, put together a fork?

Also, I have an Apple dev account I use for signing open source software with Apple (see Simple Comic) so LMK if it would help to have signed binaries so folks can launch them more easily/safely.

jvacek commented 2 years ago

Is there any way the changes necessary to build this could be PR'd into master?

isevewel commented 2 years ago

I've just tested but it don't work on m1 macbook pro.

무제

shermanikk commented 2 years ago

I've just tested but it don't work on m1 macbook pro.

무제

What version of MacOS are you running? Do you have Homebrew installed?

acahir commented 2 years ago

@tcurdt @flying-sausages

I know it's been a while, but I have finally figured out the OpenSSL issue, see the above post! Try downloading my latest build and see if it's working for you.

I just tried your latest build on a new MBP running macOS 12.4 and it worked without problems, though I'm not connecting through SSL.

Would be great to get the universal version as default for distribution.

adissimo25 commented 2 years ago

Hi, I installed my older BackUp from my MBP 2010 to my new MBP m1 and have the following error:

Bildschirmfoto 2022-08-13 um 18 36 26

MacOS 12.5 and Homebrew is installed

Thanks for help

acahir commented 2 years ago

I was just setting up a new install, and remembered I had found a native build somewhere.

Rather than have this built out of band, are the maintainers still interested in a universal build? There's no reason why it has to be arm64 or x86-64 builds, the build script should be able to create a universal bundle with the right settings.

nickv2002 commented 2 years ago

If we can get a universal version of the app, I can also sign it with my developer account so it can launch without warnings. (As I do for Simple Comic)

acahir commented 2 years ago

Example from Apple's reference:

x86_app: main.c
    $(CC) main.c -o x86_app -target x86_64-apple-macos10.12
arm_app: main.c
    $(CC) main.c -o arm_app -target arm64-apple-macos11
universal_app: x86_app arm_app
    lipo -create -output universal_app x86_app arm_app

So instead of changing the build lines as suggested in Step 6 above, both should be included and then the lipo tool can create a universal binary.

Also note in the references that it's better to build all native libraries into the binaries, to make sure they are built for the correct arch. Not sure if that's required or not, seem like it could use the dynamic libs correctly as long as the correct arch was installed (which HB should take care of already).

Willian-Zhang commented 1 year ago

@shermanikk Trying this a few months later than others here. I have the the above SSL error that @tcurdt has experienced. Environment does not have Homebrew, and reading this thread it seems openssl should be compiled with the build? Would appreciate an Apple Silicon build. Thanks!

I'm glad you said something, I didn't realize it still wasn't working properly! So, it turns out that libssl.1.1.dylib included an LC_LOAD_DYLIB command that was still referencing the original install location of libcrypto in the homebrew directory, and that was why despite the fact that transgui was loading both libcrypto.1.1.dylib and libssl.1.1.dylib from it's own directory, it still required the homebrew install location to have libcrypto.1.1.dylib (/opt/homebrew/Cellar/openssl@1.1/1.1.1o/lib/libcrypto.1.1.dylib in this case). So, after a quick few edits using install_name_tool to both dylibs and a resigning of the entire .app bundle, I believe it should be working without requiring any homebrew installs!

I've updated the .zip linked before, but here it is again: https://shermanikk.net/stuff/transgui-macosx-arm64.zip

Please let me know if this works for you, it's built using fpc 3.3.1 and lazarus 2.3.0 on MacOS 12.3.1 on a 2020 M1 MacBook Air.

I'm running your build on Ventura 13.0 (22A380). Just found a new issue only after upgrade to Ventura: When opening the app with associated torrent file, the pop window for creation for new task would go behind the main window, instead of going top front.

This problem wouldn't be bothersome to ones noticed it, as the only step needed would be switching back. Just most cases it wouldn't be easily noticeable, hence I'm posting for anyone who came to this thread and found out the app would "occasionally unresponsive" after the upgrade.

urda commented 1 year ago

What is the status of targeting Apple Silicon in this project?

jata1 commented 1 year ago

@shermanikk - just wanted to say thanks. This works fine / native on my M2 MacBook Air with latest Ventura.

Will all of the work you and others have done to get this working be merged into the main dev branch for this project?

jvacek commented 1 year ago

@PeterDaveHello

@Willian-Zhang I don't think we have resource to work on it yet, we'll need some help to do that.

Given the proof of concepts that work just fine, what would you need in order to implement this "upstream"?

PeterDaveHello commented 1 year ago

@jvacek Sure, that's a good idea, I'm gonna need to take some time to sort it out, make sure the build and release process can be automatic for the next release.

Anyone looking forward to have this update, please feel free to help us all to organize the information and works here, that may speed up the whole process to get it done.

Thank you all for the waiting and contribution.

shermanikk commented 1 year ago

Later today I will start from scratch with a clean install and do a little step-by-step guide (excluding getting the tools themselves installed since those guides already exist) that includes all the little caveats I learned along the way, especially the subtle issue I had getting the OpenSSL libs working properly.

If there's anything else you'd like me to do, I'd be happy to! I have been using transgui every day for years now to control my home torrent server and it's been fantastic. Heaps better than some janky, slow WebUI!

Smultie commented 1 year ago

Thanks a lot for your work, @shermanikk Would be great indeed if the changes would be implemented in the original app.

urda commented 1 year ago

Alas this took too long and I've migrated my servers to another torrent platform.

mreid-tt commented 1 year ago

If there's anything else you'd like me to do, I'd be happy to! I have been using transgui every day for years now to control my home torrent server and it's been fantastic. Heaps better than some janky, slow WebUI!

Would it be possible to create a PR to enable the Apple Silicon build?

PeterDaveHello commented 1 year ago

It'll be great if any contributors would like to send a pull request.

As you can see, many pull requests have been reviewed and merged recently, but my spare time can be very limited, and I'm still working on some Linux issues. So, if someone can help with this issue together, it would be very much appreciated.

jvacek commented 1 year ago

Later today I will start from scratch with a clean install and do a little step-by-step guide (excluding getting the tools themselves installed since those guides already exist) that includes all the little caveats I learned along the way, especially the subtle issue I had getting the OpenSSL libs working properly.

@shermanikk any updates by any chance?

ArneAnka commented 1 year ago

I want to build from the latest merge to get labels/groups working. How can i build it?

PeterDaveHello commented 1 year ago

@xavery would you like to send a pull request for it? Thanks a lot!

lighterowl commented 1 year ago

@xavery would you like to send a pull request for it? Thanks a lot!

Not sure what you mean, my fork only builds for Intel Mac. I haven't looked into setting up M1 builds at all.

PeterDaveHello commented 1 year ago

@xavery oh, sorry, I misunderstand that you might have build for M1 😅

chkuendig commented 1 year ago

I think it was @shermanikk who had managed to setup a build - https://github.com/transmission-remote-gui/transgui/issues/1355#issuecomment-1477993771 and https://github.com/transmission-remote-gui/transgui/issues/1355#issuecomment-1125818588. This thread is a bit of a mess #1358

lighterowl commented 1 year ago

For everyone interested, I have just added Mac Silicon builds to my fork. The first release is here - in fact, the binaries are universal so nothing changes for existing macOS users.

In my very limited testing, it seems no less stable than the Intel version, which is probably as good as it's going to get. If I don't get any overwhelmingly negative feedback over the next few weeks, I'll create a new point release and provide universal binaries for macOS from now on, or for as long as I have access to an M1 runner. Please create issues in the fork instead of here in case of problems.

@PeterDaveHello Feel free to merge the changes from my fork to this repository, but keep in mind that I made some quite significant changes to how the project is built, i.e. Makefiles have been replaced with lazbuild and all CI stuff is handled by GitHub Actions instead of Travis. Most importantly perhaps, this requires actual native Apple Silicon hardware to be compiled : I have not tried cross-compiling to M1 from an Intel Mac. There is also support for cross-compiling to M1 from an Intel Mac : the executables created this way were perfectly usable on the M1 Mac that I use for testing.

Smultie commented 1 year ago

The link shows a 404 for me.

lighterowl commented 1 year ago

The link shows a 404 for me.

As this is a build artifact and not a "release binary", you need to be logged in with your GitHub account to download. Here's the same file as an attachment, hopefully it works better : TransGUI macOS Universal Binary.zip

Smultie commented 1 year ago

For everyone interested, I have just added Mac Silicon builds to my fork. The first release is here - in fact, the binaries are universal so nothing changes for existing macOS users.

In my very limited testing, it seems no less stable than the Intel version, which is probably as good as it's going to get. If I don't get any overwhelmingly negative feedback over the next few weeks, I'll create a new point release and provide universal binaries for macOS from now on, or for as long as I have access to an M1 runner. Please create issues in the fork instead of here in case of problems.

@PeterDaveHello Feel free to merge the changes from my fork to this repository, but keep in mind that I made some quite significant changes to how the project is built, i.e. Makefiles have been replaced with lazbuild and all CI stuff is handled by GitHub Actions instead of Travis. ~Most importantly perhaps, this requires actual native Apple Silicon hardware to be compiled : I have not tried cross-compiling to M1 from an Intel Mac.~ There is also support for cross-compiling to M1 from an Intel Mac : the executables created this way were perfectly usable on the M1 Mac that I use for testing.

Maybe for next release, it's an idea to have the Command button work for CTRL-commands? This is the only app where I need to use the CTRL-button for stuff I normally use the Command button (in this case Reannounce (get more peers)

lighterowl commented 1 year ago

@Smultie Please have a look at https://github.com/xavery/transgui/issues/45 and comment there if you can, thanks.