diff --git a/homebrew/Unzip/build.sh b/homebrew/Unzip/build.sh new file mode 100755 index 0000000..64ce66b --- /dev/null +++ b/homebrew/Unzip/build.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Copyright (C) 2024 John Törnblom +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not see +# . + +SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")" +SCRIPT_DIR="$(dirname "${SCRIPT_PATH}")" + +if [[ -z "$PS5_PAYLOAD_SDK" ]]; then + echo "error: PS5_PAYLOAD_SDK is not set" + exit 1 +fi + +source "${PS5_PAYLOAD_SDK}/toolchain/prospero.sh" || exit 1 + +# ffplay is included with sdk, just copy it +cp "${PS5_SYSROOT}/${PS5_HBROOT}/bin/unzip" "${SCRIPT_DIR}/unzip.elf" diff --git a/homebrew/Unzip/homebrew.js b/homebrew/Unzip/homebrew.js new file mode 100755 index 0000000..62bcd53 --- /dev/null +++ b/homebrew/Unzip/homebrew.js @@ -0,0 +1,50 @@ +/* Copyright (C) 2024 John Törnblom + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, see +. */ + + +async function main() { + const PAYLOAD = window.workingDir + '/unzip.elf'; + + return { + mainText: "Unzip", + secondaryText: 'Extract zip files', + onclick: async () => { + let zip = await pickFile('', 'Select zip file to extract...', true); + if(!zip) { + return; + } + + if(!zip.startsWith('/')) { + zip = ApiClient.getNetworkShareHttpProxyUrl(zip); + } + + let extract_dir = await pickDirectory('', 'Select folder to extract to...', true); + if(!extract_dir) { + return; + } + + + if(!extract_dir.startsWith('/')) { + extract_dir = ApiClient.getNetworkShareHttpProxyUrl(extract_dir); + } + + return { + path: PAYLOAD, + args: ['-o', zip, '-d', extract_dir] + }; + }, + }; +} diff --git a/homebrew/Unzip/sce_sys/icon0.png b/homebrew/Unzip/sce_sys/icon0.png new file mode 100755 index 0000000..fb1491b Binary files /dev/null and b/homebrew/Unzip/sce_sys/icon0.png differ