Skip to content

Commit

Permalink
Upgrade to new opam packages
Browse files Browse the repository at this point in the history
  • Loading branch information
rizo committed Jul 24, 2024
1 parent 5c6ec46 commit c2ed6bd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
17 changes: 17 additions & 0 deletions nix/onixPackages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
})
20 changes: 20 additions & 0 deletions nix/onixPackages/spdx_licenses.nix
Original file line number Diff line number Diff line change
@@ -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 = [ ];
};
}
20 changes: 20 additions & 0 deletions nix/onixPackages/swhid_core.nix
Original file line number Diff line number Diff line change
@@ -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 = [ ];
};
}
4 changes: 2 additions & 2 deletions src/onix_core/System.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down

0 comments on commit c2ed6bd

Please sign in to comment.