{"id":21004666,"url":"https://github.com/flaque/useslib","last_synced_at":"2026-04-24T17:35:52.230Z","repository":{"id":80716186,"uuid":"135631192","full_name":"Flaque/useslib","owner":"Flaque","description":"A Cyrstal macro for testing if a user has a C dep installed","archived":false,"fork":false,"pushed_at":"2018-05-31T20:26:05.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-28T04:24:23.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Flaque.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":"2018-05-31T20:17:24.000Z","updated_at":"2018-08-18T19:07:28.000Z","dependencies_parsed_at":"2023-02-28T10:15:36.384Z","dependency_job_id":null,"html_url":"https://github.com/Flaque/useslib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Flaque/useslib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fuseslib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fuseslib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fuseslib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fuseslib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flaque","download_url":"https://codeload.github.com/Flaque/useslib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fuseslib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32234722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-19T08:37:25.022Z","updated_at":"2026-04-24T17:35:52.216Z","avatar_url":"https://github.com/Flaque.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# useslib\n\n`useslib` is a litle macro for checking if a user \nhas a C dependency installed. It's a way for c-binding authors to alert their users that they need to have some dependencies installed without giving them difficult to understand compiler errors.\n\nIf the user has the item, then compilation will work like normal. If they don't, the project will throw a normal crystal compiler error with a message like this:\n\n```\n❯ crystal run src/useslib.cr\nError in src/useslib.cr:14: Unable to find c library 'fuzzboing' on your system. Are you sure you installed it?\n\nuseslib fuzzboing\n^~~~~~~\n```\n\nWithout `useslib`, a `@[Lib(\"imagemagick\")]` call will throw an error like this: \n\n```\nld: library not found for -lMagickWand\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nError: execution of command failed with code: 1: `cc \"${@}\" -o '/Users/flaque/.cache/c\nrystal/crystal-run-webimg.tmp'  -rdynamic  -lMagickWand -lpcre -lgc -lpthread /usr/loc\nal/Cellar/crystal-lang/0.24.2_1/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -\nL/usr/local/lib`\n```\n\nThat's a lot harder to figure out. \n\n## Warning\n\n`pkg-config` probably won't work on every system and I've only tested it so far on macOS. It's probably not a good idea to use this for everything. If you find issues with the project on other OS's please let me know.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  useslib:\n    github: flaque/useslib\n```\n\n## Usage\n\nJust put `useslib someLibrary` at the top of your file. \n\n```crystal\nrequire \"useslib\"\n\nuseslib imagemagick\n\nputs \"this code will only get to the compiler if imagemagick is installed\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/flaque/useslib/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [flaque](https://github.com/flaque) Flaque - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaque%2Fuseslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaque%2Fuseslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaque%2Fuseslib/lists"}