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

Update common #417

Merged
merged 7 commits into from
Apr 19, 2024
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
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## 3.2.2 (2024-02-05)
- fix incorrect usage of seconds, should be ms
([GH#411](https://github.com/eduvpn/android/issues/411))
- fix not being able to add secure internet servers ([GH#412](https://github.com/eduvpn/android/issues/411))
- fix not being able to add secure internet servers ([GH#412](https://github.com/eduvpn/android/issues/412))
- Update eduvpn-common to commit 8f9a1ec5fb489af88c6e53f592bac3cccfb77f67

## 3.2.1 (2024-01-19)
- update all build scripts for new release
Expand Down
48 changes: 23 additions & 25 deletions common/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,42 @@ set(GO_OS "android")
set(GO_ARCH "${NDK_GO_ARCH_MAP_${ANDROID_ARCH_NAME}}")

# The env var COMMON_VERSION comes from the build.gradle
set(INTERMEDIARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/eduvpn-common/exports/lib/${GO_OS}/${GO_ARCH}")
set(INTERMEDIARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/eduvpn-common/lib/${GO_OS}/${GO_ARCH}")
set(INTERMEDIARY_DEFAULT_HEADER "${INTERMEDIARY_DIR}/libeduvpn_common-${COMMON_VERSION}.h")
set(INTERMEDIARY_HEADER "${INTERMEDIARY_DIR}/eduvpn_common.h")
set(INTERMEDIARY_FILE "${INTERMEDIARY_DIR}/libeduvpn_common-${COMMON_VERSION}.so")
set(OUTPUT_FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libeduvpn_common-${COMMON_VERSION}.so")
set(INTERMEDIARY_FILE "libeduvpn_common-${COMMON_VERSION}.so")
set(INTERMEDIARY_FILE_PATH "${INTERMEDIARY_DIR}/${INTERMEDIARY_FILE}")
set(OUTPUT_FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${INTERMEDIARY_FILE}")
set(CLANG_FLAGS "-arch ${GO_ARCH} --target=${ANDROID_LLVM_TRIPLE} --gcc-toolchain=${ANDROID_TOOLCHAIN_ROOT} --sysroot=${ANDROID_SYSROOT}")

find_program(MAKE_EXECUTABLE
NAMES gmake mingw32-make make
NAMES_PER_DIR
DOC "GNU Make"
REQUIRED
)

# Remove -mthumb
string(REPLACE " -mthumb" "" CMAKE_C_FLAGS_NO_THUMB ${CMAKE_C_FLAGS})
string(REPLACE " -mthumb" "" CMAKE_CXX_FLAGS_NO_THUMB ${CMAKE_CXX_FLAGS})

# Compile from Go to C
add_custom_command(
OUTPUT ${INTERMEDIARY_FILE} ${INTERMEDIARY_HEADER}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/eduvpn-common/exports"
OUTPUT ${INTERMEDIARY_FILE_PATH} ${INTERMEDIARY_DEFAULT_HEADER}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/eduvpn-common"
COMMENT "Building shared library for ${ANDROID_LLVM_TRIPLE}"
VERBATIM
COMMAND ${MAKE_EXECUTABLE}
GOOS=${GO_OS}
GOARCH=${GO_ARCH}
CC=${ANDROID_C_COMPILER}
CXX=${ANDROID_CXX_COMPILER}
CGO_CPPFLAGS=${CLANG_FLAGS}\ --target=${ANDROID_LLVM_TRIPLE}
CGO_CFLAGS=${CLANG_FLAGS}\ ${CMAKE_C_FLAGS_NO_THUMB}\ -Wno-unused-command-line-argument
CGO_CXXFLAGS=${CLANG_FLAGS}\ ${CMAKE_CXX_FLAGS_NO_THUMB}
CGO_LDFLAGS=${CLANG_FLAGS}\ ${CMAKE_SHARED_LINKER_FLAGS}
COMMAND ${CMAKE_COMMAND} -E env
CGO_ENABLED=1
GOOS=${GO_OS}
GOARCH=${GO_ARCH}
CC=${ANDROID_C_COMPILER}
CXX=${ANDROID_CXX_COMPILER}
CGO_CPPFLAGS=${CLANG_FLAGS}\ --target=${ANDROID_LLVM_TRIPLE}
CGO_CFLAGS=${CLANG_FLAGS}\ ${CMAKE_C_FLAGS_NO_THUMB}\ -Wno-unused-command-line-argument
CGO_CXXFLAGS=${ClANG_FLAGS}\ ${CMAKE_CXX_FLAGS_NO_THUMB}
CGO_LDFLAGS=${CLANG_FLAGS}\ ${CMAKE_SHARED_LINKER_FLAGS}
go build -o "${INTERMEDIARY_FILE_PATH}" -buildmode=c-shared ./exports
)
# Copy from intermediary to output file
add_custom_command(
OUTPUT ${OUTPUT_FILE}
DEPENDS ${INTERMEDIARY_FILE}
COMMAND cp ${INTERMEDIARY_FILE} ${OUTPUT_FILE}
OUTPUT ${OUTPUT_FILE} ${INTERMEDIARY_HEADER}
DEPENDS ${INTERMEDIARY_FILE_PATH} ${INTERMEDIARY_DEFAULT_HEADER}
COMMAND cp ${INTERMEDIARY_FILE_PATH} ${OUTPUT_FILE}
COMMAND cp ${INTERMEDIARY_DEFAULT_HEADER} ${INTERMEDIARY_HEADER}
)
# Set the output file on the target
add_custom_target(libeduvpn_common DEPENDS ${OUTPUT_FILE} ${INTERMEDIARY_HEADER})
Expand All @@ -67,4 +65,4 @@ target_link_libraries(eduvpn_common-wrapper
${OUTPUT_FILE}
android
log
)
)
2 changes: 1 addition & 1 deletion common/libs/eduvpn-common
Submodule eduvpn-common updated 61 files
+6 −3 .github/workflows/deploy.yml
+1 −6 .github/workflows/test-win.yml
+15 −12 .github/workflows/test.yml
+4 −0 .gitignore
+18 −1 CHANGES.md
+17 −22 Makefile
+21 −26 client/client.go
+1 −0 client/fsm.go
+2 −2 client/locales/da/messages.gotext.json
+30 −30 client/locales/de/messages.gotext.json
+3 −3 client/locales/en/messages.gotext.json
+2 −2 client/locales/es/messages.gotext.json
+2 −2 client/locales/fr/messages.gotext.json
+2 −2 client/locales/it/messages.gotext.json
+2 −2 client/locales/nl/messages.gotext.json
+2 −2 client/locales/sl/messages.gotext.json
+2 −2 client/locales/uk/messages.gotext.json
+22 −25 client/proxy.go
+93 −64 client/zgotext.go
+1 −0 docker/pip/build.sh
+5 −19 docs/src/api/functiondocs.md
+4 −46 docs/src/gettingstarted/building/go.md
+2 −35 docs/src/gettingstarted/building/packageformats.md
+1 −5 docs/src/gettingstarted/building/python.md
+0 −1 exports/.gitignore
+0 −24 exports/Makefile
+0 −49 exports/common.mk
+10 −30 exports/exports.go
+0 −30 exports/generate_lib.ps1
+6 −3 genexportsdoc.py
+5 −5 go.mod
+22 −12 go.sum
+27 −45 internal/api/api.go
+66 −0 internal/api/cache.go
+1 −15 internal/api/profiles/profiles.go
+9 −4 internal/config/v1/v1.go
+5 −5 internal/config/v2/convert.go
+56 −50 internal/config/v2/v2.go
+9 −3 internal/discovery/discovery.go
+19 −17 internal/server/custom.go
+20 −15 internal/server/institute.go
+21 −16 internal/server/secureinternet.go
+29 −37 internal/server/server.go
+7 −10 internal/server/servers.go
+1 −1 internal/version/version.go
+1 −2 internal/wireguard/ini/ini.go
+10 −0 keys/[email protected]
+59 −10 make_release.sh
+54 −0 prepare_release.sh
+5 −1 types/server/server.go
+17 −16 wrappers/python/Makefile
+5 −22 wrappers/python/README.md
+4 −4 wrappers/python/docs/source/conf.py
+1 −1 wrappers/python/eduvpn_common/__init__.py
+2 −5 wrappers/python/eduvpn_common/event.py
+84 −77 wrappers/python/eduvpn_common/loader.py
+24 −32 wrappers/python/eduvpn_common/main.py
+2 −14 wrappers/python/eduvpn_common/types.py
+3 −1 wrappers/python/example/main.py
+35 −4 wrappers/python/pyproject.toml
+0 −122 wrappers/python/setup.py
3 changes: 2 additions & 1 deletion common/src/main/cpp/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ int createStateCallback(int oldstate, int newstate, void *data) {
}

// Implement a function that matches the proxyFD signature
void proxyFD(int fd) {
// the android app does not use peer_ips as it uses a socket protect for routing
void proxyFD(int fd, const char* peer_ips) {
if (!globalVM) {
return;
}
Expand Down
Loading