Code Monkey home page Code Monkey logo

smlpkg's Introduction

smlpkg CI

This program constitutes a generic package manager for Standard ML libraries and programs. The package manager assumes nothing and knows nothing about the Standard ML compilers used and is thus quite generic.

The package manager is centered around the notion of semantic versioning and currently supports packages hosted on GitHub and GitLab.

The package manager takes care of downloading and upgrading dependent packages and works well with the use of MLB files supported by Standard ML compilers such as MLton, MLKit, and SMLtoJs.

Usage

Adding a package

$ smlpkg add github.com/diku-dk/sml-random

This command modifies only sml.pkg and creates it if it does not already exist.

Downloading required packages

$ smlpkg sync

This command populates the lib directory based on the packages listed in sml.pkg.

Creating a new package

$ smlpkg init github.com/foo/bar

This command creates a file sml.pkg and initiates it with the given package name (foo should be a github user name or an organisation name and bar should be a repository name). You can now add code in the directory lib/github.com/foo/bar/.

Releasing a package

$ git tag vX.Y.Z
$ git push --tags

Remember to follow semantic versioning. Once a package has been released, other packages can safely add the package to their own source code tree using smlpkg add (see above).

Probably incomplete list of available packages

Design details

See this blog post on the design of the Futhark package manager.

Compilation

To compile the package manager, you need a Standard ML compiler such as MLton or MLKit.

Compilation using MLKit on macOS

$ brew install mlkit
$ make all

Compilation using MLton

$ MLCOMP=mlton make clean all

License

This software is distributed under the MIT LICENSE.

The package manager is almost a complete port of the Futhark package manager, designed, and implemented in Haskell by Troels Henriksen.

smlpkg's People

Contributors

athas avatar melsman avatar munksgaard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smlpkg's Issues

add brew formula

Here is a brew formula for smlpkg on Homebrew:

class Smlpkg < Formula
  desc "Package manager for Standard ML libraries and programs"
  homepage "https://github.com/diku-dk/smlpkg"
  url "https://github.com/diku-dk/smlpkg/archive/v0.1.3.tar.gz"
  sha256 "cfa7eeff951e04df428694fda38917ee2aaaf0532e2d1dbea7ab4c150f4fe2f0"
  head "https://github.com/diku-dk/smlpkg.git"

  depends_on "mlkit"

  def install
    system "make", "-C", "src", "smlpkg"
    system "make", "install", "INSTALLDIR=#{bin}"
  end

  test do
    (testpath/"sml.pkg.ok").write <<~EOS                                                                        
      package github.com/diku-dk/testpkg                                                                        
                                                                                                                
      require {                                                                                                 
      }                                                                                                         
    EOS                                                                                                         
    system "#{bin}/smlpkg", "init", "github.com/diku-dk/testpkg"
    assert_equal "", shell_output("diff sml.pkg sml.pkg.ok")
  end
end

The formula installs fine and brew audit --new-formula smlpkg has only one complaint:

$ brew audit --new-formula smlpkg
smlpkg:
  * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
Error: 1 problem in 1 formula detected

Once we get more than 75 stars, we will send a pull request...

Suggestion: switch to using Git directly

smlpkg is closely based on the Futhark package manager, which recently switched to using git directly instead of downloading from GitHub/GitLab websites. This means arbitrary Git hosting sites (or Git over random SSH connections) can be supported. Most importantly, private repositories also work. Discussion here: diku-dk/futhark#1835

Since the implementation of smlpkg is still very similar to the original Haskell code, such a switch would not be difficult. In fact, it turns out that it is less code in total.

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.