Skip to content

Commit b5f628c

Browse files
committed
moira: Add moira packaging
1 parent e95559e commit b5f628c

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ in
2626
inherit athena-pkgs;
2727
# linkFarmFromDrvs is undocumented, but the source is at
2828
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders/default.nix#L578
29-
default = pkgs.linkFarmFromDrvs "nixathena-pkgs" (with athena-pkgs; [ discuss pyhesiodfs remctl athena-python3 ]);
29+
default = pkgs.linkFarmFromDrvs "nixathena-pkgs" (with athena-pkgs; [ discuss pyhesiodfs remctl moira athena-python3 ]);
3030
debathena-aclocal = athena-pkgs.debathena-aclocal;
3131
discuss = athena-pkgs.discuss;
3232
python-discuss = athena-pkgs.python-discuss;
3333
python-afs = athena-pkgs.python-afs;
3434
python-hesiod = athena-pkgs.python-hesiod;
3535
pyhesiodfs = athena-pkgs.pyhesiodfs;
3636
remctl = athena-pkgs.remctl;
37+
moira = athena-pkgs.moira;
3738
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
3839
# ...
3940
athena-python3 = athena-python3;

pkgs/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ in rec
1313
locker-support = ps: ps.callPackage ./locker-support.nix { inherit python-afs python-hesiod; };
1414
pyhesiodfs = pkgs.callPackage ./pyhesiodfs.nix { inherit python-hesiod locker-support; };
1515
remctl = pkgs.callPackage ./remctl.nix { };
16+
moira = pkgs.callPackage ./moira.nix { inherit hesiod; };
1617
# https://ryantm.github.io/nixpkgs/builders/images/dockertools/
1718
# docker = pkgs.dockerTools.buildLayeredImage {
1819
# name = "${dockerName}";

pkgs/moira.nix

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{ stdenv, pkgs, lib,
2+
fetchFromGitHub, autoreconfHook, pkg-config,
3+
libkrb5, openafs, readline, ncurses, openssl, termcap,
4+
hesiod,
5+
}:
6+
7+
let
8+
fs = lib.fileset;
9+
in stdenv.mkDerivation rec {
10+
pname = "moira";
11+
version = "4.2.4.0";
12+
13+
# Ideally we'd use the github.mit.edu version, but that requires auth
14+
# https://github.mit.edu/ops/moira
15+
src = fetchFromGitHub {
16+
owner = "mit-athena";
17+
repo = "moira";
18+
rev = "${version}";
19+
hash = "sha256-joO8n3jocmL/JqOkt47jnN3dvmtoZGwk+Ixd+ChDcss=";
20+
};
21+
sourceRoot = "source/moira";
22+
23+
meta = with lib; {
24+
description = "Athena Service Management system";
25+
homepage = "https://github.com/mit-athena/moira";
26+
platforms = platforms.linux;
27+
};
28+
29+
buildInputs = [
30+
autoreconfHook
31+
libkrb5
32+
readline
33+
ncurses
34+
openssl
35+
openafs
36+
termcap
37+
hesiod
38+
];
39+
nativeBuildInputs = [
40+
];
41+
42+
# I don't understand why upstream is happy with the existing Makefile.in, but
43+
# it doesn't build without this patch for me (it looks like the files are in
44+
# .libs but not found). It does feel more correct to pass in $(OBJS) than to
45+
# just assume that the object files are $(TARGET).o -- note that e.g.
46+
# `blanche` already looks like this, so there's inconsistency between files.
47+
patchPhase = ''
48+
sed -ie 's#$(LDFLAGS) [email protected] $(LIBS)#$(LDFLAGS) $(OBJS) $(LIBS)#' clients/*/Makefile.in
49+
'';
50+
51+
#configureFlags = ["--without-krb4" "--with-krb5" "--with-zephyr"];
52+
configureFlags = [
53+
"--without-krb4" "--with-krb5" "--without-zephyr" "--with-hesiod" "--with-afs" "--with-readline" "--with-com_err=${libkrb5.out}"
54+
];
55+
}

0 commit comments

Comments
 (0)