build: Added nix build for the library.

This commit is contained in:
2026-07-08 17:21:03 -04:00
parent 039df7aeb6
commit 87772cb5b6
2 changed files with 42 additions and 3 deletions
+39 -1
View File
@@ -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;