nixpkgs/pkgs/by-name/ty/typora/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

104 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv
, fetchurl
, dpkg
, lib
, glib
, nss
, nspr
, cups
, dbus
, libdrm
, gtk3
, pango
, cairo
, libxkbcommon
, mesa
, expat
, alsa-lib
, buildFHSEnv
}:
let
pname = "typora";
2024-06-23 16:26:13 +00:00
version = "1.9.3";
src = fetchurl {
url = "https://download.typora.io/linux/typora_${version}_amd64.deb";
2024-06-23 16:26:13 +00:00
hash = "sha256-3rR/CvFFjRPkz27mm1Wt5hwgRUnLL7lpLFKA2moILx8=";
};
typoraBase = stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = [ dpkg ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share
mv usr/share $out
ln -s $out/share/typora/Typora $out/bin/Typora
runHook postInstall
'';
};
typoraFHS = buildFHSEnv {
name = "typora-fhs";
targetPkgs = pkgs: (with pkgs; [
typoraBase
udev
alsa-lib
glib
nss
nspr
atk
cups
dbus
gtk3
libdrm
pango
cairo
mesa
expat
libxkbcommon
]) ++ (with pkgs.xorg; [
libX11
libXcursor
libXrandr
libXcomposite
libXdamage
libXext
libXfixes
libxcb
]);
runScript = ''
Typora $*
'';
};
in stdenv.mkDerivation {
inherit pname version;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ln -s ${typoraFHS}/bin/typora-fhs $out/bin/typora
ln -s ${typoraBase}/share/ $out
runHook postInstall
'';
meta = with lib; {
description = "Markdown editor, a markdown reader";
homepage = "https://typora.io/";
license = licenses.unfree;
2023-10-13 12:34:04 +00:00
maintainers = with maintainers; [ npulidomateo ];
platforms = [ "x86_64-linux" ];
2023-11-27 01:17:53 +00:00
mainProgram = "typora";
};
}