diff options
author | Darjan Krijan | 2023-03-09 14:34:41 +0100 |
---|---|---|
committer | Darjan Krijan | 2023-03-09 14:34:41 +0100 |
commit | a9eae850ee96cb13d16cea0079435cac6c3f8718 (patch) | |
tree | 0eb680ab82a07119312d02dbbff321e134494ac6 | |
parent | daa48b968f68aab854c2e70572a0a35854d4e3ab (diff) | |
download | aur-a9eae850ee96cb13d16cea0079435cac6c3f8718.tar.gz |
Add source script and modulefile to /opt/ps3dev.
Add ps3toolchain.install to inform user about how to use after installing.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 27 | ||||
-rw-r--r-- | modulefile | 25 | ||||
-rw-r--r-- | ps3toolchain.install | 16 |
4 files changed, 72 insertions, 2 deletions
@@ -1,8 +1,9 @@ pkgbase = ps3toolchain pkgdesc = Meta package for tools used in the creation of homebrew software for the Sony PlayStation 3 videogame system. pkgver = 20230307 - pkgrel = 2 + pkgrel = 3 url = https://github.com/ps3dev/ps3toolchain + install = ps3toolchain.install arch = any license = MIT depends = ps3-ppu-binutils>=2.40 @@ -11,5 +12,8 @@ pkgbase = ps3toolchain depends = ps3-spu-gcc>=9.5.0 depends = ps3-psl1ght-rules=20230307 depends = ps3-psl1ght=20230307 + optdepends = env-modules + source = modulefile + sha256sums = 28cfac82649e70d080b3a41a82050c169eb8ed7d5a298cf0d68aa89d5b7cf136 pkgname = ps3toolchain @@ -2,7 +2,7 @@ pkgname=ps3toolchain pkgver=20230307 -pkgrel=2 +pkgrel=3 pkgdesc='Meta package for tools used in the creation of homebrew software for the Sony PlayStation 3 videogame system.' url='https://github.com/ps3dev/ps3toolchain' arch=('any') @@ -15,3 +15,28 @@ depends=( 'ps3-psl1ght-rules=20230307' 'ps3-psl1ght=20230307' ) +optdepends=(env-modules) +install=${pkgname}.install +source=( + "modulefile" +) +sha256sums=( + '28cfac82649e70d080b3a41a82050c169eb8ed7d5a298cf0d68aa89d5b7cf136' +) + +_prefix="/opt/ps3dev" + +package() { + mkdir -p "${pkgdir}${_prefix}" + + echo "export PS3DEV=\"${_prefix}\"" > "${pkgdir}${_prefix}/${pkgname}.sh" + echo "export PSL1GHT=\"\${PS3DEV}\"" >> "${pkgdir}${_prefix}/${pkgname}.sh" + echo "export PATH=\"\${PATH}:\${PS3DEV}/bin\"" >> "${pkgdir}${_prefix}/${pkgname}.sh" + echo "export PATH=\"\${PATH}:\${PS3DEV}/ppu/bin\"" >> "${pkgdir}${_prefix}/${pkgname}.sh" + echo "export PATH=\"\${PATH}:\${PS3DEV}/spu/bin\"" >> "${pkgdir}${_prefix}/${pkgname}.sh" + + # env-modules (optional) + cp "${srcdir}/modulefile" "${pkgdir}${_prefix}" + mkdir -p "${pkgdir}/etc/modules/modulefiles/" + ln -s "${_prefix}/modulefile" "${pkgdir}/etc/modules/modulefiles/${pkgname}" +} diff --git a/modulefile b/modulefile new file mode 100644 index 000000000000..484944d0a63d --- /dev/null +++ b/modulefile @@ -0,0 +1,25 @@ +#%Module1.0 +# +# Created by Darjan Krijan [https://disc-kuraudo.eu] +# + +set MODULE "ps3toolchain" +set BASE_DIR "/opt/ps3dev" +set VERSION "20230307" +set PS3TC_ROOT "${BASE_DIR}" +set PS3TC_TEXT "Tools used in the creation of homebrew software for the Sony PlayStation 3 videogame system." + +setenv PS3DEV ${PS3TC_ROOT} +setenv PSL1GHT ${PS3TC_ROOT} +append-path PATH ${PS3TC_ROOT}/bin +append-path PATH ${PS3TC_ROOT}/ppu/bin +append-path PATH ${PS3TC_ROOT}/spu/bin + +module-whatis "${PS3TC_TEXT} version ${VERSION}" + +proc ModulesHelp {} { + global PS3TC_TEXT + puts stderr "This module sets up the environment for ${PS3TC_TEXT}" + puts stderr "by adapting the following environment variables:" + puts stderr "PS3DEV, PSL1GHT, PATH" +} diff --git a/ps3toolchain.install b/ps3toolchain.install new file mode 100644 index 000000000000..89444601ed28 --- /dev/null +++ b/ps3toolchain.install @@ -0,0 +1,16 @@ +post_install() { + if pacman -Q env-modules &> /dev/null; then + echo "env-modules seems to be installed:" + echo "If configured correctly, you can conveniently use" + echo " $ module load ps3toolchain" + echo "to set up the environment for ps3toolchain." + echo "Alternatively source /opt/ps3dev/ps3dev.sh." + else + echo "Source /opt/ps3dev/ps3dev.sh to use ps3toolchain." + fi + +} + +post_upgrade() { + post_install +} |