diff --git a/pkgs/development/ocaml-modules/opam-repository/download-tool.patch b/pkgs/development/ocaml-modules/opam-repository/download-tool.patch index 5af720adca91..9cc5f43f34f1 100644 --- a/pkgs/development/ocaml-modules/opam-repository/download-tool.patch +++ b/pkgs/development/ocaml-modules/opam-repository/download-tool.patch @@ -2,16 +2,20 @@ diff --git a/src/repository/opamRepositoryConfig.ml b/src/repository/opamReposit index c2954c1d..528fc621 100644 --- a/src/repository/opamRepositoryConfig.ml +++ b/src/repository/opamRepositoryConfig.ml -@@ -27,23 +27,7 @@ type 'a options_fun = +@@ -27,31 +27,7 @@ type 'a options_fun = 'a let default = { - download_tool = lazy ( +- let os = OpamStd.Sys.os () in - try +- let curl = "curl", `Curl in - let tools = -- if OpamStd.Sys.(os () = Darwin) -- then ["wget", `Default; "curl", `Curl] -- else ["curl", `Curl; "wget", `Default] +- match os with +- | Darwin -> ["wget", `Default; curl] +- | FreeBSD -> ["fetch", `Default ; curl] +- | OpenBSD -> ["ftp", `Default; curl] +- | _ -> [curl; "wget", `Default] - in - let cmd, kind = - List.find (fun (c,_) -> OpamSystem.resolve_command c <> None) tools @@ -20,8 +24,12 @@ index c2954c1d..528fc621 100644 - with Not_found -> - OpamConsole.error_and_exit `Configuration_error - "Could not find a suitable download command. Please make sure you \ -- have either \"curl\" or \"wget\" installed, or specify a custom \ -- command through variable OPAMFETCH." +- have %s installed, or specify a custom command through variable \ +- OPAMFETCH." +- (match os with +- | FreeBSD -> "fetch" +- | OpenBSD -> "ftp" +- | _ -> "either \"curl\" or \"wget\"") - ); + download_tool = lazy ([ CIdent SUBSTITUTE_NIXOS_CURL_PATH, None ], `Curl); validation_hook = None; diff --git a/pkgs/development/tools/ocaml/dune-release/default.nix b/pkgs/development/tools/ocaml/dune-release/default.nix index 60a9bfba58fe..4e0f8d80f780 100644 --- a/pkgs/development/tools/ocaml/dune-release/default.nix +++ b/pkgs/development/tools/ocaml/dune-release/default.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, fetchurl, makeWrapper , curly, fmt, bos, cmdliner, re, rresult, logs -, odoc, opam-format, opam-core, opam-state, yojson +, odoc, opam-format, opam-core, opam-state, yojson, astring , opam, git, findlib, mercurial, bzip2, gnutar, coreutils , alcotest, mdx }: @@ -10,18 +10,18 @@ let runtimeInputs = [ opam findlib git mercurial bzip2 gnutar coreutils ]; in buildDunePackage rec { pname = "dune-release"; - version = "1.4.0"; + version = "1.5.0"; minimumOCamlVersion = "4.06"; src = fetchurl { url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz"; - sha256 = "1frinv1rsrm30q6jclicsswpshkdwwdgxx7sp6q9w4c2p211n1ln"; + sha256 = "1lyfaczskdbqnhmpiy6wga9437frds3m8prfk2rhwyb96h69y3pv"; }; nativeBuildInputs = [ makeWrapper ]; buildInputs = [ curly fmt cmdliner re opam-format opam-state opam-core - rresult logs odoc bos yojson ]; + rresult logs odoc bos yojson astring ]; checkInputs = [ alcotest mdx ] ++ runtimeInputs; doCheck = true; @@ -32,16 +32,16 @@ in buildDunePackage rec { # to have a fixed path to the binary in nix store sed -i '/must_exist (Cmd\.v "curl"/d' lib/github.ml - # fix problems with git invocations in tests - for f in tests/bin/{delegate_info,errors,tag,no_doc,x-commit-hash}/run.t; do - # set bogus user info in git so git commit doesn't fail - sed -i '/git init/ a \ $ git config user.name test; git config user.email "pseudo@pseudo.invalid"' "$f" - # surpress hint to set default branch name - substituteInPlace "$f" --replace "git init" "git init -b main" - done - # ignore weird yes error message - sed -i 's/yes |/yes 2>\/dev\/null |/' tests/bin/no_doc/run.t + sed -i 's/yes |/yes 2>\/dev\/null |/' \ + tests/bin/no_doc/run.t \ + tests/bin/draft/run.t \ + tests/bin/url-file/run.t + ''; + + preCheck = '' + # it fails when it tries to reference "./make_check_deterministic.exe" + rm -fr tests/bin/check ''; # tool specific env vars have been deprecated, use PATH diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix index bd33d4cc1d34..eb0d284c0821 100644 --- a/pkgs/development/tools/ocaml/opam/default.nix +++ b/pkgs/development/tools/ocaml/opam/default.nix @@ -6,62 +6,74 @@ assert lib.versionAtLeast ocaml.version "4.02.3"; let srcs = { - cmdliner = fetchurl { - url = "http://erratique.ch/software/cmdliner/releases/cmdliner-1.0.2.tbz"; - sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1"; + "0install-solver" = fetchurl { + url = "https://github.com/0install/0install/releases/download/v2.17/0install-v2.17.tbz"; + sha256 = "08q95mzmf9pyyqs68ff52422f834hi313cxmypwrxmxsabcfa10p"; }; - cppo = fetchurl { - url = "https://github.com/ocaml-community/cppo/releases/download/v1.6.6/cppo-v1.6.6.tbz"; - sha256 = "185q0x54id7pfc6rkbjscav8sjkrg78fz65rgfw7b4bqlyb2j9z7"; + "cmdliner" = fetchurl { + url = "http://erratique.ch/software/cmdliner/releases/cmdliner-1.0.4.tbz"; + sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw"; }; - cudf = fetchurl { + "cppo" = fetchurl { + url = "https://github.com/ocaml-community/cppo/releases/download/v1.6.7/cppo-v1.6.7.tbz"; + sha256 = "17ajdzrnmnyfig3s6hinb56mcmhywbssxhsq32dz0v90dhz3wmfv"; + }; + "cudf" = fetchurl { url = "https://gforge.inria.fr/frs/download.php/36602/cudf-0.9.tar.gz"; sha256 = "0771lwljqwwn3cryl0plny5a5dyyrj4z6bw66ha5n8yfbpcy8clr"; }; - dose3 = fetchurl { + "dose3" = fetchurl { url = "https://gforge.inria.fr/frs/download.php/file/36063/dose3-5.0.1.tar.gz"; sha256 = "00yvyfm4j423zqndvgc1ycnmiffaa2l9ab40cyg23pf51qmzk2jm"; }; - dune-local = fetchurl { - url = "https://github.com/ocaml/dune/releases/download/1.6.3/dune-1.6.3.tbz"; - sha256 = "0dmf0wbfmgdy5plz1bjiisc2hjgblvxsnrqjmw2c8y45v1h23mdz"; + "dune-local" = fetchurl { + url = "https://github.com/ocaml/dune/releases/download/2.9.0/dune-2.9.0.tbz"; + sha256 = "07m476kgagpd6kzm3jq30yfxqspr2hychah0xfqs14z82zxpq8dv"; }; - extlib = fetchurl { + "extlib" = fetchurl { url = "https://ygrek.org/p/release/ocaml-extlib/extlib-1.7.7.tar.gz"; sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1"; }; - mccs = fetchurl { - url = "https://github.com/AltGr/ocaml-mccs/archive/1.1+11.tar.gz"; - sha256 = "0mswapf37rav8nvvbjc4c7c7wnl6qwgd3c5v0nfifmr910qygz72"; + "mccs" = fetchurl { + url = "https://github.com/AltGr/ocaml-mccs/archive/1.1+13.tar.gz"; + sha256 = "05nnji9h8mss3hzjr5faid2v3xfr7rcv2ywmpcxxp28y6h2kv9gv"; }; - ocamlgraph = fetchurl { - url = "http://ocamlgraph.lri.fr/download/ocamlgraph-1.8.8.tar.gz"; - sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr"; + "ocamlgraph" = fetchurl { + url = "https://github.com/backtracking/ocamlgraph/releases/download/2.0.0/ocamlgraph-2.0.0.tbz"; + sha256 = "029692bvdz3hxpva9a2jg5w5381fkcw55ysdi8424lyyjxvjdzi0"; }; - opam-file-format = fetchurl { - url = "https://github.com/ocaml/opam-file-format/archive/2.0.0.tar.gz"; - sha256 = "0cjw69r7iilidi7b6arr92kjnjspchvwnmwr1b1gyaxqxpr2s98m"; + "opam-0install-cudf" = fetchurl { + url = "https://github.com/ocaml-opam/opam-0install-solver/releases/download/v0.4.2/opam-0install-cudf-v0.4.2.tbz"; + sha256 = "10wma4hh9l8hk49rl8nql6ixsvlz3163gcxspay5fwrpbg51fmxr"; }; - re = fetchurl { + "opam-file-format" = fetchurl { + url = "https://github.com/ocaml/opam-file-format/archive/2.1.3.tar.gz"; + sha256 = "1bqyrlsvmjf4gqzmzbiyja9m1ph30ic9i18x23p5ziymyylw2sfg"; + }; + "re" = fetchurl { url = "https://github.com/ocaml/ocaml-re/releases/download/1.9.0/re-1.9.0.tbz"; sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj"; }; - result = fetchurl { - url = "https://github.com/janestreet/result/archive/1.4.tar.gz"; - sha256 = "1cjlncnzkwc6zr4v8dgy8nin490blbyxzwwp0qh0cla7s3q2jw0n"; + "result" = fetchurl { + url = "https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz"; + sha256 = "0cpfp35fdwnv3p30a06wd0py3805qxmq3jmcynjc3x2qhlimwfkw"; }; - seq = fetchurl { - url = "https://github.com/c-cube/seq/archive/0.1.tar.gz"; - sha256 = "02lb2d9i12bxrz2ba5wygk2bycan316skqlyri0597q7j9210g8r"; + "seq" = fetchurl { + url = "https://github.com/c-cube/seq/archive/0.2.2.tar.gz"; + sha256 = "1ck15v3pg8bacdg6d6iyp2jc3kgrzxk5jsgzx3287x2ycb897j53"; + }; + "stdlib-shims" = fetchurl { + url = "https://github.com/ocaml/stdlib-shims/releases/download/0.3.0/stdlib-shims-0.3.0.tbz"; + sha256 = "0jnqsv6pqp5b5g7lcjwgd75zqqvcwcl5a32zi03zg1kvj79p5gxs"; }; opam = fetchurl { - url = "https://github.com/ocaml/opam/archive/2.0.8.zip"; - sha256 = "1h55jh4nnx1fcn7v7ss3fgxrn6ixkgnq7pvg5njz8c9xq4njwbc1"; + url = "https://github.com/ocaml/opam/archive/2.1.0.zip"; + sha256 = "063df5gsvp4yrbqbnd8k7a1f04cf12prc5wh4f1200acs3jwjxwb"; }; }; in stdenv.mkDerivation { pname = "opam"; - version = "2.0.8"; + version = "2.1.0"; nativeBuildInputs = [ makeWrapper unzip ]; buildInputs = [ curl ncurses ocaml getconf ] ++ lib.optional stdenv.isLinux bubblewrap; @@ -69,18 +81,21 @@ in stdenv.mkDerivation { src = srcs.opam; postUnpack = '' - ln -sv ${srcs.cmdliner} $sourceRoot/src_ext/cmdliner.tbz - ln -sv ${srcs.cppo} $sourceRoot/src_ext/cppo.tbz - ln -sv ${srcs.cudf} $sourceRoot/src_ext/cudf.tar.gz - ln -sv ${srcs.dose3} $sourceRoot/src_ext/dose3.tar.gz - ln -sv ${srcs.dune-local} $sourceRoot/src_ext/dune-local.tbz - ln -sv ${srcs.extlib} $sourceRoot/src_ext/extlib.tar.gz - ln -sv ${srcs.mccs} $sourceRoot/src_ext/mccs.tar.gz - ln -sv ${srcs.ocamlgraph} $sourceRoot/src_ext/ocamlgraph.tar.gz - ln -sv ${srcs.opam-file-format} $sourceRoot/src_ext/opam-file-format.tar.gz - ln -sv ${srcs.re} $sourceRoot/src_ext/re.tbz - ln -sv ${srcs.result} $sourceRoot/src_ext/result.tar.gz - ln -sv ${srcs.seq} $sourceRoot/src_ext/seq.tar.gz + ln -sv ${srcs."0install-solver"} $sourceRoot/src_ext/0install-solver.tbz + ln -sv ${srcs."cmdliner"} $sourceRoot/src_ext/cmdliner.tbz + ln -sv ${srcs."cppo"} $sourceRoot/src_ext/cppo.tbz + ln -sv ${srcs."cudf"} $sourceRoot/src_ext/cudf.tar.gz + ln -sv ${srcs."dose3"} $sourceRoot/src_ext/dose3.tar.gz + ln -sv ${srcs."dune-local"} $sourceRoot/src_ext/dune-local.tbz + ln -sv ${srcs."extlib"} $sourceRoot/src_ext/extlib.tar.gz + ln -sv ${srcs."mccs"} $sourceRoot/src_ext/mccs.tar.gz + ln -sv ${srcs."ocamlgraph"} $sourceRoot/src_ext/ocamlgraph.tbz + ln -sv ${srcs."opam-0install-cudf"} $sourceRoot/src_ext/opam-0install-cudf.tbz + ln -sv ${srcs."opam-file-format"} $sourceRoot/src_ext/opam-file-format.tar.gz + ln -sv ${srcs."re"} $sourceRoot/src_ext/re.tbz + ln -sv ${srcs."result"} $sourceRoot/src_ext/result.tbz + ln -sv ${srcs."seq"} $sourceRoot/src_ext/seq.tar.gz + ln -sv ${srcs."stdlib-shims"} $sourceRoot/src_ext/stdlib-shims.tbz ''; patches = [ ./opam-shebangs.patch ]; @@ -118,4 +133,4 @@ in stdenv.mkDerivation { platforms = platforms.all; }; } -# Generated by: ./opam.nix.pl -v 2.0.8 -p opam-shebangs.patch +# Generated by: ./opam.nix.pl -v 2.1.0 -p opam-shebangs.patch diff --git a/pkgs/development/tools/ocaml/opam/opam-shebangs.patch b/pkgs/development/tools/ocaml/opam/opam-shebangs.patch index 13aa7a895708..72efec0a9105 100644 --- a/pkgs/development/tools/ocaml/opam/opam-shebangs.patch +++ b/pkgs/development/tools/ocaml/opam/opam-shebangs.patch @@ -2,7 +2,7 @@ diff --git a/src/client/opamInitDefaults.ml b/src/client/opamInitDefaults.ml index eca13a7c..1fd66f43 100644 --- a/src/client/opamInitDefaults.ml +++ b/src/client/opamInitDefaults.ml -@@ -35,11 +35,15 @@ let eval_variables = [ +@@ -35,14 +35,18 @@ let eval_variables = [ let os_filter os = FOp (FIdent ([], OpamVariable.of_string "os", None), `Eq, FString os) @@ -13,6 +13,9 @@ index eca13a7c..1fd66f43 100644 let macos_filter = os_filter "macos" let openbsd_filter = os_filter "openbsd" let freebsd_filter = os_filter "freebsd" + let not_open_free_bsd_filter = + FNot (FOr (openbsd_filter, freebsd_filter)) + let win32_filter = os_filter "win32" let sandbox_filter = FOr (linux_filter, macos_filter) +let nixos_filter = os_distribution_filter "nixos" diff --git a/pkgs/development/tools/ocaml/opam/opam.nix.pl b/pkgs/development/tools/ocaml/opam/opam.nix.pl index bfaea0c7ef30..c914bac8b5c6 100755 --- a/pkgs/development/tools/ocaml/opam/opam.nix.pl +++ b/pkgs/development/tools/ocaml/opam/opam.nix.pl @@ -51,7 +51,7 @@ for my $src (sort keys %urls) { system "echo \Q$md5s{$src}\E' *'\Q$store_path\E | md5sum -c 1>&2"; die "md5 check failed for $urls{$src}\n" if $?; print <<"EOF"; - $src = fetchurl { + "$src" = fetchurl { url = "$urls{$src}"; sha256 = "$sha256"; }; @@ -68,8 +68,8 @@ in stdenv.mkDerivation { pname = "opam"; version = "$OPAM_RELEASE"; - nativeBuildInputs = [ unzip ]; - buildInputs = [ curl ncurses ocaml makeWrapper getconf ] ++ lib.optional stdenv.isLinux bubblewrap; + nativeBuildInputs = [ makeWrapper unzip ]; + buildInputs = [ curl ncurses ocaml getconf ] ++ lib.optional stdenv.isLinux bubblewrap; src = srcs.opam; @@ -79,7 +79,7 @@ for my $src (sort keys %urls) { my($ext) = $urls{$src} =~ /(\.(?:t(?:ar\.|)|)(?:gz|bz2?))$/ or die "could not find extension for $urls{$src}\n"; print <<"EOF"; - ln -sv \${srcs.$src} \$sourceRoot/src_ext/$src$ext + ln -sv \${srcs."$src"} \$sourceRoot/src_ext/$src$ext EOF } print <<'EOF';