Unverified Commit 49a9eca5 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

typst-preview: 0.9.0 -> 0.9.1

parent b9aa1e95
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
, millet
, shfmt
, typst-lsp
, typst-preview
, autoPatchelfHook
, zlib
, stdenv
@@ -2329,6 +2330,17 @@ let

        buildInputs = lib.optionals stdenv.isLinux [ stdenv.cc.cc.lib ];

        buildInputs = [
          typst-preview
        ];

        nativeBuildInputs = [ jq moreutils ];

        postInstall = ''
          cd "$out/$installPrefix"
          jq '.contributes.configuration.properties."typst-preview.executable".default = "${lib.getExe typst-preview}"' package.json | sponge package.json
        '';

        meta = {
          description = "Typst Preview is an extension for previewing your Typst files in vscode instantly";
          downloadPage = "https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview";
+1 −1
Original line number Diff line number Diff line
@@ -3390,7 +3390,7 @@ dependencies = [

[[package]]
name = "typst-preview"
version = "0.9.0"
version = "0.9.1"
dependencies = [
 "anyhow",
 "chrono",
+94 −0
Original line number Diff line number Diff line
{ lib, fetchFromGitHub, rustPlatform, fetchYarnDeps, mkYarnPackage, darwin
, stdenv }:
{ lib
, rustPlatform
, fetchFromGitHub
, mkYarnPackage
, fetchYarnDeps
, pkg-config
, libgit2
, openssl
, zlib
, stdenv
, darwin
}:

let
  name = "typst-preview";
  version = "0.9.0";
  # Keep the vscode "mgt19937.typst-preview" extension in sync when updating
  # this package at pkgs/applications/editors/vscode/extensions/default.nix
  version = "0.9.1";

  src = fetchFromGitHub {
    owner = "Enter-tainer";
    repo = name;
    repo = "typst-preview";
    rev = "v${version}";
    hash = "sha256-r/zDvfMvfvZqa3Xkzk70tIEyhc5LDwqc2A5MUuK2xC0=";
    hash = "sha256-VmUcnmTe5Ngcje0SSpOY13HUIfdxBMg8KwvZ1wupCqc=";
  };

  frontendSrc = "${src}/addons/frontend";
  frontend = mkYarnPackage rec {

  frontend = mkYarnPackage {
    inherit version;
    pname = "${name}-frontend";
    pname = "typst-preview-frontend";
    src = frontendSrc;
    packageJSON = ./package.json;

@@ -30,44 +44,51 @@ let

    installPhase = ''
      runHook preInstall
      cp -R deps/${pname}/dist $out
      cp -R deps/typst-preview-frontend/dist $out
      runHook postInstall
    '';

    doDist = false;
  };

in rustPlatform.buildRustPackage rec {

  pname = name;
in
rustPlatform.buildRustPackage {
  pname = "typst-preview";
  inherit version src;

  buildInputs = lib.optionals stdenv.isDarwin
    (with darwin.apple_sdk.frameworks; [
      Security
      SystemConfiguration
      CoreServices
    ]);

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "hayagriva-0.4.0" = "sha256-377lXL3+TO8U91OopMYEI0NrWWwzy6+O7B65bLhP+X4=";
      "typst-0.9.0" = "sha256-+rnsUSGi3QZlbC4i8racsM4U6+l8oA9YjjUOtQAIWOk=";
      "typst-ts-compiler-0.4.0-rc9" =
        "sha256-NVmbAodDRJBJlGGDRjaEcTHGoCeN4hNjIynIDKqvNbM=";
      "typst-ts-compiler-0.4.0-rc9" = "sha256-NVmbAodDRJBJlGGDRjaEcTHGoCeN4hNjIynIDKqvNbM=";
    };
  };

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    libgit2
    openssl
    zlib
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.CoreFoundation
    darwin.apple_sdk.frameworks.CoreServices
    darwin.apple_sdk.frameworks.Security
    darwin.apple_sdk.frameworks.SystemConfiguration
  ];

  prePatch = ''
    mkdir -p addons/vscode/out/frontend
    cp -R ${frontend}/* addons/vscode/out/frontend/
  '';

  meta = with lib; {
    description = "Preview your Typst files in vscode";
    homepage = "https://github.com/Enter-tainer/typse-preview";
    license = licenses.mit;
    maintainers = with maintainers; [ berberman ];
  meta = {
    description = "Typst preview extension for VSCode";
    homepage = "https://github.com/Enter-tainer/typst-preview/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ berberman ];
    mainProgram = "typst-preview";
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -14235,8 +14235,6 @@ with pkgs;
  typst-live = callPackage ../tools/typesetting/typst-live { };
  typst-preview = callPackage ../tools/typesetting/typst-preview { };
  tz = callPackage ../tools/misc/tz { };
  u9fs = callPackage ../servers/u9fs { };
Loading