Code Monkey home page Code Monkey logo

Comments (10)

laurent22 avatar laurent22 commented on August 17, 2024 1

Done in Homebrew/homebrew-core#19791, thanks @vitorgalvao!

from massren.

vitorgalvao avatar vitorgalvao commented on August 17, 2024

I agree. I’d like to see this in the main tap.

from massren.

laurent22 avatar laurent22 commented on August 17, 2024

I've tried to submit it but the formula I have is old and no longer pass their validation. Unfortunately I don't have a Mac anymore so I can't fix it myself.

If someone's interested in updating it, it can be found here. As I understand you just need to run brew audit --new-formula massren (see here ) and fix the errors. It's small tweaks like changing single quotes to double quotes, removing trailing spaces, etc.

Anyway, if someone can fix it and do a pull request, I will submit it again.

from massren.

vitorgalvao avatar vitorgalvao commented on August 17, 2024

Getting a build error:

go
build
-o
/usr/local/Cellar/massren/1.5.1/bin/massren

src/github.com/mattn/go-sqlite3/sqlite3.go:118:2: cannot find package "golang.org/x/net/context" in any of:
	/usr/local/Cellar/go/1.9.1/libexec/src/golang.org/x/net/context (from $GOROOT)
	/private/tmp/massren-20171023-81591-6trj3t/massren-1.5.1/src/golang.org/x/net/context (from $GOPATH)

with the following formula:

require "language/go"

class Massren < Formula
  desc "Easily rename multiple files using your text editor"
  homepage "https://github.com/laurent22/massren"
  url "https://github.com/laurent22/massren/archive/v1.5.1.tar.gz"
  sha256 "21a602a29410e30b1b518356d5707b25b22b9d2578aaf0d0d5ab3de9e0ad225d"

  depends_on "go" => :build

  go_resource "github.com/jessevdk/go-flags" do
    url "https://github.com/jessevdk/go-flags.git",
        :revision => "f88afde2fa19a30cf50ba4b05b3d13bc6bae3079"
  end

  go_resource "github.com/kr/text" do
    url "https://github.com/kr/text.git",
        :revision => "7cafcd837844e784b526369c9bce262804aebc60"
  end

  go_resource "github.com/laurent22/go-sqlkv" do
    url "https://github.com/laurent22/go-sqlkv.git",
        :revision => "db1022af2c66c36268b346d203ceaa78579673d2"
  end

  go_resource "github.com/laurent22/go-trash" do
    url "https://github.com/laurent22/go-trash.git",
        :revision => "681610e5e1bc5214826533dfa339c84e71e49821"
  end

  go_resource "github.com/mattn/go-sqlite3" do
    url "https://github.com/mattn/go-sqlite3.git",
        :revision => "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08"
  end

  go_resource "github.com/nu7hatch/gouuid" do
    url "https://github.com/nu7hatch/gouuid.git",
        :revision => "179d4d0c4d8d407a32af483c2354df1d2c91e6c3"
  end

  def install
    ENV["GOPATH"] = buildpath
    Language::Go.stage_deps resources, buildpath/"src"
    system "go", "build", "-o", bin/"massren"
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/massren --version")
  end
end

Also tried adding

  go_resource "github.com/golang/net" do
    url "https://github.com/golang/net.git",
        :revision => "cd69bc3fc700721b709c3a59e16e24c67b58f6ff"
  end

but no dice.

from massren.

laurent22 avatar laurent22 commented on August 17, 2024

The package path is actually "golang.org/x" so did you try go_resource "golang.org/x/net/context" do (thought it won't be possible to specify a revision and I don't know if this parameter is optional or not)?

Alternatively, try with an earlier version of go-sqlite3 that didn't have this x/net thing yet. For example, this formula is using this revision:

go_resource "github.com/mattn/go-sqlite3" do
    url "https://github.com/mattn/go-sqlite3.git",
        :revision => "8897bf145272af4dd0305518cfb725a5b6d0541c"
end

Edit: actually there are also a few examples with x/net in the official repository, so maybe we can use one of these:

https://github.com/Homebrew/homebrew-core/search?utf8=%E2%9C%93&q=go_resource+golang.org+net&type=

  go_resource "golang.org/x/net" do
    url "https://go.googlesource.com/net.git",
        :revision => "4971afdc2f162e82d185353533d3cf16188a9f4e"
  end

from massren.

vitorgalvao avatar vitorgalvao commented on August 17, 2024

Success. Thank you. Opening a PR shortly.

from massren.

vitorgalvao avatar vitorgalvao commented on August 17, 2024

Homebrew/homebrew-core#19791

from massren.

laurent22 avatar laurent22 commented on August 17, 2024

Brilliant, thanks for submitting the formula. Just two things: the version number is actually 1.5.1, and also I see that the tests are failing because the test units need to create directories and files which probably is not permitted by Jenkins. So I think the simplest thing to do would be to remove the test block from the formula (the tests are checked from this repo anyway).

from massren.

vitorgalvao avatar vitorgalvao commented on August 17, 2024

Homebrew/homebrew-core#19791 (review)

In new formulae, we don't allow go_resource blocks. Please file an issue upstream requesting use of a Go vendor directory or one of the various Go vendoring tools.


the version number is actually 1.5.1

Fixed.


So I think the simplest thing to do would be to remove the test block from the formula

It’s a requirement.

from massren.

laurent22 avatar laurent22 commented on August 17, 2024

For vendoring, I guess that can be done, thought I'm not really familiar with this yet.

For the tests, I don't think it's a good idea to introduce a dependency to vim just for that. I think just running this should prove that the software is installed and running properly:

massren config editor 'something'

Then call:

massren config

and check that the string "something" appears in the output. Just doing that would confirm that the SQLite database has been installed (because that's were the config is stored) and is working properly. If this is working the rest is also definitely fine too.

from massren.

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.