Start drafting an update for audacity: 2.4.2 -> 3.0.2

The XGD-config patch is removed since it conflicts with the new version of audacity, as it was not merged upstream.

Audacity now requires their own fork of wxWidgets, according to https://wiki.audacityteam.org/wiki/Building_On_Linux - this is the cause of current trouble since I am new to nix and unsure how to integrate it. I copied the current 3.1.4 nixpkgs version of wxWidgets found at pkgs/development/libraries/wxwidgets/3.1/default.nix and modified it to retrieve the forked version, but that's it so far.
This commit is contained in:
Daniel Ethridge 2021-05-03 14:40:20 -04:00
parent cc3609a59c
commit 126b5f5990
3 changed files with 142 additions and 23 deletions

View File

@ -1,9 +1,7 @@
{ stdenv { stdenv
, lib , lib
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, cmake , cmake
, wxGTK
, pkg-config , pkg-config
, python3 , python3
, gettext , gettext
@ -41,33 +39,20 @@
}: }:
# TODO # 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 # - detach sbsms
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "audacity"; pname = "audacity";
version = "2.4.2"; version = "3.0.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "audacity"; owner = "audacity";
repo = "audacity"; repo = "audacity";
rev = "Audacity-${version}"; 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. # workaround for a broken cmake. Drop it with a later version to see if it works.
# https://github.com/NixOS/nixpkgs/issues/94905 # https://github.com/NixOS/nixpkgs/issues/94905
cmakeFlags = lib.optional stdenv.isLinux "-DCMAKE_OSX_ARCHITECTURES="; cmakeFlags = lib.optional stdenv.isLinux "-DCMAKE_OSX_ARCHITECTURES=";
@ -110,8 +95,7 @@ stdenv.mkDerivation rec {
sratom sratom
suil suil
twolame twolame
wxGTK import ./wxWidgets-audacity.nix {}
wxGTK.gtk
] ++ lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
at-spi2-core at-spi2-core
dbus dbus

View File

@ -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" ];
};
}

View File

@ -22152,9 +22152,7 @@ in
audacious = libsForQt5.callPackage ../applications/audio/audacious { }; audacious = libsForQt5.callPackage ../applications/audio/audacious { };
audaciousQt5 = audacious; audaciousQt5 = audacious;
audacity-gtk2 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; }; audacity = callPackage ../applications/audio/audacity { };
audacity-gtk3 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk3; };
audacity = audacity-gtk2;
audio-recorder = callPackage ../applications/audio/audio-recorder { }; audio-recorder = callPackage ../applications/audio/audio-recorder { };