codeblocks: fix builds

+70 -5
+46 -5
pkgs/applications/editors/codeblocks/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, file, zip, wxGTK30-gtk3, gtk3 1 + { lib, stdenv, fetchurl, fetchpatch, pkg-config, file, zip, wxGTK31-gtk3, gtk3 2 2 , contribPlugins ? false, hunspell, gamin, boost, wrapGAppsHook 3 3 }: 4 4 ··· 15 15 }; 16 16 17 17 nativeBuildInputs = [ pkg-config file zip wrapGAppsHook ]; 18 - buildInputs = [ wxGTK30-gtk3 gtk3 ] 18 + buildInputs = [ wxGTK31-gtk3 gtk3 ] 19 19 ++ optionals contribPlugins [ hunspell gamin boost ]; 20 20 enableParallelBuilding = true; 21 - patches = [ ./writable-projects.patch ]; 21 + patches = [ 22 + ./writable-projects.patch 23 + ./fix-clipboard-flush.patch 24 + # Fix build on non-x86 machines 25 + (fetchpatch { 26 + name = "remove-int3.patch"; 27 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/d76c015c456561d2c7987935a5f4dc6c0932b0c4.patch"; 28 + sha256 = "sha256-dpH33vGf2aNdYTeLwxglYDNbvwoY2bGSG6YFRyoGw+A="; 29 + }) 30 + (fetchpatch { 31 + name = "remove-pragmas.patch"; 32 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/966949d5ab7f3cb86e2a2c7ef4e853ee209b5a1a.patch"; 33 + sha256 = "sha256-XjejjGOvDk3gl1/n9R69XATGLj5n7tOZNyG8vIlwfyg="; 34 + }) 35 + # Fix build with GCC 11 36 + (fetchpatch { 37 + name = "use-gcc11-openfilelist.patch"; 38 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/a5ea6ff7ff301d739d3dc8145db1578f504ee4ca.patch"; 39 + sha256 = "sha256-kATaLej8kJf4xm0VicHfRetOepX8O9gOhwdna0qylvQ="; 40 + }) 41 + (fetchpatch { 42 + name = "use-gcc11-ccmanager.patch"; 43 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/04b7c50fb8c6a29b2d84579ee448d2498414d855.patch"; 44 + sha256 = "sha256-VPy/M6IvNBxUE4hZRbLExFm0DJf4gmertrqrvsXQNz4="; 45 + }) 46 + # Fix build with wxGTK 3.1.5 47 + (fetchpatch { 48 + name = "use-wxgtk315.patch"; 49 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/2345b020b862ec855038dd32a51ebb072647f28d.patch"; 50 + sha256 = "sha256-RRjwZA37RllnG8cJdBEnASpEd8z0+ru96fjntO42OvU="; 51 + }) 52 + (fetchpatch { 53 + name = "fix-getstring.patch"; 54 + url = "https://github.com/arnholm/codeblocks_sfmirror/commit/dbdf5c5ea9e3161233f0588a7616b7e4fedc7870.patch"; 55 + sha256 = "sha256-DrEMFluN8vs0LERa7ULGshl7HdejpsuvXAMjIr/K1fQ="; 56 + }) 57 + ]; 22 58 preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file"; 23 59 postConfigure = optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig"; 24 - configureFlags = [ "--enable-pch=no" ] 25 - ++ optionals contribPlugins [ "--with-contrib-plugins" "--with-boost-libdir=${boost}/lib" ]; 60 + configureFlags = [ "--enable-pch=no" ] ++ optionals contribPlugins [ 61 + ("--with-contrib-plugins" + optionalString stdenv.isDarwin "=all,-FileManager,-NassiShneiderman") 62 + "--with-boost-libdir=${boost}/lib" 63 + ]; 64 + postInstall = optionalString stdenv.isDarwin '' 65 + ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins 66 + ''; 26 67 27 68 meta = { 28 69 maintainers = [ maintainers.linquize ];
+24
pkgs/applications/editors/codeblocks/fix-clipboard-flush.patch
··· 1 + diff --git a/src/src/app.cpp b/src/src/app.cpp 2 + index 81130fd..f98d37b 100644 3 + --- a/src/src/app.cpp 4 + +++ b/src/src/app.cpp 5 + @@ -602,7 +602,8 @@ bool CodeBlocksApp::OnInit() 6 + m_BatchWindowAutoClose = true; 7 + m_pSingleInstance = nullptr; 8 + 9 + - wxTheClipboard->Flush(); 10 + + if (wxTheClipboard->IsOpened()) 11 + + wxTheClipboard->Flush(); 12 + 13 + wxCmdLineParser& parser = *Manager::GetCmdLineParser(); 14 + parser.SetDesc(cmdLineDesc); 15 + @@ -851,7 +852,8 @@ bool CodeBlocksApp::OnInit() 16 + 17 + int CodeBlocksApp::OnExit() 18 + { 19 + - wxTheClipboard->Flush(); 20 + + if (wxTheClipboard->IsOpened()) 21 + + wxTheClipboard->Flush(); 22 + 23 + if (g_DDEServer) delete g_DDEServer; 24 +