Schubert

Definition of portable

The definition of the world portable when used in this project is code that conforms to R7RS Small and uses only SRFIs which are in final status.

Introduction

Schubert is a project dependency manager. This means that it installs the libraries that project depends on inside your project in the directory called schubert.

The list of dependencies, among other information, is stored inside your project in a file called composition.scm.

The libraries are installed from local library cache. Libraries are put into the cache either by automatically downloading them from remote repository or manually installing them with schubert install

Libraries you handle locally do not have to be portable. But any library added to the remote repository needs to be.

The programs you develop with Schubert do not need to be portable either. And Schubert can be used alongside other package/dependency managers.

System Requirements

Any R7RS Small conforming Scheme implementation with SRFI-106 (Basic socket interface) and SRFI-170 (POSIX API) should be able to run Schubert. However not many implementations currently support these SRFIs so this documentation focuses on Gauche. Gauche supports both needed SRFISs.

Even when Schubert is run with Gauche, any Scheme implementation can be used to develop your programs and libraries.

Installation

See the project readme for up to date installation information: https://codeberg.org/Schubert/schubert

Usage

Note that on Windows the schubert command is schubert.bat.

Init

In your projects root folder run

schubert init TYPE PACKAGER NAME LICENSE

Replace

  • TYPE with either "library" or "application"
  • PACKAGER with your name. Name can not contain spaces.
  • NAME with the name of the application or library. Name can not contain spaces.
  • LICENSE with short name of the license, for example MIT, GPL, LGPL.
  • DESCRIPTION description of the library, remember to add quotes around it if it contains spaces

Schubert will write this information into file called composition.scm. And set up folder called schubert. If type is "application" folder called src will also be created containing "main.scm" file. If type is "library" a folder packager/name/version containing file called main.scm will be created. The schubert folder and composition.scm are required, the other folders and main.scm's are just for convenience.

Add Dependency

Add dependency into the composition.scm files depdency list. Here is example

((packager . "retropikzel")
  (name . "example-project")
  (version . "v0-1-0")
  (type . "library")
  (license . "LGPL")
  (description . "Remember to change this")
  (dependencies (retropikzel string-util v0-4-1)))
                    

Note that dependencies are lists, but they are not inside a list but on the same "level" with dependencies -symbol.

Here is how it would look like if there were 3 dependencies.

((packager . "retropikzel")
  (name . "example-project")
  (version . "v0-1-0")
  (type . "library")
  (license . "LGPL")
  (description . "Remember to change this")
  (dependencies
        (retropikzel string-util v0-4-1)
        (retropikzel something-else v0-1-0)
        (retropikzel third-thing v0-1-0)))
                    

Compose

To install requirements of the project, which is called composing in Schubert, run

schubert compose composition.scm

Run your code

To run your code add schubert folder into your Scheme implementations load path.

Gauche

gosh -r7 -A ./schubert src/main.scm

Sagittarius

sash -r7 -A ./schubert src/main.scm

Kawa

kawa --r7rs -Dkawa.import.path="./schubert" src/main.scm

Guile

guile --r7rs -L ./schubert src/main.scm

Composition.scm

Typical composition.scm file looks something like this

((packager . "mark")
(name . "marks-awesome-library")
(version . "v1-0-0")
(type . "library")
(license . "LGPL")
(description . "This is Marks awesome library!")
(dependencies
    (retropikzel file-util v0-1-0)))
                    

Local Usage

You can install library locally by running command

schubert install

in the librarys projects root folder. This will install the library into local cache, overwriting files if library already exists there. This way you can use the library in your other local projects without using the repository.

Its quite handy in a situation where you notice that code you are writing should go into its own library, but its still under development alot.

Adding your own library to repository

Libraries are added to the repository trough git pull request in codeberg. So you will need an account there.

Do note that libraries must only use code conforming to R7RS-small and SRFI's in final status!

Before starting you can check your library by using it

  • locally.
    1. Fork the repository from https://codeberg.org/Schubert/schubert-repository.
    2. Clone the just forked repository.
    3. Create directories repository/PACKAGER_NAME/LIBRARY_NAME
      • The PACKAGER_NAME must be same as librarys packager.
        • If it already exists, and it is not yours then you must choose another packager name.
      • The LIBRARY_NAME must be same as librarys name.
    4. Create files
      • repository/PACKAGER_NAME/LIBRARY_NAME/git.txt
        • Insert the https url of your librarys git repository there.
      • repository/PACKAGER_NAME/LIBRARY_NAME/license.txt
        • Insert the license of your library there in short form for example MIT, GPL.
      • repository/PACKAGER_NAME/LIBRARY_NAME/description.txt
        • Insert the description of your library there.
      • repository/PACKAGER_NAME/LIBRARY_NAME/tags.txt
        • Insert the tags of your library there each on their own line.
    5. Create pull request back to the original repository
    6. Create a release for your library.

    Creating library release

    Run schubert check-library to check that library before release.

    Version number needs to be changed in composition.scm

    To create release of your library add tag with following form into it

    vN-N-N

    The tag needs to be same version as the library version, which must also follow same form.

    N means number, please follow semver regarding the numbers. Unfortunately only numbers are supported for now, no extensions.

    Releases are updated to the repository hourly on the hour.