obinskit: update to new electron_3 packaging

This commit is contained in:
Pavol Rusnak 2020-04-27 22:23:05 +02:00
parent 6e41b08e7a
commit 8247dc86db
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -1,33 +1,24 @@
{ lib { stdenv
, stdenv
, fetchurl , fetchurl
, xorg
, libxkbcommon , libxkbcommon
, systemd , systemd
, gcc-unwrapped , xorg
, electron_3 , electron_3
, wrapGAppsHook , makeWrapper
, makeDesktopItem , makeDesktopItem
}: }:
let let
libPath = lib.makeLibraryPath [
libxkbcommon
xorg.libXt
systemd.lib
stdenv.cc.cc.lib
];
desktopItem = makeDesktopItem rec { desktopItem = makeDesktopItem rec {
name = "Obinskit"; name = "Obinskit";
exec = "obinskit"; exec = "obinskit";
icon = "obinskit.png"; icon = "obinskit";
desktopName = "Obinskit"; desktopName = "Obinskit";
genericName = "Obinskit keyboard configurator"; genericName = "Obinskit keyboard configurator";
categories = "Utility"; categories = "Utility";
}; };
in stdenv.mkDerivation rec { in
stdenv.mkDerivation rec {
pname = "obinskit"; pname = "obinskit";
version = "1.1.4"; version = "1.1.4";
@ -40,44 +31,33 @@ in stdenv.mkDerivation rec {
sourceRoot = "ObinsKit_${version}_x64"; sourceRoot = "ObinsKit_${version}_x64";
nativeBuildInputs = [ wrapGAppsHook ]; nativeBuildInputs = [ makeWrapper ];
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
installPhase = '' installPhase = ''
mkdir -p $out/opt/obinskit mkdir -p $out/opt/obinskit
install icudtl.dat $out/opt/obinskit/
install natives_blob.bin $out/opt/obinskit/
install v8_context_snapshot.bin $out/opt/obinskit/
install blink_image_resources_200_percent.pak $out/opt/obinskit/
install content_resources_200_percent.pak $out/opt/obinskit/
install content_shell.pak $out/opt/obinskit/
install ui_resources_200_percent.pak $out/opt/obinskit/
install views_resources_200_percent.pak $out/opt/obinskit/
cp -r resources $out/opt/obinskit/ cp -r resources $out/opt/obinskit/
cp -r locales $out/opt/obinskit/ cp -r locales $out/opt/obinskit/
mkdir -p $out/bin
ln -s ${electron_3}/bin/electron $out/bin/obinskit
mkdir -p $out/share/{applications,pixmaps} mkdir -p $out/share/{applications,pixmaps}
install resources/icons/tray-darwin@2x.png $out/share/pixmaps/obinskit.png install resources/icons/tray-darwin@2x.png $out/share/pixmaps/obinskit.png
ln -s ${desktopItem}/share/applications/* $out/share/applications ln -s ${desktopItem}/share/applications/* $out/share/applications
''; '';
preFixup = '' postFixup = ''
gappsWrapperArgs+=( makeWrapper ${electron_3}/bin/electron $out/bin/${pname} \
--add-flags $out/opt/obinskit/resources/app.asar --add-flags $out/opt/obinskit/resources/app.asar \
--prefix LD_LIBRARY_PATH : "${libPath}" --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib libxkbcommon systemd.lib xorg.libXt ]}"
)
''; '';
meta = with lib; { meta = with stdenv.lib; {
description = "Graphical configurator for Anne Pro and Anne Pro II keyboards"; description = "Graphical configurator for Anne Pro and Anne Pro II keyboards";
homepage = "http://en.obins.net/obinskit/"; homepage = "http://en.obins.net/obinskit/"; # https is broken
license = licenses.unfree; license = licenses.unfree;
maintainers = [ maintainers.shou ]; maintainers = with maintainers; [ shou ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
}; };
} }