diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix index 36320a01061..1ce0a44445b 100644 --- a/pkgs/applications/audio/audacity/default.nix +++ b/pkgs/applications/audio/audacity/default.nix @@ -1,9 +1,7 @@ { stdenv , lib , fetchFromGitHub -, fetchpatch , cmake -, wxGTK , pkg-config , python3 , gettext @@ -41,33 +39,20 @@ }: # TODO -# - as of 2.4.2, GTK2 is still the recommended version ref https://www.audacityteam.org/download/source/ check if that changes in future versions +# - as of 3.0.2, GTK2 is still the recommended version ref https://www.audacityteam.org/download/source/ check if that changes in future versions # - detach sbsms stdenv.mkDerivation rec { pname = "audacity"; - version = "2.4.2"; + version = "3.0.2"; src = fetchFromGitHub { owner = "audacity"; repo = "audacity"; rev = "Audacity-${version}"; - sha256 = "sha256-hpRTo5B0EMyzORopsNPOgv6mohBkwJfWfCLnPvFmdFI="; + sha256 = "035qq2ff16cdl2cb9iply2bfjmhfl1dpscg79x6c9l0i9m8k41zj"; }; - patches = [ - (fetchpatch { - url = "https://github.com/audacity/audacity/commit/a070b5d8a8ba10fb86edba6aeb8fdab0f66ba408.patch"; - sha256 = "sha256-8UZupGcN+/tytAhyy5T1P0nufvsQPeyLgOUMGt7l8Oc="; - name = "audacity_xdg_paths.patch"; - }) - ]; - - # this file *should* be generated by cmake but as of 2.4.2 isn't yet - postPatch = '' - touch src/RevisionIdent.h - ''; - # workaround for a broken cmake. Drop it with a later version to see if it works. # https://github.com/NixOS/nixpkgs/issues/94905 cmakeFlags = lib.optional stdenv.isLinux "-DCMAKE_OSX_ARCHITECTURES="; @@ -110,8 +95,7 @@ stdenv.mkDerivation rec { sratom suil twolame - wxGTK - wxGTK.gtk + import ./wxWidgets-audacity.nix {} ] ++ lib.optionals stdenv.isLinux [ at-spi2-core dbus diff --git a/pkgs/applications/audio/audacity/wxWidgets-audacity.nix b/pkgs/applications/audio/audacity/wxWidgets-audacity.nix new file mode 100644 index 00000000000..e593ba69eca --- /dev/null +++ b/pkgs/applications/audio/audacity/wxWidgets-audacity.nix @@ -0,0 +1,137 @@ +{ lib, stdenv +, fetchFromGitHub +, fetchurl +, pkg-config +, libXinerama +, libSM +, libXxf86vm +, libXtst +, gtk2 +, GConf ? null +, gtk3 +, xorgproto +, gst_all_1 +, setfile +, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms +, withMesa ? libGLSupported +, libGLU ? null +, libGL ? null +, compat28 ? false +, compat30 ? true +, unicode ? true +, withGtk2 ? true +, withWebKit ? false +, webkitgtk ? null +, AGL ? null +, Carbon ? null +, Cocoa ? null +, Kernel ? null +, QTKit ? null +}: + +with lib; + +assert withMesa -> libGLU != null && libGL != null; +assert withWebKit -> webkitgtk != null; + +assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK31: You cannot enable withWebKit when using withGtk2."; + +stdenv.mkDerivation rec { + version = "3.1.3"; + pname = "wxwidgets"; + + src = fetchFromGitHub { + owner = "audacity"; + repo = "wxWidgets"; + rev = "07e7d832c7a337aedba3537b90b2c98c4d8e2985"; + sha256 = "1mawnkcrmqj98jp0jxlnh9xkc950ca033ccb51c7035pzmi9if9a"; + fetchSubmodules = true; + }; + + buildInputs = [ + libXinerama + libSM + libXxf86vm + libXtst + xorgproto + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ] ++ optionals withGtk2 [ gtk2 GConf ] + ++ optional (!withGtk2) gtk3 + ++ optional withMesa libGLU + ++ optional withWebKit webkitgtk + ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ]; + + nativeBuildInputs = [ pkg-config ]; + + propagatedBuildInputs = optional stdenv.isDarwin AGL; + + patches = [ + (fetchurl { + # https://trac.wxwidgets.org/ticket/17942 + url = "https://trac.wxwidgets.org/raw-attachment/ticket/17942/" + + "fix_assertion_using_hide_in_destroy.diff"; + sha256 = "009y3dav79wiig789vkkc07g1qdqprg1544lih79199kb1h64lvy"; + }) + ]; + + configureFlags = + [ + "--disable-precomp-headers" + "--enable-mediactrl" + (if compat28 then "--enable-compat28" else "--disable-compat28") + (if compat30 then "--enable-compat30" else "--disable-compat30") + ] + ++ optional unicode "--enable-unicode" + ++ optional withMesa "--with-opengl" + ++ optionals stdenv.isDarwin + # allow building on 64-bit + [ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ] + ++ optionals withWebKit + [ "--enable-webview" "--enable-webviewwebkit" ]; + + SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib "; + + preConfigure = " + substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' + substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB=' + substituteInPlace configure --replace /usr /no-such-path + " + optionalString stdenv.isDarwin '' + substituteInPlace configure --replace \ + 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \ + 'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"' + substituteInPlace configure --replace \ + "-framework System" \ + -lSystem + ''; + + postInstall = " + (cd $out/include && ln -s wx-*/* .) + "; + + passthru = { + inherit compat28 compat30 unicode; + gtk = if withGtk2 then gtk2 else gtk3; + }; + + enableParallelBuilding = true; + + meta = { + platforms = with platforms; darwin ++ linux; + license = licenses.wxWindows; + homepage = "https://www.wxwidgets.org/"; + description = "A C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base"; + longDescription = '' + WxWidgets gives you a single, easy-to-use API for + writing GUI applications on multiple platforms that still utilize the + native platform's controls and utilities. Link with the appropriate library + for your platform and compiler, and your application will adopt the look + and feel appropriate to that platform. On top of great GUI functionality, + wxWidgets gives you: online help, network programming, streams, clipboard + and drag and drop, multithreading, image loading and saving in a variety of + popular formats, database support, HTML viewing and printing, and much + more. + ''; + badPlatforms = [ "x86_64-darwin" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a9f24ab1d51..8b86a1ddf2d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22152,9 +22152,7 @@ in audacious = libsForQt5.callPackage ../applications/audio/audacious { }; audaciousQt5 = audacious; - audacity-gtk2 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; }; - audacity-gtk3 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk3; }; - audacity = audacity-gtk2; + audacity = callPackage ../applications/audio/audacity { }; audio-recorder = callPackage ../applications/audio/audio-recorder { };