Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing #501 #504

Merged
merged 14 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .devel/sphinx/news.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog


## 1.8.2 (under development)

* [BUILD TIME] [BUGFIX] #501: Fixed failing build on 32-bit Windows
(Windows API `ResolveLocaleName` function not available).

* [BUILD TIME] [BUGFIX] #502: `PKG_CPPFLAGS` are now considered
before other `CPPFLAGS` (the same with other flag types) in
the `configure` script to make it compatible with what happens in `Makevars`.


## 1.8.1 (2023-11-09)

* [GENERAL] ICU bundle updated to version 74.1 (Unicode 15.1, CLDR 44).
Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/rapi/stri_datetime_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ print(x)
```

```
## [1] "2024-01-16 10:51:29 AEDT"
## [1] "2024-01-21 14:33:02 AEDT"
```

```r
stri_datetime_add(x, -2, units='months')
```

```
## [1] "2023-11-16 10:51:29 AEDT"
## [1] "2023-11-21 14:33:02 AEDT"
```

```r
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/rapi/stri_datetime_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ stri_datetime_create(hour=15, minute=59)
```

```
## [1] "2023-11-16 15:59:00 AEDT"
## [1] "2023-11-21 15:59:00 AEDT"
```
8 changes: 4 additions & 4 deletions .devel/sphinx/rapi/stri_datetime_fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ stri_datetime_fields(stri_datetime_now())

```
## Year Month Day Hour Minute Second Millisecond WeekOfYear WeekOfMonth
## 1 2023 11 16 10 51 30 7 47 3
## 1 2023 11 21 14 33 3 213 48 4
## DayOfYear DayOfWeek Hour12 AmPm Era
## 1 320 5 10 1 2
## 1 325 3 2 2 2
```

```r
Expand All @@ -88,9 +88,9 @@ stri_datetime_fields(stri_datetime_now(), locale='@calendar=hebrew')

```
## Year Month Day Hour Minute Second Millisecond WeekOfYear WeekOfMonth
## 1 5784 3 3 10 51 30 11 10 1
## 1 5784 3 8 14 33 3 218 11 2
## DayOfYear DayOfWeek Hour12 AmPm Era
## 1 62 5 10 1 1
## 1 67 3 2 2 1
```

```r
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/rapi/stri_datetime_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,5 @@ stri_datetime_format(stri_datetime_now(), 'datetime_relative_medium')
```

```
## [1] "today, 10:51:30 am"
## [1] "today, 2:33:03 pm"
```
4 changes: 2 additions & 2 deletions .devel/sphinx/rapi/stri_locale_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ oldloc <- stri_locale_set('pt_BR')
```

```
## You are now working with stringi_1.8.1 (pt_BR.UTF-8; ICU4C 74.1 [bundle]; Unicode 15.1)
## You are now working with stringi_1.8.1.9001 (pt_BR.UTF-8; ICU4C 74.1 [bundle]; Unicode 15.1)
```

```r
Expand All @@ -65,7 +65,7 @@ stri_locale_set(oldloc) # restore the previous default locale
```

```
## You are now working with stringi_1.8.1 (en_AU.UTF-8; ICU4C 74.1 [bundle]; Unicode 15.1)
## You are now working with stringi_1.8.1.9001 (en_AU.UTF-8; ICU4C 74.1 [bundle]; Unicode 15.1)
```

```r
Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/rapi/stri_sprintf.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ stri_sprintf("UNIX time %1$f is %1$s.", Sys.time())
```

```
## [1] "UNIX time 1700092299.497165 is 2023-11-16 10:51:39.497165."
## [1] "UNIX time 1700537593.184348 is 2023-11-21 14:33:13.184348."
```

```r
Expand All @@ -213,7 +213,7 @@ stri_sprintf("%1$s is %1$f UNIX time.", Sys.time()) # re-coercion needed
```

```
## [1] "2023-11-16 10:51:39.49887 is 1700092299.498870 UNIX time."
## [1] "2023-11-21 14:33:13.18612 is 1700537593.186120 UNIX time."
```

```r
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/r-check-other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- {os: macOS-latest, r: 'oldrel-4'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel-4'}
- {os: windows-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'oldrel-4'}

Expand All @@ -29,6 +30,7 @@ jobs:
_R_CHECK_FORCE_SUGGESTS_: false
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
Expand All @@ -48,12 +50,12 @@ jobs:

- name: Install
run: |
install.packages("tinytest")
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}

