You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-27 06:23:53 +01:00
Merge pull request #167 from kkonradpl/main
Add workflow for librdsparser and update it to v1.1
This commit is contained in:
61
.github/workflows/librdsparser.yml
vendored
Normal file
61
.github/workflows/librdsparser.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Fetch and Commit librdsparser
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Release version'
|
||||||
|
required: true
|
||||||
|
default: 'v1.1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fetch-and-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Download all librdsparser release assets
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
cd server/libraries
|
||||||
|
|
||||||
|
VERSION="${{ github.event.inputs.version }}"
|
||||||
|
echo "Fetching librdsparser release: $VERSION"
|
||||||
|
|
||||||
|
platforms=(
|
||||||
|
"aarch64"
|
||||||
|
"arm"
|
||||||
|
"macos"
|
||||||
|
"mingw32"
|
||||||
|
"mingw64"
|
||||||
|
"x86"
|
||||||
|
"x86_64"
|
||||||
|
)
|
||||||
|
|
||||||
|
base_url="https://github.com/kkonradpl/librdsparser/releases/download/$VERSION"
|
||||||
|
|
||||||
|
for platform in "${platforms[@]}"; do
|
||||||
|
filename="librdsparser-${platform}.zip"
|
||||||
|
dir="${platform}"
|
||||||
|
mkdir -p "$dir"
|
||||||
|
|
||||||
|
echo "Downloading $filename..."
|
||||||
|
curl -sSL -o "$dir/$filename" "$base_url/$filename"
|
||||||
|
|
||||||
|
echo "Extracting from $filename..."
|
||||||
|
unzip -j "$dir/$filename" "*.dll" "*.so" "*.dylib" -d "$dir" || echo "No binaries in $filename"
|
||||||
|
rm "$dir/$filename"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Commit and push binaries to the repo
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions"
|
||||||
|
git config user.email "github-actions@github.com"
|
||||||
|
|
||||||
|
git add server/libraries
|
||||||
|
git diff --cached --quiet || git commit -m "Add librdsparser ${{ github.event.inputs.version }}"
|
||||||
|
git push
|
||||||
@@ -12,13 +12,17 @@ let shared_Library;
|
|||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
unicode_type = 'int16_t';
|
unicode_type = 'int16_t';
|
||||||
shared_Library=path.join(__dirname, "libraries", "librdsparser.dll");
|
arch_type = (cpuArchitecture === 'x64' ? 'mingw64' : 'mingw32');
|
||||||
|
shared_Library=path.join(__dirname, "libraries", arch_type, "librdsparser.dll");
|
||||||
} else if (platform === 'linux') {
|
} else if (platform === 'linux') {
|
||||||
unicode_type = 'int32_t';
|
unicode_type = 'int32_t';
|
||||||
shared_Library=path.join(__dirname, "libraries", "librdsparser_" + cpuArchitecture + ".so");
|
arch_type = (cpuArchitecture === 'x64' ? 'x86_64' :
|
||||||
|
(cpuArchitecture === 'ia32' ? 'x86' :
|
||||||
|
(cpuArchitecture === 'arm64' ? 'aarch64' : cpuArchitecture)));
|
||||||
|
shared_Library=path.join(__dirname, "libraries", arch_type, "librdsparser.so");
|
||||||
} else if (platform === 'darwin') {
|
} else if (platform === 'darwin') {
|
||||||
unicode_type = 'int32_t';
|
unicode_type = 'int32_t';
|
||||||
shared_Library=path.join(__dirname, "libraries", "librdsparser" + ".dylib");
|
shared_Library=path.join(__dirname, "libraries", "macos", "librdsparser.dylib");
|
||||||
}
|
}
|
||||||
|
|
||||||
const lib = koffi.load(shared_Library);
|
const lib = koffi.load(shared_Library);
|
||||||
@@ -42,8 +46,8 @@ const rdsparser = {
|
|||||||
free: lib.func('void rdsparser_free(void *rds)'),
|
free: lib.func('void rdsparser_free(void *rds)'),
|
||||||
clear: lib.func('void rdsparser_clear(void *rds)'),
|
clear: lib.func('void rdsparser_clear(void *rds)'),
|
||||||
parse_string: lib.func('bool rdsparser_parse_string(void *rds, const char *input)'),
|
parse_string: lib.func('bool rdsparser_parse_string(void *rds, const char *input)'),
|
||||||
set_text_correction: lib.func('bool rdsparser_set_text_correction(void *rds, uint8_t text, uint8_t type, uint8_t error)'),
|
set_text_correction: lib.func('void rdsparser_set_text_correction(void *rds, uint8_t text, uint8_t type, uint8_t error)'),
|
||||||
set_text_progressive: lib.func('bool rdsparser_set_text_progressive(void *rds, uint8_t string, bool state)'),
|
set_text_progressive: lib.func('void rdsparser_set_text_progressive(void *rds, uint8_t string, uint8_t state)'),
|
||||||
get_pi: lib.func('int32_t rdsparser_get_pi(void *rds)'),
|
get_pi: lib.func('int32_t rdsparser_get_pi(void *rds)'),
|
||||||
get_pty: lib.func('int8_t rdsparser_get_pty(void *rds)'),
|
get_pty: lib.func('int8_t rdsparser_get_pty(void *rds)'),
|
||||||
get_tp: lib.func('int8_t rdsparser_get_tp(void *rds)'),
|
get_tp: lib.func('int8_t rdsparser_get_tp(void *rds)'),
|
||||||
@@ -169,8 +173,8 @@ rdsparser.set_text_correction(rds, 0, 0, 2);
|
|||||||
rdsparser.set_text_correction(rds, 0, 1, 2);
|
rdsparser.set_text_correction(rds, 0, 1, 2);
|
||||||
rdsparser.set_text_correction(rds, 1, 0, 2);
|
rdsparser.set_text_correction(rds, 1, 0, 2);
|
||||||
rdsparser.set_text_correction(rds, 1, 1, 2);
|
rdsparser.set_text_correction(rds, 1, 1, 2);
|
||||||
rdsparser.set_text_progressive(rds, 0, true)
|
rdsparser.set_text_progressive(rds, 0, 1)
|
||||||
rdsparser.set_text_progressive(rds, 1, true)
|
rdsparser.set_text_progressive(rds, 1, 1)
|
||||||
rdsparser.register_pi(rds, callbacks.pi);
|
rdsparser.register_pi(rds, callbacks.pi);
|
||||||
rdsparser.register_pty(rds, callbacks.pty);
|
rdsparser.register_pty(rds, callbacks.pty);
|
||||||
rdsparser.register_tp(rds, callbacks.tp);
|
rdsparser.register_tp(rds, callbacks.tp);
|
||||||
|
|||||||
BIN
server/libraries/aarch64/librdsparser.so
Executable file
BIN
server/libraries/aarch64/librdsparser.so
Executable file
Binary file not shown.
BIN
server/libraries/arm/librdsparser.so
Executable file
BIN
server/libraries/arm/librdsparser.so
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
server/libraries/librdsparser.dylib → server/libraries/macos/librdsparser.dylib
Normal file → Executable file
BIN
server/libraries/librdsparser.dylib → server/libraries/macos/librdsparser.dylib
Normal file → Executable file
Binary file not shown.
BIN
server/libraries/mingw32/librdsparser.dll
Normal file
BIN
server/libraries/mingw32/librdsparser.dll
Normal file
Binary file not shown.
BIN
server/libraries/mingw64/librdsparser.dll
Normal file
BIN
server/libraries/mingw64/librdsparser.dll
Normal file
Binary file not shown.
BIN
server/libraries/x86/librdsparser.so
Executable file
BIN
server/libraries/x86/librdsparser.so
Executable file
Binary file not shown.
BIN
server/libraries/x86_64/librdsparser.so
Executable file
BIN
server/libraries/x86_64/librdsparser.so
Executable file
Binary file not shown.
Reference in New Issue
Block a user