mirror of
https://github.com/sbrow/zomq.git
synced 2026-08-26 10:53:32 -04:00
build: Added nix build for the library.
This commit is contained in:
@@ -27,7 +27,45 @@
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
perSystem =
|
||||
{ pkgs, system, inputs', ... }: {
|
||||
{ pkgs, system, inputs', ... }:
|
||||
let
|
||||
zomq = pkgs.stdenv.mkDerivation {
|
||||
pname = "zomq";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = [ pkgs.odin ];
|
||||
buildInputs = [ pkgs.zeromq ];
|
||||
|
||||
dontConfigure = true;
|
||||
doCheck = true;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
odin build . -build-mode:lib -o:speed -out:libzomq
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
odin test . -all-packages
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm644 libzomq.a $out/lib/libzomq.a
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "libzmq bindings for odin";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
};
|
||||
in {
|
||||
packages.default = zomq;
|
||||
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
|
||||
Reference in New Issue
Block a user