drakkan / sftpgo

Full-featured and highly configurable SFTP, HTTP/S, FTP/S and WebDAV server - S3, Google Cloud Storage, Azure Blob
https://sftpgo.com
GNU Affero General Public License v3.0
9.54k stars 743 forks source link

Providing prebuilt binaries for Android and Termux #1755

Open maaaaz opened 2 months ago

maaaaz commented 2 months ago

Is your feature request related to a problem? Please describe.

No prebuilt binaries for Android are currently provided. Such binaries should be compiled with the Android NDK.

Describe the solution you'd like

Prebuilt binaries for different Android versions, and different architectures (armv7 and armv8) A simple example for a specific Android target (Android 11 Level 30), with a static build for armv7:

$ cd /tmp/

$ sudo apt install binutils-arm-linux-gnueabi

$ wget -nv "https://go.dev/dl/go1.23.1.linux-amd64.tar.gz"
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin

$ wget -nv "https://dl.google.com/android/repository/android-ndk-r27-linux.zip"
$ unzip android-ndk-r27-linux.zip

$ git clone https://github.com/drakkan/sftpgo.git
$ cd sftpgo

$ env GOOS=android GOARCH=arm CGO_ENABLED=1 CC=/tmp/android-ndk-r27/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi30-clang go build -o sftpgo_android_30
$ arm-linux-gnueabi-readelf -a sftpgo_android30  | grep "Shared library:"
 0x00000001 (NEEDED)                     Shared library: [libdl.so]
 0x00000001 (NEEDED)                     Shared library: [liblog.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

Describe alternatives you've considered

No response

What are you using SFTPGo for?

Private user, home usecase (home backup/VPS)

Additional context

No response