diff --git a/nix/onixPackages/default.nix b/nix/onixPackages/default.nix index 67781f1..13c68a8 100644 --- a/nix/onixPackages/default.nix +++ b/nix/onixPackages/default.nix @@ -7,5 +7,22 @@ ocamlPackages.overrideScope (self: super: { yojson = super.yojson.overrideAttrs (_: { doCheck = false; }); uri = super.uri.overrideAttrs (_: { doCheck = false; }); angstrom = super.angstrom.overrideAttrs (_: { doCheck = false; }); + opam-repository = super.opam-repository.overrideAttrs (_: { + configureFlags = [ + "--disable-checks" + ]; + doCheck = false; + }); logs = super.logs.override { jsooSupport = false; }; + opam-core = super.opam-core.overrideAttrs (attrs: { + propagatedBuildInputs = attrs.propagatedBuildInputs ++ [ + ocamlPackages.uutf + ocamlPackages.jsonm + ocamlPackages.sha + self.swhid_core + self.spdx_licenses + ]; + }); + swhid_core = self.callPackage ./swhid_core.nix {}; + spdx_licenses = self.callPackage ./spdx_licenses.nix {}; }) diff --git a/nix/onixPackages/spdx_licenses.nix b/nix/onixPackages/spdx_licenses.nix new file mode 100644 index 0000000..dc1dd08 --- /dev/null +++ b/nix/onixPackages/spdx_licenses.nix @@ -0,0 +1,20 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "spdx_licenses"; + version = "1.2.0"; + useDune2 = true; + + src = fetchurl { + url = + "https://github.com/kit-ty-kate/spdx_licenses/releases/download/v1.2.0/spdx_licenses-1.2.0.tar.gz"; + sha256 = "sha256-9ViB7PRDz70w3RJczapgn2tJx9wTWgAbdzos6r3J2r4="; + }; + + meta = with lib; { + description = "spdx_licenses"; + homepage = "https://github.com/kit-ty-kate/spdx_licenses"; + license = licenses.mit; + maintainers = [ ]; + }; +} diff --git a/nix/onixPackages/swhid_core.nix b/nix/onixPackages/swhid_core.nix new file mode 100644 index 0000000..678eb60 --- /dev/null +++ b/nix/onixPackages/swhid_core.nix @@ -0,0 +1,20 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "swhid_core"; + version = "0.1"; + useDune2 = true; + + src = fetchurl { + url = + "https://github.com/OCamlPro/swhid_core/archive/refs/tags/0.1.tar.gz"; + sha256 = "sha256-hxi065fJ8KzW2RYqnvovavgkdKC9GG9iL9oylPdzvM8="; + }; + + meta = with lib; { + description = "swhid_core"; + homepage = "https://github.com/OCamlPro/swhid_core"; + license = licenses.isc; + maintainers = [ ]; + }; +} diff --git a/src/onix_core/System.ml b/src/onix_core/System.ml index 1dc6174..e0c11f9 100644 --- a/src/onix_core/System.ml +++ b/src/onix_core/System.ml @@ -13,8 +13,8 @@ let os_list = ["linux"; "macos"] let arch_list = ["x86_64"; "arm64"] let host = - let arch = OpamSysPoll.arch () in - let os = OpamSysPoll.os () in + let arch = OpamSysPoll.arch OpamVariable.Map.empty in + let os = OpamSysPoll.os OpamVariable.Map.empty in match (arch, os) with | Some arch, Some os -> { arch; os } | Some _, None -> failwith "could not get host's 'os'"