diff options
| author | seth <[email protected]> | 2024-03-17 04:37:05 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-03-17 04:37:05 -0400 |
| commit | 91a5a4e807681f0f69d8d7d2e3ffead9385c1dc3 (patch) | |
| tree | 7daea6cfc5456579917d4e1c9ffc710f80856309 /pkgs/flightcore/default.nix | |
| parent | ca5b1d79dafeef4258dc4cec4d4c04281d27e0d1 (diff) | |
pkgs/flightcore: init at 2.19.2flightcore
Diffstat (limited to 'pkgs/flightcore/default.nix')
| -rw-r--r-- | pkgs/flightcore/default.nix | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/pkgs/flightcore/default.nix b/pkgs/flightcore/default.nix new file mode 100644 index 0000000..be747a4 --- /dev/null +++ b/pkgs/flightcore/default.nix @@ -0,0 +1,98 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + fetchNpmDeps, + npmHooks, + wrapGAppsHook, + flightcore, + cargo-tauri, + glib, + glib-networking, + libsoup, + nodejs, + openssl, + pkg-config, + webkitgtk, +}: +rustPlatform.buildRustPackage { + pname = "flightcore"; + version = "2.19.2"; + + src = fetchFromGitHub { + owner = "R2NorthstarTools"; + repo = "FlightCore"; + rev = "v${flightcore.version}"; + hash = "sha256-Gar6qCtnk3eUGhSjRHFx7aclPPaMCL+5CV30pCMsgvA="; + }; + + prePatch = '' + pushd $npmRoot + + ln -sf ${./package.json} package.json + ln -sf ${./package-lock.json} package-lock.json + substituteInPlace $(find -type f -name '*.vue' -or -name '*.ts') \ + --replace "tauri-plugin-store-api" "@tauri-apps/plugin-store" + + popd + ''; + + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "tauri-plugin-store-0.1.0" = "sha256-G7b1cIMr7YcI5cUhlYi4vhLFCe3/CMSPSB4gYY1Ynz8="; + }; + }; + buildAndTestSubdir = flightcore.cargoRoot; + cargoRoot = "src-tauri"; + + npmDeps = fetchNpmDeps { + name = "${flightcore.pname}-npm-deps-${flightcore.version}"; + src = ./.; + hash = "sha256-2X5pZ0T1dR6NCB0qcSvQl0RsMA7KFYKUUI5Z8tQ7ddQ="; + }; + + npmRoot = "src-vue"; + makeCacheWritable = true; + + nativeBuildInputs = [ + cargo-tauri + nodejs + npmHooks.npmConfigHook + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + glib + glib-networking + libsoup + openssl + webkitgtk + ]; + + buildPhase = '' + runHook preBuild + + cargo tauri build --bundles deb + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + cp -r ${flightcore.cargoRoot}/target/release/bundle/deb/*/data/usr $out + + runHook postInstall + ''; + + meta = with lib; { + mainProgram = "flight-core"; + description = "A Northstar installer, updater, and mod-manager"; + homepage = "https://github.com/R2NorthstarTools/FlightCore"; + changelog = "https://github.com/R2NorthstarTools/FlightCore/releases/tag/v${flightcore.version}"; + license = licenses.mit; + maintainers = with maintainers; [getchoo]; + }; +} |
