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
Package request, ueberzug support in ranger #59906
Comments
How did you install it? Can you share your derivation please? |
Well i'm not the author of that derivation, someone made it for me
|
Ranger has merged ueberzug support but hasn't published a release since then. Therefore the current version in nixpkgs of ranger doesn't support ueberzug yet. I tried it out with their current master and it does indeed work with your derivation for ueberzug. (Notice that version 5.4.1 of pillow-simd isn't actually the simd variant, so it's slower) Here's my ranger derivation:
So I guess we'll have to wait for them to make another release to merge it into nixpkgs, or patch it ourselves. |
Oh ok thank you, i was surprised because ranger --version outputed the same but maybe the dev branch didn't updated it well thanks, i guess you can close it as any ranger update will fix it ^ |
Do you want to package ueberzug and make a PR to nixpkgs? |
Well i could do it, i'm just not the author of that derivation so i'm not much a fan of taking credits for things i didn't do |
Who's the author? Do they want to make the commits? |
@tadeokondrak is the author |
Yeah, I would submit it to nixpkgs but I wasn't exactly sure how Pillow-SIMD should work (the main Pillow derivation is pretty complicated), so I haven't, feel free to do that. |
I renamed the { stdenv, lib, fetchFromGitHub, fetchPypi, callPackage, simd ? false, ... }:
let pillow = callPackage ./pillow.nix {};
in
if simd
then (pillow.overrideAttrs (old: rec {
pname = "pillow-simd";
version = "5.3.0.post1";
src = fetchFromGitHub {
owner = "uploadcare";
repo = "pillow-simd";
rev = "v${version}";
sha256 = "1xy92vvrf2ljzcp1f9mq3xipfm89sfrargv15fg8qf567z80rs5c";
};
meta.platforms = lib.platforms.x86_64; # Needs x86 SIMD instructions
}))
else pillow Then in pillow = callPackage ../development/python-modules/pillow {
- inherit (pkgs) freetype libjpeg zlib libtiff libwebp tcl lcms2 tk;
+ inherit (pkgs.xorg) libX11;
+ };
+
+ pillow-simd = callPackage ../development/python-modules/pillow {
+ simd = true;
inherit (pkgs.xorg) libX11;
}; For ueberzeug you don't need the substitute, should check for the python version and can choose between the pillow versions: { stdenv, buildPythonPackage, fetchFromGitHub, fetchPypi, pythonAtLeast
, libX11, libXext
, xlib, psutil, docopt, attrs, pillow-simd ? null, pillow }:
buildPythonPackage rec {
pname = "ueberzug";
version = "18.1.3";
src = fetchPypi {
inherit pname version;
sha256 = "1galc64vbi8d1nbq7d8387my87jq4kqmv30jhlcwrl8g7yph00kg";
};
buildInputs = [ libX11 libXext ];
propagatedBuildInputs = [
xlib
psutil
docopt
attrs
(if pillow-simd == null || (!stdenv.hostPlatform.isx86_64) then pillow else pillow-simd)
];
disabled = !(pythonAtLeast "3.5");
meta = with stdenv.lib; {
description = "Command line utility which allows to display images in combination with X11";
homepage = https://github.com/seebye/ueberzug;
license = licenses.gpl3;
maintainer = with maintainers; [ tadeokondrak ];
};
} Also don't forget to add it to While we're at it, we might as well patch ranger because we're too impatient to wait for the next release :P -{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight
-, imagePreviewSupport ? true, w3m ? null}:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, python3Packages, file, less, highlight
+, imagePreviewSupport ? true }:
with stdenv.lib;
-assert imagePreviewSupport -> w3m != null;
-
python3Packages.buildPythonApplication rec {
name = "ranger-${version}";
version = "1.9.2";
@@ -16,11 +14,16 @@ python3Packages.buildPythonApplication rec {
sha256= "1ws6g8z1m1hfp8bv4msvbaa9f7948p687jmc8h69yib4jkv3qyax";
};
+ patches = [(fetchpatch {
+ url = "https://patch-diff.githubusercontent.com/raw/ranger/ranger/pull/1284.diff";
+ sha256 = "1hf7wp5d94g2qhdar03h861lwfl71405a3az55lrhwd7z5bsbpx1";
+ })];
+
LC_ALL = "en_US.UTF-8";
checkInputs = with python3Packages; [ pytest ];
propagatedBuildInputs = [ file ]
- ++ lib.optional (imagePreviewSupport) [ python3Packages.pillow ];
+ ++ (lib.optional imagePreviewSupport (with python3Packages; [ ueberzug ]));
checkPhase = ''
py.test tests
@@ -46,12 +49,11 @@ python3Packages.buildPythonApplication rec {
substituteInPlace ranger/config/rc.conf \
--replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
'' + optionalString imagePreviewSupport ''
- substituteInPlace ranger/ext/img_display.py \
- --replace /usr/lib/w3m ${w3m}/libexec/w3m
-
- # give image previews out of the box when building with w3m
+ # give image previews out of the box when building with
substituteInPlace ranger/config/rc.conf \
--replace "set preview_images false" "set preview_images true"
+ substituteInPlace ranger/config/rc.conf \
+ --replace "set preview_images_method w3m" "set preview_images_method ueberzug"
'';
meta = with lib; { |
Oh and it works fantastically in ranger :) |
Ranger has published a new release with ueberzug support. |
@JohnAZoidberg Thanks ! |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
The pull request that added support for this in ranger was released with 1.9.3. We do have ranger 1.9.3 in nixpkgs. I think we can close this issue. |
I marked this as stale due to inactivity. → More info |
Hi @alkeryn 👋 When reading the above comments I get the impression that this issue has been resolved. If so, would you be able to close this issue? (I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me). |
@patka-123 where there is little doubt like here, I think it's fair to close and ask for the person to reopen if it's still not solved. |
So there is a python package called ueberzug that can be used to display images in ranger, it is kinda similar to w3m except it works better and most importantly it works in termite in bspwm which w3m dosen't
I found out how to install ueberzug but it dosen't work in ranger for some reason ^
The text was updated successfully, but these errors were encountered: