-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
popcorntime: init at 0.4.9 #168121
popcorntime: init at 0.4.9 #168121
Conversation
|
We can probably package it in a much cleaner way with yarn2nix. |
Sounds great, do you know how to use it? I tried to package it like this: Somehow only the source gets copied into $out, it looks like it doesn't build anything. |
b0008c4 to
d1804bb
Compare
|
@timjrd Added you as a co-author in the commit. |
8e80b91 to
508d1df
Compare
448a1e2 to
9247f79
Compare
|
@happysalada Yeah, was able to build it with yarn2nix :) Unfortunately it doesn't run yet, probably due to an build error (missing dependencies) I need to fix |
|
I still can't get it to work, the app wont start without displaying any meaningful error messafe :,( Not sure if this is the correct way to manually build and package it either ... |
|
The issue is probably related to this build error I can see in the logs? The build process is running fine anyway ... I really would like to read the npm log, hope I can find it |
|
Manually copied the missing node_modules into the directory. Build error is gone but app still wont start :( |
|
@onny apps are sometimes crashing at startup on NixOS because they try to |
|
Thats a good way to start debugging, thank you for the hint. |
|
That's where the script is useful: I don't know if it's the only problem or if it's a problem at all, but |
|
As I wasn't able to run Popcorn Time from this current PR, I looked at—and mostly copied—this commit, packing a nwjs application (thanks to Hound) and made this: I usually get an error about the NWJS profile, but otherwise it looks like it works as expected (torrents, identification of the players [mpv]). I understand my approach is very much the opposite of what is being done at this stage of the PR and is closer to the first idea: packaging around the final delivered artifact from the project's github, here 0.4.9. Hope this helps anyway ;) Here is the detail: { autoPatchelfHook
, fetchurl
, gcc-unwrapped
, gsettings-desktop-schemas
, gtk3
, lib
, makeDesktopItem
, makeWrapper
, nwjs
, stdenv
, unzip
, udev
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "popcorntime";
version = "0.4.9";
src = fetchurl {
url = "https://github.com/popcorn-official/popcorn-desktop/releases/download/v${version}/Popcorn-Time-${version}-linux64.zip";
sha256 = "sha256-cbKL5bgweZD/yfi/8KS0L7Raha8PTHqIm4qSPFidjUc=";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
unzip
wrapGAppsHook
];
buildInputs = [
gcc-unwrapped
gsettings-desktop-schemas
gtk3
nwjs
udev
];
sourceRoot = ".";
dontWrapGApps = true;
dontUnpack = true;
makeWrapperArgs = [
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gcc-unwrapped.lib gtk3 udev ]}"
"--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}"
];
desktopItem = makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
comment = meta.description;
genericName = meta.description;
type = "Application";
desktopName = "Popcorn-Time";
categories = [ "System" ];
};
# Extract and copy executable in $out/bin
installPhase = ''
mkdir -p $out/share/applications $out/bin $out/opt/bin $out/share/icons/hicolor/scalable/apps/
# we can't unzip it in $out/lib, because nw.js will start with
# an empty screen. Therefore it will be unzipped in a non-typical
# folder and symlinked.
unzip -q $src -d $out/opt/popcorntime
ln -s $out/opt/popcorntime/Popcorn-Time $out/bin/${pname}
ln -s $out/opt/${pname}/src/app/images/icon.png $out/share/icons/hicolor/scalable/apps/${pname}.png
ln -s ${desktopItem}/share/applications/* $out/share/applications
'';
# GSETTINGS_SCHEMAS_PATH is not set in installPhase
preFixup = ''
wrapProgram $out/bin/${pname} \
''${makeWrapperArgs[@]} \
''${gappsWrapperArgs[@]}
'';
meta = with lib; {
homepage = "https://github.com/popcorn-official/popcorn-desktop";
description = "An application that streams movies and TV shows from torrents";
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = lib.licenses.gpl3;
maintainers = with maintainers; [ ];
};
} |
|
That's super cool! You've fixed some stuff I had missing in my other attempts. Already thought about PATH and LIBRARY_PATH but really couldn't imagine what I have to add there. |
|
I'm sorry, I don't feel like maintaining a package at this point ; I have been on NixOS for a week and not willing to be engaged with it, yet. |
66f99f2 to
8f77f50
Compare
8f77f50 to
b2b485c
Compare
|
Nice thank you! Updated the commit, hope it's possible to merge it now :) |
b2b485c to
a616564
Compare
Co-authored-by: VolodiaPG
a616564 to
b4bd4a3
Compare
|
Thank you for this! |
|
|
||
| # Extract and copy executable in $out/bin | ||
| installPhase = '' | ||
| mkdir -p $out/share/applications $out/bin $out/opt/bin $out/share/icons/hicolor/scalable/apps/ |
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.
$out/share/applications and $out/opt/bin seem to be empty, is there expected to be something there?
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.
It was supposed to be populated by a .desktop entry and its icon, however it looks like it got lost somewhere ; from what I've understood it wasn't being created using the correct method…
Description of changes
This PR adds the p2p video player popcorntime at version 0.4.9.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes