2018-07-10 00:34:32 +02:00
|
|
|
{ stdenv, fetchurl, dpkg, lib, glib, dbus, makeWrapper, gnome2, gnome3, gtk3, atk, cairo, pango
|
2018-05-29 22:04:04 +02:00
|
|
|
, gdk_pixbuf, freetype, fontconfig, nspr, nss, xorg, alsaLib, cups, expat, udev, wrapGAppsHook }:
|
2017-05-20 09:52:11 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "typora-${version}";
|
2018-06-26 02:22:20 +02:00
|
|
|
version = "0.9.53";
|
2017-05-20 09:52:11 +02:00
|
|
|
|
|
|
|
src =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2017-05-20 09:52:11 +02:00
|
|
|
fetchurl {
|
|
|
|
url = "https://www.typora.io/linux/typora_${version}_amd64.deb";
|
2018-06-26 02:22:20 +02:00
|
|
|
sha256 = "02k6x30l4mbjragqbq5rn663xbw3h4bxzgppfxqf5lwydswldklb";
|
2017-05-20 09:52:11 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
|
|
|
url = "https://www.typora.io/linux/typora_${version}_i386.deb";
|
2018-06-26 02:22:20 +02:00
|
|
|
sha256 = "1wyq1ri0wwdy7slbd9dwyrdynsaa644x44c815jl787sg4nhas6y";
|
2017-05-20 09:52:11 +02:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
rpath = stdenv.lib.makeLibraryPath [
|
|
|
|
alsaLib
|
2018-07-10 00:34:32 +02:00
|
|
|
gnome2.GConf
|
2018-05-29 22:04:04 +02:00
|
|
|
gdk_pixbuf
|
|
|
|
pango
|
2018-05-28 11:55:17 +02:00
|
|
|
gnome3.defaultIconTheme
|
2017-05-20 09:52:11 +02:00
|
|
|
expat
|
2018-05-18 11:04:13 +02:00
|
|
|
gtk3
|
2017-05-20 09:52:11 +02:00
|
|
|
atk
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
glib
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
udev
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
];
|
|
|
|
|
2018-05-28 11:55:17 +02:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook ];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
2017-05-20 09:52:11 +02:00
|
|
|
|
|
|
|
buildInputs = [ dpkg makeWrapper ];
|
|
|
|
|
|
|
|
unpackPhase = "true";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
dpkg -x $src $out
|
2017-11-05 18:53:40 +01:00
|
|
|
mv $out/usr/bin $out
|
|
|
|
mv $out/usr/share $out
|
2017-05-20 09:52:11 +02:00
|
|
|
rm $out/bin/typora
|
2017-11-05 18:53:40 +01:00
|
|
|
rmdir $out/usr
|
2017-05-20 09:52:11 +02:00
|
|
|
|
|
|
|
# Otherwise it looks "suspicious"
|
|
|
|
chmod -R g-w $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "$out/share/typora:${rpath}" "$out/share/typora/Typora"
|
|
|
|
|
2018-05-28 11:55:17 +02:00
|
|
|
makeWrapper $out/share/typora/Typora $out/bin/typora
|
|
|
|
|
|
|
|
wrapProgram $out/bin/typora \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--suffix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gnome3.defaultIconTheme}/share"
|
2017-05-20 09:52:11 +02:00
|
|
|
|
|
|
|
# Fix the desktop link
|
|
|
|
substituteInPlace $out/share/applications/typora.desktop \
|
|
|
|
--replace /usr/bin/ $out/bin/ \
|
|
|
|
--replace /usr/share/ $out/share/
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A minimal Markdown reading & writing app";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://typora.io;
|
2017-11-05 18:53:40 +01:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ jensbin ];
|
2017-05-20 09:52:11 +02:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|