2022-09-30 01:58:47 +00:00
|
|
|
{ gnustep, lib, fetchFromGitHub, fetchpatch, makeWrapper, python3, lndir, libxcrypt
|
2021-12-06 23:19:07 +00:00
|
|
|
, openssl, openldap, sope, libmemcached, curl, libsodium, libytnef, libzip, pkg-config, nixosTests
|
2022-07-18 13:28:05 +00:00
|
|
|
, oath-toolkit
|
|
|
|
, enableActiveSync ? false
|
|
|
|
, libwbxml }:
|
2021-08-19 15:22:47 +00:00
|
|
|
gnustep.stdenv.mkDerivation rec {
|
2020-02-03 17:50:49 +00:00
|
|
|
pname = "SOGo";
|
2023-12-23 11:42:55 +00:00
|
|
|
version = "5.9.1";
|
2020-02-03 17:50:49 +00:00
|
|
|
|
2023-11-28 12:30:46 +00:00
|
|
|
# always update the sope package as well, when updating sogo
|
2020-02-03 17:50:49 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "inverse-inc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "SOGo-${version}";
|
2023-12-23 11:42:55 +00:00
|
|
|
hash = "sha256-b6BZZ61wY0Akt1Q6+Bq6JXAx/67MwBNbzHr3sB0NuRg=";
|
2020-02-03 17:50:49 +00:00
|
|
|
};
|
|
|
|
|
2022-09-25 02:49:25 +00:00
|
|
|
nativeBuildInputs = [ gnustep.make makeWrapper python3 pkg-config ];
|
2022-09-30 01:58:47 +00:00
|
|
|
buildInputs = [ gnustep.base sope openssl libmemcached curl libsodium libytnef libzip openldap oath-toolkit libxcrypt ]
|
2022-07-18 13:28:05 +00:00
|
|
|
++ lib.optional enableActiveSync libwbxml;
|
|
|
|
|
|
|
|
patches = lib.optional enableActiveSync ./enable-activesync.patch;
|
2020-02-03 17:50:49 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Exclude NIX_ variables
|
|
|
|
sed -i 's/grep GNUSTEP_/grep ^GNUSTEP_/g' configure
|
|
|
|
|
|
|
|
# Disable argument verification because $out is not a GNUStep prefix
|
|
|
|
sed -i 's/^validateArgs$//g' configure
|
|
|
|
|
|
|
|
# Patch exception-generating python scripts
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
# Move all GNUStep makefiles to a common directory
|
|
|
|
mkdir -p makefiles
|
|
|
|
cp -r {${gnustep.make},${sope}}/share/GNUstep/Makefiles/* makefiles
|
|
|
|
|
|
|
|
# Modify the search path for GNUStep makefiles
|
|
|
|
find . -type f -name GNUmakefile -exec sed -i "s:\\$.GNUSTEP_MAKEFILES.:$PWD/makefiles:g" {} +
|
|
|
|
'';
|
|
|
|
|
2021-12-06 23:19:07 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-debug"
|
|
|
|
"--with-ssl=ssl"
|
|
|
|
"--enable-mfa"
|
|
|
|
];
|
2020-02-03 17:50:49 +00:00
|
|
|
|
2023-11-30 11:57:19 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=int-conversion -Wno-error=implicit-int";
|
|
|
|
|
2020-02-03 17:50:49 +00:00
|
|
|
preFixup = ''
|
|
|
|
# Create gnustep.conf
|
|
|
|
mkdir -p $out/share/GNUstep
|
|
|
|
cp ${gnustep.make}/etc/GNUstep/GNUstep.conf $out/share/GNUstep/
|
|
|
|
sed -i "s:${gnustep.make}:$out:g" $out/share/GNUstep/GNUstep.conf
|
|
|
|
|
|
|
|
# Link in GNUstep base
|
2022-12-23 17:53:54 +00:00
|
|
|
${lndir}/bin/lndir ${lib.getLib gnustep.base}/lib/GNUstep/ $out/lib/GNUstep/
|
2020-02-03 17:50:49 +00:00
|
|
|
|
|
|
|
# Link in sope
|
|
|
|
${lndir}/bin/lndir ${sope}/ $out/
|
|
|
|
|
|
|
|
# sbin fixup
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv $out/sbin/* $out/bin
|
|
|
|
rmdir $out/sbin
|
|
|
|
|
|
|
|
# Make sogo find its files
|
|
|
|
for bin in $out/bin/*; do
|
|
|
|
wrapProgram $bin --prefix LD_LIBRARY_PATH : $out/lib/sogo --prefix GNUSTEP_CONFIG_FILE : $out/share/GNUstep/GNUstep.conf
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-06-13 10:12:28 +00:00
|
|
|
passthru.tests.sogo = nixosTests.sogo;
|
|
|
|
|
2021-08-19 15:22:47 +00:00
|
|
|
meta = with lib; {
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "A very fast and scalable modern collaboration suite (groupware)";
|
2021-06-13 10:12:28 +00:00
|
|
|
license = with licenses; [ gpl2Only lgpl21Only ];
|
2020-02-03 17:50:49 +00:00
|
|
|
homepage = "https://sogo.nu/";
|
|
|
|
platforms = platforms.linux;
|
2023-11-17 12:35:31 +00:00
|
|
|
maintainers = with maintainers; [];
|
2020-02-03 17:50:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|