Giter Site home page Giter Site logo

brew-stew's Introduction

brew-stew

Monolithic homebrew packages for dev/build environment deployment. The goal of this project is to be able to build a single self-contained homebrew installation in the format of a macOS installer package.

The package contains the entire homebrew installation at its default location of /usr/local, so it is designed to be built on an isolated system and the package deployed to build/dev machines instead of using brew directly on the target system(s). It should, however, play nice with any other binaries/applications which may be installed to /usr/local on the target.

Usage

brew-stew [-v] <path_to_list_file> <path_to_output_dir>

Use -h to see full help. Use -v to print DEBUG level output to stdout. INFO level is currently output by default.

The "list_file" is simply a text file with a list of formulae. A few samples are included in the sample_listfiles directory.

Approaches

A couple possible approaches being played with in terms of the logic for determining what goes in the package, which are for now just termed as 'subtractive' and 'additive'. Currently the build script defaults to additive.

Subtractive

Building the package by packaging up all of /usr/local, and attempting to filter out certain items we know aren't part of brew. We can get a list of files not managed by brew using brew ls --unbrewed, but it seems to at least mix symlinks like /usr/local/bin/santactl. This is a bit of a shotgun approach and seems like it would be very easy to capture things we don't want.

Additive

Using tools like brew ls --verbose <formula> to list all the files known to be installed by a formula, stage these to an alternate package root using rsync to preserve modes, and package from this root instead. What we don't yet have is the logic to also include symlinks or the opt brew directories. This may be easy to do ourselves by following naming conventions, even if brew doesn't provide an obvious way to do it.

Reporting

Currently several report files are saved in the output directory alongside the installer package:

report.json

report.json currently contains the following:

  • exhaustive output from brew info --json=v1
  • output of santactl fileinfo from every executable detected in the Cellar
  • a summary, currently containing only formula names and versions

See this wiki page for sample JSON report output for a build of just the cowsay formula.

build_debug.log

Full debug output of the command, regardless of verbose level specified in the tool. Note that currently there is still a lot of output from brew itself which is not yet being redirected through the logger, so this currently information we're logging explicitly and nothing directly output brew commands.

package_bom.txt

This is the output of lsbom on the Bom file from the package, which is a complete list of all files with ownerships and modes in the package.

formula_versions.txt

This is a simple textfile with a list of formulae and versions for easy readability and diff'ing. For example:

dnsmasq 2.77_1
docker 17.05.0
jpeg 8d
libtiff 4.0.8
xz 5.2.3

brew-stew's People

Contributors

timsutton avatar headmin avatar

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.