- name: Test
run: |
install.packages("tinytest")
source(".devel/tinytest.R")
shell: Rscript {0}

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: stringi
Version: 1.8.1.9001
Date: 2023-11-18
Date: 2023-11-21
Title: Fast and Portable Character String Processing Facilities
Description: A collection of character string/text/natural language
processing tools for pattern searching (e.g., with 'Java'-like regular
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

## 1.8.2 (under development)

* ...TODO... [BUILD TIME] [BUGFIX] #501: Fixed failing build on 32-bit Windows.
* [BUILD TIME] [BUGFIX] #501: Fixed failing build on 32-bit Windows
(Windows API `ResolveLocaleName` function not available).

* [BUILD TIME] [BUGFIX] #502: `PKG_CPPFLAGS` are now considered
before other `CPPFLAGS` (the same with other flag types) in
Expand Down
6 changes: 5 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ ICUDT_DIR
ICU_FOUND
STRINGI_CXXSTD
STRINGI_OBJECTS
DISABLE_RESOLVE_LOCALE_NAME
STRINGI_ICU_STUBDATA_SOURCES_CPP
STRINGI_ICU_I18N_SOURCES_CPP
STRINGI_ICU_COMMON_SOURCES_CPP
Expand Down Expand Up @@ -3700,7 +3701,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \

check_flags_icu_bundle() {
# files are relative to src/ now, then we'll make it the current dir
ICU_CPPFLAGS="-DU_STRINGI_PATCHES \
ICU_CPPFLAGS="\
-Isrc/icu${ICU_BUNDLE_VERSION} \
-Isrc/icu${ICU_BUNDLE_VERSION}/unicode \
-Isrc/icu${ICU_BUNDLE_VERSION}/common \
Expand Down Expand Up @@ -4068,6 +4069,9 @@ STRINGI_CPPFLAGS="-I. ${with_extra_cppflags} ${ICU_CPPFLAGS}"
STRINGI_LDFLAGS="${with_extra_ldflags} ${ICU_LDFLAGS}"
STRINGI_LIBS="${with_extra_libs} ${ICU_LIBS}"

DISABLE_RESOLVE_LOCALE_NAME=1 # this does not apply on non-Windows platforms




#AC_SUBST(STRINGI_CFLAGS)
Expand Down
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# kate: hl bash
# autoconf/configure script for stringi <https://stringi.gagolewski.com/>
# Copyright (c) 2013-2023, Marek Gagolewski <https://www.gagolewski.com/>

Expand Down Expand Up @@ -588,7 +589,7 @@ check_icu_with_pkg_config() {

check_flags_icu_bundle() {
# files are relative to src/ now, then we'll make it the current dir
ICU_CPPFLAGS="-DU_STRINGI_PATCHES \
ICU_CPPFLAGS="\
-Isrc/icu${ICU_BUNDLE_VERSION} \
-Isrc/icu${ICU_BUNDLE_VERSION}/unicode \
-Isrc/icu${ICU_BUNDLE_VERSION}/common \
Expand Down Expand Up @@ -871,6 +872,9 @@ STRINGI_CPPFLAGS="-I. ${with_extra_cppflags} ${ICU_CPPFLAGS}"
STRINGI_LDFLAGS="${with_extra_ldflags} ${ICU_LDFLAGS}"
STRINGI_LIBS="${with_extra_libs} ${ICU_LIBS}"

DISABLE_RESOLVE_LOCALE_NAME=1 # this does not apply on non-Windows platforms
AC_SUBST(DISABLE_RESOLVE_LOCALE_NAME)

AC_SUBST(STRINGI_OBJECTS)
AC_SUBST(STRINGI_CXXSTD)
#AC_SUBST(STRINGI_CFLAGS)
Expand Down
38 changes: 29 additions & 9 deletions configure.win
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
# Copyright (c) 2013-2023, Marek Gagolewski <https://www.gagolewski.com/>

# this is an architecture-independent configure.win file
# This is an architecture-independent configure.win file

ICU_FOUND=0 # use our ICU bundle

ICUDT_DIR="icu74/data"
ICU_BUNDLE_VERSION=74

# some systems do not have ResolveLocaleName - this applies to mingw
# on 32-bit windows shipped with older Rtools (R < 4.2)
DISABLE_RESOLVE_LOCALE_NAME=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
cat(as.integer(getRversion() < "4.2"))
'`


echo "ICU_FOUND=${ICU_FOUND}"
echo "ICU_BUNDLE_VERSION=${ICU_BUNDLE_VERSION}"
echo "ICUDT_DIR=${ICUDT_DIR}"
echo "DISABLE_RESOLVE_LOCALE_NAME=${DISABLE_RESOLVE_LOCALE_NAME}"


"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
fin <- "src/uconfig_local.h.in";
fout <- "src/uconfig_local.h";
f <- readLines(fin);
f <- gsub("@ICU_FOUND@", 0, f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "icu74/data", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "74", f, fixed = TRUE);
f <- gsub("@ICU_FOUND@", '"${ICU_FOUND}"', f, fixed = TRUE);
f <- gsub("@DISABLE_RESOLVE_LOCALE_NAME@", '"${DISABLE_RESOLVE_LOCALE_NAME}"', f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "'"${ICUDT_DIR}"'", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "'"${ICU_BUNDLE_VERSION}"'", f, fixed = TRUE);
f <- gsub("@ICUDT_ENDIANNESS@", .Platform$endian, f, fixed = TRUE);
con <- file(fout, "wb") # LF line ending
writeLines(f, con);
close(con)
' `
'

"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
fin <- "src/install.libs.R.in";
fout <- "src/install.libs.R";
f <- readLines(fin);
f <- gsub("@ICU_FOUND@", 0, f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "icu74/data", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "74", f, fixed = TRUE);
f <- gsub("@ICU_FOUND@", '"${ICU_FOUND}"', f, fixed = TRUE);
f <- gsub("@DISABLE_RESOLVE_LOCALE_NAME@", '"${DISABLE_RESOLVE_LOCALE_NAME}"', f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "'"${ICUDT_DIR}"'", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "'"${ICU_BUNDLE_VERSION}"'", f, fixed = TRUE);
f <- gsub("@ICUDT_ENDIANNESS@", .Platform$endian, f, fixed = TRUE);
con <- file(fout, "wb") # LF line ending
writeLines(f, con);
close(con)
' `
'
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.8.1',
VERSION: '1.8.1.9001',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
6 changes: 3 additions & 3 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<a class="sidebar-brand" href="index.html">stringi</a>
</span>
<div class="sidebar-brand">
1.8.1
1.8.1.9001
</div>
<form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -357,7 +357,7 @@ <h1 id="index">Index</h1>
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
Last updated on 2023-11-16T10:51:45+1100.
Last updated on 2023-11-21T14:33:19+1100.
This site will never display any ads: it is a non-profit project.
It does not collect any data.
</div>
Expand All @@ -372,7 +372,7 @@ <h1 id="index">Index</h1>

</aside>
</div>
</div><script src="_static/documentation_options.js?v=1166ed6b"></script>
</div><script src="_static/documentation_options.js?v=8323ae8b"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<a class="sidebar-brand" href="#">stringi</a>
</span>
<div class="sidebar-brand">
1.8.1
1.8.1.9001
</div>
<form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -473,7 +473,7 @@ <h1>stringi: Fast and Portable Character String Processing in R<a class="headerl
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
Last updated on 2023-11-16T10:51:45+1100.
Last updated on 2023-11-21T14:33:19+1100.
This site will never display any ads: it is a non-profit project.
It does not collect any data.
</div>
Expand Down Expand Up @@ -506,7 +506,7 @@ <h1>stringi: Fast and Portable Character String Processing in R<a class="headerl

</aside>
</div>
</div><script src="_static/documentation_options.js?v=1166ed6b"></script>
</div><script src="_static/documentation_options.js?v=8323ae8b"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
6 changes: 3 additions & 3 deletions docs/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<a class="sidebar-brand" href="index.html">stringi</a>
</span>
<div class="sidebar-brand">
1.8.1
1.8.1.9001
</div>
<form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -470,7 +470,7 @@ <h2>Getting Help<a class="headerlink" href="#getting-help" title="Link to this h
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
Last updated on 2023-11-16T10:51:45+1100.
Last updated on 2023-11-21T14:33:19+1100.
This site will never display any ads: it is a non-profit project.
It does not collect any data.
</div>
Expand Down Expand Up @@ -506,7 +506,7 @@ <h2>Getting Help<a class="headerlink" href="#getting-help" title="Link to this h

</aside>
</div>
</div><script src="_static/documentation_options.js?v=1166ed6b"></script>
</div><script src="_static/documentation_options.js?v=8323ae8b"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
Loading
Loading