"Create custom package for jellyfin-media-player"
This commit is contained in:
parent
9dab96573a
commit
c81d494387
40
flake.lock
40
flake.lock
|
@ -55,6 +55,25 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flatpak": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662408312,
|
||||
"narHash": "sha256-H1kmMTmXLud5duk6O+wR0zWU7TPh37y1uDB7SAfpW/w=",
|
||||
"owner": "yawnt",
|
||||
"repo": "declarative-nix-flatpak",
|
||||
"rev": "a82b3b135f79b78c379c4f1b0c52957cd7ccf50c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "yawnt",
|
||||
"ref": "main",
|
||||
"repo": "declarative-nix-flatpak",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-crypt-agessh": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -130,6 +149,20 @@
|
|||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1664904529,
|
||||
"narHash": "sha256-mGlB/SQR4E9jb7fOOxCTJlwL6Mk1Dpyvi4UrOXL6C18=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b7a47253e0c8cb04c0a3f8ed3149e90229e62884",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1658912196,
|
||||
"narHash": "sha256-GTP5XCLPU2Hg2bQC5dVqSBF9ef5C/J6pD4qM09Ba4Gk=",
|
||||
|
@ -145,7 +178,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1658119717,
|
||||
"narHash": "sha256-4upOZIQQ7Bc4CprqnHsKnqYfw+arJeAuU+QcpjYBXW0=",
|
||||
|
@ -165,7 +198,7 @@
|
|||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"libnbtplusplus": "libnbtplusplus",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"tomlplusplus": "tomlplusplus"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -186,9 +219,10 @@
|
|||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"fenix": "fenix",
|
||||
"flatpak": "flatpak",
|
||||
"git-crypt-agessh": "git-crypt-agessh",
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"polymc": "polymc",
|
||||
"unstable": "unstable"
|
||||
}
|
||||
|
|
|
@ -18,11 +18,13 @@
|
|||
git-crypt-agessh.inputs.nixpkgs.follows = "nixpkgs"; # idk if this is needed
|
||||
|
||||
polymc.url = "github:PolyMC/PolyMC";
|
||||
|
||||
flatpak.url = "github:yawnt/declarative-nix-flatpak/main";
|
||||
};
|
||||
|
||||
# nixpkgs.overlays = [ inputs.polymc.overlay ];
|
||||
|
||||
outputs = inputs@{ nixpkgs, unstable, home-manager, agenix, git-crypt-agessh, polymc, ... }:
|
||||
outputs = inputs@{ nixpkgs, unstable, home-manager, agenix, flatpak, git-crypt-agessh, polymc, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
|
||||
|
@ -51,6 +53,9 @@
|
|||
inherit (pkgs.stdenv.targetPlatform) system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
# _module.args.flatpak = import inputs.flatpak {
|
||||
# inherit (pkgs.stdenv.targetPlatform) system;
|
||||
# };
|
||||
};
|
||||
in [
|
||||
{
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
slack
|
||||
google-chrome
|
||||
(callPackage ../../modules/pkgs/upwork.nix { inherit runCommandLocal; })
|
||||
(callPackage ../../modules/pkgs/jellyfin-media-player.nix { inherit runCommandLocal; })
|
||||
(libsForQt5.callPackage ../../modules/pkgs/jellyfin-media-player.nix { })
|
||||
jetbrains.idea-community
|
||||
renderdoc
|
||||
];
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
imports = [
|
||||
./audio
|
||||
./cli-tools.nix
|
||||
./flatpak
|
||||
];
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{pkgs, flatpak, ... }:
|
||||
let
|
||||
runtime = flatpak.lib.flatpak.fetchRuntimeFromFlatHub {
|
||||
name = "org.freedesktop.Platform";
|
||||
branch = "21.08";
|
||||
commit = "c7252386179c4c1ecf5d93bdaec6ca82852dddfdae7112b5c3177f7424c4a928";
|
||||
sha256 = "sha256-wuFiB2+x+Mj6F9idkrknvD9Su6bWr5QVhgcB8/4uBQc=";
|
||||
};
|
||||
jmp = flatpak.lib.flatpak.fetchAppFromFlatHub {
|
||||
name = "com.github.iwalton3.jellyfin-media-player";
|
||||
commit = "f26193386f3552bc7d6849078ef073d1ca94629d";
|
||||
sha256 = "sha256-yxnsiou/ujd9fdP4D7J7i00uNGm0TjHgrIp0TTwUq3o=";
|
||||
inherit runtime;
|
||||
};
|
||||
in {
|
||||
services.flatpak.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
flatpak.lib.flatpak.wrapFlatpakLauncher "com.github.iwalton3.jellyfin-media-player" jmp runtime
|
||||
];
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, python
|
||||
, unzip
|
||||
, qtbase
|
||||
, wrapQtAppsHook
|
||||
}:
|
||||
|
||||
let
|
||||
stdenv = pkgs.clangStdenv;
|
||||
|
||||
distZip = builtins.fetchurl {
|
||||
url = "https://github.com/iwalton3/jellyfin-web-jmp/releases/download/jwc-10.8.1/dist.zip";
|
||||
sha256 = "sha256:1mn0l89li1cv3jmazrdbdhjldbm0daphv18193jd24vhwxd4sx9z";
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "v1.7.1";
|
||||
pname = "jellyfin-media-player";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jellyfin";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-piMqI4qxcNUSNC+0JE2KZ/cvlNgtxUOnSfrcWnBVzC0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake wrapQtAppsHook unzip ];
|
||||
|
||||
buildInputs = [ qtbase python pkgs.SDL2 pkgs.zlib-ng pkgs.fribidi pkgs.gnutls pkgs.libsForQt5.qt5.qtwebengine
|
||||
pkgs.libsForQt5.qt5.qtquickcontrols pkgs.libsForQt5.qt5.qtx11extras pkgs.libsForQt5.qt5.qtwebchannel
|
||||
pkgs.libcec pkgs.mpv ];
|
||||
|
||||
configurePhase = ''
|
||||
unzip -q ${pkgs.lib.strings.escapeShellArg distZip}
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Jellyfin Desktop Client based on Plex Media Player.";
|
||||
homepage = "https://github.com/jellyfin/jellyfin-media-player";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ seanomik ];
|
||||
};
|
||||
}
|
|
@ -1,80 +1,78 @@
|
|||
{ lib, stdenv, fetchurl, dpkg, wrapGAppsHook, autoPatchelfHook
|
||||
, alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig, freetype
|
||||
, gdk-pixbuf, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid, libX11, libxcb
|
||||
, libXcomposite, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender
|
||||
, libXScrnSaver, libXtst, mesa, nspr, nss, openssl, pango, systemd, writeText, runCommandLocal, wget }:
|
||||
{ lib
|
||||
, pkgs
|
||||
, stdenv
|
||||
, fetchurl
|
||||
|
||||
# Packaging tools
|
||||
, dpkg
|
||||
, wrapQtAppsHook
|
||||
|
||||
# Dependencies
|
||||
, qtbase
|
||||
, qt5
|
||||
, xorg
|
||||
, mesa
|
||||
, SDL2
|
||||
, zlib-ng
|
||||
, fribidi
|
||||
, gnutls
|
||||
, libcec
|
||||
, mpv
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jellyfin-media-player";
|
||||
version = "1.7.1";
|
||||
hotfix = "-1";
|
||||
pname = "jellyfin-media-player";
|
||||
|
||||
src = runCommandLocal "${pname}_${version}_amd64-jammy.deb"
|
||||
rec {
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "sha256-g2RldDAvgEpyKz+umxcaAjWfGGH9DZ56UndsIraudFg=";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/jellyfin/jellyfin-media-player/releases/download/v${version}/jellyfin-media-player_${version}${hotfix}_amd64-jammy.deb";
|
||||
sha256 = "sha256-9z3L0c+2LDPMx82biJq/Mhsb8rt6Lr+4F/jWzT5v0R4=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ wget ];
|
||||
sourceRoot = ".";
|
||||
unpackCmd = "dpkg-deb -x $src .";
|
||||
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
} ''
|
||||
# Figure out certificates
|
||||
wget --no-check-certificate \
|
||||
-U "Mozilla/5.0 (X11; Linux x86_64; rv:103.0)" \
|
||||
https://github.com/jellyfin/jellyfin-media-player/releases/download/v1.7.1/jellyfin-media-player_1.7.1-1_amd64-jammy.deb \
|
||||
-O $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
dpkg
|
||||
wrapGAppsHook
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libcxx systemd libpulseaudio
|
||||
stdenv.cc.cc alsa-lib atk at-spi2-atk at-spi2-core cairo cups
|
||||
dbus expat fontconfig freetype gdk-pixbuf glib gtk3 libdrm libnotify
|
||||
libuuid libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes
|
||||
libXi libXrandr libXrender libXScrnSaver libXtst mesa nspr nss pango systemd
|
||||
];
|
||||
|
||||
libPath = lib.makeLibraryPath buildInputs;
|
||||
|
||||
dontWrapGApps = true;
|
||||
dontBuild = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
unpackPhase = ''
|
||||
# curl -i -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0" -O https://upwork-usw2-desktopapp.upwork.com/binaries/v5_6_10_13_3c485d1dd2af4f61/upwork_5.6.10.13_amd64.deb
|
||||
echo $out
|
||||
echo $src
|
||||
dpkg-deb -x "$src" ./
|
||||
'';
|
||||
nativeBuildInputs = [ wrapQtAppsHook dpkg ];
|
||||
|
||||
buildInputs = [ qtbase qt5.qtwebengine ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mv usr $out
|
||||
# mv share $out
|
||||
# Copy everything in usr to $out
|
||||
cp -r usr/ $out/
|
||||
|
||||
# Now it requires lib{ssl,crypto}.so.1.0.0. Fix based on Spotify pkg.
|
||||
# https://github.com/NixOS/nixpkgs/blob/efea022d6fe0da84aa6613d4ddeafb80de713457/pkgs/applications/audio/spotify/default.nix#L129
|
||||
# mkdir -p $out/lib/upwork
|
||||
# ln -s ${lib.getLib openssl}/lib/libssl.so $out/lib/upwork/libssl.so.1.0.0
|
||||
# ln -s ${lib.getLib openssl}/lib/libcrypto.so $out/lib/upwork/libcrypto.so.1.0.0
|
||||
# Link the web-client next to the bin file.
|
||||
# Without this, the qt5-webengine(?) wont load since it can't find .html files
|
||||
ln -s $out/share/jellyfinmediaplayer/web-client $out/bin/web-client
|
||||
'';
|
||||
|
||||
sed -e "s|/opt/jellyfin-media-player|$out/bin|g" -i $out/share/applications/com.github.iwalton3.jellyfin-media-player.desktop
|
||||
makeWrapper $out/bin/jellyfinmediaplayer \
|
||||
$out/bin/jellyfinmediaplayer \
|
||||
--prefix LD_LIBRARY_PATH : ${libPath}
|
||||
runHook postInstall
|
||||
preFixup = let
|
||||
libPath = lib.makeLibraryPath [
|
||||
qtbase
|
||||
qt5.qtwebengine qt5.qtquickcontrols qt5.qtx11extras qt5.qtwebchannel qt5.qtdeclarative
|
||||
xorg.libX11 # libX11.so.6
|
||||
xorg.libXrandr # libXrandr.so.2
|
||||
SDL2 # libSDL2-2.0.so.0
|
||||
libcec # libcec.so.6
|
||||
mpv # libmpv.so.1
|
||||
|
||||
stdenv.cc.cc.lib # libstdc++.so.6
|
||||
];
|
||||
in ''
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${libPath}" \
|
||||
$out/bin/jellyfinmediaplayer
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Jellyfin Desktop Client based on Plex Media Player";
|
||||
description = "Jellyfin Desktop Client based on Plex Media Player.";
|
||||
homepage = "https://github.com/jellyfin/jellyfin-media-player";
|
||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||
license = licenses.gpl2Only;
|
||||
license = licenses.gpl2;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ seanomik ];
|
||||
};
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from git import Repo
|
||||
import shutil
|
||||
import os
|
||||
|
||||
GIT_REPO_URL = "git@git.seanomik.net:SeanOMik/nixos-dotfiles.git"
|
|
@ -12,18 +12,19 @@ GIT_REPO_URL = "git@git.seanomik.net:SeanOMik/nixos-dotfiles.git"
|
|||
def get_yes_no_answer(question: str, error_msg: str = "ERROR: Malformed input!"):
|
||||
ans = ""
|
||||
|
||||
while ans != "y" or ans != "n":
|
||||
while True:
|
||||
print(f"{question} (y,n): ", end="")
|
||||
ans = input()
|
||||
ans = input().lower().strip()
|
||||
|
||||
if ans != "y" or ans != "n":
|
||||
print(error_msg)
|
||||
print(f"Input: \"{ans}\"");
|
||||
|
||||
if ans == "y":
|
||||
return True
|
||||
elif ans == "n":
|
||||
return False
|
||||
|
||||
print(error_msg)
|
||||
|
||||
## Clears the working directory
|
||||
def remove_working_dir():
|
||||
if os.path.exists(WORKING_DIR):
|
Loading…
Reference in New Issue