Code Monkey home page Code Monkey logo

Comments (8)

filipekiss avatar filipekiss commented on May 16, 2024 2

I've created a simple formula that might be a good starting point. It's available here.

The formula does not build from source but uses the tar. I wanted to make sure the installation was as close to using curl https://get.volta.sh | bash. The only thing the Formula doesn't do currently is running volta setup. Whenever I try to run volta setup during the installation process, I get an error saying that volta couldn't find any of the profiles to edit. I'm looking into it, but I have very little experience with homebrew formula


Update: I've opened a pull-request to homebrew/homebrew-core

from volta.

twokul avatar twokul commented on May 16, 2024 1

I feel like I got the formula to a decent place and we can start talking about it.

Spoiler: I'm new to Rust/Cargo and how the build system works don't yell at me for doing silly things 😬

Name

There is already a cask package called "notion", see here. I'd say we can name ours notion-cli, or we can keep it as notion (since cask packages and regular ones have different registries).

I personally would go with notion-cli, but I'd love your thoughts @dherman.

Homebrew formula

The formula itself (snippet below) gets generated automatically by running:

brew create https://dl.dropboxusercontent.com/s/rawxzfb4fsruu14/notion-cli-0.1.0.tgz

Properties and methods like desc, homepage, depends_on, install and test were added by me. File name has to contain 0.1.0 so we don't specify it in the formula itself via version property.

I hacked together a notion-cli archive just to get started, it contains:

$ tree -L 1 homebrew
homebrew
β”œβ”€β”€ Cargo.lock
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ build.sh
β”œβ”€β”€ crates
β”œβ”€β”€ install.sh
β”œβ”€β”€ install.sh.in
└── src

Once the folder is downloaded, we run cargo build and then build and install scripts. From then on, notion should be available and good to go.

Also, I believe we can remove the code from install.sh.in which adds notion binary to the PATH and replace it with bin.install in the recipe.

class NotionCli < Formula
  desc "The hassle-free node.js manager"
  homepage "https://github.com/notion-cli/notion"
  url "https://dl.dropboxusercontent.com/s/rawxzfb4fsruu14/notion-cli-0.1.0.tgz"
  sha256 "90f96b6c7e33593acb0dfb6917461e9dbc095f4c71bf6ea06a75b06638f4aa18"

  depends_on "rust" => :build

  def install
    system "cargo", "build", "--release"
    system "./build.sh",
           "./target/release/notion",
           "./target/release/node",
           "./target/release/launchbin",
           "./target/release/launchscript"
    system "./install.sh"
  end

  test do
    assert_equal "The hassle-free node.js manager", (system "notion -V")
  end
end

Audit

Homebrew documentation suggest we run brew audit command on a newly generated formula to make sure we adhere to their standards.

Audit showed that we are not notable enough yet:

$ brew audit --new-formula notion-cli
notion-cli:
  * GitHub repository not notable enough (<20 forks, <20 watchers and <50 stars)
Error: 1 problem in 1 formula

I'm not sure what to do about the above yet, let's discuss.

from volta.

charlespierce avatar charlespierce commented on May 16, 2024 1

It looks like this was completed some time ago thanks to @filipekiss!

from volta.

claydiffrient avatar claydiffrient commented on May 16, 2024

Has anyone circled back to this? It'd be cool to get this in now since it appears that the repo is notable enough now.

from volta.

alizain avatar alizain commented on May 16, 2024

@dherman now that this project has been renamed to volta, any plans on adding a homebrew formula?

from volta.

cowboy avatar cowboy commented on May 16, 2024

@dherman is there anything the project needs to help make this happen?

from volta.

filipekiss avatar filipekiss commented on May 16, 2024

While working on the formula for Homebrew I've encountered an issue and I'm not sure if I should file this as a separate bug, but the installation script from brew is not able to run volta setup:

error: Could not locate user profile.
Tried $PROFILE (), ~/.bashrc, ~/.bash_profile, ~/.zshrc, ~/.profile, and ~/.config/fish/config.fish

Please create one of these and try again; or you can edit your profile manually to add '/Users/filipekiss/.volta/bin' to your PATH

Running volta setup as soon as the installation is finished works as intended.

I think this has something to do with Homebrew's superenv so I'm not sure if it's worthing pursuing this.

from volta.

filipekiss avatar filipekiss commented on May 16, 2024

Anyone who has access to a macOS Catalina can try to help me debug the formula? I'm getting an error when building to Catalina during the CI step for the pull-request and I'm not able to figure out how to deal with it since I don't have access to Catalina…

from volta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.