CPM: The Curry Package Manager

Overview

The Curry Package Manager (CPM) is a tool to distribute and install Curry libraries and manage version dependencies between these libraries. These libraries are organized in packages. There is a central index of all these packages which can easily be downloaded by CPM. The individual packages are currently not stored in a central server but their source can be anywhere. CPM organizes the automatic access to appropriate versions of these packages so that a user does not need to know about these details.

CPM also supports semantic versioning, i.e., it is able to check whether a new minor version of a package is consistent (w.r.t. its API and behavior) with a previous version of the same package.

Installing the Curry Package Manager

The installation assumes that one of the Curry systems PAKCS or KiCS2 is installed and the executables curry and git are in your path (if curry is not in your path, you can also specify the root location of your Curry system by modifying the definition of CURRYROOT in the Makefile before executing make in step 3). Then perform the following steps to install CPM:

  1> git clone https://git.ps.informatik.uni-kiel.de/curry-packages/cpm.git
  2> cd cpm
  3> make

If this was successful, the binary cpm has been generated in the directory ~/.cpm/bin. This is also the directory where CPM installs binaries of tools distributed with packages. For convenient use, you should add the directory ~/.cpm/bin to your path. Alternatively, you can also put the binary ~/.cpm/bin/cpm somewhere in your path or create a symbolic link from some path directory to this binary.

Quick Start

Now you can clone a copy of the central package index repository by

  > cpm update

Afterwards, you can show a short list of all packages in this index by

  > cpm list

The command

  > cpm info PACKAGE

can be used to show more information about a package.

In order to use a package in your Curry program which you intend to develop, you have to start a new project. Note that your project can also contribute to the Curry packages. Therefore, to initialize it and use other packages, you need a package description file in some project directory. All this can be created by the command cpm new and answering some questions:

  > cpm new
  Create a new package
  --------------------
  What is the name of the new package? myproject
  What is the first version of the package? [0.0.1] 
  Who is the author of the package? Joe Curry <joe@curry.com>
  Please provide a short (one line) summary of what the package does:
  > This is just for testing.
  A new package in the directory 'myproject' has been created.
  Please go into this directory, add dependencies in 'package.json',
  and run 'cpm install' to install all dependencies.

As you will see, an initial package description file package.json and a subdirectory src has been created. If you need some other package for your project, add it as a dependency in package.json. Then run

  > cpm install

to install all dependencies of the current package. Afterwards, start your interactive Curry environment by

  > cpm curry

and you will be able to load the modules of the current package as well as all dependent packages. In particular, the source directory src is added to your path so that you can directly load any program you have stored in this directory.

Manual and Further Documentation

For further information, look into the manual of CPM.

A detailed description about CPM and its implementation can be found in the following thesis:

A Package Manager for Curry (Jonas Oberschweiber, CAU Kiel, September 2016)

Uploading and Publishing Packages

Currently, there is no support for automatically uploading and publishing new packages. However, if you have developed some package that might be of interest to other Curry users, please send the package as a zip file, or just the package description file package.json (if the package is already in a publicly available git archive) to

  packages (AT) curry-language.org

in order to make it publicly available.

/srv/dokuwiki/currywiki/data/pages/tools/cpm.txt · Last modified: Y-m-d H:i by mh
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0