Git Product home page Git Product logo

glam's Introduction

Glam

A cross-platform package manager for projects that rock.

Glam offers a flexible way to bring binaries into scope globally or for just one shell.

Work in progress, not ready for production, breaking changes will happen.

Package PRs welcome.

Install

Glam uses the Clojure CLI.

Install glam by using this alias in deps.edn:

:glam {:extra-deps
       {borkdude/glam {:git/url "https://github.com/borkdude/glam"
                       :sha "92e1a8ec285bb983ad1c2fba28837606c5c99ab6"}
        ;; your-org/your-packages {,,,}
        }
       ;; :extra-paths ["your-packages"]
       :main-opts ["-m" "glam.main"]}

Use any later SHA at your convenience or simply clone this project and use :local/root.

Additionally, install a shell helper script by running this and following the instructions:

$ clojure -M:glam setup
Include this in your .bashrc analog to finish setup:

source $HOME/.glam/scripts/glam.sh

Scripts for Windows will follow. Meanwhile you can replace glam invocations by clojure -M:glam and append the printed path to %PATH% yourself.

Usage

Package files like <package-org>/<package-name>.glam.edn are discovered via the classpath. This means that in addition to glam's own packages you can add your own.

E.g. in the glam repo's packages directory, there is a org.babashka/babashka.glam.edn.

To install packages for the current shell:

$ glam install clj-kondo/clj-kondo org.babashka/babashka

Now clj-kondo and bb are available:

$ which bb
/Users/borkdude/.glam/repository/org.babashka/babashka/0.2.1/bb
$ which clj-kondo
/Users/borkdude/.glam/repository/clj-kondo/clj-kondo/2020.09.09/clj-kondo
$ bb '(+ 1 2 3)'
6

Use --verbose for more output, --force for re-downloading packages.

Global

To install packages globally, use --global or -g.

$ glam install clj-kondo/clj-kondo -g --verbose
...
Wrote /Users/borkdude/.glam/path

Babashka

Glam can also run with babashka for fast startup. Currently you will need the latest 0.2.2-SNAPSHOT version. First install it using glam:

$ glam org.babashka/babashka@0.2.2-SNAPSHOT -g

Glam automatically detects if you have a compatible bb installed, so next glam invocations are invoked using bb:

$ time (glam)
( glam; )   0.03s  user 0.03s system 93% cpu 0.065 total

Uberjar

To bundle the package manager and packages into one asset e.g. for moving to another machine, use babashka's --uberjar option:

$ bb -cp $(clojure -Spath -A:glam) -m glam.main --uberjar glam.jar

This uberjar contains all packages from the classpath and the package manager itself. You can then run it from anywhere on your system:

$ mv glam.jar /tmp
$ cd /tmp
$ bb -jar glam.jar install clj-kondo/clj-kondo -g --verbose
...
Wrote /Users/borkdude/.glam/path
/Users/borkdude/.glam/repository/org.babashka/babashka/SNAPSHOT:/Users/borkdude/.glam/repository/clj-kondo/clj-kondo/2020.09.09

License

Copyright © 2020 Michiel Borkent

Distributed under the EPL License. See LICENSE.

glam's People

Contributors

borkdude avatar sogaiu 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.