nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitLab,
4 rustPlatform,
5 rustc,
6 wasm-pack,
7 wasm-bindgen-cli_0_2_95,
8 binaryen,
9}:
10
11let
12 version = "0.1.1";
13in
14rustPlatform.buildRustPackage {
15 pname = "tpsecore";
16 inherit version;
17
18 src = fetchFromGitLab {
19 owner = "UniQMG";
20 repo = "tpsecore";
21 rev = "v${version}";
22 hash = "sha256-+OynnLMBEiYwdFzxGzgkcBN6xrHoH1Q6O5i+OW7RBLo=";
23 };
24
25 cargoHash = "sha256-EM/THiR0NV4N3mFGjRYe1cpaF82rCYnOPLxv67BronU=";
26
27 nativeBuildInputs = [
28 wasm-pack
29 wasm-bindgen-cli_0_2_95
30 binaryen
31 rustc.llvmPackages.lld
32 ];
33
34 buildPhase = ''
35 runHook preBuild
36
37 HOME=$(mktemp -d) wasm-pack build --target web --release
38
39 runHook postBuild
40 '';
41
42 installPhase = ''
43 runHook preInstall
44
45 cp -r pkg/ $out
46
47 runHook postInstall
48 '';
49
50 doCheck = false;
51
52 meta = {
53 description = "Self contained toolkit for creating, editing, and previewing TPSE files";
54 homepage = "https://gitlab.com/UniQMG/tpsecore";
55 license = lib.licenses.mit;
56 maintainers = with lib.maintainers; [ huantian ];
57 platforms = lib.platforms.linux;
58 };
59}