2019-03-31 02:44:58 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, electron_3, dpkg, gtk3, glib, gsettings-desktop-schemas, wrapGAppsHook }:
|
2017-05-20 08:52:11 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-01-28 22:13:37 +00:00
|
|
|
pname = "typora";
|
2019-03-31 02:44:58 +01:00
|
|
|
version = "0.9.68";
|
2017-05-20 08:52:11 +01:00
|
|
|
|
2019-01-28 22:13:37 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.typora.io/linux/typora_${version}_amd64.deb";
|
2019-03-31 02:44:58 +01:00
|
|
|
sha256 = "09hkmnh9avzb7nc8i67vhbv6nc1v90kk88aq01mpmyibpdqp03zp";
|
2019-01-28 22:13:37 +00:00
|
|
|
};
|
2017-05-20 08:52:11 +01:00
|
|
|
|
2019-03-31 02:44:58 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2017-05-20 08:52:11 +01:00
|
|
|
|
2019-03-31 02:44:58 +01:00
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
gtk3
|
|
|
|
];
|
2018-05-28 10:55:17 +01:00
|
|
|
|
2019-01-28 22:13:37 +00:00
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
2017-05-20 08:52:11 +01:00
|
|
|
|
2019-01-28 22:13:37 +00:00
|
|
|
dontWrapGApps = true;
|
2017-05-20 08:52:11 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2019-03-31 02:44:58 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/share
|
2019-01-28 22:13:37 +00:00
|
|
|
{
|
|
|
|
cd usr
|
2019-03-31 02:44:58 +01:00
|
|
|
mv share/typora/resources/app $out/share/typora
|
|
|
|
mv share/{applications,icons,doc} $out/share/
|
2019-01-28 22:13:37 +00:00
|
|
|
}
|
|
|
|
|
2019-03-31 02:44:58 +01:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2019-01-28 22:13:37 +00:00
|
|
|
makeWrapper ${electron_3}/bin/electron $out/bin/typora \
|
|
|
|
--add-flags $out/share/typora \
|
2018-05-28 10:55:17 +01:00
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2019-01-28 22:13:37 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]}"
|
2017-05-20 08:52:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A minimal Markdown reading & writing app";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://typora.io;
|
2017-11-05 17:53:40 +00:00
|
|
|
license = licenses.unfree;
|
2019-03-31 02:44:58 +01:00
|
|
|
maintainers = with maintainers; [ jensbin worldofpeace ];
|
2019-01-28 22:13:37 +00:00
|
|
|
inherit (electron_3.meta) platforms;
|
2017-05-20 08:52:11 +01:00
|
|
|
};
|
|
|
|
}
|