summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Strygin2023-11-25 20:42:04 +0300
committerNikita Strygin2023-11-25 20:42:04 +0300
commit38c01799391430929bce1e0ace418f7b0184c057 (patch)
tree9b8a72edefeb6d40d21e9dc51b41a751dbc8b98c
downloadaur-psvpfstools-git.tar.gz
Initial commit
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD64
-rw-r--r--build-examples.patch38
-rw-r--r--run-execute-in-example.patch41
4 files changed, 172 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7adce1998f57
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = psvpfstools-git
+ pkgdesc = Tools for decrypting PS Vita PFS filesystem (Vita3K fork).
+ pkgver = 0.17.0.gfe2549cb
+ pkgrel = 1
+ url = https://github.com/Vita3K/psvpfstools
+ arch = any
+ license = Unknown
+ makedepends = git
+ makedepends = cmake
+ makedepends = ninja
+ depends = boost
+ source = git+https://github.com/Vita3K/psvpfstools.git
+ source = git+https://github.com/KorewaWatchful/libb64.git
+ source = git+https://github.com/KorewaWatchful/libtomcrypt.git
+ source = git+https://github.com/KorewaWatchful/libzrif.git
+ source = git+https://github.com/Vita3K/psvpfsparser.git
+ source = git+https://github.com/KorewaWatchful/zlib.git
+ source = build-examples.patch
+ source = run-execute-in-example.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = psvpfstools-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b41ae890b2f2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: ⭐️NINIKA⭐️ <nikita6@bk.ru>
+pkgname=psvpfstools-git
+_gitname=psvpfstools
+pkgver=0.17.0.gfe2549cb
+pkgrel=1
+pkgdesc="Tools for decrypting PS Vita PFS filesystem (Vita3K fork)."
+arch=('any')
+url="https://github.com/Vita3K/psvpfstools"
+license=('Unknown')
+depends=(boost)
+makedepends=(git cmake ninja)
+source=(
+ "git+https://github.com/Vita3K/psvpfstools.git"
+ "git+https://github.com/KorewaWatchful/libb64.git"
+ "git+https://github.com/KorewaWatchful/libtomcrypt.git"
+ "git+https://github.com/KorewaWatchful/libzrif.git"
+ "git+https://github.com/Vita3K/psvpfsparser.git"
+ "git+https://github.com/KorewaWatchful/zlib.git"
+ "build-examples.patch"
+ "run-execute-in-example.patch"
+)
+sha256sums=(
+ SKIP
+ SKIP
+ SKIP
+ SKIP
+ SKIP
+ SKIP
+ SKIP
+ SKIP
+)
+
+_link_submodule() {
+ git config "submodule.libs/$1.url" "$srcdir/$1"
+}
+
+prepare() {
+ cd "${_gitname}"
+ git submodule init
+
+ _link_submodule libb64
+ _link_submodule libtomcrypt
+ _link_submodule libzrif
+ _link_submodule svpfsparser
+ _link_submodule zlib
+
+ git -c protocol.file.allow=always submodule update
+
+ patch -Nup1 --ignore-whitespace -i "${srcdir}/build-examples.patch"
+ patch -Nup1 --ignore-whitespace -i "${srcdir}/run-execute-in-example.patch"
+}
+
+build() {
+ mkdir -p build
+ cd build
+ cmake ../${_gitname} -DCMAKE_BUILD_TYPE=Release -G Ninja
+
+ ninja
+}
+
+package() {
+ mkdir -p "${pkgdir}/usr/bin/"
+ install -Dm755 "${srcdir}/build/psvpfsparser/cmake/example_project" "${pkgdir}/usr/bin/psvpfsparser"
+}
diff --git a/build-examples.patch b/build-examples.patch
new file mode 100644
index 000000000000..f72d3c26e436
--- /dev/null
+++ b/build-examples.patch
@@ -0,0 +1,38 @@
+diff --git a/psvpfsparser/cmake/CMakeLists.txt b/psvpfsparser/cmake/CMakeLists.txt
+--- a/psvpfsparser/cmake/CMakeLists.txt
++++ b/psvpfsparser/cmake/CMakeLists.txt
+@@ -85,6 +85,10 @@ list(FIND CMAKE_CXX_KNOWN_FEATURES cxx_std_17 HAS_CXX17)
+ if(${HAS_CXX17})
+ set(FILESYSTEM_NAMESPACE "std")
+ set(FILESYSTEM_INCLUDE "filesystem")
++
++ if(${BUILD_EXAMPLES})
++ find_package(Boost COMPONENTS program_options REQUIRED)
++ endif()
+ else()
+ set(FILESYSTEM_NAMESPACE "boost")
+ set(FILESYSTEM_INCLUDE "boost/filesystem.hpp")
+@@ -93,9 +97,9 @@ else()
+ set(Boost_USE_MULTITHREADED ON)
+
+ if(${BUILD_EXAMPLES})
+- find_package(BOOST COMPONENTS filesystem system program_options REQUIRED)
++ find_package(Boost COMPONENTS filesystem system program_options REQUIRED)
+ else()
+- find_package(BOOST COMPONENTS filesystem system REQUIRED)
++ find_package(Boost COMPONENTS filesystem system REQUIRED)
+ endif()
+ endif()
+
+@@ -125,4 +129,11 @@ if(NOT ${HAS_CXX17})
+ endif()
+ else()
+ target_compile_features(${PROJECT} PUBLIC cxx_std_17)
++
++ if(${BUILD_EXAMPLES})
++ add_executable(example_project MACOSX_BUNDLE "../example/psvpfsparserconfig.cpp")
++ target_link_libraries(example_project PRIVATE ${Boost_LIBRARIES})
++ target_include_directories(example_project PRIVATE ${Boost_INCLUDE_DIRS})
++ target_link_libraries(example_project PRIVATE ${PROJECT})
++ endif()
+ endif()
diff --git a/run-execute-in-example.patch b/run-execute-in-example.patch
new file mode 100644
index 000000000000..691bdf0a7167
--- /dev/null
+++ b/run-execute-in-example.patch
@@ -0,0 +1,41 @@
+diff --git a/psvpfsparser/example/psvpfsparserconfig.cpp b/psvpfsparser/example/psvpfsparserconfig.cpp
+index a203347..541c77a 100644
+--- a/psvpfsparser/example/psvpfsparserconfig.cpp
++++ b/psvpfsparser/example/psvpfsparserconfig.cpp
+@@ -15,7 +15,7 @@
+
+ boost::program_options::options_description get_options_desc(bool include_deprecated) {
+ boost::program_options::options_description desc("Options");
+- desc.add_options()((std::string(HELP_NAME) + ",h").c_str(), "Show help")((std::string(TITLE_ID_SRC_NAME) + ",i").c_str(), boost::program_options::value<std::string>(), "Source directory that contains the application. Like PCSC00000.")((std::string(TITLE_ID_DST_NAME) + ",o").c_str(), boost::program_options::value<std::string>(), "Destination directory where everything will be unpacked. Like PCSC00000_dec.")((std::string(KLICENSEE_NAME) + ",k").c_str(), boost::program_options::value<std::string>(), "klicensee hex coded string. Like 00112233445566778899AABBCCDDEEFF.")((std::string(ZRIF_NAME) + ",z").c_str(), boost::program_options::value<std::string>(), "zRIF string.")((std::string(F00D_CACHE_NAME) + ",c").c_str(), boost::program_options::value<std::string>(), "Path to flat or json file with F00D cache.");
++ desc.add_options()((std::string(HELP_NAME) + ",h").c_str(), "Show help")((std::string(TITLE_ID_SRC_NAME) + ",i").c_str(), boost::program_options::value<std::string>(), "Source directory that contains the application. Like PCSC00000.")((std::string(TITLE_ID_DST_NAME) + ",o").c_str(), boost::program_options::value<std::string>(), "Destination directory where everything will be unpacked. Like PCSC00000_dec.")((std::string(ZRIF_NAME) + ",z").c_str(), boost::program_options::value<std::string>(), "zRIF string.")((std::string(F00D_CACHE_NAME) + ",c").c_str(), boost::program_options::value<std::string>(), "Path to flat or json file with F00D cache.");
+
+ if (include_deprecated) {
+ desc.add_options()((std::string(F00D_URL_NAME) + ",f").c_str(), boost::program_options::value<std::string>(), "Url of F00D service. [DEPRECATED] Native implementation of F00D will be used.");
+@@ -53,15 +53,11 @@ int parse_options(int argc, char *argv[], PsvPfsParserConfig &cfg) {
+ return -1;
+ }
+
+- if (vm.count(KLICENSEE_NAME)) {
+- cfg.klicensee = vm[KLICENSEE_NAME].as<std::string>();
++ if (vm.count(ZRIF_NAME)) {
++ cfg.zRIF = vm[ZRIF_NAME].as<std::string>();
+ } else {
+- if (vm.count(ZRIF_NAME)) {
+- cfg.zRIF = vm[ZRIF_NAME].as<std::string>();
+- } else {
+- std::cout << "Missing option --" << KLICENSEE_NAME << " or --" ZRIF_NAME << std::endl;
+- std::cout << "sealedkey will be used" << std::endl;
+- }
++ std::cout << "Missing option --" ZRIF_NAME << std::endl;
++ return -1;
+ }
+
+ std::string f00d_url;
+@@ -106,5 +102,7 @@ int main(int argc, char *argv[]) {
+ if (parse_options(argc, argv, cfg) < 0)
+ return -1;
+
++ execute(cfg.zRIF, cfg.title_id_src, cfg.title_id_dst, cfg.f00d_enc_type, cfg.f00d_arg);
++
+ return 0;
+ }