2020-04-27 20:23:05 +00:00
|
|
|
{ stdenv
|
2020-08-12 18:11:02 +00:00
|
|
|
, lib
|
2019-10-16 19:58:57 +00:00
|
|
|
, fetchurl
|
|
|
|
, libxkbcommon
|
|
|
|
, systemd
|
2020-04-27 20:23:05 +00:00
|
|
|
, xorg
|
2019-10-16 19:58:57 +00:00
|
|
|
, electron_3
|
2020-04-27 20:23:05 +00:00
|
|
|
, makeWrapper
|
2019-10-16 19:58:57 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "Obinskit";
|
|
|
|
exec = "obinskit";
|
2020-04-27 20:23:05 +00:00
|
|
|
icon = "obinskit";
|
2019-10-16 19:58:57 +00:00
|
|
|
desktopName = "Obinskit";
|
|
|
|
genericName = "Obinskit keyboard configurator";
|
|
|
|
categories = "Utility";
|
|
|
|
};
|
2020-05-22 16:25:35 +00:00
|
|
|
electron = electron_3;
|
2020-04-27 20:23:05 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-10-16 19:58:57 +00:00
|
|
|
pname = "obinskit";
|
2020-04-06 06:52:30 +00:00
|
|
|
version = "1.1.4";
|
2019-10-16 19:58:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://releases.obins.net/occ/linux/tar/ObinsKit_${version}_x64.tar.gz";
|
2020-04-06 06:52:30 +00:00
|
|
|
sha256 = "0q422rmfn4k4ww1qlgrwdmxz4l10dxkd6piynbcw5cr4i5icnh2l";
|
2019-10-16 19:58:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = "tar -xzf $src";
|
|
|
|
|
|
|
|
sourceRoot = "ObinsKit_${version}_x64";
|
|
|
|
|
2020-04-27 20:23:05 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-10-16 19:58:57 +00:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt/obinskit
|
2020-04-27 20:23:05 +00:00
|
|
|
|
2019-10-16 19:58:57 +00:00
|
|
|
cp -r resources $out/opt/obinskit/
|
|
|
|
cp -r locales $out/opt/obinskit/
|
|
|
|
|
|
|
|
mkdir -p $out/share/{applications,pixmaps}
|
|
|
|
install resources/icons/tray-darwin@2x.png $out/share/pixmaps/obinskit.png
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
'';
|
|
|
|
|
2020-04-27 20:23:05 +00:00
|
|
|
postFixup = ''
|
2020-05-22 16:25:35 +00:00
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
2020-04-27 20:23:05 +00:00
|
|
|
--add-flags $out/opt/obinskit/resources/app.asar \
|
2020-08-12 18:11:02 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib libxkbcommon (lib.getLib systemd) xorg.libXt ]}"
|
2019-10-16 19:58:57 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-27 20:23:05 +00:00
|
|
|
meta = with stdenv.lib; {
|
2019-10-16 19:58:57 +00:00
|
|
|
description = "Graphical configurator for Anne Pro and Anne Pro II keyboards";
|
2020-04-27 20:23:05 +00:00
|
|
|
homepage = "http://en.obins.net/obinskit/"; # https is broken
|
2019-10-16 19:58:57 +00:00
|
|
|
license = licenses.unfree;
|
2020-04-27 20:23:05 +00:00
|
|
|
maintainers = with maintainers; [ shou ];
|
2019-10-16 19:58:57 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|