Nixpkgs: Add hunter (file manager) package

Created on 28 Mar 2020  路  4Comments  路  Source: NixOS/nixpkgs

Project description
"The fastest file manager in the galaxy!" - aka the ranger file manager rewritten async in rust.

Metadata

Possible Package Definition

{ stdenv, rustPlatform, fetchFromGitHub, IOKit }:                                                                                             

assert stdenv.isDarwin -> IOKit != null;                                                                                                      

rustPlatform.buildRustPackage rec {                                                                                                           
  pname = "hunter-filemanager";                                                                                                               
  version = "1.3.5";                                                                                                                          

  src = fetchFromGitHub {                                                                                                                     
    owner = "rabite0";                                                                                                                        
    repo = "hunter";                                                                                                                          
    rev = version;                                                                                                                            
    sha256 = "7583e0a16e541a72cd87020414cdc53eddc958f6";                                                                                      
  };                                                                                                                                          

  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ IOKit ];                                                                               

  cargoSha256 = "0wmlmkq4y2923i5kjhprw2hd2v5qls49ncs6h8g9rdlmwd7qdl86";                                                                       

  meta = with stdenv.lib; {                                                                                                                   
    description = "The fastest file manager in the galaxy!";                                                                                  
    homepage = https://github.com/rabite0/hunter;                                                                                             
    license = licenses.wtfpl;                                                                                                                 
    maintainers = ???                                                                                                                         
    platforms = platforms.unix;                                                                                                               
  };                                                                                                                                          
}  

Sorry I can't create a PR myself - I do not have permission from my employer to contribute to open source code.

packaging request

Most helpful comment

This derivation could likely be improved, but it works for me:

{ stdenv
, callPackage
, makeRustPlatform
, fetchFromGitHub
, IOKit ? null
, makeWrapper
, glib
, gst_all_1
, libsixel
}:

assert stdenv.isDarwin -> IOKit != null;

let
  date = "2020-05-22";
  mozillaOverlay = fetchFromGitHub {
    owner = "mozilla";
    repo = "nixpkgs-mozilla";
    rev = "e912ed483e980dfb4666ae0ed17845c4220e5e7c";
    sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
  };
  mozilla = callPackage "${mozillaOverlay.out}/package-set.nix" {};
  rustNightly = (mozilla.rustChannelOf { inherit date; channel = "nightly"; }).rust;
  rustPlatform = makeRustPlatform {
    cargo = rustNightly;
    rustc = rustNightly;
  };
in
rustPlatform.buildRustPackage rec {
  pname = "hunter";
  version = "1.3.5";

  src = fetchFromGitHub {
    owner = "rabite0";
    repo = "hunter";
    rev = "v${version}";
    sha256 = "0z28ymz0kr726zjsrksipy7jz7y1kmqlxigyqkh3pyh154b38cis";
  };

  RUSTC_BOOTSTRAP=1;

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [
    glib
    gst_all_1.gstreamer
    gst_all_1.gst-plugins-base
    gst_all_1.gst-plugins-good
    gst_all_1.gst-plugins-ugly
    gst_all_1.gst-plugins-bad
    libsixel
  ] ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];

  postInstall = ''
    wrapProgram $out/bin/hunter --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
  '';

  cargoSha256 = "18ycj1f310s74gkjz2hh4dqzjb3bnxm683968l1cbxs7gq20jzx6";

  meta = with stdenv.lib; {
    description = "The fastest file manager in the galaxy!";
    homepage = https://github.com/rabite0/hunter;
    license = licenses.wtfpl;
    maintainers = [];
    platforms = platforms.unix;
  };
}

All 4 comments

{ stdenv
, callPackage
, makeRustPlatform
, fetchFromGitHub, IOKit ? null
}:

assert stdenv.isDarwin -> IOKit != null;

let
  # date = "2020-3-30";
  date = "2019-07-30";
  mozillaOverlay = fetchFromGitHub {
    owner = "mozilla";
    repo = "nixpkgs-mozilla";
    rev = "e912ed483e980dfb4666ae0ed17845c4220e5e7c";
    sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
  };
  mozilla = callPackage "${mozillaOverlay.out}/package-set.nix" {};
  rustNightly = (mozilla.rustChannelOf { inherit date; channel = "nightly"; }).rust;
  rustPlatform = makeRustPlatform {
    cargo = rustNightly;
    rustc = rustNightly;
  };
in
rustPlatform.buildRustPackage rec {
  pname = "hunter-filemanager";
  version = "1.3.5";

  src = fetchFromGitHub {
    owner = "rabite0";
    repo = "hunter";
    rev = "v${version}";
    sha256 = "0z28ymz0kr726zjsrksipy7jz7y1kmqlxigyqkh3pyh154b38cis";
  };

  RUSTC_BOOTSTRAP=1;

  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ IOKit ];

  cargoSha256 = "0qnvw4n49m9shpql8bh3l19iymkfbbsd548gm1p7k26c2n9iwc7y";

  meta = with stdenv.lib; {
    description = "The fastest file manager in the galaxy!";
    homepage = https://github.com/rabite0/hunter;
    license = licenses.wtfpl;
    maintainers = [];
    platforms = platforms.unix;
  };
}


