{"id":18841931,"url":"https://github.com/diskuv/dkml-installer-opam","last_synced_at":"2026-01-30T15:30:13.920Z","repository":{"id":63373193,"uuid":"562738808","full_name":"diskuv/dkml-installer-opam","owner":"diskuv","description":"An installer for opam, the OCaml package manager","archived":false,"fork":false,"pushed_at":"2024-07-08T07:07:11.000Z","size":143,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T10:50:12.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diskuv.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":"2022-11-07T06:38:18.000Z","updated_at":"2024-07-08T07:07:15.000Z","dependencies_parsed_at":"2024-11-08T02:53:17.117Z","dependency_job_id":"e2c8ef9e-c8aa-43b2-ad4d-37017e437237","html_url":"https://github.com/diskuv/dkml-installer-opam","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diskuv%2Fdkml-installer-opam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diskuv%2Fdkml-installer-opam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diskuv%2Fdkml-installer-opam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diskuv%2Fdkml-installer-opam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diskuv","download_url":"https://codeload.github.com/diskuv/dkml-installer-opam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239780120,"owners_count":19695734,"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":[],"created_at":"2024-11-08T02:53:04.493Z","updated_at":"2026-01-30T15:30:13.881Z","avatar_url":"https://github.com/diskuv.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DkML installer for Opam\n\nAn installer for Opam.\n\nThe installer is an _offline_ installer, meaning it is fully self-contained.\nHowever on Windows `opam` by itself is not very useful! The base OCaml compiler\npackage, for example, requires a POSIX shell from MSYS2 or Cygwin.\n\nFor 2022 and 2023 you should expect to need the `dkml-installer-ocaml` installer\nas well to provide the missing pieces.\n\n## Making a new version\n\n\u003e The following assumes you have a Unix shell. On Windows with DkML installed you can use `with-dkml bash` to get one.\n\u003e\n\u003e We won't be using code-signing for this section, although that is documented in [BINARY_SIGNING.md](contributors/BINARY_SIGNING.md).\n\n1. Ensure you have cloned \u003chttps://github.com/diskuv/dkml-component-opam.git\u003e in a sibling directory to this `dkml-installer-opam/` project. So your directory structure should look like:\n\n   ```text\n\n    ├── dkml-component-opam\n    │   ├── ...\n    │   └── dune-project\n    ├── dkml-installer-opam\n        ├── ...\n        └── dune-project\n   ```\n\n2. Follow [dkml-component-opam's \"Making a new version\"](https://github.com/diskuv/dkml-component-opam?tab=readme-ov-file#making-a-new-version)\n3. Edit the `(version ...)` in [dune-project](./dune-project). Use the same version as you used in `dkml-component-opam`.\n4. Edit the `--program-version` in [dkml-installer-offline-opam.opam.template](./dkml-installer-offline-opam.opam.template). Use the hyphenated version, not the opam version. So replace `~` with `-`.\n5. Edit the `arp_version` in [version.ml](installer/src/version.ml). It should be the hyphenated version **and should not include the date** since this is highly visible to the user. So `2.2.0-beta2` not `2.2.0-beta2-20240409` if you are publishing a beta release. **It is not recommended to publish a beta release to winget; all new users would get the beta version**.\n6. Do the following in `dkml-installer-opam/`:\n\n   ```sh\n   eval $(opam env --switch ../dkml-component-opam --set-switch)\n\n   opam exec -- dune build *.opam\n   opam exec -- dune runtest\n   git add dune-project *.opam dkml-installer-offline-opam.opam.template installer/src/version.ml\n   git commit -m \"Prepare new version (1/2)\"\n\n   opam remove dkml-installer-offline-opam -y\n   opam install ./dkml-installer-offline-opam.opam --keep-build-dir\n\n   # See the OS-specific installer or installer generator script.\n   # macOS ARM64 is not part of DkML opam distribution.\n   find \"$(opam var dkml-installer-offline-opam:share)/t\"\n   ```\n\n7. Do:\n\n   ```sh\n   # 2.2.0~beta2~20240409 is tagged as 2.2.0-beta2-20240409\n   tagversion=$(awk '/\\(version / { sub(/)/, \"\"); gsub(/~/, \"-\"); print $2 }' dune-project)\n   git tag \"$tagversion\"\n   git push origin \"$tagversion\"\n   ```\n\n   and wait for GitHub Actions to complete successfully.\n8. In the `installer/winget/manifest` directory search for all `# BUMP` in the `.yaml` files and edit each line.\n   - The `PackageVersion` in all `.yaml` files should be set to the ARP version that has **no date** (you set this in Step 5).\n9. Do the [winget Testing instructions](installer/winget/README.md#testing).\n10. Do the following in `dkml-installer-opam/`:\n\n    ```sh\n    git add installer/winget/manifest\n    git commit -m \"Prepare new version (2/2)\"\n\n    tagversion=$(awk '/\\(version / { sub(/)/, \"\"); gsub(/~/, \"-\"); print $2 }' dune-project)\n    git tag \"$tagversion+winget\"\n    git push origin \"$tagversion+winget\"\n    ```\n\n11. Do the [winget Submitting instructions](installer/winget/README.md#submitting).\n\n\u003e See the suggestions in \u003chttps://github.com/diskuv/dkml-installer-opam/issues/1\u003e for automating these\n\u003e steps.\n\n## (Pending) Developing\n\nYou can test on your desktop with a shell session as follows:\n\n```console\n# For macOS/Intel (darwin_x86_64)\n$ sh ci/setup-dkml/pc/setup-dkml-darwin_x86_64.sh --SECONDARY_SWITCH=true\n# For Linux/Intel (linux_x86_64). You will need Docker\n#   - Running this from macOS with Docker will also work\n#   - Running this using with-dkml.exe on Windows with Docker will also work\n#     (the normal Linux containers host, not the Windows containers host)\n$ sh ci/setup-dkml/pc/setup-dkml-linux_x86_64.sh --SECONDARY_SWITCH=true\n...\nFinished setup.\n\nTo continue your testing, run:\n  export dkml_host_abi='darwin_x86_64'\n  export abi_pattern='macos-darwin_all'\n  export opam_root='/Volumes/Source/dkml-component-desktop/.ci/o'\n  export exe_ext=''\n\nNow you can use 'opamrun' to do opam commands like:\n\n  opamrun install XYZ.opam\n  sh ci/build-test.sh\n\n# Copy and adapt from above (the text above will be different for each of: Linux, macOS and Windows)\n$ export dkml_host_abi='darwin_x86_64'\n$ export abi_pattern='macos-darwin_all'\n$ export opam_root=\"$PWD/.ci/o\"\n$ export exe_ext=''\n\n# Run the build\n#   The first argument is: 'ci' or 'full'\n#   The second argument is: 'release' or 'next'\n$ sh ci/build-test.sh ci next\n```\n\n## (Pending) Upgrading CI\n\n```bash\nopam upgrade dkml-workflows \u0026\u0026 opam exec -- generate-setup-dkml-scaffold \u0026\u0026 dune build '@gen-dkml' --auto-promote\n```\n\n## Contributing\n\nThe installer makes heavy use of the dkml-install-api.\nSee [the Contributors section of dkml-install-api](https://github.com/diskuv/dkml-install-api/blob/main/contributors/README.md).\n\nAny new dkml-components used by this installer will need an access token\n(`repo public_repo`)\nto automatically trigger builds, which you'll save as a repository secret\nin your component. Create an issue to get access if you have a new\ncomponent that you would like to get distributed.\n\nIn addition, there are\n\n- [code signing documents](contributors/BINARY_SIGNING.md)\n- [winget package submission documents](installer/winget/README.md)\n\n## Status\n\n| What                   | Branch/Tag | Status                                                                                                                                                                                          |\n| ---------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Installer packages     |            | [![Package OCaml Releases](https://github.com/diskuv/dkml-installer-opam/actions/workflows/package.yml/badge.svg)](https://github.com/diskuv/dkml-installer-opam/actions/workflows/package.yml) |\n| Installer syntax check |            | [![Syntax check](https://github.com/diskuv/dkml-installer-opam/actions/workflows/syntax.yml/badge.svg)](https://github.com/diskuv/dkml-installer-opam/actions/workflows/syntax.yml)             |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiskuv%2Fdkml-installer-opam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiskuv%2Fdkml-installer-opam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiskuv%2Fdkml-installer-opam/lists"}