|
| 1 | +{ |
| 2 | + fetchFromGitHub, |
| 3 | + cargo-tauri, |
| 4 | + fetchFromRadicle, |
| 5 | + git, |
| 6 | + glib, |
| 7 | + gtk3, |
| 8 | + fetchNpmDeps, |
| 9 | + npmHooks, |
| 10 | + lib, |
| 11 | + libsoup_3, |
| 12 | + nodejs, |
| 13 | + openssh, |
| 14 | + openssl, |
| 15 | + pkg-config, |
| 16 | + playwright-driver, |
| 17 | + radicle-node, |
| 18 | + rustPlatform, |
| 19 | + webkitgtk_4_1, |
| 20 | + wrapGAppsHook4, |
| 21 | + rustfmt, |
| 22 | + clippy, |
| 23 | +}: |
| 24 | + |
| 25 | +rustPlatform.buildRustPackage (finalAttrs: { |
| 26 | + pname = "radicle-desktop"; |
| 27 | + version = "0.8.0"; |
| 28 | + |
| 29 | + src = fetchFromRadicle { |
| 30 | + seed = "seed.radicle.xyz"; |
| 31 | + repo = "z4D5UCArafTzTQpDZNQRuqswh3ury"; |
| 32 | + rev = "aeb405aaf53b56a426ab8d68c7f89b8953683224"; |
| 33 | + hash = "sha256-Z/6GdXf3ag/89H8UMD2GNU4CXA8TWyX8dl8uh0CTem8="; |
| 34 | + leaveDotGit = true; |
| 35 | + postFetch = '' |
| 36 | + git -C $out rev-parse --short HEAD > $out/.git_head |
| 37 | + rm -rf $out/.git |
| 38 | + ''; |
| 39 | + }; |
| 40 | + |
| 41 | + postPatch = '' |
| 42 | + patchShebangs scripts/copy-katex-assets scripts/check-js scripts/check-rs |
| 43 | +
|
| 44 | + mkdir -p public/twemoji |
| 45 | + cp -t public/twemoji -r -- ${finalAttrs.twemojiAssets}/assets/svg/* |
| 46 | + : >scripts/install-twemoji-assets |
| 47 | +
|
| 48 | + substituteInPlace scripts/check-rs \ |
| 49 | + --replace-fail "-Dwarnings" "" |
| 50 | + ''; |
| 51 | + |
| 52 | + npmDeps = fetchNpmDeps { |
| 53 | + inherit (finalAttrs) src; |
| 54 | + hash = "sha256-lcSNGmIv6u7DT47lOC69BRbVSK5IPiwjtdAS8aVxwqM="; |
| 55 | + }; |
| 56 | + |
| 57 | + cargoHash = "sha256-z5fnwc7EjSvkyu4zTUyAvVfs6quwH2p9VFDK/TdzZJE="; |
| 58 | + |
| 59 | + twemojiAssets = fetchFromGitHub { |
| 60 | + owner = "twitter"; |
| 61 | + repo = "twemoji"; |
| 62 | + tag = "v14.0.2"; |
| 63 | + hash = "sha256-YoOnZ5uVukzi/6bLi22Y8U5TpplPzB7ji42l+/ys5xI="; |
| 64 | + }; |
| 65 | + |
| 66 | + env = { |
| 67 | + HW_RELEASE = "nixpkgs"; |
| 68 | + PLAYWRIGHT_BROWSERS_PATH = playwright-driver.browsers; |
| 69 | + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = true; |
| 70 | + PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true; |
| 71 | + }; |
| 72 | + |
| 73 | + nativeBuildInputs = [ |
| 74 | + cargo-tauri.hook |
| 75 | + npmHooks.npmConfigHook |
| 76 | + nodejs |
| 77 | + pkg-config |
| 78 | + wrapGAppsHook4 |
| 79 | + ]; |
| 80 | + |
| 81 | + buildInputs = [ |
| 82 | + glib |
| 83 | + gtk3 |
| 84 | + libsoup_3 |
| 85 | + openssl |
| 86 | + webkitgtk_4_1 |
| 87 | + ]; |
| 88 | + |
| 89 | + preBuild = '' |
| 90 | + export GIT_HEAD=$(<$src/.git_head) |
| 91 | + ''; |
| 92 | + |
| 93 | + nativeCheckInputs = [ |
| 94 | + git |
| 95 | + openssh |
| 96 | + radicle-node |
| 97 | + rustfmt |
| 98 | + clippy |
| 99 | + ]; |
| 100 | + |
| 101 | + checkPhase = '' |
| 102 | + runHook preCheck |
| 103 | +
|
| 104 | + export RAD_HOME="$PWD/_rad-home" |
| 105 | + export RAD_PASSPHRASE="" |
| 106 | + rad auth --alias test |
| 107 | + bins="tests/tmp/bin/heartwood/$HW_RELEASE" |
| 108 | + mkdir -p "$bins" |
| 109 | + cp -t "$bins" -- ${radicle-node}/bin/* |
| 110 | + echo -n "$HW_RELEASE" >tests/support/heartwood-release |
| 111 | +
|
| 112 | + npm run build:http |
| 113 | + npm run test:unit |
| 114 | + scripts/check-js |
| 115 | + scripts/check-rs |
| 116 | +
|
| 117 | + runHook postCheck |
| 118 | + ''; |
| 119 | + |
| 120 | + passthru.env = finalAttrs.env; |
| 121 | + |
| 122 | + meta = { |
| 123 | + description = "Radicle desktop app"; |
| 124 | + homepage = "https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z4D5UCArafTzTQpDZNQRuqswh3ury"; |
| 125 | + changelog = "https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z4D5UCArafTzTQpDZNQRuqswh3ury/tree/CHANGELOG.md"; |
| 126 | + license = lib.licenses.gpl3Only; |
| 127 | + platforms = lib.platforms.unix; |
| 128 | + maintainers = with lib.maintainers; [ |
| 129 | + matthiasbeyer |
| 130 | + defelo |
| 131 | + faukah |
| 132 | + ]; |
| 133 | + mainProgram = "radicle-desktop"; |
| 134 | + }; |
| 135 | +}) |
0 commit comments