Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prosody: 0.12.4 → 0.12.5 + community modules #372300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 47 additions & 24 deletions pkgs/servers/xmpp/prosody/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
{ stdenv, fetchurl, lib, libidn, openssl, makeWrapper, fetchhg, buildPackages
, icu
, lua
, nixosTests
, withDBI ? true
# use withExtraLibs to add additional dependencies of community modules
, withExtraLibs ? [ ]
, withExtraLuaPackages ? _: [ ]
, withOnlyInstalledCommunityModules ? [ ]
, withCommunityModules ? [ ] }:
{
stdenv,
fetchurl,
lib,
libidn,
openssl,
makeWrapper,
fetchhg,
buildPackages,
icu,
lua,
nixosTests,
withDBI ? true,
# use withExtraLibs to add additional dependencies of community modules
withExtraLibs ? [ ],
withExtraLuaPackages ? _: [ ],
withOnlyInstalledCommunityModules ? [ ],
withCommunityModules ? [ ],
}:

let
luaEnv = lua.withPackages(p: with p; [
luasocket luasec luaexpat luafilesystem luabitop luadbi-sqlite3 luaunbound
luaEnv = lua.withPackages (
p:
with p;
[
luasocket
luasec
luaexpat
luafilesystem
luabitop
luadbi-sqlite3
luaunbound
]
++ lib.optional withDBI p.luadbi
++ withExtraLuaPackages p
);
in
stdenv.mkDerivation rec {
version = "0.12.4"; # also update communityModules
version = "0.12.5"; # also update communityModules
pname = "prosody";
# The following community modules are necessary for the nixos module
# prosody module to comply with XEP-0423 and provide a working
Expand All @@ -30,23 +48,25 @@ stdenv.mkDerivation rec {
];
src = fetchurl {
url = "https://prosody.im/downloads/source/${pname}-${version}.tar.gz";
sha256 = "R9cSJzwvKVWMQS9s2uwHMmC7wmt92iQ9tYAzAYPWWFY=";
sha256 = "sha256-d4+3cHoPEDmVlbp6ucZt0qIojArjp/5Kt4+X1GK9OZ8=";
};

# A note to all those merging automated updates: Please also update this
# attribute as some modules might not be compatible with a newer prosody
# version.
communityModules = fetchhg {
url = "https://hg.prosody.im/prosody-modules";
rev = "d3a72777f149";
hash = "sha256-qLuhEdvtOMfu78oxLUZKWZDb/AME1+IRnk0jkQNxTU8=";
rev = "fc521fb5ffa0";
hash = "sha256-Ci52Xkx1xd3GW9lBPKgWFBB52SocxKyj8f/Hq3hZeak=";
};

nativeBuildInputs = [ makeWrapper ];
buildInputs = [
luaEnv libidn openssl icu
]
++ withExtraLibs;
luaEnv
libidn
openssl
icu
] ++ withExtraLibs;

configureFlags = [
"--ostype=linux"
Expand All @@ -56,7 +76,7 @@ stdenv.mkDerivation rec {
"--c-compiler=${stdenv.cc.targetPrefix}cc"
"--linker=${stdenv.cc.targetPrefix}cc"
];
configurePlatforms = [];
configurePlatforms = [ ];

postBuild = ''
make -C tools/migration
Expand All @@ -70,11 +90,14 @@ stdenv.mkDerivation rec {

# the wrapping should go away once lua hook is fixed
postInstall = ''
${lib.concatMapStringsSep "\n" (module: ''
${lib.concatMapStringsSep "\n"
(module: ''
cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
'') (lib.lists.unique(nixosModuleDeps ++ withCommunityModules ++ withOnlyInstalledCommunityModules))}
make -C tools/migration install
'';
'')
(lib.lists.unique (nixosModuleDeps ++ withCommunityModules ++ withOnlyInstalledCommunityModules))
}
make -C tools/migration install
'';

passthru = {
communityModules = withCommunityModules;
Expand Down