Skip to content

Commit

Permalink
Merge branch 'OpenCPN:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakansv authored Dec 7, 2024
2 parents 1aed7b2 + 8ed3611 commit dd9736b
Show file tree
Hide file tree
Showing 164 changed files with 13,427 additions and 11,097 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ jobs:
- restore_cache:
keys:
- macos-cache-v2-universal-{{checksum "ci/macos-universal-deps.sh"}}-{{checksum "ci/universal-build-macos.sh"}}
- run: ci/macos-sign-setup.sh
- run: ci/universal-build-macos.sh
- run: ci/macos-sign-cleanup.sh
- save_cache:
key: macos-cache-v2-universal-{{checksum "ci/macos-universal-deps.sh"}}-{{checksum "ci/universal-build-macos.sh"}}
paths:
Expand All @@ -147,7 +149,9 @@ jobs:
- restore_cache:
keys:
- macos-cache-v2-intel-{{checksum "ci/macos-universal-deps.sh"}}-{{checksum "ci/universal-build-macos.sh"}}
- run: ci/macos-sign-setup.sh
- run: ci/universal-build-macos.sh
- run: ci/macos-sign-cleanup.sh
- save_cache:
key: macos-cache-v2-intel-{{checksum "ci/macos-universal-deps.sh"}}-{{checksum "ci/universal-build-macos.sh"}}
paths:
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ set(GUI_SRC
${GUI_SRC_DIR}/NMEALogWindow.cpp
${GUI_SRC_DIR}/ocpCursor.cpp
${GUI_SRC_DIR}/ocpn_app.cpp
${GUI_SRC_DIR}/ocpn_plugin_gui.cpp
${GUI_SRC_DIR}/OCPN_AUIManager.cpp
${GUI_SRC_DIR}/ocpndc.cpp
${GUI_SRC_DIR}/ocpn_frame.cpp
Expand Down Expand Up @@ -1874,6 +1875,7 @@ if (APPLE)
set_target_properties(
${PACKAGE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST
"${CMAKE_SOURCE_DIR}/buildosx/Info.plist.in"
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
)
endif ()

Expand Down
18 changes: 18 additions & 0 deletions buildosx/entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<false/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<false/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<false/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<false/>
</dict>
</plist>
1 change: 1 addition & 0 deletions ci/circleci-build-android-corelib-armhf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cd $builddir && rm -rf *
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOCPN_TARGET_TUPLE:STRING="Android-armhf;16;armhf" \
-DOCPN_BUILD_SAMPLE=ON \
-Dtool_base="$HOME/android-sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64"\
..

Expand Down
1 change: 1 addition & 0 deletions ci/generic-build-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ else
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOCPN_CI_BUILD:BOOL=ON \
-DOCPN_USE_BUNDLED_LIBS=OFF \
-DOCPN_BUILD_SAMPLE=ON \
..
make -sj2
dbus-run-session make run-tests || :
Expand Down
7 changes: 7 additions & 0 deletions ci/generic-build-flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ cd flatpak
sed -i -e '/url:/s|\.\.|https://github.com/OpenCPN/OpenCPN.git|' \
-e "/BUILD_NUMBER/s/0/$BUILD_NUMBER/" \
org.opencpn.OpenCPN.yaml
ed org.opencpn.OpenCPN.yaml << EOF
/DOCPN_FLATPAK=ON/
i
- -DOCPN_BUILD_SAMPLE=ON \\
.
wq
EOF

test -d ../build || mkdir ../build
cd ../build
Expand Down
1 change: 1 addition & 0 deletions ci/generic-build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cmake -DOCPN_CI_BUILD=$CI_BUILD \
-DCMAKE_INSTALL_PREFIX=/tmp/opencpn \
-DOCPN_RELEASE=0 \
-DOCPN_BUILD_TEST=ON \
-DOCPN_BUILD_SAMPLE=ON \
..

# Compile OpenCPN
Expand Down
15 changes: 15 additions & 0 deletions ci/macos-sign-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -x

echo "Cleaning up the Apple developer account information keychain"

if [ -z "${APPLE_DEVELOPER_ID}" ]; then
echo "Apple developer account not set up, exiting..."
exit 0
fi

KEYCHAIN_PATH="app-signing.keychain-db"

# Clean up the keychain
security delete-keychain "${KEYCHAIN_PATH}"
39 changes: 39 additions & 0 deletions ci/macos-sign-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

set -x

echo "Importing Apple developer certificates"

if [ -z "${APPLE_DEVELOPER_ID}" ]; then
echo "Apple developer account not set up, exiting..."
exit 0
fi

KEYCHAIN_PATH="app-signing.keychain-db"
APP_P12="app.p12"
INST_P12="inst.p12"

# Store the certificates to the keychain
echo -n "${DEVELOPER_ID_APPLICATION_P12}" | base64 --decode -o "${APP_P12}"
echo -n "${DEVELOPER_ID_INSTALLER_P12}" | base64 --decode -o "${INST_P12}"

# Create temporary keychain
security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"
security set-keychain-settings -lut 21600 "${KEYCHAIN_PATH}"
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"

# Import the Apple intermediate CA certificate into the keychain
wget https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer
security import DeveloperIDG2CA.cer -k "${KEYCHAIN_PATH}"

# Import certificates to keychain
security import "${APP_P12}" -P "${DEVELOPER_ID_APPLICATION_P12_PASS}" -A -t cert -f pkcs12 -k "${KEYCHAIN_PATH}"
security import "${INST_P12}" -P "${DEVELOPER_ID_INSTALLER_P12_PASS}" -A -t cert -f pkcs12 -k "${KEYCHAIN_PATH}"
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "${KEYCHAIN_PATH}"
security list-keychain -d user -s "${KEYCHAIN_PATH}"
security default-keychain -d user -s "${KEYCHAIN_PATH}"

security find-identity -v -p codesigning

# Clean up the P12 files
rm -f "${APP_P12}" "${INST_P12}"
29 changes: 21 additions & 8 deletions ci/macos-universal-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ echo "Installing dependencies for ${arch} into ${cache_dir}"
ogg_version="1.3.5"
vorbis_version="1.3.7"
flac_version="1.4.3"
opus_version="1.4"
opus_version="1.5.2"
blake2_version="0.98.1"
zstd_version="1.5.6"
libarchive_version="3.7.3"
mpg123_version="1.32.4"
libarchive_version="3.7.7"
mpg123_version="1.32.8"
lame_version="3.100"
libsndfile_version="1.2.2"
libusb_version="1.0.27"
openssl_version="3.0.13"
wx_version="3.2.5"
openssl_version="3.0.15"
wx_version="3.2.6"

macos_deployment_target="10.13"

Expand Down Expand Up @@ -166,7 +166,7 @@ cd ..
rm -rf opus-${opus_version}

#blake2
if [ ! -f libb2-${blake2_version}.tar.gz ]; then
if [ ! -f libb2-${blake2_version}.tar.gz ]; then
wget https://github.com/BLAKE2/libb2/releases/download/v${blake2_version}/libb2-${blake2_version}.tar.gz
fi
tar xzf libb2-${blake2_version}.tar.gz
Expand Down Expand Up @@ -228,7 +228,20 @@ cd libarchive-${libarchive_version}
#lipo -create libarchive.13.dylib.x86-64 libarchive.13.dylib.arm64 -output .libs/libarchive.13.dylib
mkdir bld
cd bld
cmake -DCMAKE_OSX_ARCHITECTURES="${arch}" -DCMAKE_INSTALL_PREFIX=${cache_dir} -DENABLE_LZ4=false -DZSTD_INCLUDE_DIR=${cache_dir}/include -DZSTD_LIBRARY=${cache_dir}/lib/libzstd.dylib -DLIBB2_INCLUDE_DIR=${cache_dir}/include -DLIBB2_LIBRARY=${cache_dir}/lib/libb2.dylib -DCMAKE_POLICY_DEFAULT_CMP0068=NEW -DCMAKE_SKIP_BUILD_RPATH=FALSE -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE -DCMAKE_INSTALL_RPATH=${cache_dir}/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ..
cmake -DCMAKE_OSX_ARCHITECTURES="${arch}" \
-DCMAKE_INSTALL_PREFIX=${cache_dir} \
-DENABLE_LZ4=false \
-DZSTD_INCLUDE_DIR=${cache_dir}/include \
-DZSTD_LIBRARY=${cache_dir}/lib/libzstd.dylib \
-DLIBB2_INCLUDE_DIR=${cache_dir}/include \
-DLIBB2_LIBRARY=${cache_dir}/lib/libb2.dylib \
-DCMAKE_POLICY_DEFAULT_CMP0068=NEW \
-DCMAKE_SKIP_BUILD_RPATH=FALSE \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE \
-DCMAKE_INSTALL_RPATH=${cache_dir}/lib \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \
-DOCPN_BUILD_SAMPLE=ON \
..
#-DCMAKE_MACOSX_RPATH=FALSE ..
make -j ${ncp}
make install
Expand Down Expand Up @@ -349,7 +362,7 @@ fi
tar xjf openssl-${openssl_version}.tar.gz
cd openssl-${openssl_version}
if [[ "${arch}" = *"x86_64"* ]]; then
./Configure --prefix="${cache_dir}" darwin64-x86_64-cc shared
./Configure --prefix="${cache_dir}" darwin64-x86_64-cc shared
make -j ${ncpu}
if [[ "${arch}" = *"x86_64"* ]] && [[ "${arch}" = *"arm64"* ]]; then
mv libcrypto.3.dylib libcrypto.3.dylib.x86-64
Expand Down
25 changes: 24 additions & 1 deletion ci/universal-build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ cmake -DOCPN_CI_BUILD=$CI_BUILD \
-DCMAKE_INSTALL_PREFIX=/tmp/opencpn -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-DOCPN_RELEASE=${RELEASE} \
-DOCPN_BUILD_TEST=OFF \
-DOCPN_BUILD_SAMPLE=ON \
-DOCPN_USE_DEPS_BUNDLE=ON \
-DCMAKE_OSX_ARCHITECTURES="${ARCHS}" \
-DOCPN_USE_SYSTEM_LIBARCHIVE=OFF \
Expand Down Expand Up @@ -123,7 +124,16 @@ make install # Dunno why the second is needed but it is, otherwise
# plugin data is not included in the bundle

# Make sure the code signatures are correct
codesign --force --deep --sign - /tmp/opencpn/bin/OpenCPN.app
if [ -z "${APPLE_DEVELOPER_ID}" ]; then
# We do not have a paid Apple developer account, let's just reset the signatures
codesign --force --deep --sign - /tmp/opencpn/bin/OpenCPN.app
else
# We do have an account and did set up the certificates in ci/mac-sign.sh, let's sign the application bundle
codesign --verbose --sign "${APPLE_DEVELOPER_ID}" --options=runtime --timestamp --options=runtime /tmp/opencpn/bin/OpenCPN.app/Contents/PlugIns/*.dylib
codesign --deep --force --verbose --sign "${APPLE_DEVELOPER_ID}" --entitlements ../buildosx/entitlements.plist --timestamp --options=runtime /tmp/opencpn/bin/OpenCPN.app
fi

codesign -dv --verbose /tmp/opencpn/bin/OpenCPN.app

dsymutil -o OpenCPN.dSYM /tmp/opencpn/bin/OpenCPN.app/Contents/MacOS/OpenCPN
tar czf OpenCPN-$(git rev-parse --short HEAD).dSYM.tar.gz OpenCPN.dSYM
Expand All @@ -133,5 +143,18 @@ if [[ ! -z "${CREATE_DMG+x}" ]]; then
make create-dmg
fi

# Sign the installer if we have an Apple developer account set up
if [ -n "${APPLE_DEVELOPER_ID}" ]; then
shopt -s nullglob
for pkg_file in OpenCPN*.pkg; do
productsign --sign "${APPLE_DEVELOPER_ID}" "${pkg_file}" pkg.signed
mv pkg.signed "${pkg_file}"
done
# The resulting package has to be submitted to Apple for notarization
# xcrun notarytool submit --apple-id <Apple id e-mail> --team-id <APPLE_DEVELOPER_ID> --password <Application specific password> <OpenCPN_*.pkg>
# Once succesfully notarized, run the stapler to include the notarization ticket into the installer
# xcrun stapler staple <OpenCPN_*.pkg>
fi

# The build is over, if there is error now it is not ours
set +e
3 changes: 3 additions & 0 deletions cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ if (APPLE)
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE
)
set_target_properties(opencpn-cmd PROPERTIES
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
)
endif ()
5 changes: 4 additions & 1 deletion glutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (CMAKE_HOST_WIN32)
target_link_libraries(
${APP_TARGET} PRIVATE setupapi.lib "GLU_static" psapi.lib
iphlpapi.lib # glu32.lib
)
)
# use gdi plus only on MSVC, it is not a free library
if (MSVC)
target_link_libraries(${APP_TARGET} PRIVATE gdiplus.lib)
Expand Down Expand Up @@ -78,4 +78,7 @@ if (APPLE)
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE
)
set_target_properties(${APP_TARGET} PROPERTIES
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
)
endif ()
8 changes: 5 additions & 3 deletions glutil/console.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** \file console.cpp Simple CLI application to check OpenGL capabilities. */

/**************************************************************************
* Copyright (C) 2022 Alec Leamas *
* Copyright (C) 2024 Pavel Kalian *
Expand All @@ -18,7 +16,11 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************
***************************************************************************/

/**
* \file
* Simple CLI application to check OpenGL capabilities.
*/

#include "wx/wxprec.h"
Expand Down
5 changes: 4 additions & 1 deletion gui/include/gui/comm_overflow_dlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
**************************************************************************/

/** \file comm_oveflow_dlg.h Popup dialog on communication overflows. */
/**
* \file
* Popup dialog on communication overflows
*/

#ifndef COMM_OVERFLOW_DLG_H__
#define COMM_OVERFLOW_DLG_H__
Expand Down
5 changes: 4 additions & 1 deletion gui/include/gui/gui_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
**************************************************************************/

/** \file gui_lib.h General purpose GUI support. */
/**
* \file
* General purpose GUI support.
*/

#ifndef GUI_LIB_H__
#define GUI_LIB_H__
Expand Down
1 change: 1 addition & 0 deletions gui/include/gui/ocpn_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ class MyFrame : public wxFrame {
void InitApiListeners();
void ReleaseApiListeners();
void UpdateStatusBar(void);
void ConfigureStatusBar();

private:
void CheckToolbarPosition();
Expand Down
4 changes: 3 additions & 1 deletion gui/include/gui/pluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ enum ActionVerb {
REINSTALL_MANAGED_VERSION,
DOWNGRADE_INSTALLED_MANAGED_VERSION,
UNINSTALL_MANAGED_VERSION,
INSTALL_MANAGED_VERSION
INSTALL_MANAGED_VERSION,
UPDATE_IMPORTED_VERSION
};

class PlugInMenuItemContainer {
Expand Down Expand Up @@ -256,6 +257,7 @@ class PlugInManager : public wxEvtHandler {

bool SendMouseEventToPlugins(wxMouseEvent& event);
bool SendKeyEventToPlugins(wxKeyEvent& event);
void SendPreShutdownHookToPlugins();

void SendBaseConfigToAllPlugIns();
void SendS52ConfigToAllPlugIns(bool bReconfig = false);
Expand Down
3 changes: 2 additions & 1 deletion gui/include/gui/udev_rule_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
**************************************************************************/

/**
* \file udev_rule_mgr.h Access checks for comm devices and dongle.
* \file
*
* Access checks for comm devices and dongle.
* Only making anything useful on Linux.
*/

Expand Down
6 changes: 5 additions & 1 deletion gui/src/chcanv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ void ChartCanvas::SetShowGPS(bool bshow) {
}

void ChartCanvas::SetShowGPSCompassWindow(bool bshow) {
m_bShowCompassWin = bshow;
if (m_Compass) {
m_Compass->Show(m_bShowCompassWin);
if (m_bShowCompassWin) m_Compass->UpdateStatus();
Expand Down Expand Up @@ -7119,7 +7120,10 @@ bool ChartCanvas::MouseEventMUIBar(wxMouseEvent &event) {

cursor_region = CENTER;
if (!g_btouch) SetCanvasCursor(event);
return true;
if (m_muiBar)
return true;
else
return false;
}

bool ChartCanvas::MouseEventSetup(wxMouseEvent &event, bool b_handle_dclick) {
Expand Down
5 changes: 4 additions & 1 deletion gui/src/comm_overflow_dlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
**************************************************************************/

/** \file comm_oveflow_dlg.cpp Implement comm_oveflow_dlg.cpp.h. */
/**
* \file
* Implement comm_oveflow_dlg.cpp.h.
*/

#include <cassert>

Expand Down
Loading

0 comments on commit dd9736b

Please sign in to comment.