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