diff --git a/Formula/rattler-build.rb b/Formula/rattler-build.rb new file mode 100644 index 0000000..f82a9ce --- /dev/null +++ b/Formula/rattler-build.rb @@ -0,0 +1,43 @@ +class RattlerBuild < Formula + desc "Universal conda package builder for Windows, macOS and Linux" + homepage "https://github.com/prefix-dev/rattler-build" + url "https://github.com/prefix-dev/rattler-build/archive/refs/tags/v0.4.0.tar.gz" + sha256 "833768fb3fb9049b9b9f945be19ea623e9af4f86e608b25e9aff2e2dc543cbb9" + license "BSD-3-Clause" + head "https://github.com/prefix-dev/rattler-build.git", branch: "main" + + depends_on "pkg-config" => :build + depends_on "rust" => :build + depends_on "openssl@3" + + uses_from_macos "bzip2" + uses_from_macos "zlib" + + def install + system "cargo", "install", *std_cargo_args + end + + test do + assert_equal "rattler-build #{version}", shell_output("#{bin}/rattler-build --version").strip + (testpath/"recipe.yaml").write <<~EOS + package: + name: test-package + version: '0.1.0' + + build: + noarch: generic + string: buildstring + script: + - mkdir -p $PREFIX/bin + - echo "echo Hello World!" >> $PREFIX/bin/hello + - chmod +x $PREFIX/bin/hello + + test: + commands: + - test -d ${PREFIX}/bin/hello + - hello | grep "Hello World!" + EOS + system "#{bin}/rattler-build", "build" + assert_path_exists testpath/"output"/"noarch"/"test-package-0.1.0-buildstring.tar.bz2" + end +end diff --git a/README.md b/README.md index 1e28ac4..a9747dd 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,4 @@ This is a collection of formulae/casks for [Homebrew](https://brew.sh/) that I u - [Upscayl](https://github.com/upscayl/upscayl): `brew install --no-quarantine pavelzw/pavelzw/upscayl` - [cythonbuilder](https://github.com/mike-huls/cythonbuilder/): `brew install pavelzw/pavelzw/cythonbuilder` - [pixi](https://github.com/prefix-dev/pixi): ~`brew install pavelzw/pavelzw/pixi`~ migrated to [homebrew-core](https://formulae.brew.sh/formula/pixi) (https://github.com/Homebrew/homebrew-core/pull/136437) `brew install pixi` +- [rattler-build](https://github.com/prefix-dev/rattler-build): `brew install pavelzw/pavelzw/rattler-build`