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