{"id":22293926,"url":"https://github.com/rtbo/dopamine","last_synced_at":"2026-01-05T20:45:12.856Z","repository":{"id":37827329,"uuid":"315866875","full_name":"rtbo/dopamine","owner":"rtbo","description":"A package manager and development helper for compiled languages","archived":false,"fork":false,"pushed_at":"2023-07-23T21:59:44.000Z","size":5569,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T19:27:04.340Z","etag":null,"topics":["build-system","compiled-language","developer-tools","package-manager"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-11-25T07:53:34.000Z","updated_at":"2024-01-10T06:12:54.000Z","dependencies_parsed_at":"2024-12-03T17:33:52.832Z","dependency_job_id":"c0b16453-ce34-459d-bfb9-ac49afaf4422","html_url":"https://github.com/rtbo/dopamine","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/rtbo%2Fdopamine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtbo%2Fdopamine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtbo%2Fdopamine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtbo%2Fdopamine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtbo","download_url":"https://codeload.github.com/rtbo/dopamine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245550681,"owners_count":20633883,"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":["build-system","compiled-language","developer-tools","package-manager"],"created_at":"2024-12-03T17:33:28.520Z","updated_at":"2026-01-05T20:45:12.811Z","avatar_url":"https://github.com/rtbo.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dopamine package manager\n\nPackage manager for compiled languages.\n\nDopamine PM is a tool for developers that helps to download and build dependencies in a predictible way.\n\nDopamine is still under development and cannot be used yet in production.\n\n## Goals\n\n- Ease interoperability of C / C++ / D\n- Build-system agnosticity\n- Highly flexible package recipe\n- Consume DUB packages as dependency\n- Drop-in replacement of `dub` client\n- Ease to package 3rdparty code without patching (packages not aware of Dopamine)\n- Allows to look-up for system-installed dependency before downloading and build\n- Lock dependency versions for deterministic dependencies\n- Reduce compilation time by uploading/downloading pre-built packages\n\n## Design\n\n - The `dop` command line tool provide commands for all aspects of building and packaging.\n    - Setup compilation profile\n    - Get the source\n    - Resolve and lock dependencies\n    - Build (using the build system provided by the source package)\n    - Package/publish\n    - Upload a build\n    - See the [client spec](https://github.com/rtbo/dopamine/blob/main/packages/client/SPEC.md) for more details.\n\n - Recipes are Lua scripts.\n    - Recipes provide some descriptive fields and functions for:\n        - package metadata\n        - downloading source (if the source is not packaged with the recipe)\n        - patch (if needed)\n        - build\n    - Most of recipes tasks are helped by a comprehensive `dop` lua library, pre-loaded by the client.\n    - Thanks to Lua's functional flexibility, most recipes can look purely declarative\n\n - Dependencies are resolved with a DAG. See [dag.d](https://github.com/rtbo/dopamine/blob/main/packages/lib/src/dopamine/dep/dag.d).\n\n - Compilation profiles are saved in INI files, that can be saved user-wide and reused at will\n    - The `dop` client provide helpers to edit them, but can also be done by hand.\n    - Each profile gets a unique identifier based on the build options, platform, compilers versions and ABI etc.\n\n - Everything that can alter the build (profile id, resolved dependencies versions...) is reduced to a unique build identifier.\n    - This identifier allows to upload a built package\n    - A consumer can consume this pre-built package as dependency if the same ID is computed.\n    - If no build is found, the recipe is used to build the package (and optionally upload it after the build).\n\n - A part of the design is inspired by [conan](https://conan.io)\n\n## Example of Recipe\n\nHere is an example of recipe that would build and package `libpng`.\nBecause it is packaging a 3rd party library, it has to download the source,\nand perform a few adjustement in the build options.\n\n```lua\nname = 'libpng'\nversion = '1.6.37'\ndescription = 'The PNG reference library'\nauthors = {'The PNG Reference Library Authors'}\nlicense = 'http://www.libpng.org/pub/png/src/libpng-LICENSE.txt'\ncopyright = 'Copyright (c) 1995-2019 The PNG Reference Library Authors'\ntools = {'cc'}\n\ndependencies = {zlib = '\u003e=1.2.5'}\n\nfunction source()\n    local folder = 'libpng-' .. version\n    local archive = folder .. '.tar.xz'\n    dop.download {\n        'https://download.sourceforge.net/libpng/' .. archive,\n        dest = archive,\n    }\n    dop.checksum {\n        archive,\n        sha256 = '505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca',\n    }\n    dop.extract_archive { archive, outdir = '.' }\n\n    return folder\nend\n\nfunction build(dirs, config, dep_infos)\n\n    local cmake = dop.CMake:new(config.profile)\n\n    local defs = {\n        ['PNG_TESTS'] = false,\n    }\n    -- if zlib is not in the system but in the dependency cache\n    if dep_infos and dep_infos.zlib then\n        local zlib = dep_infos.zlib.install_dir\n        local libname = dop.windows and 'zlibstatic' or 'z'\n        defs['ZLIB_INCLUDE_DIR'] = dop.path(zlib, 'include')\n        defs['ZLIB_LIBRARY'] = dop.find_libfile(dop.path(zlib, 'lib'), libname, 'static')\n    end\n\n    cmake:configure({\n        src_dir = dirs.src,\n        install_dir = dirs.install,\n        defs = defs,\n    })\n    cmake:build()\n    cmake:install()\nend\n```\n\n## Build dopamine\n\nDopamine is developed and built with `meson`.\nYou need the following tools:\n - meson (\u003e= 0.63)\n - ninja\n - a D compiler (either DMD or LDC)\n - Dub (dopamine depends on vibe-d)\n - a C compiler\n    - C libraries are compiled if not found on the system (Lua + compression libraries)\n\n### Linux\n\n```sh\nDC=ldc meson setup build-ldc\ncd build-ldc\nninja # or meson compile\nninja test # or meson test\n\n# you can now run the dop client\npackages/client/dop -h\n```\n\n### Windows\n\nWindows is always more complex to setup.\nOnly MSVC is supported as C compiler, as D compilers do not link to MingW out of the box.\nAlso you need to run both meson **and** ninja from a VS prompt.\nIf you have `[vswhere](https://github.com/microsoft/vswhere)` in your Path,\n`win_env_vs.bat` is provided to setup the VS environment from your regular CMD prompt (do not work with powershell).\nAlternatively, the modern `Windows Terminal` app is also helpful.\n\n```bat\nwin_env_vs.bat\nrem Windows is so slow to compile, you are better off with a fast D compiler\nset DC=dmd\nmeson setup build-dmd\ncd build-dmd\nninja rem or meson compile\nninja test rem or meson test\n\nrem you can now run the dop client\npackages\\client\\dop.exe -h\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtbo%2Fdopamine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtbo%2Fdopamine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtbo%2Fdopamine/lists"}