NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.02k stars 14.03k forks source link

ocenaudio not starting under budgie (with a potential fix) #316100

Open rhizoome opened 5 months ago

rhizoome commented 5 months ago

Describe the bug

Under budgie ocenaudio does not start. There is

QT_QPA_PLATFORMTEHEME=gtk2
QT_STLYE_OVERRIDE=gtk2

set. If you unset these it will start.

unset QT_QPA_PLATFORMTEHEME
unset QT_STLYE_OVERRIDE

But then it looks out of place to the rest of the desktop. I was able to fix this using a qt6 build of ocenaudio. The fedora package is linked against qt6. I made a package.nix that creates a version of ocanaudio that looks fine and works (see at the end). I do not submit this an pull request because:

  1. I installed nixos the first time today, I have no experience with it.
  2. I do not know if my version would work for most people
  3. I have no experience with the nix-language

I renamed my package to ocenaudio-qt6, in case it makes sense to provide it as an alternative. I added the package as an overlay to my system, so I am happy with that.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run budgie (on 24.05)
  2. Start oceanaudio
  3. It does not start

Expected behavior

It should start

Screenshots

-

Additional context

{ stdenv
, lib
, fetchurl
, autoPatchelfHook
, rpmextract
, qt6
, libjack2
, alsa-lib
, bzip2
, libpulseaudio
, xz
}:

stdenv.mkDerivation rec {
  pname = "ocenaudio-qt6";
  version = "3.13.8";

  src = fetchurl {
    url = "https://www.ocenaudio.com/downloads/index.php/ocenaudio_fedora35.rpm??version=v${version}";
    hash = "sha256-BWORR6nCwnr6/paH/VAuYgmWVYTCMr/5lpOdCqPoFC8=";
  };

  nativeBuildInputs = [
    alsa-lib
    autoPatchelfHook
    bzip2
    libjack2
    libpulseaudio
    qt6.qtbase
    qt6.wrapQtAppsHook
    xz
  ];
  autoPatchelfIgnoreMissingDeps = [ "libjackserver.so.0" ];

  buildInputs = [ rpmextract ];

  dontUnpack = true;
  dontBuild = true;
  dontStrip = true;

  installPhase = ''
    mkdir -p $out
    cd $out
    rpmextract $src
    cp -av $out/opt/ocenaudio/* $out
    rm -rf $out/opt
    mv $out/usr/share $out/share
    rm -rf $out/usr
    substituteInPlace $out/share/applications/ocenaudio.desktop \
      --replace-fail "/opt/ocenaudio/bin/ocenaudio" "ocenaudio"
    mkdir -p $out/share/licenses/ocenaudio
    mv $out/bin/ocenaudio_license.txt $out/share/licenses/ocenaudio/LICENSE

    # Create symlink bzip2 library
    ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/libbz2.so.1.0

    mv $out/bin/ocenaudio $out/bin/ocenaudio.main
    makeWrapper $out/bin/ocenaudio.main $out/bin/ocenaudio \
      --unset QT_STYLE_OVERRIDE \
      --unset QT_QPA_PLATFORMTHEME
  '';

  meta = with lib; {
    description = "Cross-platform, easy to use, fast and functional audio editor";
    homepage = "https://www.ocenaudio.com";
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    license = licenses.unfree;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ onny ];
  };
}

Notify maintainers

@r-ryantm @onny


Add a :+1: reaction to issues you find important.

chewblacka commented 4 months ago

I tried to run this under budgie on unstable (24.11), and it just won't run. Terminates with SIGSEGV (Address boundary error). Works fine on other desktops.