Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webos makefile and CI updates #16312

Merged
merged 2 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/webOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI webOS

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Download ares-cli-rs
uses: robinraju/[email protected]
with:
repository: "webosbrew/ares-cli-rs"
latest: true
fileName: "ares-package_*.deb"
out-file-path: "temp"

- name: Update packages
run: sudo apt-get -yq update

- name: Install webOS CLI
run: sudo apt-get -yq install ./temp/*.deb

- name: Download webOS NDK
uses: robinraju/[email protected]
with:
repository: "openlgtv/buildroot-nc4"
latest: true
fileName: "arm-webos-linux-gnueabi_sdk-buildroot.tar.gz"
out-file-path: "/tmp"

- name: Extract webOS NDK
shell: bash
working-directory: /tmp
run: |
tar xzf arm-webos-linux-gnueabi_sdk-buildroot.tar.gz
./arm-webos-linux-gnueabi_sdk-buildroot/relocate-sdk.sh

- name: Compile RA
run: |
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
make -f Makefile.webos ADD_SDL2_LIB=1 -j$(getconf _NPROCESSORS_ONLN)
52 changes: 35 additions & 17 deletions Makefile.webos
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
include version.all

$(call assert,$(call seq,$(TARGET_PREFIX),arm-webos-linux-gnueabi-),webOS SDK isn't setup properly. See https://github.com/webosbrew/meta-lg-webos-ndk#compile-program-by-command-line)
ifneq ($(CROSS_COMPILE),arm-webos-linux-gnueabi-)
$(error You need webOS toolchain to build this. See https://github.com/webosbrew/native-toolchain)
endif

ifdef SDKTARGETSYSROOT
$(warning OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain)
STAGING_DIR = $(SDKTARGETSYSROOT)
else ifndef STAGING_DIR
$(error Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain)
endif

WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config

WEBOS_FREETYPE_CONFIG ?= $(SDKTARGETSYSROOT)/usr/bin/freetype-config
WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include
WEBOS_LIB_DIR ?= $(STAGING_DIR)/usr/lib

WEBOS_INC_DIR ?= $(SDKTARGETSYSROOT)/usr/include
WEBOS_LIB_DIR ?= $(SDKTARGETSYSROOT)/usr/lib
ADD_SDL2_LIB ?= 0
SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.0-2/SDL2-2.30.0-webos.tar.gz

ADD_SDL2_LIB ?= 0

#########################
#########################

Expand Down Expand Up @@ -122,15 +132,15 @@ OS = Linux
TARGET = retroarch

OBJ :=
LINK := $(CXX)
LINK := $(CC)
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
LIBS := -ldl -lz -lrt -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
LIBRARY_DIRS = -L$(WEBOS_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
Expand All @@ -142,12 +152,12 @@ DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_UPDATE_CORE_INFO

PKG_CONFIG=$(SDKTARGETSYSROOT)/../../bin/pkg-config

SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
PKG_CONFIG=pkg-config
SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
OPENGLES_LIBS = -lGLESv2
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
MMAP_LIBS = -lc
NEON_CFLAGS = -mfpu=neon
NEON_ASFLAGS = -mfpu=neon
Expand Down Expand Up @@ -225,18 +235,26 @@ clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf SDL
rm -rf webos/*.ipk
rm -rf webos/dist

ipk: $(TARGET)
sdl2: $(TARGET)
ifeq ($(ADD_SDL2_LIB), 1)
@echo "Downloading SDL2 prebuilt"
mkdir -p SDL
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -
endif

ipk: $(TARGET) sdl2
rm -rf webos/dist
mkdir -p webos/dist/lib
echo "$$APPINFO" > webos/dist/appinfo.json
cp -t webos/dist -vf $(TARGET) webos/icon160.png
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libSDL2-2.0.so.0
endif
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0
endif
$(STRIP) webos/dist/$(TARGET)
cd webos && ares-package dist

Expand Down
2 changes: 1 addition & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
#if defined(HAKCHI)
#define DEFAULT_BUILDBOT_SERVER_URL "http://hakchicloud.com/Libretro_Cores/"
#elif defined(WEBOS)
#define DEFAULT_BUILDBOT_SERVER_URL "https://www.webosbrew.org/retroarch-cores/armv7a/"
#define DEFAULT_BUILDBOT_SERVER_URL "http://retroarch-cores.webosbrew.org/armv7a/"
#elif defined(ANDROID)
#if defined(ANDROID_ARM_V7)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"
Expand Down
Loading