From 9773be3a4ed56d46e482131c9460cab983b8dca1 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sat, 6 Apr 2024 14:25:52 +0200 Subject: [PATCH] realmd: init at 0.17.1 --- pkgs/by-name/re/realmd/package.nix | 80 +++++++++++++++++++ .../by-name/re/realmd/remove-tap-driver.patch | 40 ++++++++++ 2 files changed, 120 insertions(+) create mode 100644 pkgs/by-name/re/realmd/package.nix create mode 100644 pkgs/by-name/re/realmd/remove-tap-driver.patch diff --git a/pkgs/by-name/re/realmd/package.nix b/pkgs/by-name/re/realmd/package.nix new file mode 100644 index 000000000000..4757931926a3 --- /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 000000000000..162703d9b966 --- /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: