Skip to content

Commit 8ab27a3

Browse files
committed
feat: update scripts for macos development
1 parent 3a17e63 commit 8ab27a3

File tree

4 files changed

+84
-4
lines changed

4 files changed

+84
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ base/cache
1111
/cmake_install.cmake
1212
/tmp
1313
/subconverter
14+
/base/subconverter
15+
/*.a
1416

1517
# Dependencies for development
1618
/curl

CONTRIBUTING.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pacman -S base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x
3636

3737
2. run script to initialize the project for development:
3838
```shell
39-
sh scripts/dev.windows.release.sh
39+
sh scripts/build.windows.dev.sh
4040
```
4141

4242
3. debug the project with GDB:
@@ -78,7 +78,7 @@ or use VSCode with the following configuration:
7878
make -j4 && cp subconverter.exe subconverter/subconverter.exe
7979
```
8080

81-
### Linux / macOS
81+
### macOS
8282

8383
1. install the prerequisites:
8484

@@ -88,10 +88,15 @@ You should install all the following prequisites via your package manager.
8888
- patch
8989
- python
9090

91-
2. run the script to initialize the project for development:
91+
for macos run
92+
```shell
93+
brew reinstall rapidjson zlib pcre2 pkgconfig
94+
```
95+
96+
1. run the script to initialize the project for development:
9297

9398
```shell
94-
sh scripts/build.macos.release.sh
99+
sh scripts/build.macos.dev.sh
95100
```
96101

97102
3. run the executable for test:

scripts/build.macos.dev.sh

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
set -xe
3+
4+
# remove all old deps
5+
rm -rf curl libcron quickjspp rapidjson toml11 yaml-cpp
6+
# remove tmp folder
7+
rm -rf tmp
8+
9+
# brew reinstall rapidjson zlib pcre2 pkgconfig
10+
11+
#git clone https://github.com/curl/curl --depth=1 --branch curl-7_88_1
12+
#cd curl
13+
#./buildconf > /dev/null
14+
#./configure --with-ssl=/usr/local/opt/[email protected] --without-mbedtls --disable-ldap --disable-ldaps --disable-rtsp --without-libidn2 > /dev/null
15+
#cmake -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF . > /dev/null
16+
#make -j8 > /dev/null
17+
#cd ..
18+
19+
git clone https://github.com/jbeder/yaml-cpp --depth=1
20+
cd yaml-cpp
21+
cmake -DCMAKE_BUILD_TYPE=Debug -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF . > /dev/null
22+
make install -j8 > /dev/null
23+
cd ..
24+
25+
git clone https://github.com/ftk/quickjspp --depth=1
26+
cd quickjspp
27+
cmake -DCMAKE_BUILD_TYPE=Debug .
28+
make quickjs -j8
29+
install -d /usr/local/lib/quickjs/
30+
install -m644 quickjs/libquickjs.a /usr/local/lib/quickjs/
31+
install -d /usr/local/include/quickjs/
32+
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/local/include/quickjs/
33+
install -m644 quickjspp.hpp /usr/local/include/
34+
cd ..
35+
36+
git clone https://github.com/PerMalmberg/libcron --depth=1
37+
cd libcron
38+
git submodule update --init
39+
cmake -DCMAKE_BUILD_TYPE=Debug .
40+
make libcron install -j8
41+
install -m644 libcron/out/Debug/liblibcron.a /usr/local/lib/
42+
install -d /usr/local/include/libcron/
43+
install -m644 libcron/include/libcron/* /usr/local/include/libcron/
44+
install -d /usr/local/include/date/
45+
install -m644 libcron/externals/date/include/date/* /usr/local/include/date/
46+
cd ..
47+
48+
git clone https://github.com/ToruNiina/toml11 --depth=1
49+
cd toml11
50+
cmake -DCMAKE_CXX_STANDARD=11 .
51+
make install -j4
52+
cd ..
53+
54+
cp /usr/local/opt/zlib/lib/libz.a .
55+
cp /usr/local/lib/libpcre2-8.a .
56+
57+
cmake -DCMAKE_BUILD_TYPE=Debug .
58+
make -j8
59+
rm subconverter
60+
# shellcheck disable=SC2046
61+
c++ -Xlinker -unexported_symbol -Xlinker "*" -o base/subconverter -framework CoreFoundation -framework Security $(find CMakeFiles/subconverter.dir/src/ -name "*.o") $(find . -name "*.a") -lcurl -O3
62+
63+
python -m ensurepip
64+
python -m pip install gitpython
65+
python scripts/update_rules.py -c scripts/rules_config.conf
66+
67+
cd base
68+
chmod +rx subconverter
69+
chmod +r ./*
70+
cd ..
71+
mv base subconverter
72+
73+
set +xe
File renamed without changes.

0 commit comments

Comments
 (0)