2019-05-07 06:43:53 +00:00
|
|
|
{ pkgs, stdenv, fetchFromGitHub }:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "0.7.1";
|
|
|
|
rev = "9d54904e4896ab6c3c3a52f97381e5948b455970"; # This revision will get used in modules/react-native-desktop-notification/desktop/CMakeLists.txt#L71
|
|
|
|
sha256 = "0ix1qgx877nw9mlbbqsgkis4phkkf4ax2ambziy2w48hg6ai0x4d";
|
|
|
|
package = stdenv.mkDerivation {
|
|
|
|
name = "snorenotify-patched-source";
|
2019-06-04 16:50:29 +00:00
|
|
|
version = "${version}-${stdenv.lib.strings.substring 0 7 rev}";
|
2019-05-07 06:43:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev sha256;
|
|
|
|
owner = "status-im";
|
|
|
|
repo = "snorenotify";
|
|
|
|
name = "snorenotify-source-${version}";
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" ];
|
2019-06-04 16:50:29 +00:00
|
|
|
unpackPhase =
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) versions;
|
|
|
|
in ''
|
2019-05-07 06:43:53 +00:00
|
|
|
mkdir -p $out/src
|
|
|
|
cp -r $src/* $out/src/
|
|
|
|
substituteInPlace $out/src/CMakeLists.txt \
|
|
|
|
--replace "cmake_minimum_required( VERSION 2.8.12 )" "" \
|
|
|
|
--replace "project( SnoreNotify )" "cmake_minimum_required( VERSION 3.12.1 )
|
|
|
|
project( SnoreNotify VERSION ${version} )" \
|
2019-06-04 16:50:29 +00:00
|
|
|
--replace "set(SNORE_VERSION_MAJOR 0)" "set(SNORE_VERSION_MAJOR ${versions.major version} )" \
|
|
|
|
--replace "set(SNORE_VERSION_MINOR 7)" "set(SNORE_VERSION_MINOR ${versions.minor version} )" \
|
|
|
|
--replace "set(SNORE_VERSION_PATCH 1)" "set(SNORE_VERSION_PATCH ${versions.patch version} )"
|
2019-05-07 06:43:53 +00:00
|
|
|
substituteInPlace $out/src/src/libsnore/CMakeLists.txt \
|
|
|
|
--replace "{SNORE_VERSION_MAJOR}" "SNORE_VERSION_MAJOR" \
|
|
|
|
--replace "{SNORE_VERSION_MINOR}" "SNORE_VERSION_MINOR" \
|
|
|
|
--replace "{SNORE_VERSION_PATCH}" "SNORE_VERSION_PATCH" \
|
|
|
|
--replace "ecm_setup_version(\"\$SNORE_VERSION_MAJOR.\$SNORE_VERSION_MINOR.\$SNORE_VERSION_PATCH\"" "ecm_setup_version(SnoreNotify"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Patched sources for Snorenotify, a multi platform Qt notification framework. Using a plugin system it is possible to create notifications with many different notification systems on Windows, Mac OS and Unix and mobile Devices";
|
|
|
|
homepage = https://github.com/status-im/snorenotify;
|
|
|
|
license = stdenv.lib.licenses.lgpl3;
|
2019-06-04 16:50:29 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ pombeirp ];
|
2019-05-07 06:43:53 +00:00
|
|
|
platforms = with stdenv.lib.platforms; darwin ++ linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in package // {
|
2019-07-19 18:40:03 +00:00
|
|
|
shellHook = (package.shellHook or "") + ''
|
2019-05-07 06:43:53 +00:00
|
|
|
export SNORENOTIFY_SOURCES="${package}/src"
|
|
|
|
'';
|
|
|
|
}
|