Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/content/docs/contributing/guidelines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,59 @@ atlas rep atlas.lock
%nim_c src/netto
```

### OCaml

OCaml packages in Terra MUST follow the [Fedora OCaml Guidelines](https://docs.fedoraproject.org/my/packaging-guidelines/OCaml/), except when it comes to the spec format if using the [`dune`](https://dune.build/) build system.
If this is the case, we recommend you use `BuildSystem: dune`, which declaritively defines the `%prep`, `%build`, `%install`, and `%check` sections for the dune build system. This makes the specs more simple, and helps to ensure no steps are forgotten.

Example OCaml dune spec using `BuildSystem: dune`:

```rpmspec
Name: ocaml-ppx-disable-unused-warnings
Version: 0.17.0
Release: 1%{?dist}
Summary: disables the many OCaml compiler warnings having to do with something being used

License: MIT
URL: https://github.com/janestreet/ppx_disable_unused_warnings
Source: %{url}/archive/v%{version}/ppx_disable_unnused_warnings-%{version}.tar.gz

BuildSystem: dune
BuildRequires: ocaml
BuildRequires: ocaml-dune
BuildRequires: ocaml-ppxlib-devel
BuildRequires: ocaml-base-devel

Packager: Owen Zimmerman <owen@fyralabs.com>

%description
The @disable_unused_warnings annotation disables the many
OCaml compiler warnings having to do with something being
used (variable, constructor, declaration, open, rec keyword, etc.).

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{evr}

%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%prep
%autosetup -C

%files -f .ofiles
%license LICENSE.md

%files devel -f .ofiles-devel

%changelog
* Tue Sep 22 2026 Owen Zimmerman <owen@fyralabs.com> - 0.17.0-1
- Initial commit
```

ocaml-* OCaml packages SHOULD be placed in anda/langs/ocaml, with the folder and spec named with ocaml-*.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I don't think the folder should start with ocaml- nor would the spec need to, it's already in langs/ocaml?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's how Fedora does it, and currently how all the Haskell/OCaml packages do it in Terra. Example - https://src.fedoraproject.org/rpms/ocaml-ppx-bin-prot/blob/rawhide/f/ocaml-ppx-bin-prot.spec

We could mass change this in Terra but beyond the scope of this PR imo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mass changing it in Terra is sure, but enforcing this as our rules feels strange.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for uniformity, it's just a SHOULD not a MUST. Haskell has the same thing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well per the RFC RFC SHOULD means it's heavily discouraged without a good reason not to. IDK I guess it's fine, just seems stupid and makes unnecessarily long folder/file names I have to deal with when rebuilding stuff LMAO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, we can discuss changing this in Terra outside of the PR, but I think this is fine for now (especially since only I have ever added OCaml packages)


### Rust

These are guidelines for packaging projects written in [Rust](https://rust-lang.org).
Expand Down
Loading