nixpkgs/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
2.6 KiB
Nix
Raw Normal View History

2024-02-15 21:36:55 +00:00
{
lib,
stdenv,
apple-sdk_11,
cacert,
2024-11-15 01:15:49 +00:00
cargo-tauri,
2024-02-15 21:36:55 +00:00
desktop-file-utils,
fetchFromGitHub,
2024-11-15 01:15:49 +00:00
makeBinaryWrapper,
nodejs,
2024-02-15 21:36:55 +00:00
openssl,
pkg-config,
pnpm_9,
rustPlatform,
turbo,
2024-11-15 01:15:49 +00:00
webkitgtk_4_1,
}:
let
pnpm = pnpm_9;
in
2024-06-07 21:46:07 +00:00
rustPlatform.buildRustPackage rec {
2024-02-15 21:36:55 +00:00
pname = "modrinth-app-unwrapped";
2024-11-15 01:15:49 +00:00
version = "0.8.9";
2024-02-15 21:36:55 +00:00
src = fetchFromGitHub {
owner = "modrinth";
repo = "code";
2024-11-15 01:15:49 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-DR1aPbSqAVhL/m/Maa3mPzNWwK4A1WvDd/PwEMVYn5g=";
2024-02-15 21:36:55 +00:00
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
2024-11-15 01:15:49 +00:00
"wry-0.44.1" = "sha256-I1qkUVTu+Yqk1Imo1w5rG/lRSPLITF5BdcjBsPe+jXU=";
2024-02-15 21:36:55 +00:00
};
};
pnpmDeps = pnpm.fetchDeps {
2024-06-07 21:46:07 +00:00
inherit pname version src;
2024-11-15 01:15:49 +00:00
hash = "sha256-murZ82LV2pGng/Cg08NoWr/mDIVECrf00utVrs6PKRg=";
2024-06-07 21:46:07 +00:00
};
2024-02-15 21:36:55 +00:00
nativeBuildInputs = [
2024-11-15 01:15:49 +00:00
cacert # Required for turbo
cargo-tauri.hook
2024-02-15 21:36:55 +00:00
desktop-file-utils
nodejs
2024-02-15 21:36:55 +00:00
pkg-config
pnpm.configHook
2024-11-15 01:15:49 +00:00
] ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper;
2024-02-15 21:36:55 +00:00
buildInputs =
[ openssl ]
++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_11
2024-11-15 01:15:49 +00:00
++ lib.optional stdenv.hostPlatform.isLinux webkitgtk_4_1;
2024-02-15 21:36:55 +00:00
env = {
TURBO_BINARY_PATH = lib.getExe turbo;
2024-02-15 21:36:55 +00:00
};
2024-08-18 09:48:10 +00:00
postInstall =
lib.optionalString stdenv.hostPlatform.isDarwin ''
2024-11-15 01:15:49 +00:00
makeBinaryWrapper "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App "$out"/bin/ModrinthApp
2024-02-15 21:36:55 +00:00
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
desktop-file-edit \
--set-comment "Modrinth's game launcher" \
--set-key="StartupNotify" --set-value="true" \
--set-key="Categories" --set-value="Game;ActionGame;AdventureGame;Simulation;" \
--set-key="Keywords" --set-value="game;minecraft;mc;" \
--set-key="StartupWMClass" --set-value="ModrinthApp" \
2024-11-15 01:15:49 +00:00
$out/share/applications/Modrinth\ App.desktop
2024-02-15 21:36:55 +00:00
'';
meta = {
description = "Modrinth's game launcher";
longDescription = ''
A unique, open source launcher that allows you to play your favorite mods,
and keep them up to date, all in one neat little package
'';
homepage = "https://modrinth.com";
license = with lib.licenses; [
gpl3Plus
unfreeRedistributable
];
maintainers = with lib.maintainers; [ getchoo ];
2024-11-15 01:15:49 +00:00
mainProgram = "ModrinthApp";
platforms = with lib; platforms.linux ++ platforms.darwin;
# This builds on architectures like aarch64, but the launcher itself does not support them yet.
# Darwin is the only exception
# See https://github.com/modrinth/code/issues/776#issuecomment-1742495678
broken = !stdenv.hostPlatform.isx86_64 && !stdenv.hostPlatform.isDarwin;
2024-02-15 21:36:55 +00:00
};
}