4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{ lib, stdenv, bundlerEnv, ruby, fetchFromGitHub }:
|
|
let
|
|
version = "1.1";
|
|
gems = bundlerEnv {
|
|
name = "tree-from-tags-${version}-gems";
|
|
inherit ruby;
|
|
gemdir = ./.;
|
|
};
|
|
in stdenv.mkDerivation {
|
|
pname = "tree-from-tags";
|
|
inherit version;
|
|
src = fetchFromGitHub {
|
|
owner = "dbrock";
|
|
repo = "bongo";
|
|
rev = version;
|
|
sha256 = "1nszph9mn98flyhn1jq3y6mdh6jymjkvj5ng36ql016dj92apvhv";
|
|
};
|
|
buildInputs = [ gems ruby ];
|
|
installPhase = ''
|
|
mkdir -p $out/{bin,share}
|
|
cp tree-from-tags.rb $out/share/
|
|
bin=$out/bin/tree-from-tags
|
|
# we are using bundle exec to start in the bundled environment
|
|
cat > $bin <<EOF
|
|
#!/bin/sh -e
|
|
exec ${gems}/bin/bundle exec ${ruby}/bin/ruby "$out"/share/tree-from-tags.rb "\$@"
|
|
EOF
|
|
chmod +x $bin
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Create file hierarchies from media tags";
|
|
homepage = "https://www.emacswiki.org/emacs/Bongo";
|
|
platforms = ruby.meta.platforms;
|
|
maintainers = [ maintainers.livnev maintainers.dbrock ];
|
|
license = licenses.gpl2Plus;
|
|
};
|
|
}
|