Skip to content

Commit

Permalink
multilib: refactor kiss hook outside README
Browse files Browse the repository at this point in the history
  • Loading branch information
git-bruh committed Apr 27, 2021
1 parent 15608bf commit 4c50446
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 45 deletions.
51 changes: 6 additions & 45 deletions multilib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,9 @@ for pkg in $(kiss search "lib32-*" | grep multilib); do
done
```

* Set up a `KISS_HOOK` to remove unwanted stuff from 32-bit packages:
```sh
#!/bin/sh -e

case "$TYPE" in
pre-build)
export _CC="${CC:-cc}"
export _CXX="${CXX:-c++}"
export _PKG_CONFIG_PATH="$PKG_CONFIG_PATH"

case "$PKG" in
lib32-*)
export CC="gcc -m32"
export CXX="g++ -m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
;;
esac
;;

post-build)
: "${DEST:?DEST is unset}"

export CC="$_CC"
export CXX="$_CXX"
export PKG_CONFIG_PATH="$_PKG_CONFIG_PATH"

case "$PKG" in
lib32-glibc) ;;
lib32-*)
rm -rf "$3/etc" \
"$3/usr/bin" \
"$3/usr/include" \
"$3/usr/share"
;;
esac

# Default package manager hook.
rm -rf "$3/usr/share/gettext" \
"$3/usr/share/polkit-1" \
"$3/usr/share/locale" \
"$3/usr/share/info"
;;
esac
```
* Set a `KISS_HOOK` to remove unwanted stuff from 32-bit packages:

`export KISS_HOOK=/path/to/hook`
`export KISS_HOOK=/path/to/grepo/multilib/kiss-hook`

* In order to run graphical applications, one of either `lib32-nvidia` or `lib32-mesa` must be installed, depending upon the graphics card present in the system.

Expand Down Expand Up @@ -104,3 +61,7 @@ ln -sf ../cert.pem ca-certificates.crt
kiss b gtar && kiss i gtar
kiss a gtar /usr/bin/tar
```

* Some games require `pulseaudio`:

`kiss b pulseaudio && kiss i pulseaudio # From 'gcommunity'`
41 changes: 41 additions & 0 deletions multilib/kiss-hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh -e

case "$TYPE" in
pre-build)
export _CC="${CC:-cc}"
export _CXX="${CXX:-c++}"
export _PKG_CONFIG_PATH="$PKG_CONFIG_PATH"

case "$PKG" in
lib32-*)
export CC="gcc -m32"
export CXX="g++ -m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
;;
esac
;;

post-build)
: "${DEST:?DEST is unset}"

export CC="$_CC"
export CXX="$_CXX"
export PKG_CONFIG_PATH="$_PKG_CONFIG_PATH"

case "$PKG" in
lib32-glibc) ;;
lib32-*)
rm -rf "$3/etc" \
"$3/usr/bin" \
"$3/usr/include" \
"$3/usr/share"
;;
esac

# Default package manager hook.
rm -rf "$3/usr/share/gettext" \
"$3/usr/share/polkit-1" \
"$3/usr/share/locale" \
"$3/usr/share/info"
;;
esac

0 comments on commit 4c50446

Please sign in to comment.