Skip to content

Commit 52ca238

Browse files
committed
add pacman conf
1 parent cb3cafd commit 52ca238

File tree

3 files changed

+133
-5
lines changed

3 files changed

+133
-5
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ vignettes/.*\.png$
2727
^poppler\.sh$
2828
^tesseract\.sh$
2929
^lib$
30+
^pacman\.conf$

pacman.conf

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#
2+
# /etc/pacman.conf
3+
#
4+
# See the pacman.conf(5) manpage for option and repository directives
5+
6+
#
7+
# GENERAL OPTIONS
8+
#
9+
[options]
10+
# The following paths are commented out with their default values listed.
11+
# If you wish to use different paths, uncomment and update the paths.
12+
#RootDir = /
13+
#DBPath = /var/lib/pacman/
14+
#CacheDir = /var/cache/pacman/pkg/
15+
#LogFile = /var/log/pacman.log
16+
#GPGDir = /etc/pacman.d/gnupg/
17+
HoldPkg = pacman
18+
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
19+
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
20+
#CleanMethod = KeepInstalled
21+
Architecture = auto
22+
23+
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
24+
#IgnorePkg =
25+
#IgnoreGroup =
26+
27+
#NoUpgrade =
28+
#NoExtract =
29+
30+
# Misc options
31+
#UseSyslog
32+
Color
33+
#NoProgressBar
34+
CheckSpace
35+
#VerbosePkgLists
36+
ParallelDownloads = 5
37+
38+
# By default, pacman accepts packages signed by keys that its local keyring
39+
# trusts (see pacman-key and its man page), as well as unsigned packages.
40+
#SigLevel = Never
41+
SigLevel = Required
42+
LocalFileSigLevel = Optional
43+
#RemoteFileSigLevel = Required
44+
45+
#
46+
# REPOSITORIES
47+
# - can be defined here or included from another file
48+
# - pacman will search repositories in the order defined here
49+
# - local/custom mirrors can be added here or in separate files
50+
# - repositories listed first will take precedence when packages
51+
# have identical names, regardless of version number
52+
# - URLs will have $repo replaced by the name of the current repo
53+
# - URLs will have $arch replaced by the name of the architecture
54+
#
55+
# Repository entries are of the format:
56+
# [repo-name]
57+
# Server = ServerName
58+
# Include = IncludePath
59+
#
60+
# The header [repo-name] is crucial - it must be present and
61+
# uncommented to enable the repo.
62+
#
63+
64+
# The testing repositories are disabled by default. To enable, uncomment the
65+
# repo name header and Include lines. You can add preferred servers immediately
66+
# after the header, and they will be used before the default mirrors.
67+
68+
# Staging packages: enable at your own risk
69+
# [staging]
70+
# Server = https://repo.msys2.org/staging/
71+
# SigLevel = Never
72+
73+
[ucrt64-libs]
74+
Server = https://ftp.opencpu.org/msys2/ucrt64-libs
75+
SigLevel = Never
76+
77+
[clang64-libs]
78+
Server = https://ftp.opencpu.org/msys2/clang64-libs
79+
SigLevel = Never
80+
81+
[clangarm64-libs]
82+
Server = https://ftp.opencpu.org/msys2/clangarm64-libs
83+
SigLevel = Never
84+
85+
86+
# For debugging only:
87+
[ucrt64]
88+
Server = https://repo.msys2.org/mingw/ucrt64/
89+
SigLevel = Never
90+
91+
#Include = /etc/pacman.d/mirrorlist.mingw
92+
#
93+
#[clang64]
94+
#Include = /etc/pacman.d/mirrorlist.mingw
95+
#
96+
#[clangarm64]
97+
#Include = /etc/pacman.d/mirrorlist.mingw
98+
#
99+
#[msys]
100+
#Include = /etc/pacman.d/mirrorlist.msys
101+
102+
# An example of a custom package repository. See the pacman manpage for
103+
# tips on creating your own repositories.
104+
#[custom]
105+
#SigLevel = Optional TrustAll
106+
#Server = file:///home/custompkgs

tools/winlibs.R

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
# Tesseract ----
2+
13
if(!file.exists("../windows/tesseract/include/tesseract/baseapi.h")){
24
unlink("../windows", recursive = TRUE)
35
url <- if(grepl("aarch", R.version$platform)){
4-
"https://github.com/r-windows/bundles/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-clang-aarch64.tar.xz"
6+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-clang-aarch64.tar.xz"
57
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
6-
"https://github.com/r-windows/bundles/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-clang-x86_64.tar.xz"
8+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-clang-x86_64.tar.xz"
79
} else if(getRversion() >= "4.3") {
8-
"https://github.com/r-windows/bundles/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-ucrt-x86_64.tar.xz"
10+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/tesseract-5.3.2/tesseract-ocr-5.3.2-ucrt-x86_64.tar.xz"
911
} else {
1012
"https://github.com/rwinlib/tesseract/archive/v5.3.2.tar.gz"
1113
}
@@ -17,17 +19,36 @@ if(!file.exists("../windows/tesseract/include/tesseract/baseapi.h")){
1719
file.rename(list.files(), 'tesseract')
1820
}
1921

20-
# Also download the english training data
2122
dir.create("../windows/tessdata", showWarnings = FALSE)
2223
if(!file.exists("../windows/tessdata/eng.traineddata")){
2324
message("Downloading eng.traineddata...")
2425
download.file("https://github.com/tesseract-ocr/tessdata_fast/raw/4.1.0/eng.traineddata",
2526
"../windows/tessdata/eng.traineddata", mode = "wb", quiet = TRUE)
2627
}
2728

28-
# This is base training data for Orientation and Script Detection
2929
if(!file.exists("../windows/tessdata/osd.traineddata")){
3030
message("Downloading osd.traineddata...")
3131
download.file("https://github.com/tesseract-ocr/tessdata_fast/raw/4.1.0/osd.traineddata",
3232
"../windows/tessdata/osd.traineddata", mode = "wb", quiet = TRUE)
3333
}
34+
35+
# Poppler ----
36+
37+
if (!file.exists("../windows/poppler/include/poppler/cpp/poppler-document.h")) {
38+
unlink("../windows", recursive = TRUE)
39+
url <- if (grepl("aarch", R.version$platform)) {
40+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/poppler-23.08.0/poppler-23.08.0-clang-aarch64.tar.xz"
41+
} else if (grepl("clang", Sys.getenv("R_COMPILED_BY"))) {
42+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/poppler-23.08.0/poppler-23.08.0-clang-x86_64.tar.xz"
43+
} else if (getRversion() >= "4.3") {
44+
"https://github.com/pachadotdev/cpp11tesseract/releases/download/poppler-23.08.0/poppler-23.08.0-ucrt-x86_64.tar.xz"
45+
} else {
46+
"https://github.com/rwinlib/poppler/archive/v22.04.0-2.tar.gz"
47+
}
48+
download.file(url, basename(url), quiet = TRUE)
49+
dir.create("../windows", showWarnings = FALSE)
50+
untar(basename(url), exdir = "../windows", tar = "internal")
51+
unlink(basename(url))
52+
setwd("../windows")
53+
file.rename(list.files(), "poppler")
54+
}

0 commit comments

Comments
 (0)