Commit Graph

52 Commits

Author SHA1 Message Date
sempiternal-aurora
8c223b0953 ocamlPackages.buildDunePackage: allow multiple dune packages
A single `dune-project` file can contain multiple packages that dune can
build. This is a problem, because the default dune build command we use
doesn't search through `dune-project` for dependencies, it assumes that
will have already been built and can be found with findlib. See
zipperposition for an example of this.

Adds a new `dunePackages` argument to allow this, defaulting to `[ pname ]`
for backwards compatibility.
2026-08-19 01:24:46 +10:00
Vincent Laporte
53a14cec89 buildDunePackage: use final version in name 2026-08-11 00:12:02 +02:00
Eman Resu
c19f0976a3 build-support/ocaml: remove throwIf usage 2026-05-26 14:50:40 -04:00
Vincent Laporte
85c59938d8 Revert "ocamlPackages.buildDunePackage: Use final pname and version" 2025-12-20 12:29:57 +01:00
Ross Smyth
1070d3820e ocamlPackages.buildDunePackage: Use overriden pname and version 2025-12-16 13:32:08 -05:00
Vincent Laporte
7314867163 dune_1: remove 2025-11-13 09:22:35 +01:00
jopejoe1
1e1cef625b ocamlPackages: swap throws to meta.broken
throws no longer work with the current ci we have in nixpkgs
2025-10-18 22:23:06 +02:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Yifei Sun
73432f59e1 ocamlPackages.buildDunePackage: support fixed point args with lib.extendMkDerivation 2025-09-25 14:59:57 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Antonio Nuno Monteiro
cadeeaa525 buildDunePackage: allow overriding stdenv 2024-09-18 14:13:53 +02:00
superherointj
40ae5e072c build-support/ocaml: deprecate minimumOCamlVersion (#319907)
* ocamlPackages.wtf8: use minimalOCamlVersion

* ocamlPackages.ppx_yojson_conv: minimalOCamlVersion

* ocamlPackages.postgresql: use minimalOCamlVersion

* ocamlPackages.opti: use minimalOCamlVersion

* ocamlPackages.opam-repository: use minimalOCamlVersion

* ocamlPackages.opam-format: use minimalOCamlVersion

* ocamlPackages.lwt-dllist: use minimalOCamlVersion

* ocamlPackages.lacaml: use minimalOCamlVersion

* ocamlPackages.gnuplot: use minimalOCamlVersion

* ocamlPackages.fix: use minimalOCamlVersion

* ocamlPackages.eigen: use minimalOCamlVersion

* ocamlPackages.earley: use minimalOCamlVersion

* ocamlPackages.directories: use minimalOCamlVersion

* ocamlPackages.cpuid: use minimalOCamlVersion

* build-support/ocaml: deprecate minimumOCamlVersion

* build-support/ocaml: deprecate minimumOCamlVersion

---------

Co-authored-by: Vincent Laporte <Vincent.Laporte@gmail.com>
2024-06-21 10:29:31 +02:00
Jules Aguillon
187d777aad ocamlPackages.buildTopkgPackage: Added
This function helps building an OCaml package that builds with topkg.
There are currently many such packages in nixpkgs and this function
would greatly simplify adding more.

This is heavily inspired by `ocamlPackages.buildDunePackage`.
2023-09-28 12:03:20 +02:00
Vincent Laporte
e7b211e3d2 ocamlPackages: default to version 3 of Dune 2023-05-12 05:50:40 +02:00
Et7f3
caf436a52b ocamlPackages.buildDunePackage: deprecate useDune2 2023-05-06 08:11:25 +02:00
Antonio Nuno Monteiro
91137380e6 buildDunePackage: use --mandir instead of --man 2023-03-28 11:07:28 -07:00
François Bobot
3b3e37f996 [OCaml] tell dune where to install man
`fixupPhase` move `$out/man` to `$out/share/man`. So the information of their location in the dune-project file is outdated which breaks dependencies on packages ( `(package foo)`).
2023-03-14 14:37:57 +01:00
Antonio Nuno Monteiro
45c3600bb1 buildDunePackage: fix doc installation
The default directory where dune expects docs is in
`$out/doc`, but Nix installs it in `$out/share/doc`
2023-03-13 20:50:15 +01:00
Ulrik Strid
f12b9ea461 buildDunePackage: default to strictDeps = true 2023-02-03 08:59:34 +01:00
Ulrik Strid
c53a63adf1 ocamlPackages treewide: strictDeps all packages 2023-02-03 08:59:34 +01:00
Vincent Laporte
8b11f0a513 ocamlPackages.buildOcaml: remove 2022-10-25 09:40:57 +02:00
Anders Kaseorg
6920d8ca42 treewide: Simplify negated uses of versionAtLeast, versionOlder
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-04-25 13:35:24 -07:00
Vincent Laporte
15f220b07c ocamlPackages.buildDunePackage: add support for dune 3 2022-03-28 07:08:14 +02:00
Vincent Laporte
b5359c444e buildDunePackage: use dune_2 by default 2022-03-13 21:19:09 +01:00
Ulrik Strid
a13cdfe520 ocamlPackages tree-wide: Move buildInputs that should be nativeBuildInputs
To keep this for the future we also strictDeps where possible, including for janePackages, topkg, oasis and ocamlbuild.
This makes some closures significantly smaller and makes cross compilation easier
2022-02-24 14:39:27 +01:00
Felix Buehler
e601787f7e buildOcaml: rename name to pname 2021-11-01 16:19:30 +01:00
Guillaume Girol
a17fc03375 pkgsStatic.ocaml-ng: migrate static adapter to derivations themselves 2021-08-19 09:32:03 +02:00
Guillaume Girol
856fa067c5 buildDunePackage: use nativeBuildInputs for build tools 2021-08-19 09:29:55 +02:00
Guillaume Girol
ddd479fe7c ocamlPackages.mkDerivation: use nativeBuildInputs for build tools 2021-08-19 09:29:55 +02:00
superherointj
15807923f9 build-support.ocaml.dune: handle minimalOCamlVersion typo 2021-06-11 11:08:12 +02:00
Vincent Laporte
60785fe4db ocamlPackages.dune: rename into dune_1 2021-03-07 12:07:14 +01:00
Pavol Rusnak
90f7338112 treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
sternenseemann
640d92513d buildDunePackage: use dune install instead of opaline 2020-12-21 00:43:33 +01:00
Vincent Laporte
885fb1406d ocamlPackages.buildOasis: fix handling of installation prefix 2020-07-02 07:13:34 +02:00
Mario Rodas
f7ac956a2b buildDunePackage: add support for parallel build
dune allows to specify the number of jobs to build the package.
2020-04-29 16:08:52 +02:00
Vincent Laporte
0229936bbe buildDunePackage: add a “useDune2” option 2020-03-23 09:12:50 +01:00
John Ericson
bca2e8255e treewide: CAML_LD_LIBRARY_PATH may be undefined 2019-11-14 13:44:07 -05:00
Merlin Göttlinger
b1f0e3ebc5 Suggested edits 2019-08-07 09:50:46 +02:00
Merlin Göttlinger
6e6c1448fa Suggested edits 2019-08-07 06:51:36 +02:00
Merlin Göttlinger
961b83a99d Don't use buildOcaml 2019-08-06 17:54:09 +02:00
Merlin Göttlinger
6ef367a5e8 Suggested changes 2019-08-06 06:46:03 +02:00
Merlin Göttlinger
2ea2643b13 OCaml build support: add oasis build system 2019-08-01 10:44:04 +02:00
volth
f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Vincent Laporte
66efb76c75 ocamlPackages.buildDunePackage: fix meta.platforms 2018-11-30 16:19:03 +00:00
Théo Zimmermann
742bce7793 buildDunePackage: inline dune.installPhase for easier overriding
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2018-11-07 10:08:08 +01:00
Théo Zimmermann
406405d8bd buildDunePackage: add support for pre and post phase hooks
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2018-11-07 10:08:08 +01:00
Théo Zimmermann
794158fcd5 buildDunePackage: new support function; use it to refactor some OCaml derivations 2018-11-07 10:08:03 +01:00
Vincent Laporte
4168706d4f OCaml modules: make explicit some dependencies to ocamlbuild 2016-10-09 11:55:19 +02:00
Kirill Boltaev
3e646865f4 treewide: use ocaml.version (#19192) 2016-10-05 09:32:30 +02:00