fails with

Compiling async_value v0.2.5
   Compiling image v0.21.3
error[E0658]: use of unstable library feature 'mem_take'
   --> src/files.rs:214:38
    |
214 |                             false => std::mem::take(&mut old_buffer[old_pos])
    |                                      ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/61129
    = help: add `#![feature(mem_take)]` to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `hunter`.
warning: build failed, waiting for other jobs to finish...
error: linking with `/nix/store/1wb31gzrjw055xl6d3igzj1gnajzlwbk-gcc-wrapper-9.2.0/bin/cc` failed: exit code: 1
  |
  = note: "/nix/store/1wb31gzrjw055xl6d3igzj1gnajzlwbk-gcc-wrapper-9.2.0/bin/cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/nix/store/hwn3m07h6alkrw8f4pw3bkc990h4543l-rust-1.38.0-nightly-2019-07-29-04b88a9eb/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/build/source/target/x86_64-unknown-linux-gnu/release/deps/hunter_media-4fb235d29ea98d62.hunter_media.cg9z37q3-cgu.0.rcgu.o" "-o" "/build/source/target/x86_64-unknown-linux-gnu/release/deps/hunter_media-4fb235d29ea98d62" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/build/source/target/x86_64-unknown-linux-gnu/release/deps" "-L" "/build/source/target/release/deps" "-L" "/build/source/target/x86_64-unknown-linux-gnu/release/build/backtrace-sys-17dc6065238b858c/out" "-L" "/build/source/target/x86_64-unknown-linux-gnu/release/build/sixel-sys-14e93ede716e855a/out/lib" "-L" "/nix/store/hwn3m07h6alkrw8f4pw3bkc990h4543l-rust-1.38.0-nightly-2019-07-29-04b88a9eb/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/build/rustcIX3ozN/libbacktrace_sys-542bcc0a801333ad.rlib" "-Wl,--start-group" "/build/rustcIX3ozN/libbacktrace_sys-8a69cc14f6a9e6ef.rlib" "-Wl,--end-group" "/nix/store/fy4s629zgxb6gf3m65xmh3g5c48ylbxx-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-885d1467d513261b.rlib" "-Wl,-Bdynamic" "-lsixel" "-lgstvideo-1.0" "-lgstapp-1.0" "-lgstbase-1.0" "-lgstreamer-1.0" "-lgobject-2.0" "-lgobject-2.0" "-lglib-2.0" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgstvideo-1.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgstapp-1.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgstbase-1.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgstreamer-1.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgobject-2.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lgobject-2.0
          /nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin/ld: cannot find -lglib-2.0
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `hunter`.

This derivation could likely be improved, but it works for me:

{ stdenv
, callPackage
, makeRustPlatform
, fetchFromGitHub
, IOKit ? null
, makeWrapper
, glib
, gst_all_1
, libsixel
}:

assert stdenv.isDarwin -> IOKit != null;

let
  date = "2020-05-22";
  mozillaOverlay = fetchFromGitHub {
    owner = "mozilla";
    repo = "nixpkgs-mozilla";
    rev = "e912ed483e980dfb4666ae0ed17845c4220e5e7c";
    sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
  };
  mozilla = callPackage "${mozillaOverlay.out}/package-set.nix" {};
  rustNightly = (mozilla.rustChannelOf { inherit date; channel = "nightly"; }).rust;
  rustPlatform = makeRustPlatform {
    cargo = rustNightly;
    rustc = rustNightly;
  };
in
rustPlatform.buildRustPackage rec {
  pname = "hunter";
  version = "1.3.5";

  src = fetchFromGitHub {
    owner = "rabite0";
    repo = "hunter";
    rev = "v${version}";
    sha256 = "0z28ymz0kr726zjsrksipy7jz7y1kmqlxigyqkh3pyh154b38cis";
  };

  RUSTC_BOOTSTRAP=1;

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [
    glib
    gst_all_1.gstreamer
    gst_all_1.gst-plugins-base
    gst_all_1.gst-plugins-good
    gst_all_1.gst-plugins-ugly
    gst_all_1.gst-plugins-bad
    libsixel
  ] ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];

  postInstall = ''
    wrapProgram $out/bin/hunter --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
  '';

  cargoSha256 = "18ycj1f310s74gkjz2hh4dqzjb3bnxm683968l1cbxs7gq20jzx6";

  meta = with stdenv.lib; {
    description = "The fastest file manager in the galaxy!";
    homepage = https://github.com/rabite0/hunter;
    license = licenses.wtfpl;
    maintainers = [];
    platforms = platforms.unix;
  };
}

@callahad Thanks!
Works for me. Any reason not to PR that?

I didn't submit a pull request because I don't use Hunter, so I didn't want to take on the responsibility of maintaining the derivation 馃檪

Totally happy for anyone else to claim authorship and submit that as a PR, though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spacekitteh picture spacekitteh  路  3Comments

sid-kap picture sid-kap  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

grahamc picture grahamc  路  3Comments

teto picture teto  路  3Comments