Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 37 additions & 38 deletions pkgs/build-support/ocaml/oasis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,47 @@
...
}@args:

if args ? minimumOCamlVersion && lib.versionOlder ocaml.version args.minimumOCamlVersion then
throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation (
args
// {
name = "ocaml${ocaml.version}-${pname}-${version}";

stdenv.mkDerivation (
args
// {
name = "ocaml${ocaml.version}-${pname}-${version}";
nativeBuildInputs = [
ocaml
findlib
ocamlbuild
ocaml_oasis
]
++ nativeBuildInputs;

nativeBuildInputs = [
ocaml
findlib
ocamlbuild
ocaml_oasis
]
++ nativeBuildInputs;
inherit createFindlibDestdir;
inherit dontStrip;

inherit createFindlibDestdir;
inherit dontStrip;
strictDeps = true;

strictDeps = true;
buildPhase = ''
runHook preBuild
oasis setup
ocaml setup.ml -configure --prefix $OCAMLFIND_DESTDIR --exec-prefix $out
ocaml setup.ml -build
runHook postBuild
'';

buildPhase = ''
runHook preBuild
oasis setup
ocaml setup.ml -configure --prefix $OCAMLFIND_DESTDIR --exec-prefix $out
ocaml setup.ml -build
runHook postBuild
'';
checkPhase = ''
runHook preCheck
ocaml setup.ml -test
runHook postCheck
'';

checkPhase = ''
runHook preCheck
ocaml setup.ml -test
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out
ocaml setup.ml -install
runHook postInstall
'';

installPhase = ''
runHook preInstall
mkdir -p $out
ocaml setup.ml -install
runHook postInstall
'';

}
)
meta = args.meta // {
broken = args ? minimumOCamlVersion && lib.versionOlder ocaml.version args.minimumOCamlVersion;
};
}
)
131 changes: 64 additions & 67 deletions pkgs/by-name/li/libnbd/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,83 +16,80 @@
autoreconfHook,
}:

lib.throwIf (buildOcamlBindings && !lib.versionAtLeast ocamlPackages.ocaml.version "4.05")
"OCaml binding are not available for OCaml < 4.05"
stdenv.mkDerivation rec {
pname = "libnbd";
version = "1.22.1";

stdenv.mkDerivation
rec {
pname = "libnbd";
version = "1.22.1";
src = fetchurl {
url = "https://download.libguestfs.org/libnbd/${lib.versions.majorMinor version}-stable/${pname}-${version}.tar.gz";
hash = "sha256-9oVJrU2YcXGnKaDf8SoHKGtG7vpH5355/DKIiYrchHI=";
};

src = fetchurl {
url = "https://download.libguestfs.org/libnbd/${lib.versions.majorMinor version}-stable/${pname}-${version}.tar.gz";
hash = "sha256-9oVJrU2YcXGnKaDf8SoHKGtG7vpH5355/DKIiYrchHI=";
};

nativeBuildInputs = [
bash-completion
pkg-config
perl
autoreconfHook
nativeBuildInputs = [
bash-completion
pkg-config
perl
autoreconfHook
]
++ lib.optionals buildPythonBindings [ python3 ]
++ lib.optionals buildOcamlBindings (
with ocamlPackages;
[
findlib
ocaml
]
++ lib.optionals buildPythonBindings [ python3 ]
++ lib.optionals buildOcamlBindings (
with ocamlPackages;
[
findlib
ocaml
]
);
);

buildInputs = [
fuse
fuse3
gnutls
libxml2
];
buildInputs = [
fuse
fuse3
gnutls
libxml2
];

postPatch = lib.optionalString buildOcamlBindings ''
substituteInPlace ocaml/Makefile.am \
--replace-fail '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib'
'';
postPatch = lib.optionalString buildOcamlBindings ''
substituteInPlace ocaml/Makefile.am \
--replace-fail '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib'
'';

configureFlags = lib.optionals buildPythonBindings [
"--with-python-installdir=${placeholder "out"}/${python3.sitePackages}"
];
configureFlags = lib.optionals buildPythonBindings [
"--with-python-installdir=${placeholder "out"}/${python3.sitePackages}"
];

installFlags = [ "bashcompdir=$(out)/share/bash-completion/completions" ];
installFlags = [ "bashcompdir=$(out)/share/bash-completion/completions" ];

postInstall = lib.optionalString buildPythonBindings ''
LIBNBD_PYTHON_METADATA='${placeholder "out"}/${python3.sitePackages}/nbd-${version}.dist-info/METADATA'
install -Dm644 -T ${./libnbd-metadata} $LIBNBD_PYTHON_METADATA
substituteAllInPlace $LIBNBD_PYTHON_METADATA
'';
postInstall = lib.optionalString buildPythonBindings ''
LIBNBD_PYTHON_METADATA='${placeholder "out"}/${python3.sitePackages}/nbd-${version}.dist-info/METADATA'
install -Dm644 -T ${./libnbd-metadata} $LIBNBD_PYTHON_METADATA
substituteAllInPlace $LIBNBD_PYTHON_METADATA
'';

meta = with lib; {
homepage = "https://gitlab.com/nbdkit/libnbd";
description = "Network Block Device client library in userspace";
longDescription = ''
NBD — Network Block Device — is a protocol for accessing Block Devices
(hard disks and disk-like things) over a Network. This is the NBD client
library in userspace, a simple library for writing NBD clients.
meta = with lib; {
homepage = "https://gitlab.com/nbdkit/libnbd";
description = "Network Block Device client library in userspace";
longDescription = ''
NBD — Network Block Device — is a protocol for accessing Block Devices
(hard disks and disk-like things) over a Network. This is the NBD client
library in userspace, a simple library for writing NBD clients.

The key features are:
- Synchronous API for ease of use.
- Asynchronous API for writing non-blocking, multithreaded clients. You
can mix both APIs freely.
- High performance.
- Minimal dependencies for the basic library.
- Well-documented, stable API.
- Bindings in several programming languages.
- Shell (nbdsh) for command line and scripting.
'';
license = with licenses; lgpl21Plus;
maintainers = with maintainers; [
humancalico
];
platforms = with platforms; linux;
};
}
The key features are:
- Synchronous API for ease of use.
- Asynchronous API for writing non-blocking, multithreaded clients. You
can mix both APIs freely.
- High performance.
- Minimal dependencies for the basic library.
- Well-documented, stable API.
- Bindings in several programming languages.
- Shell (nbdsh) for command line and scripting.
'';
license = with licenses; lgpl21Plus;
maintainers = with maintainers; [
humancalico
];
platforms = with platforms; linux;
broken = buildOcamlBindings && !lib.versionAtLeast ocamlPackages.ocaml.version "4.05";
};
}
# TODO: package the 1.6-stable version too
# TODO: git version needs ocaml
# TODO: bindings for go
109 changes: 53 additions & 56 deletions pkgs/development/compilers/mezzo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,66 @@
functory,
}:

