From ba54ba93161b96a3f5a9f0072be2930bcd4dd4e8 Mon Sep 17 00:00:00 2001 From: Malo Bourgon Date: Tue, 17 May 2022 17:57:46 -0700 Subject: [PATCH] ocamlPackages: add meta.mainProgram to packages with multiple executables where none of the executables match the package's `name` or `pname`, and one of the executables is the obvious `mainProgram`. --- pkgs/development/ocaml-modules/bap/default.nix | 3 ++- pkgs/development/ocaml-modules/dns/cli.nix | 1 + pkgs/development/ocaml-modules/earley/default.nix | 3 ++- pkgs/development/ocaml-modules/hxd/default.nix | 1 + pkgs/development/ocaml-modules/imagelib/default.nix | 3 ++- pkgs/development/ocaml-modules/lablgtk/default.nix | 9 ++++----- pkgs/development/ocaml-modules/mdx/default.nix | 3 ++- .../development/ocaml-modules/ocaml-gettext/camomile.nix | 2 +- pkgs/development/ocaml-modules/ocaml-gettext/default.nix | 1 + pkgs/development/ocaml-modules/ocaml-gettext/stub.nix | 4 +++- pkgs/development/ocaml-modules/ocp-ocamlres/default.nix | 3 ++- pkgs/development/ocaml-modules/pgsolver/default.nix | 3 ++- pkgs/development/ocaml-modules/rebez/default.nix | 3 ++- pkgs/development/ocaml-modules/twt/default.nix | 5 +++-- pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix | 4 ++-- pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix | 3 ++- pkgs/development/tools/ocaml/js_of_ocaml/default.nix | 4 +++- pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix | 4 +++- pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix | 4 +++- .../tools/ocaml/js_of_ocaml/ppx_deriving_json.nix | 4 +++- pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix | 4 +++- pkgs/development/tools/ocaml/ocamlbuild/default.nix | 5 +++-- pkgs/development/tools/ocaml/ocp-build/default.nix | 5 +++-- 23 files changed, 53 insertions(+), 28 deletions(-) diff --git a/pkgs/development/ocaml-modules/bap/default.nix b/pkgs/development/ocaml-modules/bap/default.nix index 522872772765..4f87715a74ad 100644 --- a/pkgs/development/ocaml-modules/bap/default.nix +++ b/pkgs/development/ocaml-modules/bap/default.nix @@ -75,7 +75,8 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Platform for binary analysis. It is written in OCaml, but can be used from other languages."; homepage = "https://github.com/BinaryAnalysisPlatform/bap/"; - maintainers = [ maintainers.maurer ]; license = licenses.mit; + maintainers = [ maintainers.maurer ]; + mainProgram = "bap"; }; } diff --git a/pkgs/development/ocaml-modules/dns/cli.nix b/pkgs/development/ocaml-modules/dns/cli.nix index 6e149180642d..f9fc8e21d2b4 100644 --- a/pkgs/development/ocaml-modules/dns/cli.nix +++ b/pkgs/development/ocaml-modules/dns/cli.nix @@ -44,5 +44,6 @@ buildDunePackage { meta = dns.meta // { description = "Unix command line utilities using uDNS"; + mainProgram = "odns"; }; } diff --git a/pkgs/development/ocaml-modules/earley/default.nix b/pkgs/development/ocaml-modules/earley/default.nix index c7b2d09d6674..0d365c8036dd 100644 --- a/pkgs/development/ocaml-modules/earley/default.nix +++ b/pkgs/development/ocaml-modules/earley/default.nix @@ -21,8 +21,9 @@ buildDunePackage rec { meta = { description = "Parser combinators based on Earley Algorithm"; + homepage = "https://github.com/rlepigre/ocaml-earley"; license = lib.licenses.cecill-b; maintainers = [ lib.maintainers.vbgl ]; - homepage = "https://github.com/rlepigre/ocaml-earley"; + mainProgram = "pa_ocaml"; }; } diff --git a/pkgs/development/ocaml-modules/hxd/default.nix b/pkgs/development/ocaml-modules/hxd/default.nix index 0b05a83dd7ef..7840bb4ff19a 100644 --- a/pkgs/development/ocaml-modules/hxd/default.nix +++ b/pkgs/development/ocaml-modules/hxd/default.nix @@ -35,5 +35,6 @@ buildDunePackage rec { homepage = "https://github.com/dinosaure/hxd"; license = licenses.mit; maintainers = [ maintainers.sternenseemann ]; + mainProgram = "hxd.xxd"; }; } diff --git a/pkgs/development/ocaml-modules/imagelib/default.nix b/pkgs/development/ocaml-modules/imagelib/default.nix index 580db48769ef..a2debdaf492d 100644 --- a/pkgs/development/ocaml-modules/imagelib/default.nix +++ b/pkgs/development/ocaml-modules/imagelib/default.nix @@ -21,8 +21,9 @@ buildDunePackage rec { meta = { description = "Image formats such as PNG and PPM in OCaml"; + homepage = "https://github.com/rlepigre/ocaml-imagelib"; license = lib.licenses.lgpl3; maintainers = [ lib.maintainers.vbgl ]; - homepage = "https://github.com/rlepigre/ocaml-imagelib"; + mainProgram = "imagetool"; }; } diff --git a/pkgs/development/ocaml-modules/lablgtk/default.nix b/pkgs/development/ocaml-modules/lablgtk/default.nix index 7eb94bc188aa..f82548b18838 100644 --- a/pkgs/development/ocaml-modules/lablgtk/default.nix +++ b/pkgs/development/ocaml-modules/lablgtk/default.nix @@ -37,12 +37,11 @@ stdenv.mkDerivation { dontStrip = true; meta = with lib; { - inherit (ocaml.meta) platforms; - maintainers = with maintainers; [ - maggesi roconnor vbgl - ]; - homepage = "http://lablgtk.forge.ocamlcore.org/"; description = "An OCaml interface to GTK"; + homepage = "http://lablgtk.forge.ocamlcore.org/"; license = licenses.lgpl21Plus; + maintainers = with maintainers; [ maggesi roconnor vbgl ]; + mainProgram = "lablgtk2"; + inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix index 09f505c0e254..fc1ecb5e0762 100644 --- a/pkgs/development/ocaml-modules/mdx/default.nix +++ b/pkgs/development/ocaml-modules/mdx/default.nix @@ -31,10 +31,11 @@ buildDunePackage rec { ''; meta = { - homepage = "https://github.com/realworldocaml/mdx"; description = "Executable OCaml code blocks inside markdown files"; + homepage = "https://github.com/realworldocaml/mdx"; changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md"; license = lib.licenses.isc; maintainers = [ lib.maintainers.romildo ]; + mainProgram = "ocaml-mdx"; }; } diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix b/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix index 012f3b61ff32..d36063300196 100644 --- a/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix +++ b/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix @@ -9,7 +9,7 @@ buildDunePackage { doCheck = true; checkInputs = [ ounit fileutils ]; - meta = ocaml_gettext.meta // { + meta = (builtins.removeAttrs ocaml_gettext.meta [ "mainProgram" ]) // { description = "Internationalization library using camomile (i18n)"; }; diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/default.nix b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix index 7525a10030eb..fa8857f36b35 100644 --- a/pkgs/development/ocaml-modules/ocaml-gettext/default.nix +++ b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix @@ -28,5 +28,6 @@ buildDunePackage rec { homepage = "https://github.com/gildor478/ocaml-gettext"; license = licenses.lgpl21; maintainers = [ maintainers.volth ]; + mainProgram = "ocaml-gettext"; }; } diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix index 51e902b91408..950ac652e54d 100644 --- a/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix +++ b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix @@ -4,7 +4,7 @@ buildDunePackage rec { pname = "gettext-stub"; - inherit (ocaml_gettext) src version useDune2 meta; + inherit (ocaml_gettext) src version useDune2; buildInputs = [ dune-configurator ]; @@ -13,4 +13,6 @@ buildDunePackage rec { doCheck = true; checkInputs = [ ounit ]; + + meta = builtins.removeAttrs ocaml_gettext.meta [ "mainProgram" ]; } diff --git a/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix index d084e7f8a62e..d5a70406e9c3 100644 --- a/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix +++ b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix @@ -26,9 +26,10 @@ stdenv.mkDerivation rec { meta = { description = "A simple tool and library to embed files and directories inside OCaml executables"; - license = lib.licenses.lgpl3Plus; homepage = "https://www.typerex.org/ocp-ocamlres.html"; + license = lib.licenses.lgpl3Plus; maintainers = [ lib.maintainers.vbgl ]; + mainProgram = "ocp-ocamlres"; inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/ocaml-modules/pgsolver/default.nix b/pkgs/development/ocaml-modules/pgsolver/default.nix index a1d6fe6486ac..6653284ba487 100644 --- a/pkgs/development/ocaml-modules/pgsolver/default.nix +++ b/pkgs/development/ocaml-modules/pgsolver/default.nix @@ -15,9 +15,10 @@ buildOasisPackage rec { propagatedBuildInputs = [ tcslib ocaml-sat-solvers ]; meta = { - homepage = "https://github.com/tcsprojects/pgsolver"; description = "A collection of tools for generating, manipulating and - most of all - solving parity games"; + homepage = "https://github.com/tcsprojects/pgsolver"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ mgttlinger ]; + mainProgram = "pgsolver-bin"; }; } diff --git a/pkgs/development/ocaml-modules/rebez/default.nix b/pkgs/development/ocaml-modules/rebez/default.nix index b82c2ba74827..743f94454eeb 100644 --- a/pkgs/development/ocaml-modules/rebez/default.nix +++ b/pkgs/development/ocaml-modules/rebez/default.nix @@ -16,7 +16,8 @@ buildDunePackage rec { meta = with lib; { description = "Cubic bezier implementation in Reason / OCaml"; homepage = "https://github.com/jchavarri/rebez/"; - maintainers = with maintainers; [ superherointj ]; license = licenses.mit; + maintainers = with maintainers; [ superherointj ]; + mainProgram = "RebezApp.exe"; }; } diff --git a/pkgs/development/ocaml-modules/twt/default.nix b/pkgs/development/ocaml-modules/twt/default.nix index 4e76f0c16d38..46822df31fc0 100644 --- a/pkgs/development/ocaml-modules/twt/default.nix +++ b/pkgs/development/ocaml-modules/twt/default.nix @@ -27,10 +27,11 @@ stdenv.mkDerivation rec { dontStrip = true; meta = with lib; { - homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/"; description = "“The Whitespace Thing” for OCaml"; + homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/"; license = licenses.mit; maintainers = [ maintainers.vbgl ]; - platforms = ocaml.meta.platforms or [ ]; + mainProgram = "ocaml+twt"; + inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix index 39f6d5f7aa2d..d72a653182d3 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix @@ -15,7 +15,7 @@ buildDunePackage rec { sha256 = "1v2hfq0ra9j07yz6pj6m03hrvgys4vmx0gclchv94yywpb2wc7ik"; }; - inherit (js_of_ocaml-compiler) meta; - buildInputs = [ camlp4 ocsigen_deriving ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix index 7805ca264035..64313112f43b 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix @@ -21,8 +21,9 @@ buildDunePackage rec { meta = { description = "Compiler from OCaml bytecode to Javascript"; + homepage = "https://ocsigen.org/js_of_ocaml/"; license = lib.licenses.gpl2; maintainers = [ lib.maintainers.vbgl ]; - homepage = "https://ocsigen.org/js_of_ocaml/"; + mainProgram = "js_of_ocaml"; }; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix index 25826e94eb3a..679fd9ab9de8 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix @@ -5,9 +5,11 @@ buildDunePackage { pname = "js_of_ocaml"; - inherit (js_of_ocaml-compiler) version src meta useDune2; + inherit (js_of_ocaml-compiler) version src useDune2; buildInputs = [ ppxlib ]; propagatedBuildInputs = [ js_of_ocaml-compiler uchar ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix b/pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix index 81b1a41614b0..8cdb7224d891 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix @@ -5,9 +5,11 @@ buildDunePackage { pname = "js_of_ocaml-lwt"; - inherit (js_of_ocaml-compiler) version src meta useDune2; + inherit (js_of_ocaml-compiler) version src useDune2; buildInputs = [ js_of_ocaml-ppx ]; propagatedBuildInputs = [ js_of_ocaml ocaml_lwt lwt_log ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix b/pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix index 3c0f8c761239..535fe6dae79c 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix @@ -6,8 +6,10 @@ buildDunePackage { pname = "js_of_ocaml-ppx"; - inherit (js_of_ocaml-compiler) version src meta useDune2; + inherit (js_of_ocaml-compiler) version src useDune2; buildInputs = [ js_of_ocaml ]; propagatedBuildInputs = [ ppxlib ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/ppx_deriving_json.nix b/pkgs/development/tools/ocaml/js_of_ocaml/ppx_deriving_json.nix index d862d4bc67b7..5256cd4037fc 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/ppx_deriving_json.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/ppx_deriving_json.nix @@ -5,7 +5,9 @@ buildDunePackage { pname = "js_of_ocaml-ppx_deriving_json"; - inherit (js_of_ocaml-compiler) version src meta useDune2; + inherit (js_of_ocaml-compiler) version src useDune2; propagatedBuildInputs = [ js_of_ocaml ppxlib ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix b/pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix index 7082e4b86c97..e371c9f10bf0 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix @@ -6,9 +6,11 @@ buildDunePackage { pname = "js_of_ocaml-tyxml"; - inherit (js_of_ocaml-compiler) version src meta useDune2; + inherit (js_of_ocaml-compiler) version src useDune2; buildInputs = [ js_of_ocaml-ppx ]; propagatedBuildInputs = [ js_of_ocaml reactivedata tyxml ]; + + meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ]; } diff --git a/pkgs/development/tools/ocaml/ocamlbuild/default.nix b/pkgs/development/tools/ocaml/ocamlbuild/default.nix index 2caf6c67857c..3d8ade975f99 100644 --- a/pkgs/development/tools/ocaml/ocamlbuild/default.nix +++ b/pkgs/development/tools/ocaml/ocamlbuild/default.nix @@ -31,10 +31,11 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - homepage = "https://github.com/ocaml/ocamlbuild/"; description = "A build system with builtin rules to easily build most OCaml projects"; + homepage = "https://github.com/ocaml/ocamlbuild/"; license = licenses.lgpl2; - inherit (ocaml.meta) platforms; maintainers = with maintainers; [ vbgl ]; + mainProgram = "ocamlbuild"; + inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/tools/ocaml/ocp-build/default.nix b/pkgs/development/tools/ocaml/ocp-build/default.nix index 583468521817..bf87bc550217 100644 --- a/pkgs/development/tools/ocaml/ocp-build/default.nix +++ b/pkgs/development/tools/ocaml/ocp-build/default.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { preInstall = "mkdir -p $out/bin"; meta = with lib; { - homepage = "https://www.typerex.org/ocp-build.html"; description = "A build tool for OCaml"; longDescription = '' ocp-build is a build system for OCaml application, based on simple @@ -33,8 +32,10 @@ stdenv.mkDerivation rec { the number of cores and the automatically-inferred dependencies between source files. ''; + homepage = "https://www.typerex.org/ocp-build.html"; license = licenses.gpl3; - platforms = ocaml.meta.platforms or []; maintainers = [ maintainers.jirkamarsik ]; + mainProgram = "ocp-build"; + inherit (ocaml.meta) platforms; }; }