-
Notifications
You must be signed in to change notification settings - Fork 287
Add decky-loader and nodejs #2802
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
base: next
Are you sure you want to change the base?
Changes from all commits
1721216
fdbb076
c9f39da
09b71ca
25a9cd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-or-later | ||
| # Copyright (C) 2026 ROCKNIX (https://github.com/ROCKNIX) | ||
|
|
||
| PKG_NAME="nodejs" | ||
| PKG_VERSION="v22.22.3" | ||
| PKG_LICENSE="MIT" | ||
| PKG_SITE="https://github.com/nodejs/node" | ||
| PKG_URL="${PKG_SITE}/archive/refs/tags/${PKG_VERSION}.tar.gz" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing PKG_DEPENDS_HOST |
||
| PKG_DEPENDS_TARGET="toolchain bzip2:host" | ||
| PKG_LONGDESC="Open-source, cross-platform JavaScript runtime environment." | ||
| PKG_TOOLCHAIN="configure" | ||
|
|
||
| pre_build_target() { | ||
| mkdir -p ${PKG_BUILD}/.${TARGET_NAME} | ||
| cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${TARGET_NAME} | ||
| } | ||
|
|
||
| pre_build_host() { | ||
| mkdir -p ${PKG_BUILD}/.${HOST_NAME} | ||
| cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${HOST_NAME} | ||
| } | ||
|
|
||
| configure_target() { | ||
| case ${ARCH} in | ||
| aarch64) | ||
| PKG_ARCH_NAME_NODEJS="arm64" | ||
| ;; | ||
| arm) | ||
| PKG_ARCH_NAME_NODEJS="arm" | ||
| ;; | ||
| x86_64) | ||
| PKG_ARCH_NAME_NODEJS="x86_64" | ||
| ;; | ||
| esac | ||
|
|
||
| export CC_target=${TARGET_NAME}-gcc | ||
| export CXX_target=${TARGET_NAME}-g++ | ||
| export AR_target=${TARGET_NAME}-ar | ||
| export LD_target=${TARGET_NAME}-ld | ||
|
|
||
| export CC_host=/usr/bin/gcc | ||
| export CXX_host=/usr/bin/g++ | ||
| export AR_host=/usr/bin/ar | ||
| export LD_host=/usr/bin/ld | ||
|
|
||
| /usr/bin/python3 ./configure.py \ | ||
| --cross-compiling \ | ||
| --dest-cpu ${PKG_ARCH_NAME_NODEJS} \ | ||
| --shared \ | ||
| --prefix /usr | ||
| } | ||
|
|
||
| configure_host() { | ||
| /usr/bin/python3 ./configure.py \ | ||
| --shared \ | ||
| --prefix ${TOOLCHAIN} | ||
| } | ||
|
|
||
| post_makeinstall_host() { | ||
| mkdir -p ${TOOLCHAIN}/usr/{lib,bin,include} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # SPDX-License-Identifier: GPL-2.0 | ||
| # Copyright (C) 2026-present ROCKNIX (https://github.com/ROCKNIX) | ||
|
|
||
| . ${ROOT}/packages/lang/Python3/package.mk | ||
|
|
||
| PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false | ||
| ac_cv_prog_SVNVERSION=/bin/false | ||
| py_cv_module_unicodedata=yes | ||
| py_cv_module__codecs_cn=n/a | ||
| py_cv_module__codecs_hk=n/a | ||
| py_cv_module__codecs_iso2022=n/a | ||
| py_cv_module__codecs_jp=n/a | ||
| py_cv_module__codecs_kr=n/a | ||
| py_cv_module__codecs_tw=n/a | ||
| py_cv_module__decimal=n/a | ||
| py_cv_module__lzma=n/a | ||
| py_cv_module_nis=n/a | ||
| py_cv_module_ossaudiodev=n/a | ||
| py_cv_module__dbm=n/a | ||
| py_cv_module__gdbm=n/a | ||
| --without-readline | ||
| --disable-tk | ||
| --disable-curses | ||
| --disable-pydoc | ||
| --disable-idle3 | ||
| --with-expat=builtin | ||
| --with-doc-strings | ||
| --without-pymalloc | ||
| --with-ensurepip=yes | ||
| --enable-shared | ||
| " | ||
|
|
||
| post_makeinstall_target() { | ||
| ln -sf ${PKG_PYTHON_VERSION} ${INSTALL}/usr/bin/python | ||
|
|
||
| rm -fr ${PKG_BUILD}/.${TARGET_NAME}/build/temp.* | ||
|
|
||
| PKG_INSTALL_PATH_LIB=${INSTALL}/usr/lib/${PKG_PYTHON_VERSION} | ||
|
|
||
| for dir in config compiler sysconfigdata lib-dynload/sysconfigdata test; do | ||
| rm -rf ${PKG_INSTALL_PATH_LIB}/${dir} | ||
| done | ||
|
|
||
| safe_remove ${INSTALL}/usr/bin/python*-config | ||
|
|
||
| find ${INSTALL} -name '*.o' -delete | ||
| find ${INSTALL}/usr/lib/ | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf | ||
|
|
||
| # strip | ||
| chmod u+w ${INSTALL}/usr/lib/libpython*.so.* | ||
| debug_strip ${INSTALL}/usr | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain the changes to this package please as you have made a number of changes.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The post_makeinstall_target step is the same, just with I'm not sure why but the python_compile step was causing Python on the target to crash instantly with a FS codec error (when the host has these build support changes) The PKG_CONFIGURE_OPTS_HOST is mostly the same, just adding back pyc-build and other stuff for building packages (host side) I'm not sure why the configuration for the host side was so stripped down, I understand why the target would be though |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-or-later | ||
| # Copyright (C) 2026 ROCKNIX (https://github.com/ROCKNIX) | ||
|
|
||
| PKG_NAME="decky-loader" | ||
| PKG_VERSION="v3.2.4" | ||
| PKG_LICENSE="MIT" | ||
| PKG_SITE="https://github.com/SteamDeckHomebrew/decky-loader" | ||
| PKG_URL="${PKG_SITE}/archive/refs/tags/${PKG_VERSION}.tar.gz" | ||
| PKG_DEPENDS_TARGET="toolchain nodejs:host Python3:host Python3" | ||
| PKG_LONGDESC="A plugin loader for the Steam Deck." | ||
| PKG_TOOLCHAIN="manual" | ||
|
|
||
| makeinstall_target() { | ||
| # Build the frontend | ||
| # npm needs a home directory, we can't really do that with our build system (or at least Docker) | ||
| export PKG_DECKY_LOADER_NPM_HOME="${PKG_BUILD}/npm-home" | ||
| export PKG_DECKY_LOADER_NPM_CACHE="${PKG_BUILD}/npm-cache" | ||
| mkdir -p ${PKG_DECKY_LOADER_NPM_HOME} | ||
| mkdir -p ${PKG_DECKY_LOADER_NPM_CACHE} | ||
|
|
||
| pushd ${PKG_BUILD}/frontend | ||
| # Remove existing node_modules so we can handle the change from npm to pnpm | ||
| rm -rf node_modules | ||
|
|
||
| # Download dependencies | ||
| HOME="${PKG_DECKY_LOADER_NPM_HOME}" npm install pnpm --cache ${PKG_DECKY_LOADER_NPM_CACHE} --no-save --legacy-peer-deps | ||
| HOME="${PKG_DECKY_LOADER_NPM_HOME}" npm exec -- pnpm i --frozen-lockfile --dangerously-allow-all-builds | ||
|
|
||
| # Build | ||
| HOME="${PKG_DECKY_LOADER_NPM_HOME}" npm exec -- pnpm build | ||
| popd | ||
|
|
||
| # "Build" the backend | ||
| # We can't really build it... just install the dependencies preemptively | ||
| export PKG_DECKY_LOADER_PIP_LIBS="${PKG_BUILD}/backend/lib" | ||
| pip3 install \ | ||
| --target="${PKG_DECKY_LOADER_PIP_LIBS}" \ | ||
| --platform=manylinux2014_aarch64 \ | ||
| --python-version=313 \ | ||
| --implementation=cp \ | ||
| --only-binary=:all: \ | ||
| aiohttp aiohttp-jinja2 aiohttp-cors \ | ||
| setproctitle watchdog certifi packaging Jinja2 yarl frozenlist attrs multidict | ||
| } | ||
|
|
||
| post_makeinstall_target() { | ||
| mkdir -p ${INSTALL}/usr/share/decky-loader/ | ||
| cp -rf ${PKG_BUILD}/backend ${INSTALL}/usr/share/decky-loader/ | ||
|
|
||
| mkdir -p ${INSTALL}/usr/bin/ | ||
| cp -rf ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin/ | ||
|
|
||
| chmod +x ${INSTALL}/usr/bin/* | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not necessary if you have already made executable in your commit |
||
| } | ||
|
|
||
| post_install() { | ||
| enable_service decky-loader.service | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| # SPDX-License-Identifier: GPL-2.0-or-later | ||
| # Copyright (C) 2026 ROCKNIX (https://github.com/ROCKNIX) | ||
|
|
||
| . /etc/profile | ||
|
|
||
| DECKY_LOADER_HOME="/storage/.config/decky-loader" | ||
| mkdir -p $DECKY_LOADER_HOME/data | ||
| mkdir -p $DECKY_LOADER_HOME/plugins | ||
|
|
||
| UNPRIVILEGED_PATH="$DECKY_LOADER_HOME/data" \ | ||
| PLUGIN_PATH="$DECKY_LOADER_HOME/plugins" \ | ||
| PYTHONPATH="/usr/share/decky-loader/backend/lib/" python3 /usr/share/decky-loader/backend/main.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [Unit] | ||
| Description=Decky Loader | ||
|
|
||
| [Service] | ||
| ExecStart=/bin/bash -c "source /etc/profile && /usr/bin/decky-backend.sh" | ||
| Restart=always | ||
| RestartSec=5 | ||
| User=root | ||
| Group=root | ||
|
|
||
| [Install] | ||
| WantedBy=rocknix.target |
Uh oh!
There was an error while loading. Please reload this page.