mczachurski / wallpapper

:computer: Console application for creating dynamic wallpapers for macOS Mojave and newer
MIT License
3.31k stars 137 forks source link

Fails to install on macOS Mojave, needs swift tools 5.2.0 #48

Closed Patronics closed 3 years ago

Patronics commented 3 years ago

This is failing to install for me in the latest version of Mojave using homebrew, it gives the following output:

==> Installing wallpapper from mczachurski/wallpapper
==> Downloading https://github.com/mczachurski/wallpapper/archive/1.7.1.tar.gz
Already downloaded: /Users/patrickleiser/Library/Caches/Homebrew/downloads/6688deaca709f04f836bb33c2b9c2186695fb45842954f4ad95d989e95b2e6da--wallpapper-1.7.1.tar.gz
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.

==> swift build --disable-sandbox --configuration release
Last 15 lines from /Users/patrickleiser/Library/Logs/Homebrew/wallpapper/01.swift:
2021-02-23 18:39:32 -0800

swift
build
--disable-sandbox
--configuration
release

/private/tmp/wallpapper-20210223-4930-o8q0xe/wallpapper-1.7.1: error: package at '/private/tmp/wallpapper-20210223-4930-o8q0xe/wallpapper-1.7.1' is using Swift tools version 5.2.0 but the installed version is 5.1.0

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/mczachurski/homebrew-wallpapper/issues

Error: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.

I have already attempted reinstalling the Xcode developer tools as the homebrew warning advised, with no change in the output. It seems that the current release is using too new a version of the swift API, is there any way to install an older release that does support Mojave?

I also have Xcode 11.3.1 installed, as the latest version supported on Mojave, and did attempt the fix listed under Troubleshooting in the readme, with, again, no apparent effect.

mczachurski commented 3 years ago

Hi,

You can always build manually:

$ git clone https://github.com/mczachurski/wallpapper.git
$ cd wallpapper

Now you can modify Package.swift file (set proper Swift version). And run following commands:

swift build --configuration release
sudo cp .build/release/wallpapper /usr/local/bin
sudo cp .build/release/wallpapper-exif /usr/local/bin
Patronics commented 3 years ago

Thanks, that worked perfectly, just had to change the very first line's 5.2 to 5.1. It'd probably be helpful to add this to the readme, for anyone else still using Mojave.

Also worth noting that I didn't need to use sudo for those commands, and you typically shouldn't unless your /usr/local/bin permissions have been changed away from the default.

Also, is there anything that breaks when using swift-tools 5.1 instead of 5.2? If not, given that it seems to specify the minimum version required, I think it'd probably be better to change the file to use 5.1 by default.