about summary refs log tree commit diff
path: root/pkgs/by-name/re
diff options
context:
space:
mode:
authorAnthony Roussel <anthony@roussel.dev>2024-04-06 14:25:52 +0200
committerAnthony Roussel <anthony@roussel.dev>2024-04-06 14:25:52 +0200
commit9773be3a4ed56d46e482131c9460cab983b8dca1 (patch)
tree8ed9e8e98e1a3dcbec2e2c3490ee7e4a6f08006a /pkgs/by-name/re
parent5bcb08ea0326908bee7ffda009d46da7da1f2668 (diff)
realmd: init at 0.17.1
Diffstat (limited to 'pkgs/by-name/re')
-rw-r--r--pkgs/by-name/re/realmd/package.nix80
-rw-r--r--pkgs/by-name/re/realmd/remove-tap-driver.patch40
2 files changed, 120 insertions, 0 deletions
diff --git a/pkgs/by-name/re/realmd/package.nix b/pkgs/by-name/re/realmd/package.nix
new file mode 100644
index 0000000000000..4757931926a3f
--- /dev/null
+++ b/pkgs/by-name/re/realmd/package.nix
@@ -0,0 +1,80 @@
+{
+  autoreconfHook,
+  fetchFromGitLab,
+  glib,
+  lib,
+  libkrb5,
+  nix-update-script,
+  openldap,
+  pkg-config,
+  polkit,
+  samba,
+  stdenv,
+  systemdLibs,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "realmd";
+  version = "0.17.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "realmd";
+    repo = "realmd";
+    rev = "refs/tags/${finalAttrs.version}";
+    hash = "sha256-lmNlrXOOUSDk/8H/ge0IRA64bnau9nYUIkW6OyVxbBg=";
+  };
+
+  patches = [
+    # Remove unused tap driver/valgrind checks to make tests work
+    ./remove-tap-driver.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    libkrb5
+    openldap
+    polkit
+    samba
+    systemdLibs
+  ];
+
+  configureFlags = [
+    "--sysconfdir=${placeholder "out"}/etc"
+    "--with-private-dir=${placeholder "out"}/lib/realmd"
+    "--with-systemd-unit-dir=${placeholder "out"}/lib/systemd/system"
+
+    # realmd doesn't fails without proper defaults and distro configuration files
+    # These settings will be overriden by the NixOS module
+    "--with-distro=redhat"
+
+    # Documentation is disabled
+    # We need to run gdbus-codegen & xmlto in **offline mode** to make it work
+    # See https://github.com/NixOS/nixpkgs/pull/301631
+    "--disable-doc"
+  ];
+
+  hardeningDisable = [
+    # causes redefinition of _FORTIFY_SOURCE
+    "fortify3"
+  ];
+
+  doCheck = true;
+
+  passthru.updateScript = nix-update-script { };
+
+  meta = {
+    changelog = "https://gitlab.freedesktop.org/realmd/realmd/-/blob/${finalAttrs.version}/NEWS";
+    description = "DBus service for configuring Kerberos and other online identities";
+    homepage = "https://gitlab.freedesktop.org/realmd/realmd";
+    license = lib.licenses.lgpl21Only;
+    mainProgram = "realm";
+    maintainers = [ lib.maintainers.anthonyroussel ];
+    platforms = lib.platforms.linux;
+  };
+})
diff --git a/pkgs/by-name/re/realmd/remove-tap-driver.patch b/pkgs/by-name/re/realmd/remove-tap-driver.patch
new file mode 100644
index 0000000000000..162703d9b9663
--- /dev/null
+++ b/pkgs/by-name/re/realmd/remove-tap-driver.patch
@@ -0,0 +1,40 @@
+diff --git a/Makefile.am b/Makefile.am
+index 1df20d1..b355d59 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -152,35 +152,6 @@ uninstall-doc:
+ 	@true
+ endif
+
+-# ------------------------------------------------------------
+-# Testing
+-#
+-
+-LOG_DRIVER = $(top_srcdir)/build/tap-driver
+-LOG_COMPILER = sh -c '"$$0" "$$@" --tap'
+-
+-VALGRIND_ARGS = --trace-children=no --quiet --error-exitcode=33 \
+-	--suppressions=valgrind-suppressions --gen-suppressions=all \
+-	--num-callers=16
+-
+-VALGRIND_SUPPRESSIONS = \
+-	build/glib.supp \
+-	$(NULL)
+-
+-valgrind-suppressions: $(VALGRIND_SUPPRESSIONS)
+-	$(AM_V_GEN) cat $^ > $@
+-
+-check-memory: valgrind-suppressions
+-	$(MAKE) LOG_FLAGS="-- libtool --mode=execute valgrind $(VALGRIND_ARGS)" \
+-		$(AM_MAKEFLAGS) check
+-recheck-memory: valgrind-suppressions
+-	$(MAKE) LOG_FLAGS="-- libtool --mode=execute valgrind $(VALGRIND_ARGS)" \
+-		$(AM_MAKEFLAGS) recheck
+-
+-EXTRA_DIST += \
+-	$(LOG_DRIVER) \
+-	$(VALGRIND_SUPPRESSIONS) \
+-	$(NULL)
+
+ if WITH_COVERAGE
+ coverage: