Skip to content

Commit

Permalink
Merge pull request #259450 from npulidomateo/reinit-typora
Browse files Browse the repository at this point in the history
Reinit typora
  • Loading branch information
wegank authored Oct 13, 2023
2 parents 9034d47 + 9b4f78b commit 7546bc6
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12851,6 +12851,12 @@
githubId = 9939720;
name = "Philippe Nguyen";
};
npulidomateo = {
matrix = "@npulidomateo:matrix.org";
github = "npulidomateo";
githubId = 13149442;
name = "Nico Pulido-Mateo";
};
nrdxp = {
email = "tim.deh@pm.me";
matrix = "@timdeh:matrix.org";
Expand Down
104 changes: 104 additions & 0 deletions pkgs/applications/editors/typora/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{ stdenv
, fetchurl
, dpkg
, lib
, glib
, nss
, nspr
, at-spi2-atk
, cups
, dbus
, libdrm
, gtk3
, pango
, cairo
, xorg
, libxkbcommon
, mesa
, expat
, alsa-lib
, buildFHSEnv
}:

let
pname = "typora";
version = "1.7.5";
src = fetchurl {
url = "https://download.typora.io/linux/typora_${version}_amd64.deb";
hash = "sha256-4Q+fx1kNu98+nxnI/7hLhE6zOdNsaAiAnW6xVd+hZOI=";
};

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 = "A markdown editor, a markdown reader";
homepage = "https://typora.io/";
license = licenses.unfree;
maintainers = with maintainers; [ npulidomateo ];
platforms = [ "x86_64-linux" ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34242,6 +34242,8 @@ with pkgs;

synfigstudio = callPackage ../applications/graphics/synfigstudio { };

typora = callPackage ../applications/editors/typora { };

taxi = callPackage ../applications/networking/ftp/taxi { };

taxi-cli = with python3Packages; toPythonApplication taxi;
Expand Down

0 comments on commit 7546bc6

Please sign in to comment.