fix: overridable per-user BLHeliSuite32 state dir
Separate BLHeliSuite32 state workaround from dist and add per-user state dir.
This commit is contained in:
parent
978bc19f68
commit
7ec67295f4
|
@ -19,7 +19,7 @@ in {
|
|||
betaflight-configurator
|
||||
inav-configurator
|
||||
inav-blackbox-tools
|
||||
blhelisuite32
|
||||
(blhelisuite32.override { workdir = "${config.home.homeDirectory}/.blhelisuite32"; })
|
||||
expresslrs-configurator
|
||||
];
|
||||
|
||||
|
|
|
@ -4,23 +4,17 @@
|
|||
, fetchzip
|
||||
, stdenvNoCC
|
||||
, makeDesktopItem
|
||||
, buildFHSUserEnv }: let
|
||||
, buildFHSUserEnv
|
||||
, workdir ? "/tmp/blhelisuite32" }: let
|
||||
name = "BLHeliSuite32";
|
||||
pname = "blhelisuite32";
|
||||
workdir = "/tmp/${pname}";
|
||||
version = "32.10";
|
||||
suffix = "1044";
|
||||
|
||||
dist = fetchzip {
|
||||
name = "${pname}-dist";
|
||||
url = "https://github.com/bitdump/BLHeli/releases/download/Rev${version}/${name}xLinux64_${suffix}.zip";
|
||||
hash = "sha256-lempCne+Sf/38WHfJHRdL6MspSpi+UhpZNFcsPgI0jw=";
|
||||
|
||||
postFetch = ''
|
||||
# BLHeliSuite32 tries to write next to its binary
|
||||
ln -s ${workdir}/settings $out/Settings
|
||||
ln -s ${workdir}/music $out/Music
|
||||
'';
|
||||
hash = "sha256-y4S824s9Ipxb1M1IeD6Lo6k7hmm8CEmPflvhaqZz+84=";
|
||||
};
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
|
@ -56,6 +50,20 @@
|
|||
cp -r ${name}*.png "$out"
|
||||
'';
|
||||
};
|
||||
|
||||
linked = stdenvNoCC.mkDerivation {
|
||||
inherit pname version;
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
src = dist;
|
||||
|
||||
installPhase = ''
|
||||
cp -r . "$out"
|
||||
|
||||
# BLHeliSuite32 tries to write next to its binary
|
||||
ln -s ${workdir}/settings $out/Settings
|
||||
ln -s ${workdir}/music $out/Music
|
||||
'';
|
||||
};
|
||||
in buildFHSUserEnv {
|
||||
inherit pname;
|
||||
targetPkgs = pkgs: (with pkgs; [
|
||||
|
@ -80,5 +88,5 @@ in buildFHSUserEnv {
|
|||
runScript = "sh -c '" +
|
||||
"mkdir -p ${workdir}/settings && " +
|
||||
"mkdir -p ${workdir}/music && " +
|
||||
"exec ${dist}/${name}xl'";
|
||||
"exec ${linked}/${name}xl'";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue