Unverified Commit 553f2816 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

typst: 0.13.1 -> 0.14.0 (#450677)

parents ee8c3371 3b63975e
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -12,16 +12,22 @@

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "typst";
  version = "0.13.1";
  version = "0.14.0";

  src = fetchFromGitHub {
    owner = "typst";
    repo = "typst";
    tag = "v${finalAttrs.version}";
    hash = "sha256-vbBwIQt4xWZaKpXgFwDsRQIQ0mmsQPRR39m8iZnnuj0=";
    hash = "sha256-Sdl60VNjrSVj8YFZR/b2WOzN8taZ6wsJx5FnED9XQbw=";
    leaveDotGit = true;
    postFetch = ''
      cd $out
      git rev-parse HEAD > COMMIT
      rm -rf .git
    '';
  };

  cargoHash = "sha256-4kVj2BODEFjLcrh5sxfcgsdLF2Zd3K1GnhA4DEz1Nl4=";
  cargoHash = "sha256-6o7IbDBJU+FGYezfm37Z4eBBWa7G06vFbopI0FqJu7c=";

  nativeBuildInputs = [
    installShellFiles
@@ -35,14 +41,19 @@ rustPlatform.buildRustPackage (finalAttrs: {
  env = {
    GEN_ARTIFACTS = "artifacts";
    OPENSSL_NO_VENDOR = true;
    # to not have "unknown hash" in help output
    TYPST_VERSION = finalAttrs.version;
  };

  # Fix for "Found argument '--test-threads' which wasn't expected, or isn't valid in this context"
  postPatch = ''
    substituteInPlace tests/src/tests.rs --replace-fail 'ARGS.num_threads' 'ARGS.test_threads'
    substituteInPlace tests/src/args.rs --replace-fail 'num_threads' 'test_threads'
    substituteInPlace tests/src/tests.rs --replace-fail \
      'ARGS.num_threads' \
      'ARGS.test_threads'
    substituteInPlace tests/src/args.rs --replace-fail \
      'num_threads' \
      'test_threads'
    substituteInPlace crates/typst-cli/build.rs --replace-fail \
      '"cargo:rustc-env=TYPST_COMMIT_SHA={}", typst_commit_sha()' \
      "\"cargo:rustc-env=TYPST_COMMIT_SHA={}\", \"$(cat COMMIT | cut -c1-8)\""
  '';

  postInstall = ''