3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/editors/typora/default.nix

56 lines
1.3 KiB
Nix
Raw Normal View History

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