diff options
author | Fabian Möller <fabianm88@gmail.com> | 2022-04-20 12:07:07 +0200 |
---|---|---|
committer | Fabian Möller <fabianm88@gmail.com> | 2022-05-26 13:54:56 +0200 |
commit | 92e2e3b3f414bb421240b98145eb65089b637bbe (patch) | |
tree | a0d94b3d844c67f5dff55b1d62da17a6c8f9745c /pkgs/applications/networking/breitbandmessung | |
parent | a97c7f738028f0d8c6db504fba695fe8fcd7e747 (diff) |
breitbandmessung: don't use bundled electron
Diffstat (limited to 'pkgs/applications/networking/breitbandmessung')
-rw-r--r-- | pkgs/applications/networking/breitbandmessung/default.nix | 110 |
1 files changed, 25 insertions, 85 deletions
diff --git a/pkgs/applications/networking/breitbandmessung/default.nix b/pkgs/applications/networking/breitbandmessung/default.nix index 31f33be38670..ff14695cce84 100644 --- a/pkgs/applications/networking/breitbandmessung/default.nix +++ b/pkgs/applications/networking/breitbandmessung/default.nix @@ -1,32 +1,12 @@ { lib , stdenv -, alsa-lib -, at-spi2-atk -, at-spi2-core -, atk -, autoPatchelfHook -, cairo -, cups -, dbus -, dpkg -, expat , fetchurl -, gdk-pixbuf -, glib -, gtk3 -, libdrm -, libxkbcommon +, dpkg +, electron_16 , makeWrapper -, mesa , nixosTests -, nspr -, nss -, pango -, pciutils -, systemd +, nodePackages , undmg -, writeShellScriptBin -, xorg }: let @@ -34,19 +14,6 @@ let version = "3.1.0"; - # At first start, the program checks for supported operating systems by calling `lsb_release -a` - # and only runs when it finds Debian/Ubuntu. So we present us as Debian an make it happy. - fake-lsb-release = writeShellScriptBin "lsb_release" '' - echo "Distributor ID: Debian" - echo "Description: Debian GNU/Linux 10 (buster)" - echo "Release: 10" - echo "Codename: buster" - ''; - - binPath = lib.makeBinPath [ - fake-lsb-release - ]; - systemArgs = rec { x86_64-linux = rec { src = fetchurl { @@ -54,68 +21,41 @@ let sha256 = "sha256-jSP+H9ej9Wd+swBZSy9uMi2ExSTZ191FGZhqaocTl7w="; }; - dontUnpack = true; - nativeBuildInputs = [ - autoPatchelfHook dpkg makeWrapper + nodePackages.asar ]; - buildInputs = runtimeDependencies; - - runtimeDependencies = [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - cairo - cups - dbus - expat - gdk-pixbuf - glib - gtk3 - libdrm - libxkbcommon - mesa - nspr - nss - pango - pciutils - systemd - xorg.libX11 - xorg.libXcomposite - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXrandr - xorg.libxcb - xorg.libxshmfence - ]; + unpackPhase = "dpkg-deb -x $src ."; installPhase = '' - dpkg-deb -x $src $out mkdir -p $out/bin - - chmod -R g-w $out - - addAutoPatchelfSearchPath --no-recurse $out/opt/Breitbandmessung - autoPatchelfFile $out/opt/Breitbandmessung/breitbandmessung - - makeWrapper $out/opt/Breitbandmessung/breitbandmessung $out/bin/breitbandmessung \ - --prefix PATH : ${binPath} - - mv $out/usr/share $out/share - rmdir $out/usr + mv usr/share $out/share + mkdir -p $out/share/breitbandmessung/resources + + asar e opt/Breitbandmessung/resources/app.asar $out/share/breitbandmessung/resources + + # At first start, the program checks for supported operating systems by using the `bizzby-lsb-release` + # module and only runs when it finds Debian/Ubuntu. So we present us as Debian and make it happy. + cat <<EOF > $out/share/breitbandmessung/resources/node_modules/bizzby-lsb-release/lib/lsb-release.js + module.exports = function release() { + return { + distributorID: "Debian", + description: "Debian GNU/Linux 10 (buster)", + release: "10", + codename: "buster" + } + } + EOF + + makeWrapper ${electron_16}/bin/electron $out/bin/breitbandmessung \ + --add-flags $out/share/breitbandmessung/resources/build/electron.js # Fix the desktop link substituteInPlace $out/share/applications/breitbandmessung.desktop \ --replace /opt/Breitbandmessung $out/bin ''; - - dontAutoPatchelf = true; - dontPatchELF = true; }; x86_64-darwin = { |