Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feishin: 0.5.1 -> 0.5.3, build from source #288210

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions pkgs/applications/audio/feishin/darwin.nix

This file was deleted.

70 changes: 55 additions & 15 deletions pkgs/applications/audio/feishin/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,67 @@
{ lib
, stdenv
, callPackage
, ...
}@args:
, buildNpmPackage
, fetchFromGitHub
, electron_27
}:

let
extraArgs = removeAttrs args [ "callPackage" ];

electron = electron_27;
in buildNpmPackage rec {
pname = "feishin";
version = "0.5.1";
appname = "Feishin";
version = "0.5.3";

src = fetchFromGitHub {
owner = "jeffvli";
repo = "feishin";
rev = "refs/tags/v${version}";
hash = "sha256-yzaWOucz1lPWFlknPc8g74LfX/pFFQ2JRYSgauNGMRQ=";
};

npmDepsHash = "sha256-Fa59nwkkMHp9GNY8piAz3usNU4lhTzwonlmowFf5qqY=";

postPatch = ''
substituteInPlace package.json \
--replace-fail "electron-builder install-app-deps &&" ""
'';

npmFlags = [ "--legacy-peer-deps" ];

makeCacheWritable = true;

env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

postBuild = ''
npm exec electron-builder -- \
--dir \
-c.electronDist=${electron}/libexec/electron \
-c.electronVersion=${electron.version} \
-c.npmRebuild=false
'';

installPhase = ''
runHook preInstall

pushd release/build/*/
mkdir -p $out/opt/feishin
cp -r locales resources{,.pak} $out/opt/feishin
popd

makeWrapper ${lib.getExe electron} $out/bin/feishin \
--add-flags $out/opt/feishin/resources/app.asar \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--inherit-argv0

runHook postInstall
'';

meta = with lib; {
description = "Full-featured Subsonic/Jellyfin compatible desktop music player";
homepage = "https://github.com/jeffvli/feishin";
changelog = "https://github.com/jeffvli/feishin/releases/tag/v${version}";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
sourceProvenance = with sourceTypes; [ fromSource ];
license = licenses.mit;
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
platforms = platforms.unix;
mainProgram = "feishin";
maintainers = with maintainers; [ onny ];
};

in
if stdenv.isDarwin
then callPackage ./darwin.nix (extraArgs // { inherit pname appname version meta; })
else callPackage ./linux.nix (extraArgs // { inherit pname appname version meta; })
}
71 changes: 0 additions & 71 deletions pkgs/applications/audio/feishin/linux.nix

This file was deleted.

Loading