feishin: add override for web version
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
nix-update-script,
|
||||
webVersion ? false,
|
||||
}:
|
||||
let
|
||||
pname = "feishin";
|
||||
@@ -34,6 +35,7 @@ buildNpmPackage {
|
||||
inherit src;
|
||||
|
||||
npmConfigHook = pnpmConfigHook;
|
||||
npmBuildScript = if webVersion then "build:web" else "build";
|
||||
|
||||
npmDeps = null;
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
@@ -52,8 +54,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 +75,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 +90,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 +132,7 @@ buildNpmPackage {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
desktopItems = lib.optionals (!webVersion) [
|
||||
(makeDesktopItem {
|
||||
name = "feishin";
|
||||
desktopName = "Feishin";
|
||||
@@ -152,11 +158,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"; };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user