2019-05-07 06:43:53 +00:00
{ pkgs , stdenv , fetchFromGitHub }:
let
version = " 0 . 8 . 9 0 " ;
rev = " d 3 c 6 0 6 c 5 5 a d f 8 c 2 c 2 7 4 7 5 5 6 0 5 5 6 5 2 b 3 4 6 9 f 6 c 4 c 2 " ; # This revision will get used in https://github.com/status-im/react-native-keychain/blob/master/desktop/CMakeLists.txt#L45
sha256 = " 1 g q w 3 g 0 j 4 6 a s w n c m 8 f g y 4 1 9 l p 1 f p 2 y 2 n i l d 8 2 h s 1 8 x r a 5 a l b v f 3 i " ;
package = stdenv . mkDerivation {
name = " q t k e y c h a i n - p a t c h e d - s o u r c e " ;
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 = " s t a t u s - i m " ;
repo = " q t k e y c h a i n " ;
name = " q t k e y c h a i n - s o u r c e - ${ version } " ;
} ;
phases = [ " u n p a c k P h a s e " ] ;
unpackPhase = ''
mkdir - p $ out/src
cp - r $ src /* $ o u t / s r c /
substituteInPlace $ out/src/CMakeLists.txt \
- - replace " c m a k e _ m i n i m u m _ r e q u i r e d ( V E R S I O N 2 . 8 . 1 1 ) " " c m a k e _ m i n i m u m _ r e q u i r e d ( V E R S I O N 3 . 1 2 . 1 ) " \
- - replace " p r o j e c t ( q t k e y c h a i n ) " " p r o j e c t ( q t k e y c h a i n V E R S I O N ${ version } ) " \
- - replace " s e t ( Q T K E Y C H A I N _ V E R S I O N 0 . 8 . 9 0 ) " " s e t ( Q T K E Y C H A I N _ V E R S I O N ${ version } ) " \
- - replace " { Q T K E Y C H A I N _ V E R S I O N } \" V A R I A B L E _ P R E F I X S N O R E " " Q T K E Y C H A I N _ V E R S I O N V A R I A B L E _ P R E F I X S N O R E " \
- - replace " \" \$ Q T K E Y C H A I N _ V E R S I O N " qtkeychain
'' ;
2019-05-22 16:04:45 +00:00
meta = with stdenv . lib ; {
2019-05-07 06:43:53 +00:00
description = " P a t c h e d s o u r c e s f o r q t k e y c h a i n , a p l a t f o r m - i n d e p e n d e n t Q t A P I f o r s t o r i n g p a s s w o r d s s e c u r e l y " ;
homepage = https://github.com/status-im/qtkeychain ;
2019-05-22 16:04:45 +00:00
license = licenses . bsd3 ;
maintainers = [ maintainers . pombeirp ] ;
platforms = with platforms ; darwin ++ linux ;
2019-05-07 06:43:53 +00:00
} ;
} ;
in package // {
2019-07-19 18:40:03 +00:00
shellHook = ( package . shellHook or " " ) + ''
2019-05-07 06:43:53 +00:00
export QTKEYCHAIN_SOURCES = " ${ package } / s r c "
'' ;
}