Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamlPackages.graphics: init at 5.1.0 for OCaml ≥ 4.09 & refactor buildDune2Package #82670

Merged
merged 3 commits into from Mar 23, 2020

Conversation

vbgl
Copy link
Contributor

@vbgl vbgl commented Mar 15, 2020

Motivation for this change

The initial motivation was to fix parmap with OCaml 4.09. At version 1.1, parmap depends on graphics which is shipped with OCaml < 4.09; when distributed as a separate library, it is built by dune 2 and seems to impose to dependent libraries to use dune 2 as well. This is why I wanted an easy way to select the version of dune.

FTR, here is a possible way to fix parmap after this PR:

--- a/pkgs/development/ocaml-modules/parmap/default.nix
+++ b/pkgs/development/ocaml-modules/parmap/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildDunePackage, fetchzip }:
+{ lib, buildDunePackage, fetchzip, dune-configurator, graphics }:
 
 buildDunePackage rec {
   pname = "parmap";
@@ -9,6 +9,10 @@ buildDunePackage rec {
     sha256 = "13ahqaga1palf0s0dll512cl7k43sllmwvw6r03y70kfmky1j114";
   };
 
+  useDune2 = graphics != null;
+
+  buildInputs = [ graphics ] ++ lib.optional useDune2 dune-configurator;
+

Updating parmap (as done in #82585) is a much simpler way to solve this particular issue.

Nonetheless, I think that getting rid of buildDune2Package is a good idea.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@vbgl
Copy link
Contributor Author

vbgl commented Mar 18, 2020

@GrahamcOfBorg build ocaml-ng.ocamlPackages_4_09.graphics ocamlPackages.dune-configurator

@vbgl vbgl merged commit dd6d785 into NixOS:master Mar 23, 2020
@vbgl vbgl deleted the ocaml-parmap-4.09 branch March 23, 2020 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant