Skip to content

Commit

Permalink
[WIP] Add nix shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoo1 committed Aug 15, 2021
1 parent a5a92a0 commit 3ec1edf
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let
# 2021-08-15
nix-rev = "3ab8ce12c2db31268f579c11727d9c63cfee2eee";
nix-src = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${nix-rev}.tar.gz";
sha256 = "13fx0yb95gxyk0jyvgrxv2yp4fj54g7nzrlvjfc8slx9ccqd2v86";
};
in import nix-src {
overrides = [
(self: super: {
ocaml = self.ocaml_4_03;
ocamlPackages = super.ocamlPackages.overrideAttrs
(attrs: attrs // { ocaml = self.ocaml_4_03; });
})
];
}
52 changes: 52 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
let
pkgs = import ./pin.nix;
ocaml-xkbcommon = pkgs.ocamlPackages.buildDunePackage {
pname = "xkbcommon";
version = "0.1";
minimumOcamlVersion = "4.04";
useDune2 = true;
src = pkgs.fetchFromGitHub {
owner = "Armael";
repo = "ocaml-xkbcommon";
rev = "af0cd8c938938db3e67b65ac13b6444102756ba0";
sha256 = "0zh80aczdn821xkwjn8m74mjcqb6f1hj0qfh1kxrz2z9h5as2r8k";
};
buildInputs = [ pkgs.libxkbcommon pkgs.ocamlPackages.dune-configurator ];
propagatedBuildInputs = [
pkgs.ocamlPackages.ctypes
pkgs.ocamlPackages.base
pkgs.ocamlPackages.stdio
pkgs.libxkbcommon
];
meta = {
homepage = "https://github.com/Armael/ocaml-xkbcommon";
synopsis = "OCaml bindings to xkbcommon";
description = "This package provides OCaml bindings to xkbcommon";
maintainers = [ ];
};
};
ocaml-unix-time = pkgs.callPackage (import ./unix-time.nix) { };
in pkgs.mkShell {
name = "wlroots-ocaml-shell";
propagatedNativeBuildInputs = [
pkgs.ocamlPackages.ctypes
pkgs.ocamlPackages.dune-configurator
pkgs.ocamlPackages.mtime
ocaml-unix-time
ocaml-xkbcommon
];
nativeBuildInputs = [
pkgs.dune_2
pkgs.ocamlPackages.findlib
# Should be put upstream as an input for wlroots
pkgs.libudev
pkgs.m4
pkgs.ocaml
pkgs.pixman
pkgs.pkg-config
pkgs.less
pkgs.wayland
pkgs.wayland-protocols
pkgs.wlroots
];
}
27 changes: 27 additions & 0 deletions unix-time.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ ocamlPackages, fetchFromGitHub }:
ocamlPackages.buildOcaml rec {
name = "unix-time";
version = "0.1.0";
minimumOcamlVersion = "4.04";
src = fetchFromGitHub {
owner = "dsheets";
repo = "ocaml-unix-time";
rev = version;
sha256 = "0000000000000000000000000000000000000000000000000000";
};
doCheck = true;
nativeBuildInputs = [ ocamlPackages.alcotest ocamlPackages.ctypes ];
propagatedBuildInputs = [ ocamlPackages.unix-errno ocamlPackages.base-unix ];
meta = {
homepage = "https://github.com/dsheets/ocaml-unix-time";
synopsis = "Unix time.h types, maps, and support";
description = ''
unix-time provides access to the features exposed in time.h in a way
that is not tied to the implementation on the host system.
The Time module provides types which are analogous to those defined in
time.h such as timespec.
The Time_unix module provides a ctypes view for timespec.
'';
maintainers = [ ];
};
}

0 comments on commit 3ec1edf

Please sign in to comment.