about summary refs log tree commit diff
path: root/pkgs/applications/editors/typora/default.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-13 18:01:31 +0000
committerGitHub <noreply@github.com>2023-10-13 18:01:31 +0000
commitc68d98e9d41f96cf3d591f8d5a7abfdb2b292799 (patch)
treebe6df5adcc1528f56a1204acff4eaf2cfd1cefb6 /pkgs/applications/editors/typora/default.nix
parent68ba5fd2ed8be749cf1865ed9a71667dfda944a7 (diff)
parent4a7eb88e55f80623bb3ea4968ff4600814016ffb (diff)
downloadnixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar.gz
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar.bz2
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar.lz
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar.xz
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.tar.zst
nixlib-c68d98e9d41f96cf3d591f8d5a7abfdb2b292799.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/applications/editors/typora/default.nix')
-rw-r--r--pkgs/applications/editors/typora/default.nix104
1 files changed, 104 insertions, 0 deletions
diff --git a/pkgs/applications/editors/typora/default.nix b/pkgs/applications/editors/typora/default.nix
new file mode 100644
index 000000000000..5332e0b5d05b
--- /dev/null
+++ b/pkgs/applications/editors/typora/default.nix
@@ -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" ];
+  };
+}