forked from stephanemagnenat/homebrew-kf5
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkf5-okular.rb
92 lines (78 loc) · 2.98 KB
/
kf5-okular.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
class Kf5Okular < Formula
homepage "https://okular.kde.org"
url "https://download.kde.org/stable/applications/17.08.0/src/okular-17.08.0.tar.xz"
sha256 "cf2b5e372edd27ab847309a5f1a1e7f99fab5f759ffe1361b826ca448294f039"
head "git://anongit.kde.org/okular.git"
depends_on "cmake" => :build
depends_on "chigraph/kf5/kf5-extra-cmake-modules" => :build
depends_on "qt"
depends_on "zlib"
depends_on "freetype"
depends_on "chigraph/kf5/kf5-kactivities"
depends_on "chigraph/kf5/kf5-karchive"
depends_on "chigraph/kf5/kf5-kbookmarks"
depends_on "chigraph/kf5/kf5-kcompletion"
depends_on "chigraph/kf5/kf5-kconfig"
depends_on "chigraph/kf5/kf5-kconfigwidgets"
depends_on "chigraph/kf5/kf5-kcoreaddons"
depends_on "chigraph/kf5/kf5-kdbusaddons"
depends_on "chigraph/kf5/kf5-kdoctools"
depends_on "chigraph/kf5/kf5-khtml"
depends_on "chigraph/kf5/kf5-kiconthemes"
depends_on "chigraph/kf5/kf5-kio"
depends_on "chigraph/kf5/kf5-kjs"
depends_on "chigraph/kf5/kf5-kparts"
depends_on "chigraph/kf5/kf5-kpty"
depends_on "chigraph/kf5/kf5-threadweaver"
depends_on "chigraph/kf5/kf5-kwallet"
depends_on "chigraph/kf5/kf5-kwindowsystem"
def patches
DATA
end
def install
args = std_cmake_args
system "cmake", ".", *args
system "make", "install"
prefix.install "install_manifest.txt"
# mkdir_p "#{Etc.getpwuid.dir}/Library/Application Support/okular"
# system "ln", "-sf", "#{HOMEBREW_PREFIX}/share/icons/breeze/breeze-icons.rcc", "#{Etc.getpwuid.dir}/Library/Application Support/okular/icontheme.rcc"
end
def caveats; <<-EOS.undent
You need to take some manual steps in order to make this formula work:
mkdir -p "~/Library/Application Support/okular"
ln -sf "#{HOMEBREW_PREFIX}/share/icons/breeze/breeze-icons.rcc" "~/Library/Application Support/okular/icontheme.rcc"
EOS
end
end
__END__
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7537220..5fef3d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -190,7 +190,7 @@ generate_export_header(okularcore BASE_NAME okularcore EXPORT_FILE_NAME "${CMAKE
# Special handling for linking okularcore on OSX/Apple
IF(APPLE)
- SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
+ SET(OKULAR_IOKIT "-framework CoreFoundation -framework CoreGraphics -framework IOKit" CACHE STRING "Apple IOKit framework")
ENDIF(APPLE)
target_link_libraries(okularcore
diff --git a/core/utils.cpp b/core/utils.cpp
index c9bfc2d..b8c955f 100644
--- a/core/utils.cpp
+++ b/core/utils.cpp
@@ -134,7 +134,7 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen)
return err;
}
-double Utils::realDpiX()
+static double realDpiX()
{
double x,y;
CGDisplayErr err = GetDisplayDPI( CGDisplayCurrentMode(kCGDirectMainDisplay),
@@ -144,7 +144,7 @@ double Utils::realDpiX()
return err == CGDisplayNoErr ? x : 72.0;
}
-double Utils::realDpiY()
+static double realDpiY()
{
double x,y;
CGDisplayErr err = GetDisplayDPI( CGDisplayCurrentMode(kCGDirectMainDisplay),