nixpkgs-suyu/pkgs/applications/networking/instant-messengers/mikutter/default.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2017-05-18 02:47:45 +02:00
{ stdenv, fetchurl
, bundlerEnv, ruby
2017-05-18 02:47:45 +02:00
, alsaUtils, libnotify, which, wrapGAppsHook, gtk2
}:
stdenv.mkDerivation rec {
name = "mikutter-${version}";
2017-10-31 05:33:52 +01:00
version = "3.5.13";
2017-05-18 02:47:45 +02:00
src = fetchurl {
url = "https://mikutter.hachune.net/bin/mikutter.${version}.tar.gz";
2017-10-31 05:33:52 +01:00
sha256 = "2e01cd6cfe0caad663a381e5263f6d8030f0fb7cd8d4f858d320166516c7c320";
2017-05-18 02:47:45 +02:00
};
env = bundlerEnv {
name = "mikutter-${version}-gems";
gemdir = ./.;
inherit ruby;
};
buildInputs = [ alsaUtils libnotify which gtk2 ruby ];
nativeBuildInputs = [ wrapGAppsHook ];
postUnpack = ''
rm -rf $sourceRoot/vendor
'';
installPhase = ''
install -v -D -m644 README $out/share/doc/mikutter/README
install -v -D -m644 LICENSE $out/share/doc/mikutter/LICENSE
rm -v README LICENSE
cp -rv . $out
mkdir $out/bin/
# hack wrapGAppsHook wants a file not a symlink
mv $out/mikutter.rb $out/bin/mikutter
gappsWrapperArgs+=(
--prefix PATH : "${ruby}/bin:${alsaUtils}/bin:${libnotify}/bin"
--prefix GEM_HOME : "${env}/${env.ruby.gemPath}"
--set DISABLE_BUNDLER_SETUP 1
)
mkdir -p $out/share/mikutter $out/share/applications
ln -sv $out/core/skin $out/share/mikutter/skin
substituteAll ${./mikutter.desktop} $out/share/applications/mikutter.desktop
'';
postFixup = ''
mv $out/bin/.mikutter-wrapped $out/mikutter.rb
substituteInPlace $out/bin/mikutter \
--replace "$out/bin/.mikutter-wrapped" "$out/mikutter.rb"
'';
meta = with stdenv.lib; {
description = "An extensible Twitter client";
homepage = https://mikutter.hachune.net;
2017-05-18 02:47:45 +02:00
maintainers = with maintainers; [ midchildan ];
platforms = ruby.meta.platforms;
license = licenses.mit;
};
}