mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-19 23:21:27 +00:00
[backport 26.05] feishin: add override for web version (#540860)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
nix-update-script,
|
||||
webVersion ? false,
|
||||
}:
|
||||
let
|
||||
pname = "feishin";
|
||||
@@ -33,7 +34,10 @@ buildNpmPackage {
|
||||
|
||||
inherit src;
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
npmConfigHook = pnpmConfigHook;
|
||||
npmBuildScript = if webVersion then "build:web" else "build";
|
||||
|
||||
npmDeps = null;
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
@@ -52,8 +56,8 @@ buildNpmPackage {
|
||||
nativeBuildInputs = [
|
||||
pnpm_10
|
||||
]
|
||||
++ lib.optionals (stdenv.hostPlatform.isLinux) [ copyDesktopItems ]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
++ lib.optionals (stdenv.hostPlatform.isLinux && !webVersion) [ copyDesktopItems ]
|
||||
++ lib.optionals (stdenv.hostPlatform.isDarwin && !webVersion) [
|
||||
darwin.autoSignDarwinBinariesHook
|
||||
actool
|
||||
];
|
||||
@@ -73,7 +77,7 @@ buildNpmPackage {
|
||||
ln -s ${dart-sass}/bin/dart-sass "$dir"/sass
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
postBuild = lib.optionalString (!webVersion) ''
|
||||
cp -r ${electron.dist} electron-dist
|
||||
chmod -R u+w electron-dist
|
||||
|
||||
@@ -88,14 +92,18 @@ buildNpmPackage {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
+ lib.optionalString webVersion ''
|
||||
mkdir -p $out
|
||||
cp -r out/web/* $out
|
||||
''
|
||||
+ lib.optionalString (stdenv.hostPlatform.isDarwin && !webVersion) ''
|
||||
mkdir -p $out/{Applications,bin}
|
||||
cp -r dist/**/Feishin.app $out/Applications/
|
||||
makeWrapper $out/Applications/Feishin.app/Contents/MacOS/Feishin $out/bin/feishin \
|
||||
--prefix PATH : "${lib.makeBinPath [ mpv-unwrapped ]}" \
|
||||
--set DISABLE_AUTO_UPDATES 1
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
+ lib.optionalString (stdenv.hostPlatform.isLinux && !webVersion) ''
|
||||
mkdir -p $out/share/feishin
|
||||
|
||||
pushd dist/*-unpacked/
|
||||
@@ -126,7 +134,7 @@ buildNpmPackage {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
desktopItems = lib.optionals (!webVersion) [
|
||||
(makeDesktopItem {
|
||||
name = "feishin";
|
||||
desktopName = "Feishin";
|
||||
@@ -152,11 +160,11 @@ buildNpmPackage {
|
||||
sourceProvenance = with lib.sourceTypes; [ fromSource ];
|
||||
license = lib.licenses.gpl3Plus;
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "feishin";
|
||||
maintainers = with lib.maintainers; [
|
||||
BatteredBunny
|
||||
onny
|
||||
jlbribeiro
|
||||
];
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (!webVersion) { mainProgram = "feishin"; };
|
||||
}
|
||||
|
||||
@@ -11694,4 +11694,6 @@ with pkgs;
|
||||
gpac-unstable = callPackage ../by-name/gp/gpac/package.nix {
|
||||
releaseChannel = "unstable";
|
||||
};
|
||||
|
||||
feishin-web = feishin.override { webVersion = true; };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user