-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
|
||
注意:本文档非最新版,根据此文档无法构建出有效客户端,请等待作者更新。在此期间内,尝试在本地构建出错的朋友可以通过issue与作者联系。 | ||
|
||
# wiliwili | ||
|
||
A third party bilibili client for Nintendo Switch. | ||
|
||
# Usage | ||
|
||
`Copy the wiliwili.nro to sdmc://switch folder. | ||
` | ||
# Development (under ubuntu20.04) | ||
|
||
recommand using vscode with cmake tools | ||
|
||
``` | ||
git clone --recursive https://github.com/xfangfang/wiliwili.git | ||
# or | ||
git clone https://github.com/xfangfang/wiliwili.git | ||
cd wiliwili | ||
git submodule update --init --recursive | ||
``` | ||
|
||
## linux | ||
|
||
### 1. install dependency | ||
|
||
``` | ||
# for internet connection | ||
sudo apt install libcurl4-openssl-dev | ||
# for borealis | ||
sudo apt install libglfw3-dev libglm-dev | ||
# for mpv | ||
sudo apt install libmpv-dev | ||
# for building | ||
sudo apt install cmake zip git g++ | ||
``` | ||
|
||
### 2. build wiliwili | ||
|
||
``` | ||
mkdir -p linux_build && cd linux_build | ||
rm -rf ./* && cmake -DPLATFORM_LINUX:BOOL=TRUE .. | ||
make -j4 | ||
``` | ||
|
||
|
||
## switch | ||
|
||
### 1. install devkitpro | ||
|
||
``` | ||
wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb | ||
sudo apt-get install gdebi-core | ||
sudo gdebi devkitpro-pacman.amd64.deb | ||
sudo dkp-pacman -S switch-dev switch-glfw switch-mesa switch-glm switch-portlibs switch-glad switch-libvpx | ||
cat >> ~/.bashrc <<-EOF | ||
# devkitpro | ||
export DEVKITPRO=/opt/devkitpro | ||
export PATH=\$PATH:\$DEVKITPRO/tools/bin:\$DEVKITPRO/devkitA64/bin | ||
EOF | ||
source ~/.bashrc | ||
``` | ||
|
||
### 2. building switch ffmpeg library (optional) | ||
|
||
``` | ||
sudo dkp-pacman -S devkitpro-pkgbuild-helpers | ||
sudo apt install iat dist simh coreutils vit at bacula-console-qt atfs vim-addon-manager liballegro4-dev | ||
``` | ||
|
||
###### set ffmpeg config (thanks for pplay) | ||
|
||
``` | ||
cd wiliwili | ||
wget https://ffmpeg.org/releases/ffmpeg-4.3.1.tar.xz | ||
tar -xvJf ffmpeg-4.3.1.tar.xz | ||
cd ffmpeg-4.3.1 | ||
source /opt/devkitpro/switchvars.sh | ||
./configure --prefix=/opt/devkitpro/portlibs/switch \ | ||
--extra-cflags='-D_GNU_SOURCE -O2 -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec' \ | ||
--extra-cxxflags='-D_GNU_SOURCE -O2 -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec' \ | ||
--extra-ldflags='-fPIE -L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnx/lib' \ | ||
--enable-cross-compile --cross-prefix=aarch64-none-elf- --arch=aarch64 \ | ||
--pkg-config=/opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-pkg-config \ | ||
--disable-shared --enable-static --target-os=linux --enable-pic \ | ||
--enable-asm --enable-neon --disable-runtime-cpudetect --disable-autodetect\ | ||
--enable-libass --enable-libfreetype --enable-libfribidi --enable-libtheora \ | ||
--disable-protocols --enable-protocol='file,http' \ | ||
--disable-filters --enable-filter='rotate,transpose' \ | ||
--disable-encoders --disable-muxers --disable-bsfs\ | ||
--disable-programs --disable-debug --disable-doc | ||
sed 's/#define HAVE_INET_ATON 0/#define HAVE_INET_ATON 1/g' -i config.h | ||
sed 's/#define HAVE_CLOSESOCKET 1/#define HAVE_CLOSESOCKET 0/g' -i config.h | ||
sed 's/#define HAVE_MMAP 1/#define HAVE_MMAP 0/g' -i config.h | ||
``` | ||
|
||
###### building ffmpeg | ||
|
||
``` | ||
make -j4 | ||
sudo su | ||
source /opt/devkitpro/switchvars.sh | ||
make install | ||
rm -r ${PORTLIBS_PREFIX}/share/ | ||
``` | ||
|
||
### 3. build switch mpv library (optional) | ||
|
||
##### set libmpv config | ||
|
||
``` | ||
cd wiliwili | ||
wget https://github.com/mpv-player/mpv/archive/v0.33.0.tar.gz | ||
tar -xvJf v0.33.0.tar.gz | ||
cd mpv-0.33.0 | ||
patch -Np1 -i ../mpv.patch | ||
source /opt/devkitpro/switchvars.sh | ||
./bootstrap.py | ||
export CFLAGS="$CFLAGS -D_POSIX_VERSION=200809L -I`pwd`/osdep/switch" | ||
TARGET=aarch64-none-elf ./waf configure --prefix="${PORTLIBS_PREFIX}" \ | ||
--disable-libmpv-shared --enable-libmpv-static --disable-cplayer \ | ||
--enable-sdl2 --enable-sdl2-audio --enable-sdl2-gamepad --enable-sdl2-video \ | ||
--disable-iconv --disable-jpeg --disable-libavdevice --disable-debug-build | ||
sed -i 's/#define HAVE_POSIX 1/#define HAVE_POSIX 0/' build/config.h | ||
sed -i 's/#define HAVE_POSIX_OR_MINGW 1/#define HAVE_POSIX 0/' build/config.h | ||
``` | ||
|
||
##### building libmpv | ||
|
||
``` | ||
./waf build | ||
sudo ./waf install | ||
``` | ||
|
||
### 4. build wiliwili.nro | ||
|
||
``` | ||
mkdir -p switch_build && cd switch_build | ||
rm -rf ./* && cmake -DPLATFORM_SWITCH:BOOL=TRUE .. | ||
make -j4 wiliwili.nro | ||
nxlink -s wiliwili.nro | ||
``` | ||
|
||
# Reference | ||
|
||
https://devkitpro.org/wiki/devkitPro_pacman | ||
|
||
https://github.com/devkitPro/pacman/releases | ||
|
||
https://github.com/devkitPro/pacman-packages | ||
|
||
https://github.com/natinusala/borealis | ||
|
||
https://github.com/Cpasjuste/pplay | ||
|
||
https://github.com/whoshuu/cpr | ||
|
||
https://github.com/nlohmann/json | ||
|
||
https://github.com/nayuki/QR-Code-generator | ||
|
||
https://github.com/progschj/ThreadPool |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.