Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
leleliu008 committed Jan 15, 2025
1 parent a3005ea commit d082a20
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 189 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,9 @@ jobs:
rm -v "$item"
done
mv out/bin/* out/
mv *.otf out/
mv out/bin/* *.otf out/
rm -rf out/bin
rm -rf out/share
rm -rf out/share/
DIRNAME="ndk-pkg-core-${{ needs.base.outputs.release-version }}-android-${{ matrix.target-version }}-arm64-v8a"
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ sudo mount -t proc none ubuntu-rootfs/proc
sudo mount -t sysfs none ubuntu-rootfs/sys
sudo mount -t tmpfs none ubuntu-rootfs/tmp

sudo chroot ubuntu-rootfs env GITHUB_ACTIONS=true ndk-pkg setup
sudo chroot ubuntu-rootfs env GITHUB_ACTIONS=true ndk-pkg update
sudo chroot ubuntu-rootfs env GITHUB_ACTIONS=true ndk-pkg install curl --target=android-35-arm64-v8a --static
sudo chroot ubuntu-rootfs ndk-pkg setup -y
sudo chroot ubuntu-rootfs ndk-pkg update
sudo chroot ubuntu-rootfs ndk-pkg install curl --target=android-35-arm64-v8a --static
```

## Using ndk-pkg via chroot+alpine
Expand All @@ -139,12 +139,9 @@ sudo mount -o bind /dev alpine-rootfs/dev
sudo mount -t proc none alpine-rootfs/proc
sudo mount -t sysfs none alpine-rootfs/sys

sudo chroot alpine-rootfs apk update
sudo chroot alpine-rootfs apk add gcompat

sudo chroot alpine-rootfs env GITHUB_ACTIONS=true ndk-pkg setup
sudo chroot alpine-rootfs env GITHUB_ACTIONS=true ndk-pkg update
sudo chroot alpine-rootfs env GITHUB_ACTIONS=true ndk-pkg install curl --target=android-35-arm64-v8a --static
sudo chroot alpine-rootfs ndk-pkg setup
sudo chroot alpine-rootfs ndk-pkg update
sudo chroot alpine-rootfs ndk-pkg install curl --target=android-35-arm64-v8a --static
```

## Using ndk-pkg via [WSL](https://docs.microsoft.com/en-us/windows/wsl)
Expand Down Expand Up @@ -196,8 +193,9 @@ chmod a+x ndk-pkg

Please try the following URLs if above url is not reachable:

- https://gitee.com/fpliu/ndk-pkg/raw/master/ndk-pkg
- https://raw.githubusercontents.com/leleliu008/ndk-pkg/master/ndk-pkg
- https://cdn.jsdelivr.net/gh/leleliu008/ndk-pkg/ndk-pkg
- https://gitee.com/fpliu/ndk-pkg/raw/master/ndk-pkg

## Install ndk-pkg via git

Expand Down
89 changes: 89 additions & 0 deletions install-curl-via-syspm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/sh

set -e

__install_curl_via_syspm_on_debian() {
apt-get -y update
apt-get -y install curl
}

__install_curl_via_syspm_on_ubuntu() {
apt-get -y update
apt-get -y install curl
}

__install_curl_via_syspm_on_linuxmint() {
apt-get -y update
apt-get -y install curl
}

__install_curl_via_syspm_on_rocky() {
dnf -y update
dnf -y install curl
}

__install_curl_via_syspm_on_almalinux() {
dnf -y update
dnf -y install curl
}

__install_curl_via_syspm_on_centos() {
dnf -y update
dnf -y install curl
}

__install_curl_via_syspm_on_fedora() {
dnf -y update
dnf -y install curl
}

__install_curl_via_syspm_on_rhel() {
dnf -y update
dnf -y install curl
}

__install_curl_via_syspm_on_opensuse_leap() {
zypper update -y
zypper install -y curl
}

__install_curl_via_syspm_on_gentoo() {
emerge net-misc/curl
}

__install_curl_via_syspm_on_manjaro() {
pacman -Syyuu --noconfirm
pacman -S --noconfirm curl
}

__install_curl_via_syspm_on_arch() {
pacman -Syyuu --noconfirm
pacman -S --noconfirm curl
}

__install_curl_via_syspm_on_void() {
xbps-install -Syu xbps
xbps-install -S
xbps-install -Syu curl
}

__install_curl_via_syspm_on_alpine() {
apk update
apk add curl
}

__install_curl_via_syspm_on_Linux() {
if [ -f /etc/os-release ] ; then
. /etc/os-release

if [ "$ID" = 'opensuse-leap' ] ; then
ID='opensuse_leap'
fi

__install_curl_via_syspm_on_$ID
fi
}

NATIVE_OS_KIND="$(uname -s)"

__install_curl_via_syspm_on_$NATIVE_OS_KIND
88 changes: 88 additions & 0 deletions install-gcc-via-syspm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/sh

set -e

__install_gcc_via_syspm_on_debian() {
apt-get -y update
apt-get -y install g++
}

__install_gcc_via_syspm_on_ubuntu() {
apt-get -y update
apt-get -y install g++
}

__install_gcc_via_syspm_on_linuxmint() {
apt-get -y update
apt-get -y install g++
}

__install_gcc_via_syspm_on_rocky() {
dnf -y update
dnf -y install gcc-c++
}

__install_gcc_via_syspm_on_almalinux() {
dnf -y update
dnf -y install gcc-c++
}

__install_gcc_via_syspm_on_centos() {
dnf -y update
dnf -y install gcc-c++
}

__install_gcc_via_syspm_on_fedora() {
dnf -y update
dnf -y install curl g++
}

__install_gcc_via_syspm_on_rhel() {
:
}

__install_gcc_via_syspm_on_opensuse_leap() {
zypper update -y
zypper install -y gcc-c++
}

__install_gcc_via_syspm_on_gentoo() {
emerge sys-devel/gcc
}

__install_gcc_via_syspm_on_manjaro() {
pacman -Syyuu --noconfirm
pacman -S --noconfirm gcc
}

__install_gcc_via_syspm_on_arch() {
pacman -Syyuu --noconfirm
pacman -S --noconfirm gcc
}

__install_gcc_via_syspm_on_void() {
xbps-install -Syu xbps
xbps-install -S
xbps-install -Syu gcc
}

__install_gcc_via_syspm_on_alpine() {
apk update
apk add gcompat g++ linux-headers
}

__install_gcc_via_syspm_on_Linux() {
if [ -f /etc/os-release ] ; then
. /etc/os-release

if [ "$ID" = 'opensuse-leap' ] ; then
ID='opensuse_leap'
fi

__install_gcc_via_syspm_on_$ID
fi
}

NATIVE_OS_KIND="$(uname -s)"

__install_gcc_via_syspm_on_$NATIVE_OS_KIND
Loading

0 comments on commit d082a20

Please sign in to comment.