2020-04-27 22:23:05 +02:00
|
|
|
{ stdenv
|
2020-08-12 20:11:02 +02:00
|
|
|
, lib
|
2019-10-16 21:58:57 +02:00
|
|
|
, fetchurl
|
|
|
|
, libxkbcommon
|
|
|
|
, systemd
|
2020-04-27 22:23:05 +02:00
|
|
|
, xorg
|
2022-01-06 09:14:44 +01:00
|
|
|
, electron_13
|
2020-04-27 22:23:05 +02:00
|
|
|
, makeWrapper
|
2019-10-16 21:58:57 +02:00
|
|
|
, makeDesktopItem
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "Obinskit";
|
|
|
|
exec = "obinskit";
|
2020-04-27 22:23:05 +02:00
|
|
|
icon = "obinskit";
|
2019-10-16 21:58:57 +02:00
|
|
|
desktopName = "Obinskit";
|
|
|
|
genericName = "Obinskit keyboard configurator";
|
2022-02-22 15:56:15 +01:00
|
|
|
categories = [ "Utility" ];
|
2019-10-16 21:58:57 +02:00
|
|
|
};
|
2022-01-06 09:14:44 +01:00
|
|
|
electron = electron_13;
|
2020-04-27 22:23:05 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-10-16 21:58:57 +02:00
|
|
|
pname = "obinskit";
|
2022-01-06 09:14:44 +01:00
|
|
|
version = "1.2.11";
|
2019-10-16 21:58:57 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-06 09:14:44 +01:00
|
|
|
url = "https://s3.hexcore.xyz/occ/linux/tar/ObinsKit_${version}_x64.tar.gz";
|
|
|
|
sha256 = "1kcn41wmwcx6q70spa9a1qh7wfrj1sk4v4i58lbnf9kc6vasw41a";
|
2019-10-16 21:58:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = "tar -xzf $src";
|
|
|
|
|
|
|
|
sourceRoot = "ObinsKit_${version}_x64";
|
|
|
|
|
2020-04-27 22:23:05 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-10-16 21:58:57 +02:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt/obinskit
|
2020-04-27 22:23:05 +02:00
|
|
|
|
2019-10-16 21:58:57 +02: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 22:23:05 +02:00
|
|
|
postFixup = ''
|
2020-05-22 18:25:35 +02:00
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
2020-04-27 22:23:05 +02:00
|
|
|
--add-flags $out/opt/obinskit/resources/app.asar \
|
2021-08-30 15:04:12 +02:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib libxkbcommon (lib.getLib systemd) xorg.libXt xorg.libXtst ]}"
|
2019-10-16 21:58:57 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-10-16 21:58:57 +02:00
|
|
|
description = "Graphical configurator for Anne Pro and Anne Pro II keyboards";
|
2021-08-30 15:04:12 +02:00
|
|
|
homepage = "https://www.hexcore.xyz/obinskit";
|
2019-10-16 21:58:57 +02:00
|
|
|
license = licenses.unfree;
|
2020-04-27 22:23:05 +02:00
|
|
|
maintainers = with maintainers; [ shou ];
|
2019-10-16 21:58:57 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|