Skip to content

Commit

Permalink
update linux
Browse files Browse the repository at this point in the history
  • Loading branch information
FayeSpica committed Jun 3, 2024
1 parent 5d31a56 commit 3626854
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,37 @@ jobs:
name: chiaki-borealis
path: |
ChiakiBorealis
linux-x64:
runs-on: ubuntu-latest
defaults:
run:
shell: alpine.sh --root {0}
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
packages: >
build-base
git
cmake
ninja
protoc
py3-protobuf
py3-setuptools
opus-dev
ffmpeg-dev
sdl2-dev
gcc
g++
openssl-dev
glfw-dev
glm-dev
- name: alpine-build-chiaki
run: |
./scripts/github-alpine-build.sh
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: chiaki-borealis
path: |
ChiakiBorealis
10 changes: 8 additions & 2 deletions gui2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ set_target_properties(chiaki-borealis PROPERTIES

target_include_directories(chiaki-borealis PRIVATE include example)

message(STATUS "is win32 ???????? 11${WIN32}11")
if (WIN32)
set(ADDON "iconv")
else()
set(ADDON "${SWRESAMPLE}")
endif()

message(STATUS "is win32: ${WIN32}")

target_link_libraries(chiaki-borealis
chiaki-lib
borealis
iconv
${ADDON}
SDL2::SDL2
SDL2::SDL2main
FFMPEG::avcodec
Expand Down
9 changes: 6 additions & 3 deletions gui2/src/discoverymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
#include <switch.h>
#endif

// #include <arpa/inet.h>
// #include <netdb.h>
// #include <netinet/in.h>
#ifdef _WIN32
#else
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#endif
#include <stdio.h>
#include <string.h>

Expand Down
7 changes: 6 additions & 1 deletion gui2/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL
#include <windows.h>
// chiaki modules
#include <chiaki/discovery.h>
#include <chiaki/log.h>
Expand All @@ -11,6 +10,10 @@
#include "io.h"
#include "settings.h"

#ifdef _WIN32
#include <windows.h>
#endif

#ifdef __SWITCH__
#include <switch.h>
#else
Expand Down Expand Up @@ -144,6 +147,8 @@ int main(int argc, char *argv[])
return start();
}

#ifdef _WIN32
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
return start();
}
#endif
20 changes: 20 additions & 0 deletions scripts/github-alpine-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -xe

apk add git cmake ninja protoc py3-protobuf py3-setuptools opus-dev ffmpeg-dev sdl2-dev gcc g++ openssl-dev glfw-dev glm-dev

rm -rf build

cmake -Bbuild -GNinja -DCHIAKI_ENABLE_GUI=OFF -DCHIAKI_ENABLE_CLI=OFF -DCHIAKI_ENABLE_GUI2=ON -DCHIAKI_ENABLE_PI_DECODER=OFF -DCHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER=ON

ninja -C build

mkdir ChiakiBorealis && cp build/gui2/chiaki ChiakiBorealis

# copy resources
mkdir ChiakiBorealis/gui2
cp -vr gui2/res ChiakiBorealis/gui2
cp -vr scripts/chiaki.conf ChiakiBorealis/

ls -alh ChiakiBorealis

0 comments on commit 3626854

Please sign in to comment.