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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
spotube: init at 3.4.1 #282975
spotube: init at 3.4.1 #282975
Conversation
pkgs/by-name/sp/spotube/package.nix
Outdated
| homepage = "https://spotube.netlify.app/"; | ||
| license = lib.licenses.bsdOriginal; | ||
| maintainers = with lib.maintainers; [ tomasajt ]; | ||
| platforms = [ "x86_64-linux" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you naively add darwin Apple Silicon and Intel here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we are only fetching Spotube-linux-x86_64.deb from the prebuilt artifacts, so it's only going to work on x86_64-linux for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this :)
|
Gave it a try again and everything is working as expected. Looks good! |
|
I've made some amendments so that the darwin and linux derivations are in a single file: { stdenv, fetchurl, lib, makeDesktopItem, makeWrapper, undmg, autoPatchelfHook
, dpkg, wrapGAppsHook
, libappindicator, libnotify, libsecret, mpv-unwrapped, xdg-user-dirs }:
let
pname = "spotube";
version = "3.4.0";
appname = "Spotube";
meta = with lib; {
description = ''
An open source, cross-platform Spotify client compatible across multiple platforms
utilizing Spotify's data API and YouTube (or Piped.video or JioSaavn) as an audio source,
eliminating the need for Spotify Premium'';
homepage = "https://spotube.netlify.app/";
downloadPage = "https://github.com/KRTirtho/spotube/releases";
license = licenses.bsdOriginal;
maintainers = with lib.maintainers; [ tomasajt ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
filename = if stdenv.isDarwin then
"${appname}-macos-universal.dmg"
else
"${appname}-linux-x86_64.deb";
src = fetchurl {
url =
"https://github.com/KRTirtho/spotube/releases/download/v${version}/${filename}";
hash = if stdenv.isDarwin then
"sha256-dif2ec37QL9FVPGgqqvtB2zRX6P3NCth5FFnpASR/As="
else
"sha256-XBciTNWsmaY1C8ji+SCWWP/M/uIDZHM9fi9wucHJsBY=";
};
icon = fetchurl {
url =
"https://raw.githubusercontent.com/KRTirtho/spotube/nightly/assets/spotube-logo.png";
hash = "sha256-gyzP3ynzuZFN0osmEAjwGfYmbfVxE9Nm2fLJ8q8G6BE=";
};
desktopItem = makeDesktopItem {
name = "${pname}";
desktopName = "${appname}";
comment = "An open source spotify client.";
icon = "${pname}";
exec = "feishin %U";
categories = [ "Audio" ];
mimeTypes = [ "x-scheme-handler/${pname}" ];
};
darwin = stdenv.mkDerivation {
inherit pname version src appname;
meta = meta // { platforms = [ "x86_64-darwin" "aarch64-darwin" ]; };
sourceRoot = "${appname}.app";
nativeBuildInputs = [ makeWrapper undmg ];
installPhase = ''
runHook preInstall
mkdir -p $out/{Applications/${appname}.app,bin}
cp -R . $out/Applications/${appname}.app
makeWrapper $out/Applications/${appname}.app/Contents/MacOS/${appname} $out/bin/${pname}
runHook postInstall
'';
};
linux = stdenv.mkDerivation {
inherit pname version src appname;
meta = meta // { platforms = [ "x86_64-linux" ]; };
nativeBuildInputs = [ autoPatchelfHook dpkg makeWrapper wrapGAppsHook ];
buildInputs = [ libappindicator libnotify libsecret mpv-unwrapped ];
dontWrapGApps = true;
installPhase = ''
runHook preInstall
mkdir -p $out
mv usr/* $out
runHook postInstall
'';
preFixup = ''
patchelf $out/share/spotube/lib/libmedia_kit_native_event_loop.so \
--replace-needed libmpv.so.1 libmpv.so.2
'';
postFixup = ''
makeWrapper $out/share/spotube/spotube $out/bin/spotube \
"''${gappsWrapperArgs[@]}" \
--prefix LD_LIBRARY_PATH : $out/share/spotube/lib:${
lib.makeLibraryPath [ mpv-unwrapped ]
} \
--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs ]}
'';
};
in if stdenv.isDarwin then darwin else linuxI'm not on my linux boxen atm so I'm assuming your above derivation builds correctly and just modularised it. Appreciate the effort you put in <3 N.B the desktopItem is redundant, but left it in there just in case the linux derivation doesn't make one in current state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, but 3.4.1 just got released so we might want to update to that before we merge this PR.
Description of changes
Related issue: #200120
This PR adds 1 package:
spotubeI used the prebuilt binary distribution, as the
flutterversion of Nixpkgs is not low enough for building from source.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 馃憤 reaction to pull requests you find important.