diff --git a/pkgs/servers/mail/opensmtpd/libopensmtpd/default.nix b/pkgs/servers/mail/opensmtpd/libopensmtpd/default.nix new file mode 100644 index 000000000000..f740a12e53f5 --- /dev/null +++ b/pkgs/servers/mail/opensmtpd/libopensmtpd/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, fetchurl +, libevent +, mandoc +}: +stdenv.mkDerivation rec { + pname = "libopensmtpd"; + version = "0.7"; + + src = fetchurl { + url = "https://imperialat.at/releases/libopensmtpd-${version}.tar.gz"; + hash = "sha256-zdbV4RpwY/kmXaQ6QjCcZGVUuLaLA5gsqEctvisIphM="; + }; + + patches = [ ./no-chown-while-installing.patch ]; + + buildInputs = [ libevent ]; + + nativeBuildInputs = [ mandoc ]; + + makeFlags = [ + "-f Makefile.gnu" + "DESTDIR=$(out)" + "LOCALBASE=" + ]; + + meta = with lib; { + description = "Library for creating OpenSMTPD filters"; + homepage = "http://imperialat.at/dev/libopensmtpd/"; + license = licenses.isc; + maintainers = with maintainers; [ malvo ]; + }; +} diff --git a/pkgs/servers/mail/opensmtpd/libopensmtpd/no-chown-while-installing.patch b/pkgs/servers/mail/opensmtpd/libopensmtpd/no-chown-while-installing.patch new file mode 100644 index 000000000000..52d8b3e2d01f --- /dev/null +++ b/pkgs/servers/mail/opensmtpd/libopensmtpd/no-chown-while-installing.patch @@ -0,0 +1,38 @@ +diff --git a/Makefile.gnu b/Makefile.gnu +index b4bcaef..981721c 100644 +--- a/Makefile.gnu ++++ b/Makefile.gnu +@@ -27,7 +27,7 @@ SYMBOL_LIST= ${CURDIR}/Symbols.list + includes: + @cd ${CURDIR}; for i in ${HDRS}; do \ + j="cmp -s $$i ${DESTDIR}${LOCALBASE}/include/$$i || \ +- ${INSTALL} -D -o ${BINOWN} -g ${BINGRP} -m 444 $$i\ ++ ${INSTALL} -D -m 444 $$i\ + ${DESTDIR}${LOCALBASE}/include/$$i"; \ + echo $$j; \ + eval "$$j"; \ +@@ -52,11 +52,7 @@ MANFORMAT?= mangz + INSTALL?= install + LINK?= ln + +-BINOWN?= root +-BINGRP?= root + LIBPERM?= 755 +-MANOWN?= root +-MANGRP?= root + MANPERM?= 644 + + include ${CURDIR}/shlib_version +@@ -138,10 +134,10 @@ all: ${TARGET_LIB} ${TARGET_MAN} + + .PHONY: install + install: includes ${TARGET_LIB} ${TARGET_MAN} +- ${INSTALL} -D -o ${BINOWN} -g ${BINGRP} -m ${LIBPERM} ${TARGET_LIB} ${DESTDIR}${LIBDIR}/${TARGET_LIB} ++ ${INSTALL} -D -m ${LIBPERM} ${TARGET_LIB} ${DESTDIR}${LIBDIR}/${TARGET_LIB} + ${LINK} -s ${TARGET_LIB} ${DESTDIR}${LIBDIR}/${SONAME_LIB} + ${LINK} -s ${TARGET_LIB} ${DESTDIR}${LIBDIR}/${BASE_LIB} +- ${INSTALL} -D -o ${MANOWN} -g ${MANGRP} -m ${MANPERM} ${TARGET_MAN} ${DESTDIR}${MANDIR}/${TARGET_MAN} ++ ${INSTALL} -D -m ${MANPERM} ${TARGET_MAN} ${DESTDIR}${MANDIR}/${TARGET_MAN} + + CLEANFILES+= *.o ${TARGET_LIB} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9d0f42e685fa..55817e7aaed1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22085,6 +22085,7 @@ with pkgs; opensmtpd = callPackage ../servers/mail/opensmtpd { }; opensmtpd-extras = callPackage ../servers/mail/opensmtpd/extras.nix { }; opensmtpd-filter-rspamd = callPackage ../servers/mail/opensmtpd/filter-rspamd.nix { }; + libopensmtpd = callPackage ../servers/mail/opensmtpd/libopensmtpd { }; openxr-loader = callPackage ../development/libraries/openxr-loader { };