git.iko.soy/typeable/nixpkgs
on master help sign in
Switch to the simple patching of wxWidgets approach
commit49cfef8c69136295542dfa470aa8bdbf2f29ddef authorDaniel Ethridge <danielethridge@icloud.com> dateMon 3 May 2021, 23:00 (6 years ago) parentd1605b4
3 files changed+29−141
pkgs/applications/audio/audacity/default.nix+28−3 pkgs/applications/audio/audacity/wxWidgets-audacity.nix−137 pkgs/top-level/all-packages.nix+1−1
pkgs/applications/audio/audacity/default.nix+28−3
@@ -3,6 +3,7 @@
33, fetchFromGitHub
44, fetchpatch
55, cmake
6+, wxGTK
67, pkg-config
78, python3
89, gettext
@@ -27,6 +28,7 @@
2728, ffmpeg
2829, soundtouch
2930, pcre /*, portaudio - given up fighting their portaudio.patch */
31+, linuxHeaders
3032, at-spi2-core ? null
3133, dbus ? null
3234, epoxy ? null
@@ -43,6 +45,17 @@
4345# - 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
4446# - detach sbsms
4547
48+let
49+ wxGTK-audacity = wxGTK.overrideAttrs (oldAttrs: rec {
50+ src = fetchFromGitHub {
51+ owner = "audacity";
52+ repo = "wxWidgets";
53+ rev = "07e7d832c7a337aedba3537b90b2c98c4d8e2985";
54+ sha256 = "1mawnkcrmqj98jp0jxlnh9xkc950ca033ccb51c7035pzmi9if9a";
55+ fetchSubmodules = true;
56+ };
57+ });
58+in
4659stdenv.mkDerivation rec {
4760 pname = "audacity";
4861 version = "3.0.2";
@@ -57,7 +70,7 @@ stdenv.mkDerivation rec {
5770 patches = [
5871 (fetchpatch {
5972 url = "https://github.com/audacity/audacity/commit/007852e51fcbb5f1f359d112f28b8984a604dac6.patch";
60− sha256 = "1ajwp0zq725qp5v98av0g9z05w153vdrk69f61aq2qa73g7p1fnz";
73+ sha256 = "0zp2iydd46analda9cfnbmzdkjphz5m7dynrdj5qdnmq6j3px9fw";
6174 name = "audacity_xdg_paths.patch";
6275 })
6376 ];
@@ -67,6 +80,10 @@ stdenv.mkDerivation rec {
6780 touch src/RevisionIdent.h
6881 '';
6982
83+ preConfigure = ''
84+ substituteInPlace src/FileNames.cpp --replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
85+ '';
86+
7087 # workaround for a broken cmake. Drop it with a later version to see if it works.
7188 # https://github.com/NixOS/nixpkgs/issues/94905
7289 cmakeFlags = lib.optional stdenv.isLinux "-DCMAKE_OSX_ARCHITECTURES=";
@@ -85,7 +102,14 @@ stdenv.mkDerivation rec {
85102 "-lswscale"
86103 ];
87104
88− nativeBuildInputs = [ cmake gettext pkg-config python3 ];
105+ nativeBuildInputs = [
106+ cmake
107+ gettext
108+ pkg-config
109+ python3
110+ ] ++ lib.optionals stdenv.isLinux [
111+ linuxHeaders
112+ ];
89113
90114 buildInputs = [
91115 alsaLib
@@ -109,7 +133,8 @@ stdenv.mkDerivation rec {
109133 sratom
110134 suil
111135 twolame
112− import ./wxWidgets-audacity.nix {}
136+ wxGTK-audacity
137+ wxGTK-audacity.gtk
113138 ] ++ lib.optionals stdenv.isLinux [
114139 at-spi2-core
115140 dbus
pkgs/applications/audio/audacity/wxWidgets-audacity.nixdeleted−137
@@ -1,137 +0,0 @@
1−{ lib, stdenv
2−, fetchFromGitHub
3−, fetchurl
4−, pkg-config
5−, libXinerama
6−, libSM
7−, libXxf86vm
8−, libXtst
9−, gtk2
10−, GConf ? null
11−, gtk3
12−, xorgproto
13−, gst_all_1
14−, setfile
15−, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
16−, withMesa ? libGLSupported
17−, libGLU ? null
18−, libGL ? null
19−, compat28 ? false
20−, compat30 ? true
21−, unicode ? true
22−, withGtk2 ? true
23−, withWebKit ? false
24−, webkitgtk ? null
25−, AGL ? null
26−, Carbon ? null
27−, Cocoa ? null
28−, Kernel ? null
29−, QTKit ? null
30−}:
31−
32−with lib;
33−
34−assert withMesa -> libGLU != null && libGL != null;
35−assert withWebKit -> webkitgtk != null;
36−
37−assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK31: You cannot enable withWebKit when using withGtk2.";
38−
39−stdenv.mkDerivation rec {
40− version = "3.1.3";
41− pname = "wxwidgets";
42−
43− src = fetchFromGitHub {
44− owner = "audacity";
45− repo = "wxWidgets";
46− rev = "07e7d832c7a337aedba3537b90b2c98c4d8e2985";
47− sha256 = "1mawnkcrmqj98jp0jxlnh9xkc950ca033ccb51c7035pzmi9if9a";
48− fetchSubmodules = true;
49− };
50−
51− buildInputs = [
52− libXinerama
53− libSM
54− libXxf86vm
55− libXtst
56− xorgproto
57− gst_all_1.gstreamer
58− gst_all_1.gst-plugins-base
59− ] ++ optionals withGtk2 [ gtk2 GConf ]
60− ++ optional (!withGtk2) gtk3
61− ++ optional withMesa libGLU
62− ++ optional withWebKit webkitgtk
63− ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
64−
65− nativeBuildInputs = [ pkg-config ];
66−
67− propagatedBuildInputs = optional stdenv.isDarwin AGL;
68−
69− patches = [
70− (fetchurl {
71− # https://trac.wxwidgets.org/ticket/17942
72− url = "https://trac.wxwidgets.org/raw-attachment/ticket/17942/"
73− + "fix_assertion_using_hide_in_destroy.diff";
74− sha256 = "009y3dav79wiig789vkkc07g1qdqprg1544lih79199kb1h64lvy";
75− })
76− ];
77−
78− configureFlags =
79− [
80− "--disable-precomp-headers"
81− "--enable-mediactrl"
82− (if compat28 then "--enable-compat28" else "--disable-compat28")
83− (if compat30 then "--enable-compat30" else "--disable-compat30")
84− ]
85− ++ optional unicode "--enable-unicode"
86− ++ optional withMesa "--with-opengl"
87− ++ optionals stdenv.isDarwin
88− # allow building on 64-bit
89− [ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]
90− ++ optionals withWebKit
91− [ "--enable-webview" "--enable-webviewwebkit" ];
92−
93− SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib ";
94−
95− preConfigure = "
96− substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
97− substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
98− substituteInPlace configure --replace /usr /no-such-path
99− " + optionalString stdenv.isDarwin ''
100− substituteInPlace configure --replace \
101− 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
102− 'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
103− substituteInPlace configure --replace \
104− "-framework System" \
105− -lSystem
106− '';
107−
108− postInstall = "
109− (cd $out/include && ln -s wx-*/* .)
110− ";
111−
112− passthru = {
113− inherit compat28 compat30 unicode;
114− gtk = if withGtk2 then gtk2 else gtk3;
115− };
116−
117− enableParallelBuilding = true;
118−
119− meta = {
120− platforms = with platforms; darwin ++ linux;
121− license = licenses.wxWindows;
122− homepage = "https://www.wxwidgets.org/";
123− description = "A C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
124− longDescription = ''
125− WxWidgets gives you a single, easy-to-use API for
126− writing GUI applications on multiple platforms that still utilize the
127− native platform's controls and utilities. Link with the appropriate library
128− for your platform and compiler, and your application will adopt the look
129− and feel appropriate to that platform. On top of great GUI functionality,
130− wxWidgets gives you: online help, network programming, streams, clipboard
131− and drag and drop, multithreading, image loading and saving in a variety of
132− popular formats, database support, HTML viewing and printing, and much
133− more.
134− '';
135− badPlatforms = [ "x86_64-darwin" ];
136− };
137−}
pkgs/top-level/all-packages.nix+1−1
@@ -22152,7 +22152,7 @@ in
2215222152 audacious = libsForQt5.callPackage ../applications/audio/audacious { };
2215322153 audaciousQt5 = audacious;
2215422154
22155− audacity = callPackage ../applications/audio/audacity { };
22155+ audacity = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; };
2215622156
2215722157 audio-recorder = callPackage ../applications/audio/audio-recorder { };
2215822158