wulkano / Aperture

Record the screen on macOS
MIT License
1.24k stars 111 forks source link

Build with swift instead of xcodebuild #21

Closed StefMa closed 7 years ago

StefMa commented 7 years ago

Change the build script to build with swift instead of xcodebuild.

This is part of #19. Currently aperture can't be build on linux (so maybe this is part of #7 as well 🤔 but haven't looked in detail inside the PR) which means it can't build in Docker as well.

swift is available on multiple operating systems (e.g. linux) but xcodebuild not. So changing the build script to build with swift you only have to install swift on your given OS and you are fine to build aperture 🎉

Probably you want to modify the Package.swift to fits your needs. But I should that would be done later by you :)

StefMa commented 7 years ago

😞 I found out that

you only have to install swift on your given OS and you are fine to build aperture isn't true 😢

Because on Linux system (or Dockers) I got the message

aperture.js/swift/aperture/Recorder.swift:1:8: error: no such module 'AVFoundation' Because AVFoundation isn't available on Linux 😞

StefMa commented 7 years ago

Anyway. It would be great if we can merge it because it is one step closer to support other operating systems 👌

matheuss commented 7 years ago

Wooo @StefMa, amazing! I tried that when I first started, but I never managed to get it working. Will test ASAP 🙌

sindresorhus commented 7 years ago

I don't mind using swift directly to compile, but I don't understand the argument about Linux. The Swift code is highly coupled to macOS and will never run on Linux.

StefMa commented 7 years ago

I thought when we compile with swift (because it is available for linux as well) instead of xcodebuild it will be possible to compile the code on linux environments. But it can't build on linux because of the AVFoundation 😞

The idea behind this was to create a workaround for #19. Because I don't found any information about building and distribute a binary via npm

sindresorhus commented 7 years ago

The idea behind this was to create a workaround for #19.

@StefMa You're overthinking it. All that's needed for #19 is to switch the compilation from postinstall to prepublish.

StefMa commented 7 years ago

Oh, really? Make sense 😁 Anyway, have now some experience with swift and xcodebuild 🤣

If you like to merge it feel free. Otherwise just close this PR...

On Jan 22, 2017 7:11 PM, "Sindre Sorhus" notifications@github.com wrote:

The idea behind this was to create a workaround for #19 https://github.com/wulkano/aperture.js/issues/19.

@StefMa https://github.com/StefMa You're overthinking it. All that's needed for #19 https://github.com/wulkano/aperture.js/issues/19 is to switch the compilation from postinstall to prepublish.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wulkano/aperture.js/pull/21#issuecomment-274347790, or mute the thread https://github.com/notifications/unsubscribe-auth/AJwYe4y8_Ia_4nw7Ru75DA3HeLdi3nhYks5rU5vjgaJpZM4LqWgM .

sindresorhus commented 7 years ago

Actually, I don't see enough benefit in this change. It's safer to use xcodebuild as it follows the build settings in the Xcode project file. This change is also incorrect as the compiled binary needs to include Swift itself, as the Swift ABI is not stable. xcodebuild does this automatically.

StefMa commented 7 years ago

Closed because the PR make no sense 😹