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

timg: init at 2020-04-09, tiv: init at 2020-04-09 #85697

Closed
wants to merge 3 commits into from

Conversation

ToxicFrog
Copy link
Contributor

Motivation for this change

These are simple image viewers for the tty, similar to catimg but with different feature sets -- timg has better scaling options, and tiv uses 8x4 block drawing characters to achieve higher resolution.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ToxicFrog
Copy link
Contributor Author

Ping?

@Lassulus
Copy link
Member

Add myself to maintainer list is kinda right. but please use your nickname in the commit :)

@ToxicFrog
Copy link
Contributor Author

Add myself to maintainer list is kinda right. but please use your nickname in the commit :)

Done.

@@ -0,0 +1,34 @@
{ stdenv, pkgs, fetchFromGitHub }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although this is possible, its preferred to explicitly import the packages and not the whole pkgs set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use pkgs as an input.

Comment on lines +16 to +17
nativeBuildInputs = with pkgs; [gnumake];
buildInputs = with pkgs; [libwebp graphicsmagick];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the with pkgs; will be unnecessary if they are imported explicitly

@SuperSandro2000 SuperSandro2000 changed the title Add timg and tiv tty image viewers timg: init at 2020-04-09, tiv: init at 2020-04-09 Dec 29, 2020
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the version numbers in your commits and PR title to the ones in the package definitions.

@@ -0,0 +1,34 @@
{ stdenv, pkgs, fetchFromGitHub }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use pkgs as an input.

@@ -0,0 +1,34 @@
{ stdenv, pkgs, fetchFromGitHub }:

with stdenv.lib;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use with ove rthe entire package.

sha256 = "0vx4i1ibgc0rmjdb607qbdbwxz9m89vam3hgzz2kvji1zl4b90ns";
};

nativeBuildInputs = with pkgs; [gnumake];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeBuildInputs = with pkgs; [gnumake];
nativeBuildInputs =[ gnumake ];

nativeBuildInputs = with pkgs; [gnumake];
buildInputs = with pkgs; [libwebp graphicsmagick];

phases = [ "unpackPhase" "buildPhase" "installPhase" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not overwrite phases.

with stdenv.lib;

stdenv.mkDerivation rec {
name = "timg-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "timg-${version}";
pname = "timg";

with stdenv.lib;

stdenv.mkDerivation rec {
name = "tiv-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "tiv-${version}";
pname = "tiv";

@@ -0,0 +1,32 @@
{ stdenv, pkgs, fetchFromGitHub }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically all feedback from timg allpies here, too.

Comment on lines +16 to +23
nativeBuildInputs = with pkgs; [gnumake gcc];
buildInputs = with pkgs; [imagemagick];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''make -C src/main/cpp'';
installPhase = ''
mkdir -p "$out/bin/"
cp -a src/main/cpp/tiv "$out/bin/"
'';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeBuildInputs = with pkgs; [gnumake gcc];
buildInputs = with pkgs; [imagemagick];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''make -C src/main/cpp'';
installPhase = ''
mkdir -p "$out/bin/"
cp -a src/main/cpp/tiv "$out/bin/"
'';
nativeBuildInputs = [ gcc gnumake ];
buildInputs = [ imagemagick ];
buildPhase = ''
make -C src/main/cpp
'';
installPhase = ''
mkdir -p "$out/bin/"
cp -a src/main/cpp/tiv "$out/bin/"
'';

meta = {
license = licenses.asl20;
homepage = "https://github.com/stefanhaustein/TerminalImageViewer";
description = "Small C++ program to display images in a (modern) terminal using RGB ANSI codes and unicode 4x8 block graphic characters.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Small C++ program to display images in a (modern) terminal using RGB ANSI codes and unicode 4x8 block graphic characters.";
description = "Displays images in a (modern) terminal using RGB ANSI codes and unicode 4x8 block graphic characters";

meta = {
license = licenses.gpl2;
homepage = "https://github.com/hzeller/timg";
description = "A viewer that uses 24-Bit color capabilities and 1x2 unicode character blocks to display images in the terminal.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "A viewer that uses 24-Bit color capabilities and 1x2 unicode character blocks to display images in the terminal.";
description = "Viewer that uses 24-Bit color capabilities and 1x2 unicode character blocks to display images in the terminal";

@stale
Copy link

stale bot commented Jun 28, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 28, 2021
@ToxicFrog
Copy link
Contributor Author

It has been A Year and I haven't had the bandwidth to go back and deal with my PRs, but I really should do that over the long weekend or something, Sorry.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 29, 2021
@ToxicFrog
Copy link
Contributor Author

Looks like timg and tiv have both been added to nixpkgs by other people since, so I'm dropping this.

@ToxicFrog ToxicFrog closed this Jul 3, 2021
@ToxicFrog ToxicFrog deleted the timg-tiv branch July 3, 2021 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants