Skip to content

Commit 9f9f644

Browse files
committed
chore: consolidate fdroid with existing scripts
- attempt to reuse a bunch of scripts
1 parent 461eaf6 commit 9f9f644

13 files changed

Lines changed: 173 additions & 62 deletions

fdroid/build-app.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
cd "$BUILD_DIR"
55

6-
export QT_HOST_PATH=$HOME/qt/6.9.2/gcc_64
7-
export QTDIR=$HOME/qt/6.9.2/android_arm64_v8a
8-
export QT_ANDROID_PATH=$HOME/qt/6.9.2/android_arm64_v8a
9-
export QMAKE=$HOME/qt/6.9.2/android_arm64_v8a/bin/qmake
10-
export PATH="$HOME/qt/6.9.2/gcc_64/bin:$HOME/qt/6.9.2/android_arm64_v8a/bin:$PATH"
11-
export CMAKE_PREFIX_PATH=$HOME/qt/6.9.2/android_arm64_v8a
12-
export Qt6_DIR=$HOME/qt/6.9.2/android_arm64_v8a/lib/cmake/Qt6
13-
export QT_PLUGIN_PATH=$HOME/qt/6.9.2/gcc_64/plugins
14-
export PKG_CONFIG_PATH=$HOME/qt/6.9.2/android_arm64_v8a/lib/pkgconfig
15-
export QT_ANDROID_DIR=$HOME/qt/6.9.2/android_arm64_v8a/src/android/java
6+
# shellcheck source=../scripts/setup-qt-env.sh
7+
source ./scripts/setup-qt-env.sh
8+
# shellcheck source=../scripts/setup-android-env.sh
9+
source ./scripts/setup-android-env.sh
10+
1611
export GOPATH=$HOME/go
1712
export PATH="$GOPATH/bin:$PATH"
1813
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
1914

2015
ulimit -n 65536 || true
2116
export USE_SYSTEM_NIM=1
17+
export NIM_SDS_SOURCE_DIR="$BUILD_DIR/vendor/nim-sds"
2218

2319
make deps
2420

fdroid/build-openssl.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
#
3+
# Build OpenSSL for Qt Android build
4+
# This builds OpenSSL as a dependency for Qt compilation
5+
# (separate from mobile/scripts/buildOpenSSL.sh which builds for the app)
6+
#
27
set -e
38

49
cd "$OPENSSL_SRCDIR"
510

6-
export PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
11+
# Use shared Android NDK setup if available, otherwise set PATH directly
12+
if [[ -f "$BUILD_DIR/scripts/setup-android-env.sh" ]]; then
13+
# shellcheck source=../scripts/setup-android-env.sh
14+
source "$BUILD_DIR/scripts/setup-android-env.sh"
15+
else
16+
# Fallback for when running in isolation
17+
export PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
18+
fi
719

820
./Configure android-arm64 -D__ANDROID_API__=24 \
921
--prefix="$HOME/openssl" \

fdroid/build-qt-android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
mkdir -p build_qt_android && cd build_qt_android

fdroid/build-qt-host.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
mkdir -p "$HOME/qt_build_tmp"

fdroid/cleanup-binaries.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
# Remove binary files that F-Droid scanner would flag
@@ -16,6 +16,6 @@ find mobile/vendors/openssl/cloudflare-quiche -name "Cargo.toml" -type f -delete
1616
find vendor/QR-Code-generator/rust -name "Cargo.toml" -type f -delete
1717
find test/e2e -type f -delete
1818
find vendor/nimPNG/tests/invalidInput -type f -delete
19-
find vendor/qzxing/tests -name "*.bin" -type f -delete
20-
find vendor/status-go/messaging/layers/segmentation/testdata -name "*.bin" -type f -delete
2119
find vendor/nim-bearssl/bearssl/csources -name "*.exe" -type f -delete
20+
find vendor/status-go/pkg/messaging/layers/segmentation/testdata -name "*.bin" -type f -delete
21+
rm -f test/e2e_appium/package.json

