Merge pull request #157429 from AndersonTorres/new-wx

wxGTK28: rewrite

authored by Anderson Torres and committed by GitHub 5b8f14ec 87efa4e5

+80 -39
+80 -39
pkgs/development/libraries/wxwidgets/2.8/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto 2 - , libX11, cairo 3 - , libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , cairo 5 + , gtk2 6 + , libGL 7 + , libGLU 8 + , libSM 9 + , libX11 10 + , libXinerama 11 + , libXxf86vm 12 + , pkg-config 13 + , xorgproto 14 + , compat24 ? false 15 + , compat26 ? true 16 + , unicode ? true 4 17 , withMesa ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms 5 - , libGLU ? null, libGL ? null 6 - , compat24 ? false, compat26 ? true, unicode ? true, 7 18 }: 8 19 9 20 assert withMesa -> libGLU != null && libGL != null; 10 - 11 - with lib; 12 21 13 22 stdenv.mkDerivation rec { 14 - version = "2.8.12.1"; 15 23 pname = "wxGTK"; 24 + version = "2.8.12.1"; 16 25 17 26 src = fetchurl { 18 27 url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2"; 19 - sha256 = "1l1w4i113csv3bd5r8ybyj0qpxdq83lj6jrc5p7cc10mkwyiagqz"; 28 + hash = "sha256-Hz8VPZ8VBMbOLSxLI+lAuPWLgfTLo1zaGluzEUIkPNA="; 20 29 }; 21 30 22 - buildInputs = [ gtk2 libXinerama libSM libXxf86vm xorgproto libX11 cairo ] 23 - ++ optional withMesa libGLU; 24 - 25 - nativeBuildInputs = [ pkg-config ]; 31 + nativeBuildInputs = [ 32 + pkg-config 33 + ]; 26 34 27 - hardeningDisable = [ "format" ]; 35 + buildInputs = [ 36 + cairo 37 + gtk2 38 + libSM 39 + libX11 40 + libXinerama 41 + libXxf86vm 42 + xorgproto 43 + ] 44 + ++ lib.optional withMesa libGLU; 28 45 29 46 configureFlags = [ 30 47 "--enable-gtk2" 31 - (if compat24 then "--enable-compat24" else "--disable-compat24") 32 - (if compat26 then "--enable-compat26" else "--disable-compat26") 33 48 "--disable-precomp-headers" 34 - (if unicode then "--enable-unicode" else "") 35 49 "--enable-mediactrl" 36 50 "--enable-graphics_ctx" 37 - ] ++ optional withMesa "--with-opengl"; 51 + (if compat24 then "--enable-compat24" else "--disable-compat24") 52 + (if compat26 then "--enable-compat26" else "--disable-compat26") 53 + ] 54 + ++ lib.optional unicode "--enable-unicode" 55 + ++ lib.optional withMesa "--with-opengl"; 56 + 57 + hardeningDisable = [ "format" ]; 38 58 39 59 # These variables are used by configure to find some dependencies. 40 60 SEARCH_INCLUDE = 41 61 "${libXinerama.dev}/include ${libSM.dev}/include ${libXxf86vm.dev}/include"; 42 62 SEARCH_LIB = 43 63 "${libXinerama.out}/lib ${libSM.out}/lib ${libXxf86vm.out}/lib " 44 - + optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib "; 64 + + lib.optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib "; 45 65 46 66 # Work around a bug in configure. 47 67 NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing"; 48 68 49 - preConfigure = " 50 - substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' 51 - substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB=' 52 - substituteInPlace configure --replace /usr /no-such-path 53 - "; 69 + preConfigure = '' 70 + substituteInPlace configure --replace \ 71 + 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' 72 + substituteInPlace configure --replace \ 73 + 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB=' 74 + substituteInPlace configure --replace \ 75 + /usr /no-such-path 76 + ''; 54 77 55 - postBuild = "(cd contrib/src && make)"; 78 + postBuild = '' 79 + pushd contrib/src 80 + make 81 + popd 82 + ''; 56 83 57 - postInstall = " 58 - (cd contrib/src && make install) 59 - (cd $out/include && ln -s wx-*/* .) 60 - "; 84 + postInstall = '' 85 + pushd contrib/src 86 + make install 87 + popd 88 + pushd $out/include 89 + ln -s wx-*/* . 90 + popd 91 + ''; 92 + 93 + enableParallelBuilding = true; 94 + 95 + meta = with lib; { 96 + homepage = "https://www.wxwidgets.org/"; 97 + description = "A Cross-Platform C++ GUI Library"; 98 + longDescription = '' 99 + wxWidgets gives you a single, easy-to-use API for writing GUI applications 100 + on multiple platforms that still utilize the native platform's controls 101 + and utilities. Link with the appropriate library for your platform and 102 + compiler, and your application will adopt the look and feel appropriate to 103 + that platform. On top of great GUI functionality, wxWidgets gives you: 104 + online help, network programming, streams, clipboard and drag and drop, 105 + multithreading, image loading and saving in a variety of popular formats, 106 + database support, HTML viewing and printing, and much more. 107 + ''; 108 + license = licenses.wxWindows; 109 + maintainers = with maintainers; [ AndersonTorres ]; 110 + platforms = platforms.linux; 111 + }; 61 112 62 113 passthru = { 63 114 inherit compat24 compat26 unicode; 64 115 gtk = gtk2; 65 - }; 66 - 67 - enableParallelBuilding = true; 68 - 69 - meta = { 70 - platforms = platforms.linux; 71 - license = licenses.wxWindows; 72 - homepage = "https://www.wxwidgets.org/"; 73 - description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base"; 74 - 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."; 75 116 }; 76 117 }