{"id":20263449,"url":"https://github.com/briandowns/flotsam","last_synced_at":"2025-04-11T02:08:37.004Z","repository":{"id":81489531,"uuid":"203460533","full_name":"briandowns/flotsam","owner":"briandowns","description":"Project Generator and Dependency Manager for C.","archived":false,"fork":false,"pushed_at":"2024-12-29T05:22:16.000Z","size":57,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T02:08:30.374Z","etag":null,"topics":["c","dependency-manager","project-manager","project-template"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briandowns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-20T21:58:38.000Z","updated_at":"2024-12-29T05:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad5e1b24-e180-408f-a790-902c79804196","html_url":"https://github.com/briandowns/flotsam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fflotsam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fflotsam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fflotsam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fflotsam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briandowns","download_url":"https://codeload.github.com/briandowns/flotsam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328161,"owners_count":21085261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","dependency-manager","project-manager","project-template"],"created_at":"2024-11-14T11:35:12.246Z","updated_at":"2025-04-11T02:08:36.989Z","avatar_url":"https://github.com/briandowns.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flotsam\n\n[![Build Status](https://travis-ci.org/briandowns/flotsam.svg?branch=master)](https://travis-ci.org/briandowns/flotsam)\n\n`flotsam` is a project generator and dependency manager for C.  \n\n## How It Works\n\nFlotsam is a tool for overall C project development and management.  At the outset, Flotsam can be used to generate a new application or library project.  It goes a step further by managing dependencies through definition in the Flotsam.toml file.  The Flotsam.toml file lives in the root of the repository and defines the project.  A few fields are required to exist and be populated like; name, repository, build, etc.  The dependency section is required however not needed to be populated.  The dependency will be brought down, built, and installed to the system.\n\n### Requirements\n\nFlotsam has strong opinions.  It puts the built dependencies in `/usr/local/lib`.  Flotsam keeps all dependencies in a cache directory in the users home dir.  One of the primary requirements though of Flotsam is that a Flotsam dependency needs to be a git repository and must create a shared object in the form of a `.so` or a `.dylib` after having a single build command ran.  The build command is defined in the Flotsam.toml file.  All examples use `make`.\n\n## Example\n\nIn the following example we'll create a new application using Flotsam, write a small program that depends on an external library, compile, and run the appliction entirely using Flotsam.\n\nCreate a new application.  Flotsam will create all of the necessary files with the appropriate contents to write and build a new application.\n\n```sh\nflotsam new --bin my_new_app\n```\n\nAdd the below code to the `main.c`:\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cunistd.h\u003e\n\n#include \"spinner.h\"\n\nint\nmain(int argc, char** argv)\n{\n    spinner_t* s = spinner_new(19);\n    s-\u003edelay = 100000;\n    s-\u003eprefix = \"Running \";\n    s-\u003esuffix = \" I'm a suffix\";\n    s-\u003efinal_msg = \"\\nComplete!\\n\";\n    spinner_start(s);\n    sleep(5); // simulate some work\n    spinner_stop(s);\n    spinner_free(s);\n    return 0;\n}\n```\n\nIn the `Flotsam.toml` \"dependencies\" section, add the following line:\n\n```\n\"github.com/briandowns/libspinner\" = \"0.2.1\"\n```\n\nNow run `flotsam update`.  Flotsam parses the Flotsam.toml file, clones, checks out the given branch or tag, performs a build of the dependency, and makes it available for linking and execution.\nThen run `flotsam build`.  At this point, if there were not errors, the application has been built and the resulting binary has been placed in the `bin` directory.\n\nRun the application:\n\n```sh\n./bin/my_new_app\n```\n\n## Features\n\n* Create new applications and libraries including file and directory scaffolding.\n* Ready to use Dockerfile\n\n## Test\n\n```sh\nmake test\n```\n\n## Installation\n\n```sh\nmake install\n```\n\n## Contributing\n\nPlease feel free to open a PR!\n\n## License\n\nflotsam source code is available under the BSD 2 clause [License](/LICENSE).\n\n## Contact\n\n[@bdowns328](http://twitter.com/bdowns328)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriandowns%2Fflotsam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriandowns%2Fflotsam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriandowns%2Fflotsam/lists"}