fdroid/metadata.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
AntiFeatures:
22
NonFreeNet:
3-
en-US: Relies on centralized services like Infura for blockchain interactions,
4-
making it dependent on non-libre infrastructure.
3+
en-US: Relies on centralized services like Infura for blockchain
4+
interactions, making it dependent on non-libre infrastructure.
55
TetheredNet:
6-
en-US: Messaging and user profiles are stored on Waku servers rather than being
7-
fully peer-to-peer, requiring a connection to a specific service instance.
6+
en-US: Messaging and user profiles are stored on Waku servers rather than
7+
being fully peer-to-peer, requiring a connection to a specific service
8+
instance.
89
Tracking:
9-
en-US: Collects and processes IP addresses, wallet addresses, and transaction
10-
details via the API Proxy Server. Data is shared with third-party services like
11-
Infura, Grove, and Cryptocompare.
10+
en-US: Collects and processes IP addresses, wallet addresses, and
11+
transaction details via the API Proxy Server. Data is shared with
12+
third-party services like Infura, Grove, and Cryptocompare.
1213
Categories:
1314
- Connectivity
1415
- Messaging
@@ -29,18 +30,15 @@ RepoType: git
2930
Repo: https://github.com/status-im/status-app.git
3031

3132
Builds:
32-
- versionName: 2.36.1
33-
versionCode: 29498842
34-
commit: 47482570fcdedc23f18ddbac2062fbc1e901ee6d
33+
- versionName: 2.37.0
34+
versionCode: 29500000
35+
commit: 0391438ad983f828b7f75dc3ff690f8648232c75
3536
timeout: 86400
3637
submodules: true
3738
sudo:
3839
- metadata/app.status.mobile/setup-dependencies.sh
39-
patch:
40-
- fdroid-build-gradle.patch
41-
- add-fdroid-apk-detection.patch
42-
- add-fdroid-make-target.patch
43-
output: mobile/build/android/qt6/android-build/build/outputs/apk/fdroid/android-build-fdroid-unsigned.apk
40+
output:
41+
mobile/build/android/qt6/android-build/build/outputs/apk/fdroid/android-build-fdroid-unsigned.apk
4442
srclibs:
4543
- Qt@v6.9.2
4644
- OpenSSL@openssl-3.0.15
@@ -51,12 +49,10 @@ Builds:
5149
- ./cleanup-binaries.sh
5250
- cd $$Nim$$ && sh build_all.sh
5351
- cd $$Qt$$
54-
- perl init-repository --module-subset=qtbase,qtdeclarative,qt5compat,qtmultimedia,qtshadertools,qtimageformats,qtwebview,qtscxml,qtsvg
55-
scanignore:
56-
- vendor/status-go/vendor/golang.org/x/net/publicsuffix/data/
57-
- vendor/status-go/vendor/github.com/libp2p/go-libp2p-asn-util/sorted-network-list.bin
52+
- perl init-repository
53+
--module-subset=qtbase,qtdeclarative,qt5compat,qtmultimedia,qtshadertools,qtimageformats,qtwebview,qtscxml,qtsvg
5854
build:
59-
- export FDROID_VERSION_CODE=29498842
55+
- export FDROID_VERSION_CODE=29500000
6056
- export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
6157
- export ANDROID_SDK_ROOT=/opt/android-sdk
6258
- export ANDROID_HOME=/opt/android-sdk
@@ -91,5 +87,5 @@ MaintainerNotes: |-
9187
9288
AutoUpdateMode: None
9389
UpdateCheckMode: None
94-
CurrentVersion: 2.36.1
95-
CurrentVersionCode: 29498842
90+
CurrentVersion: 2.37.0
91+
CurrentVersionCode: 29500000

fdroid/setup-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
apt-get update

mobile/scripts/Common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ WRAPPER_APP_FILES := $(shell find $(WRAPPER_APP) -type f)
6767
STATUS_Q_SCRIPT := $(SCRIPTS_PATH)/buildStatusQ.sh
6868
STATUS_GO_SCRIPT := $(SCRIPTS_PATH)/buildStatusGo.sh
6969
DOTHERSIDE_SCRIPT := $(SCRIPTS_PATH)/buildDOtherSide.sh
70-
OPENSSL_SCRIPT := $(SCRIPTS_PATH)/ios/buildOpenSSL.sh
70+
OPENSSL_SCRIPT := $(SCRIPTS_PATH)/buildOpenSSL.sh
7171
QRCODEGEN_SCRIPT := $(SCRIPTS_PATH)/buildQRCodeGen.sh
7272
STATUS_KEYCARD_QT_SCRIPT := $(SCRIPTS_PATH)/buildStatusKeycardQt.sh
7373
NIM_STATUS_CLIENT_SCRIPT := $(SCRIPTS_PATH)/buildNimStatusClient.sh
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ SSL_BUILD_DIR=${BUILD_DIR}/openssl-${TARGET}
1717
CRYPTO_OUTPUT_LIB=${LIB_PATH}/libcrypto_3${LIB_EXT}
1818
SSL_OUTPUT_LIB=${LIB_PATH}/libssl_3${LIB_EXT}
1919