if lib.versionAtLeast ocaml.version "4.06" then
throw "mezzo is not available for OCaml ${ocaml.version}"
else
let
check-ocaml-version = lib.versionAtLeast (lib.getVersion ocaml);
in

let
check-ocaml-version = lib.versionAtLeast (lib.getVersion ocaml);
in
assert check-ocaml-version "4";

assert check-ocaml-version "4";
stdenv.mkDerivation {

stdenv.mkDerivation {
pname = "mezzo";
version = "0.0.m8";

pname = "mezzo";
version = "0.0.m8";
src = fetchFromGitHub {
owner = "protz";
repo = "mezzo";
rev = "m8";
sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
};

src = fetchFromGitHub {
owner = "protz";
repo = "mezzo";
rev = "m8";
sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
};
strictDeps = true;

strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
ocamlbuild
camlp4
menhir
];
buildInputs = [
yojson
menhirLib
ulex
pprint
fix
functory
ocamlbuild
];

nativeBuildInputs = [
ocaml
findlib
ocamlbuild
camlp4
menhir
];
buildInputs = [
yojson
menhirLib
ulex
pprint
fix
functory
ocamlbuild
];

# Sets warning 3 as non-fatal
prePatch =
lib.optionalString (check-ocaml-version "4.02") ''
substituteInPlace myocamlbuild.pre.ml \
--replace '@1..3' '@1..2+3'
''
# Compatibility with PPrint ≥ 20220103
+ ''
substituteInPlace typing/Fact.ml --replace PPrintOCaml PPrint.OCaml
'';
# Sets warning 3 as non-fatal
prePatch =
lib.optionalString (check-ocaml-version "4.02") ''
substituteInPlace myocamlbuild.pre.ml \
--replace '@1..3' '@1..2+3'
''
# Compatibility with PPrint ≥ 20220103
+ ''
substituteInPlace typing/Fact.ml --replace PPrintOCaml PPrint.OCaml
'';

createFindlibDestdir = true;
createFindlibDestdir = true;

postInstall = ''
mkdir $out/bin
cp mezzo $out/bin/
'';
postInstall = ''
mkdir $out/bin
cp mezzo $out/bin/
'';

meta = with lib; {
homepage = "http://protz.github.io/mezzo/";
description = "Programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
license = licenses.gpl2;
platforms = ocaml.meta.platforms or [ ];
};
}
meta = with lib; {
homepage = "http://protz.github.io/mezzo/";
description = "Programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
license = licenses.gpl2;
broken = lib.versionAtLeast ocaml.version "4.06";
platforms = ocaml.meta.platforms or [ ];
};
}
Loading
Loading