• Stars
    star
    4,748
  • Rank 8,461 (Top 0.2 %)
  • Language
    C
  • License
    MIT License
  • Created over 11 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Package manager for the C programming language.

clib(1)

Build Status Codacy Badge

Package manager for the C programming language.

c package manager screenshot

Installation

Expects libcurl to be installed and linkable.

With homebrew:

$ brew install clib

Or MacPorts:

$ sudo port selfupdate
$ sudo port install clib

With git:

$ git clone https://github.com/clibs/clib.git /tmp/clib
$ cd /tmp/clib
$ make install

Ubuntu:

# install libcurl
$ sudo apt-get install libcurl4-gnutls-dev -qq
# clone
$ git clone https://github.com/clibs/clib.git /tmp/clib && cd /tmp/clib
# build
$ make
# put on path
$ sudo make install

About

Basically the lazy-man's copy/paste promoting smaller C utilities, also serving as a nice way to discover these sort of libraries. From my experience C libraries are scattered all over the web and discovery is relatively poor. The footprint of these libraries is usually quite large and unfocused. The goal of clibs is to provide stand-alone "micro" C libraries for developers to quickly install without coupling to large frameworks.

You should use clib(1) to fetch these files for you and check them into your repository, the end-user and contributors should not require having clib(1) installed. This allows clib(1) to fit into any new or existing C workflow without friction.

The wiki listing of packages acts as the "registry" and populates the clib-search(1) results.

Usage

  clib <command> [options]

  Options:

    -h, --help     Output this message
    -V, --version  Output version information

  Commands:

    init                 Start a new project
    i, install [name...] Install one or more packages
    up, update [name...] Update one or more packages
    upgrade [version]    Upgrade clib to a specified or latest version\
    configure [name...]  Configure one or more packages
    build [name...]      Build one or more packages
    search [query]       Search for packages
    help <cmd>           Display help for cmd

More about the Command Line Interface here.

Examples

More examples and best practices at BEST_PRACTICE.md.

Install a few dependencies to ./deps:

$ clib install clibs/ms clibs/commander

Install them to ./src instead:

$ clib install clibs/ms clibs/commander -o src

When installing libraries from the clibs org you can omit the name:

$ clib install ms file hash

Install some executables:

$ clib install visionmedia/mon visionmedia/every visionmedia/watch

clib.json

Example of a clib.json explicitly listing the source:

{
  "name": "term",
  "version": "0.0.1",
  "repo": "clibs/term",
  "description": "Terminal ansi escape goodies",
  "keywords": ["terminal", "term", "tty", "ansi", "escape", "colors", "console"],
  "license": "MIT",
  "src": ["src/term.c", "src/term.h"]
}

Example of a clib.json for an executable:

{
  "name": "mon",
  "version": "1.1.1",
  "repo": "visionmedia/mon",
  "description": "Simple process monitoring",
  "keywords": ["process", "monitoring", "monitor", "availability"],
  "license": "MIT",
  "install": "make install"
}

See explanation of clib.json for more details.

Contributing

If you're interested in being part of this initiative let me know and I'll add you to the clibs organization so you can create repos here and contribute to existing ones.

If you have any issues, questions or suggestions, please open an issue here.

You can also find us on Gitter: https://gitter.im/clibs/clib

Also feel free to open a GitHub Discussion here.

Before committing to the repository, please run make commit-hook. This installs a commit hook which formats .c and .h files.

Articles

More Repositories

1

entr

A utility for running arbitrary commands when files change. Uses kqueue(2) or inotify(7) to avoid polling. entr responds to file system events by executing command line arguments or by writing to a FIFO. entr was written to provide to make rapid feedback and automated testing natural and completely ordinary.
C
593
star
2

list

C doubly linked list
C
422
star
3

cmocka

An elegant unit testing framework for C with support for mock objects.
C
213
star
4

commander

Commander option parser ported to C - simple API, auto-generated --help
C
203
star
5

buffer

Tiny C string library
C
194
star
6

hash

C hash implementation based on khash
C
165
star
7

sha1

sha1 hash alogrithm
C
163
star
8

coro

Coroutines in C
C
120
star
9

flag

Go-style flag parsing for C
C
117
star
10

lmdb

Symas Lightning Memory-Mapped Database (LMDB)
77
star
11

red-black-tree

Generic red-black tree library (by Julienne Walker).
C
54
star
12

uv

A clib pointer to libuv: Cross-platform asychronous I/O http://libuv.org/
45
star
13

net

extends libuv to support tls/ssl in a simpler API for clibs
C
35
star
14

amp

Abstract Message Protocol C implementation
C
30
star
15

timer

Timer with microsecond resolution
C
30
star
16

logfmt

Fast C logfmt parser.
C
29
star
17

term

Terminal goodies
C
26
star
18

int

Binary integer representation utilities.
C
23
star
19

mt19937ar

Mersenne Twister random number generator
C
22
star
20

dumpasn1

Display the contents of ASN.1 encoded data
C
21
star
21

rgba

RGB / RGBA parsing / formatting
C
20
star
22

rle

Run-length encoding.
C
19
star
23

readline

Tiny C readline library, note: this is not used in CLI-readline's one.
C
19
star
24

inih

Simple .INI file parser
C
19
star
25

container_of

Obtain a pointer to the struct that contains the struct member
C
19
star
26

wildcardcmp

Simple wildcard string comparison for C
C
18
star
27

ms

C str to us / ms utilities
C
18
star
28

debug

Conditional debug logging for C
C
17
star
29

unlikely

gcc branch prediction macros
C
16
star
30

zerodbg

Useful macros for debugging purposes.
C
16
star
31

bytes

byte <> string conversion utilities
C
14
star
32

which

Lookup executable via PATH or given path string
C
13
star
33

check

Super basic CHECK(), DCHECK(), and NOTREACHED() macro implementations.
Shell
12
star
34

strdup

Drop-in replacement for strdup(3) from libc
C
12
star
35

clib-uninstall

clib(1) plugin for uninstalling executables
C
11
star
36

trigger

Simple event handling library.
C
11
star
37

timestamp

C timestamp util
C
11
star
38

leveldb

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
C++
11
star
39

file

File utilities
C
10
star
40

module

A set of macros and functions to make defining a C module easier
C
10
star
41

bench

get wall and cpu time for benchmarking
C
9
star
42

clib-validate

clib(1) plugin for validating a package.json
C
9
star
43

clib-makefile

Interactively generate a `Makefile' for your C lib project with clibs in mind
Shell
9
star
44

sqlite

Embedded SQL database
C
8
star
45

logger

Logger used internally by clib(1)
C
8
star
46

strndup

Safe version of strndup
C
8
star
47

graph

Simple (directed) graph library.
C
7
star
48

clib-package

Internal bits of clib-install(1) for fetching packages
C
5
star
49

build_assert

Routines for build-time assertions
3
star
50

website

The source code for clibs.org.
TypeScript
3
star
51

tig

A clib pointer to https://github.com/jonas/tig
2
star
52

jsmn

A clib pointer to https://github.com/zserge/jsmn: Jsmn is a world fastest JSON parser/tokenizer.
2
star
53

sodium

A clib pointer to libsodium: A modern, portable, easy to use crypto library.
1
star
54

buffet

A clib pointer to https://github.com/alcover/buffet
1
star
55

discount

A clib (clib@next) pointer to https://github.com/Orc/discount
Shell
1
star
56

semver

A clib (clib@next) pointer to https://github.com/EddyLuten/lib-semver
JavaScript
1
star
57

packcc

A clib pointer for https://github.com/arithy/packcc
Shell
1
star