2020-04-30 00:08:47 -07:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, cmark
|
|
|
|
, lmdb
|
|
|
|
, mkDerivation
|
|
|
|
, qtbase
|
|
|
|
, qtmacextras
|
|
|
|
, qtmultimedia
|
|
|
|
, qttools
|
|
|
|
, mtxclient
|
|
|
|
, boost
|
|
|
|
, spdlog
|
|
|
|
, olm
|
|
|
|
, pkgconfig
|
2019-08-02 05:18:57 -07:00
|
|
|
, nlohmann_json
|
2018-05-24 10:00:40 -07:00
|
|
|
}:
|
2018-04-06 19:05:11 -07:00
|
|
|
|
2019-06-19 05:25:06 -07:00
|
|
|
# These hashes and revisions are based on those from here:
|
|
|
|
# https://github.com/Nheko-Reborn/nheko/blob/v0.6.4/deps/CMakeLists.txt#L52
|
2018-04-06 19:05:11 -07:00
|
|
|
let
|
|
|
|
tweeny = fetchFromGitHub {
|
|
|
|
owner = "mobius3";
|
|
|
|
repo = "tweeny";
|
|
|
|
rev = "b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf";
|
|
|
|
sha256 = "1wyyq0j7dhjd6qgvnh3knr70li47hmf5394yznkv9b1indqjx4mi";
|
|
|
|
};
|
|
|
|
|
|
|
|
lmdbxx = fetchFromGitHub {
|
|
|
|
owner = "bendiken";
|
|
|
|
repo = "lmdbxx";
|
|
|
|
rev = "0b43ca87d8cfabba392dfe884eb1edb83874de02";
|
|
|
|
sha256 = "1whsc5cybf9rmgyaj6qjji03fv5jbgcgygp956s3835b9f9cjg1n";
|
|
|
|
};
|
|
|
|
in
|
2019-08-02 05:18:57 -07:00
|
|
|
mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "nheko";
|
2019-06-19 05:25:06 -07:00
|
|
|
version = "0.6.4";
|
2018-04-06 19:05:11 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-02-11 13:40:50 -08:00
|
|
|
owner = "Nheko-Reborn";
|
2018-04-06 19:05:11 -07:00
|
|
|
repo = "nheko";
|
|
|
|
rev = "v${version}";
|
2019-06-19 05:25:06 -07:00
|
|
|
sha256 = "19dkc98l1q4070v6mli4ybqn0ip0za607w39hjf0x8rqdxq45iwm";
|
2018-04-06 19:05:11 -07:00
|
|
|
};
|
|
|
|
|
2018-05-24 10:00:40 -07:00
|
|
|
# If, on Darwin, you encounter the error
|
|
|
|
# error: must specify at least one argument for '...' parameter of variadic
|
|
|
|
# macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
|
|
|
|
# Then adding this parameter is likely the fix you want.
|
|
|
|
#
|
|
|
|
# However, it looks like either cmake doesn't honor this CFLAGS variable, or
|
|
|
|
# darwin's compiler doesn't have the same syntax as gcc for turning off
|
|
|
|
# -Werror selectively.
|
|
|
|
#
|
|
|
|
# Anyway, this is something that will have to be debugged with access to a
|
|
|
|
# darwin-based OS. Sorry about that!
|
|
|
|
#
|
|
|
|
#preConfigure = lib.optionalString stdenv.isDarwin ''
|
|
|
|
# export CFLAGS=-Wno-error=gnu-zero-variadic-macro-arguments
|
|
|
|
#'';
|
|
|
|
|
2018-09-09 13:14:27 -07:00
|
|
|
postPatch = ''
|
|
|
|
mkdir -p .deps/include/
|
|
|
|
ln -s ${tweeny}/include .deps/include/tweeny
|
|
|
|
ln -s ${spdlog} .deps/spdlog
|
|
|
|
'';
|
|
|
|
|
2018-04-06 19:05:11 -07:00
|
|
|
cmakeFlags = [
|
2018-09-09 13:14:27 -07:00
|
|
|
"-DTWEENY_INCLUDE_DIR=.deps/include"
|
2018-04-06 19:05:11 -07:00
|
|
|
"-DLMDBXX_INCLUDE_DIR=${lmdbxx}"
|
2019-06-19 05:25:06 -07:00
|
|
|
"-Dnlohmann_json_DIR=${nlohmann_json}/lib/cmake/nlohmann_json"
|
2018-04-06 19:05:11 -07:00
|
|
|
];
|
|
|
|
|
2020-04-30 00:08:47 -07:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
|
|
|
];
|
2018-04-06 19:05:11 -07:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-04-30 00:08:47 -07:00
|
|
|
mtxclient
|
|
|
|
olm
|
|
|
|
boost
|
|
|
|
lmdb
|
|
|
|
spdlog
|
|
|
|
cmark
|
|
|
|
qtbase
|
|
|
|
qtmultimedia
|
|
|
|
qttools
|
2018-05-24 10:00:40 -07:00
|
|
|
] ++ lib.optional stdenv.isDarwin qtmacextras;
|
2018-04-06 19:05:11 -07:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Desktop client for the Matrix protocol";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/Nheko-Reborn/nheko";
|
2018-09-09 13:14:27 -07:00
|
|
|
maintainers = with maintainers; [ ekleog fpletz ];
|
|
|
|
platforms = platforms.unix;
|
2018-08-09 03:59:52 -07:00
|
|
|
license = licenses.gpl3Plus;
|
2018-04-06 19:05:11 -07:00
|
|
|
};
|
|
|
|
}
|