20-
PLATFORM_ARGS=""
20+
PLATFORM_CONFIG_ARGS=()
21+
PLATFORM_BUILD_ARGS=()
2122

2223
if [[ "$OS" == "ios" ]]; then
2324
if [[ "$SDK" == "iphonesimulator" ]]; then
@@ -38,30 +39,30 @@ if [[ "$OS" == "ios" ]]; then
3839
fi
3940

4041
if [[ "$OS" == "android" ]]; then
41-
PLATFORM_CONFIG_ARGS="-U__ANDROID_API__ -D__ANDROID_API__=${ANDROID_API}"
42-
PLATFORM_BUILD_ARGS="SHLIB_VERSION_NUMBER="
42+
PLATFORM_CONFIG_ARGS=("-U__ANDROID_API__" "-D__ANDROID_API__=${ANDROID_API}")
43+
PLATFORM_BUILD_ARGS=("SHLIB_VERSION_NUMBER=")
4344
cleanup() {
4445
if [[ "$OS" == "android" ]]; then
45-
patch -d ${OPENSSL} -R -p0 <"${SCRIPT_DIR}/openssl-patch.diff"
46+
patch -d "${OPENSSL}" -R -p0 <"${SCRIPT_DIR}/openssl-patch.diff"
4647
fi
4748
}
4849

4950
trap cleanup EXIT
50-
patch -d ${OPENSSL} -p0 <"${SCRIPT_DIR}/openssl-patch.diff"
51+
patch -d "${OPENSSL}" -p0 <"${SCRIPT_DIR}/openssl-patch.diff"
5152
fi
5253

53-
echo "Building OpenSSL for $TARGET with platform config args $PLATFORM_CONFIG_ARGS"
54+
echo "Building OpenSSL for $TARGET with platform config args ${PLATFORM_CONFIG_ARGS[*]}"
5455

55-
mkdir -p ${SSL_BUILD_DIR}
56+
mkdir -p "${SSL_BUILD_DIR}"
5657

5758
(
58-
cd ${SSL_BUILD_DIR}
59-
59+
cd "${SSL_BUILD_DIR}"
60+
6061
# - no-module: Makes legacy provider built-in to libcrypto (not a separate module)
6162
# - enable-legacy: Enables legacy algorithms including DES
6263
# This is required for GlobalPlatform SCP02 which uses single-DES
6364
# Reference: https://github.com/openssl/openssl/discussions/25793
64-
65+
6566
# Platform-specific config
6667
if [[ "$OS" == "ios" ]]; then
6768
# iOS uses static libraries (.a files)
@@ -70,19 +71,19 @@ mkdir -p ${SSL_BUILD_DIR}
7071
# Android uses shared libraries (.so files)
7172
SHARED_FLAG="shared"
7273
fi
73-
74-
${OPENSSL}/Configure --release "$TARGET" $PLATFORM_CONFIG_ARGS \
74+
75+
"${OPENSSL}"/Configure --release "$TARGET" "${PLATFORM_CONFIG_ARGS[@]}" \
7576
no-module \
7677
enable-legacy \
7778
enable-des \
7879
enable-md2 \
7980
enable-rc5 \
80-
$SHARED_FLAG \
81+
"$SHARED_FLAG" \
8182
no-tests \
8283
no-ui-console
8384
# Rebuilding isn't working with the default target, so we need to clean and build again
8485
make clean
85-
make -j$(sysctl -n hw.ncpu) $PLATFORM_BUILD_ARGS build_libs
86+
make -j"$(sysctl -n hw.ncpu)" "${PLATFORM_BUILD_ARGS[@]}" build_libs
8687
)
8788

8889
mkdir -p "$LIB_PATH"

0 commit comments

Comments
 (0)