goldendict: enable on darwin

+167 -19
+49
pkgs/applications/misc/goldendict/0001-dont-check-for-updates.patch
··· 1 + diff --git i/config.cc w/config.cc 2 + index 04b63f5..7a453d9 100644 3 + --- i/config.cc 4 + +++ w/config.cc 5 + @@ -182,7 +182,7 @@ Preferences::Preferences(): 6 + pronounceOnLoadPopup( false ), 7 + useInternalPlayer( InternalPlayerBackend::anyAvailable() ), 8 + internalPlayerBackend( InternalPlayerBackend::defaultBackend() ), 9 + - checkForNewReleases( true ), 10 + + checkForNewReleases( false ), 11 + disallowContentFromOtherSites( false ), 12 + enableWebPlugins( false ), 13 + hideGoldenDictHeader( false ), 14 + @@ -867,8 +867,8 @@ Class load() THROW_SPEC( exError ) 15 + c.preferences.proxyServer.systemProxyPassword = proxy.namedItem( "systemProxyPassword" ).toElement().text(); 16 + } 17 + 18 + - if ( !preferences.namedItem( "checkForNewReleases" ).isNull() ) 19 + - c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" ); 20 + + //if ( !preferences.namedItem( "checkForNewReleases" ).isNull() ) 21 + + // c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" ); 22 + 23 + if ( !preferences.namedItem( "disallowContentFromOtherSites" ).isNull() ) 24 + c.preferences.disallowContentFromOtherSites = ( preferences.namedItem( "disallowContentFromOtherSites" ).toElement().text() == "1" ); 25 + @@ -1819,9 +1819,9 @@ void save( Class const & c ) THROW_SPEC( exError ) 26 + proxy.appendChild( opt ); 27 + } 28 + 29 + - opt = dd.createElement( "checkForNewReleases" ); 30 + - opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) ); 31 + - preferences.appendChild( opt ); 32 + + //opt = dd.createElement( "checkForNewReleases" ); 33 + + //opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) ); 34 + + //preferences.appendChild( opt ); 35 + 36 + opt = dd.createElement( "disallowContentFromOtherSites" ); 37 + opt.appendChild( dd.createTextNode( c.preferences.disallowContentFromOtherSites ? "1" : "0" ) ); 38 + diff --git i/preferences.cc w/preferences.cc 39 + index 72c3147..7e48f00 100644 40 + --- i/preferences.cc 41 + +++ w/preferences.cc 42 + @@ -314,6 +314,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): 43 + this, SLOT( customProxyToggled( bool ) ) ); 44 + 45 + ui.checkForNewReleases->setChecked( p.checkForNewReleases ); 46 + + ui.checkForNewReleases->setEnabled( false ); 47 + ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites ); 48 + ui.enableWebPlugins->setChecked( p.enableWebPlugins ); 49 + ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
+62
pkgs/applications/misc/goldendict/0001-dont-use-maclibs.patch
··· 1 + diff --git i/goldendict.pro w/goldendict.pro 2 + index 328dc20..5202a07 100644 3 + --- i/goldendict.pro 4 + +++ w/goldendict.pro 5 + @@ -210,21 +210,18 @@ mac { 6 + -llzo2 7 + !CONFIG( no_ffmpeg_player ) { 8 + LIBS += -lao \ 9 + - -lavutil-gd \ 10 + - -lavformat-gd \ 11 + - -lavcodec-gd 12 + + -lavutil \ 13 + + -lavformat \ 14 + + -lavcodec 15 + } 16 + - INCLUDEPATH = $${PWD}/maclibs/include 17 + - LIBS += -L$${PWD}/maclibs/lib -framework AppKit -framework Carbon 18 + + LIBS += -framework AppKit -framework Carbon 19 + OBJECTIVE_SOURCES += lionsupport.mm \ 20 + machotkeywrapper.mm \ 21 + macmouseover.mm \ 22 + speechclient_mac.mm 23 + ICON = icons/macicon.icns 24 + QMAKE_INFO_PLIST = myInfo.plist 25 + - QMAKE_POST_LINK = mkdir -p GoldenDict.app/Contents/Frameworks & \ 26 + - cp -nR $${PWD}/maclibs/lib/ GoldenDict.app/Contents/Frameworks/ & \ 27 + - mkdir -p GoldenDict.app/Contents/MacOS/locale & \ 28 + + QMAKE_POST_LINK = mkdir -p GoldenDict.app/Contents/MacOS/locale & \ 29 + cp -R locale/*.qm GoldenDict.app/Contents/MacOS/locale/ & \ 30 + mkdir -p GoldenDict.app/Contents/MacOS/help & \ 31 + cp -R $${PWD}/help/*.qch GoldenDict.app/Contents/MacOS/help/ 32 + @@ -232,15 +229,6 @@ mac { 33 + CONFIG += zim_support 34 + !CONFIG( no_chinese_conversion_support ) { 35 + CONFIG += chinese_conversion_support 36 + - CONFIG( x86 ) { 37 + - QMAKE_POST_LINK += & mkdir -p GoldenDict.app/Contents/MacOS/opencc & \ 38 + - cp -R $${PWD}/opencc/*.json GoldenDict.app/Contents/MacOS/opencc/ & \ 39 + - cp -R $${PWD}/opencc/*.ocd GoldenDict.app/Contents/MacOS/opencc/ 40 + - } else { 41 + - QMAKE_POST_LINK += & mkdir -p GoldenDict.app/Contents/MacOS/opencc & \ 42 + - cp -R $${PWD}/opencc/x64/*.json GoldenDict.app/Contents/MacOS/opencc/ & \ 43 + - cp -R $${PWD}/opencc/x64/*.ocd GoldenDict.app/Contents/MacOS/opencc/ 44 + - } 45 + } 46 + } 47 + DEFINES += PROGRAM_VERSION=\\\"$$VERSION\\\" 48 + diff --git i/tiff.cc w/tiff.cc 49 + index e3cb8bf..9ff880f 100644 50 + --- i/tiff.cc 51 + +++ w/tiff.cc 52 + @@ -6,8 +6,8 @@ 53 + #include "tiff.hh" 54 + 55 + #if defined (Q_OS_MAC) || defined (Q_OS_WIN) 56 + -#include "tiff/tiff.h" 57 + -#include "tiff/tiffio.h" 58 + +#include "tiff.h" 59 + +#include "tiffio.h" 60 + #else 61 + #include "tiff.h" 62 + #include "tiffio.h"
+53 -18
pkgs/applications/misc/goldendict/default.nix
··· 1 - { mkDerivation, lib, fetchFromGitHub, pkgconfig, libXtst, libvorbis, hunspell 2 - , libao, ffmpeg, libeb, lzo, xz, libtiff, opencc 3 - , qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake }: 4 - mkDerivation { 1 + { stdenv, mkDerivation, fetchFromGitHub, pkgconfig 2 + , libXtst, libvorbis, hunspell, lzo, xz, bzip2, libiconv 3 + , qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake 4 + , withCC ? true, opencc 5 + , withEpwing ? true, libeb 6 + , withExtraTiff ? true, libtiff 7 + , withFFmpeg ? true, libao, ffmpeg 8 + , withMultimedia ? true 9 + , withZim ? true }: 5 10 6 - name = "goldendict-2019-08-01"; 11 + mkDerivation rec { 12 + pname = "goldendict"; 13 + version = "2020-01-09"; 14 + 7 15 src = fetchFromGitHub { 8 16 owner = "goldendict"; 9 - repo = "goldendict"; 10 - rev = "0f951b06a55f3a201891cf645a556e773bda5f52"; 11 - sha256 = "1d1hn95vhvsmbq9q96l5adn90g0hg25dl01knb4y4v6v9x4yrl2x"; 17 + repo = pname; 18 + rev = "da197ff5cd0e7326124c9240a1853a0e8b1de439"; 19 + sha256 = "0dlzwjh9wg4bzhhib71jycpp21qw762ww63a37dd50z1ymi61lxc"; 12 20 }; 13 21 22 + patches = [ 23 + ./0001-dont-check-for-updates.patch 24 + ] ++ stdenv.lib.optionals stdenv.isDarwin [ 25 + ./0001-dont-use-maclibs.patch 26 + ]; 27 + 28 + postPatch = '' 29 + substituteInPlace goldendict.pro \ 30 + --replace "hunspell-1.6.1" "hunspell-${stdenv.lib.versions.majorMinor hunspell.version}" 31 + ''; 32 + 14 33 nativeBuildInputs = [ pkgconfig qmake ]; 15 34 buildInputs = [ 16 - qtbase qtsvg qtwebkit qtx11extras qttools 17 - libXtst libvorbis hunspell libao ffmpeg libeb lzo xz libtiff opencc 18 - ]; 35 + qtbase qtsvg qtwebkit qttools 36 + libvorbis hunspell xz lzo 37 + ] ++ stdenv.lib.optionals stdenv.isLinux [ qtx11extras libXtst ] 38 + ++ stdenv.lib.optionals stdenv.isDarwin [ bzip2 libiconv ] 39 + ++ stdenv.lib.optional withCC opencc 40 + ++ stdenv.lib.optional withEpwing libeb 41 + ++ stdenv.lib.optional withExtraTiff libtiff 42 + ++ stdenv.lib.optionals withFFmpeg [ libao ffmpeg ]; 19 43 20 - qmakeFlags = [ 44 + qmakeFlags = with stdenv.lib; [ 21 45 "goldendict.pro" 22 - "CONFIG+=zim_support" 23 - "CONFIG+=chinese_conversion_support" 46 + (optional withCC "CONFIG+=chinese_conversion_support") 47 + (optional (!withCC) "CONFIG+=no_chinese_conversion_support") 48 + (optional (!withEpwing) "CONFIG+=no_epwing_support") 49 + (optional (!withExtraTiff) "CONFIG+=no_extra_tiff_handler") 50 + (optional (!withFFmpeg) "CONFIG+=no_ffmpeg_player") 51 + (optional (!withMultimedia)"CONFIG+=no_qtmultimedia_player") 52 + (optional withZim "CONFIG+=zim_support") 24 53 ]; 25 54 26 - meta = with lib; { 27 - homepage = http://goldendict.org/; 55 + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' 56 + mkdir -p $out/Applications 57 + mv GoldenDict.app $out/Applications 58 + wrapQtApp $out/Applications/GoldenDict.app/Contents/MacOS/GoldenDict 59 + ''; 60 + 61 + meta = with stdenv.lib; { 62 + homepage = "http://goldendict.org/"; 28 63 description = "A feature-rich dictionary lookup program"; 29 - platforms = platforms.linux; 30 - maintainers = with maintainers; [ gebner astsmtl ]; 64 + platforms = with platforms; linux ++ darwin; 65 + maintainers = with maintainers; [ gebner astsmtl sikmir ]; 31 66 license = licenses.gpl3Plus; 32 67 }; 33 68 }
+3 -1
pkgs/top-level/all-packages.nix
··· 19033 19033 19034 19034 gr-osmosdr = callPackage ../applications/radio/gnuradio/osmosdr.nix { }; 19035 19035 19036 - goldendict = libsForQt5.callPackage ../applications/misc/goldendict { }; 19036 + goldendict = libsForQt5.callPackage ../applications/misc/goldendict { 19037 + inherit (darwin) libiconv; 19038 + }; 19037 19039 19038 19040 gomuks = callPackage ../applications/networking/instant-messengers/gomuks { }; 19039 19041