jow- / ucode

JavaScript-like language with optional templating
ISC License
90 stars 33 forks source link

Port to macOS (aka homebrew) #67

Open aparcar opened 2 years ago

aparcar commented 2 years ago

Since ucode runs fine on macOS it could be added to homebrew.

I ported it with this fun error message, however I'd keep this open as a reminder for myself to finish it in the near future

ucode:
  * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
Error: 1 problem in 1 formula detected
aparcar commented 2 years ago

For reference the build definitions looks like this

class Ucode < Formula
  desc "Jinja-like micro templating"
  homepage "https://github.com/jow-/ucode"
  url "https://github.com/jow-/ucode/archive/refs/tags/v0.0.20220331.tar.gz"
  sha256 "7536e2454ff09092f32f508fc7a3dbe968292b81e88830bc37af1f3b728d7529"
  license "ISC"

  depends_on "cmake" => :build

  def install
     system "cmake", "-S", ".", "-B", "build",
       "-D", "NL80211_SUPPORT=OFF",
       "-D", "RTNL_SUPPORT=OFF",
       "-D", "UBUS_SUPPORT=OFF",
       "-D", "UCI_SUPPORT=OFF",
       "-D", "ULOOP_SUPPORT=OFF",
       *std_cmake_args
     system "cmake", "--build", "build"
  end

  test do
    environment_variables UCODE_BIN: working_dir/"build/ucode"
    environment_variables UCODE_LIB: working_dir/"build/"
    system ./tests/custom/run_tests.sh
  end
end