2023-08-27 02:56:59 +00:00
|
|
|
{ lib, appimageTools, fetchurl, asar }: let
|
2021-04-17 16:33:31 +00:00
|
|
|
pname = "flexoptix-app";
|
2023-09-12 11:42:40 +00:00
|
|
|
version = "5.16.0-latest";
|
2021-04-17 16:33:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-08-12 12:57:23 +00:00
|
|
|
name = "${pname}-${version}.AppImage";
|
2021-04-17 16:33:31 +00:00
|
|
|
url = "https://flexbox.reconfigure.me/download/electron/linux/x64/FLEXOPTIX%20App.${version}.AppImage";
|
2023-09-12 11:42:40 +00:00
|
|
|
hash = "sha256-A10r8IUB3zWKWmjen90vLXPF7V/Cgo+DhFn/Hsc1Nhg=";
|
2021-04-17 16:33:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
udevRules = fetchurl {
|
2022-11-01 17:49:51 +00:00
|
|
|
url = "https://www.flexoptix.net/static/frontend/Flexoptix/default/en_US/files/99-tprogrammer.rules";
|
2022-06-03 00:49:34 +00:00
|
|
|
hash = "sha256-OZe5dV50xq99olImbo7JQxPjRd7hGyBIVwFvtR9cIVc=";
|
2021-04-17 16:33:31 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:57:23 +00:00
|
|
|
appimageContents = (appimageTools.extract { inherit pname version src; }).overrideAttrs (oA: {
|
2021-08-25 22:19:25 +00:00
|
|
|
buildCommand = ''
|
|
|
|
${oA.buildCommand}
|
|
|
|
|
|
|
|
# Get rid of the autoupdater
|
2023-08-27 02:56:59 +00:00
|
|
|
${asar}/bin/asar extract $out/resources/app.asar app
|
2021-08-25 22:19:25 +00:00
|
|
|
sed -i 's/async isUpdateAvailable.*/async isUpdateAvailable(updateInfo) { return false;/g' app/node_modules/electron-updater/out/AppUpdater.js
|
2023-08-27 02:56:59 +00:00
|
|
|
${asar}/bin/asar pack app $out/resources/app.asar
|
2021-08-25 22:19:25 +00:00
|
|
|
'';
|
|
|
|
});
|
2021-04-17 16:33:31 +00:00
|
|
|
|
2021-08-25 22:19:25 +00:00
|
|
|
in appimageTools.wrapAppImage {
|
2022-08-12 12:57:23 +00:00
|
|
|
inherit pname version;
|
2021-08-25 22:19:25 +00:00
|
|
|
src = appimageContents;
|
2021-04-17 16:33:31 +00:00
|
|
|
|
2023-07-01 11:35:55 +00:00
|
|
|
multiArch = false; # no 32bit needed
|
2021-04-17 16:33:31 +00:00
|
|
|
extraPkgs = { pkgs, ... }@args: [
|
|
|
|
pkgs.hidapi
|
|
|
|
] ++ appimageTools.defaultFhsEnvArgs.multiPkgs args;
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
2021-08-25 22:19:25 +00:00
|
|
|
# Add desktop convencience stuff
|
2022-08-12 12:57:23 +00:00
|
|
|
mv $out/bin/{${pname}-*,${pname}}
|
2021-04-17 16:33:31 +00:00
|
|
|
install -Dm444 ${appimageContents}/flexoptix-app.desktop -t $out/share/applications
|
|
|
|
install -Dm444 ${appimageContents}/flexoptix-app.png -t $out/share/pixmaps
|
|
|
|
substituteInPlace $out/share/applications/flexoptix-app.desktop \
|
2021-08-25 22:19:25 +00:00
|
|
|
--replace 'Exec=AppRun' "Exec=$out/bin/${pname} --"
|
|
|
|
|
|
|
|
# Add udev rules
|
2021-04-17 16:33:31 +00:00
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
ln -s ${udevRules} $out/lib/udev/rules.d/99-tprogrammer.rules
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-02-08 00:50:12 +00:00
|
|
|
description = "Configure FLEXOPTIX Universal Transceivers in seconds";
|
2021-04-17 16:33:31 +00:00
|
|
|
homepage = "https://www.flexoptix.net";
|
|
|
|
changelog = "https://www.flexoptix.net/en/flexoptix-app/?os=linux#flexapp__modal__changelog";
|
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = with lib.maintainers; [ das_j ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|