cutbox / CutBox

CutBox makes your macOS pasteboard awesome.
https://cutbox.github.io
Other
167 stars 11 forks source link

Create brew tap & formula to ease self building the app. #102

Closed jasonm23 closed 2 years ago

jasonm23 commented 3 years ago
OldhamMade commented 3 years ago

Looking forward to being able to install via brew!

jasonm23 commented 3 years ago

Thank you, I really need people who can help test the steps.

If you clone the repo on your Mac and run...

cd CutBox
bin/setup
bin/build_local_app

it should compile or throw an error...

When it's finished compilation it should open a Finder window for you to copy the app to /Applications

Let me know if you can try and how you go.

Once I've verified steps work on an unpredictable Macos environment I can push to a brew formula with more confidence.

EnilPajic commented 3 years ago

Hello. First of all, thank you for this app and your effort to ease the compile process for us!

I'm having trouble compiling this app. Cloned repo (including submodules, just in case), cd CutBox, bin/setup and lastly bin/build_local_app which fails:

➜  CutBox git:(master) ✗ bin/build_local_app
Command line invocation:
    /Applications/Xcode-12.4.0.app/Contents/Developer/usr/bin/xcodebuild -workspace CutBox/CutBox.xcworkspace -scheme CutBox archive

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Build system information
warning: Multiple targets match implicit dependency for linker flags '-framework RxSwift'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'CutBox' from project 'CutBox')

...

Command CompileSwift failed with a nonzero exit code

...

/Users/USER/Library/Developer/Xcode/DerivedData/CutBox-elcvkdssjqybbcabmcbiwleffwzs/Build/Intermediates.noindex/ArchiveIntermediates/CutBox/IntermediateBuildFilesPath/CutBox.build/Release/CutBox.build/Objects-normal/arm64/PreferencesThemeSelectionView.o
/Users/USER/projects/CutBox/CutBox/CutBox/Source/Extensions/OrderedSet.swift:41:40: error: cannot find 'i' in scope
            indexOfKey[objects[idx]] = i
                                       ^
/Users/USER/projects/CutBox/CutBox/CutBox/Source/Extensions/OrderedSet.swift:77:40: error: cannot find 'i' in scope
            indexOfKey[objects[idx]] = i
                                       ^
/Users/USER/projects/CutBox/CutBox/CutBox/Source/Extensions/Array+removeAtIndexes.swift:18:13: error: cannot find 'i' in scope
            i = indexes.integerLessThan(idx!)
            ^

** ARCHIVE FAILED **

The following build commands failed:
    CompileSwift normal x86_64
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal arm64
(3 failures)
Get latest .app from archive
find: /Users/USER/Library/Developer/Xcode/Archives: No such file or directory
cp: : No such file or directory
CutBox.app: No such file or directory
mv: rename CutBox.app to CUTBOX_BUILD/CutBox.app: No such file or directory

You can see whole build log on this gist.

Using: Macbook Pro, Big Sur (11.2.1) and Xcode 12.4.0

Do you have any info how to fix the build? Any help is appreciated!

Thanks in advance!

jasonm23 commented 3 years ago

Hmmm let me try it... I may have screwed something up while cleaning.

jasonm23 commented 3 years ago

Ok, @EnilPajic give it a git pull and you should be good.

EnilPajic commented 3 years ago

@jasonm23, it works now! Thank you very much!

jasonm23 commented 3 years ago

Awesome, thank you so much for testing it.

PaulDaPigeon commented 2 years ago

Hi!

I got the build working, but ran into some trouble on the way. At first I got a Finder window with only a shortcut to Applications, but no app. The Terminal had no errors, just a warning: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance So I got Xcode from the AppStore, ran sudo xcode-select -s /Applications/Xcode.app/Contents/Developer and tried again. This time it was working fine, and got the app as well the shortcut in CUTBOX_BUILD. Copied it over, everything seems to work fine.

Ghos3t commented 2 years ago

Just wanted to add there's another open source Clipboard Manager app on Github called Maccy that also has a Brew Cask install option, that I think might be a good reference for this task.

jasonm23 commented 2 years ago

Thank you! I'll check it out

On Tue, 17 May 2022, 05:18 Ghos3t, @.***> wrote:

Just wanted to add there's another open source Clipboard Manager app on Github called Maccy https://github.com/p0deje/Maccy that also has a Brew Cask install option, that I think might be a good reference for this task.

— Reply to this email directly, view it on GitHub https://github.com/cutbox/CutBox/issues/102#issuecomment-1128192023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARPIZYBQPORMUDLKMI7H3VKLCS7ANCNFSM4YOHNRXA . You are receiving this because you were mentioned.Message ID: @.***>

jasonm23 commented 2 years ago

I've now setup a cask tap for cutbox. To install:

brew tap cutbox/cutbox
brew install --cask cutbox

You will need to do the "malicious" software dance, and tell Macos to open anyway in security settings > general.

For permissions, make sure to add the new CutBox.app to Security > Privacy > Accessibility and Security > Privacy > Key Monitoring - do this while CutBox isn't running, it generally doesn't work otherwise.

It's also easier to compile and build yourself.

git clone git@github.com:cutbox/CutBox

gem install cocoapods
cd CutBox
pod install
cd ..

bin/build

The app will be compiled to ${gitroot}/CutBox/build/CutBox.app. (gitroot being where you cloned the repo).

FYI 1.4.18 also added user custom themes, see the wiki https://github.com/cutbox/CutBox/wiki/Color-themes

jasonm23 commented 2 years ago

Brew formula added to the cutbox tap.

To test it try the following.

brew tap cutbox/cutbox
brew update
brew install --formula cutbox

It should show required installation instructions.

Please try it out and report problems here. Thank you.

jasonm23 commented 2 years ago

Because Maccy is a Cask that'll make it the same as downloading a dmg.

Btw I noticed that since Big Sur it's possible to enter security preferences and click Allow Anyway to open and use CutBox.