Skip to content

Commit

Permalink
synced already existing .installs, added 32 variant for lib32-libgl1-…
Browse files Browse the repository at this point in the history
…amdgpu-mesa-dri
  • Loading branch information
Ashark committed Jun 14, 2019
1 parent 75f1f48 commit 3114830
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 9 deletions.
6 changes: 3 additions & 3 deletions amdgpu-core-meta.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 3f5f1e12af4667a5522a0d5862c92a3d amdgpu-core_19.10-785425_all.deb/postinst
# 3f5f1e12af4667a5522a0d5862c92a3d amdgpu-core_19.20-812932_all.deb/postinst
# Converted for arch linux:
post_install() {
prefix=/opt/amdgpu
Expand All @@ -9,10 +9,10 @@ post_install() {
echo "$prefix/lib/i386-linux-gnu" >>$conf
}

# e66513716fefe727886eadb5b95923f9 amdgpu-core_19.10-785425_all.deb/preinst
# e66513716fefe727886eadb5b95923f9 amdgpu-core_19.20-812932_all.deb/preinst
# There is nothing but checking Ubuntu version there. So did not use it.

# 9f9130053049b57ee04a078ddf71e927 amdgpu-core_19.10-785425_all.deb/prerm
# 9f9130053049b57ee04a078ddf71e927 amdgpu-core_19.20-812932_all.deb/prerm
# Converted for arch linux:
pre_remove() {
rm -f /etc/ld.so.conf.d/20-amdgpu.conf && /sbin/ldconfig
Expand Down
4 changes: 2 additions & 2 deletions amdgpu-pro-core-meta.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 995d510d3099f2be343b1d6445a85bdc amdgpu-pro-core_19.10-785425_all.deb/postinst
# 995d510d3099f2be343b1d6445a85bdc amdgpu-pro-core_19.20-812932_all.deb/postinst
# Converted for arch linux:
post_install() {
prefix=/opt/amdgpu-pro
Expand All @@ -8,7 +8,7 @@ post_install() {
echo "$prefix/lib/i386-linux-gnu" >>$conf
}

# 41e43dfaf280600942eab53da384100d amdgpu-pro-core_19.10-785425_all.deb/prerm
# 41e43dfaf280600942eab53da384100d amdgpu-pro-core_19.20-812932_all.deb/prerm
# Converted for arch linux:
pre_remove() {
rm -f /etc/ld.so.conf.d/10-amdgpu-pro.conf && /sbin/ldconfig
Expand Down
21 changes: 21 additions & 0 deletions lib32-libgl1-amdgpu-mesa-dri.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst
# Converted for arch linux (install script part):
post_install() {
source /usr/share/libalpm/scripts/update-amdgpu-dri-links-32
create_links
}

# 84cfe30e8c9c8e424e230d3c7743c969 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/prerm
# Converted for arch linux:
pre_remove() {
rm -f /opt/amdgpu/lib/i386-linux-gnu/dri/i965_dri.so

for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_dri.so; do
f=${f##*/}
if [ -f /usr/lib32/dri/$f~ ]; then
mv -f /usr/lib32/dri/$f~ /usr/lib32/dri/$f
else
rm -f /usr/lib32/dri/$f
fi
done
}
4 changes: 2 additions & 2 deletions libgl1-amdgpu-mesa-dri.install
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-785425_amd64.deb/postinst
# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst
# Converted for arch linux (install script part):
post_install() {
source /usr/share/libalpm/scripts/update-amdgpu-dri-links
create_links
}

# f81f8fbe57013765c0514e53e83caf37 libgl1-amdgpu-mesa-dri_18.3.0-785425_amd64.deb/prerm
# f81f8fbe57013765c0514e53e83caf37 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/prerm
# Converted for arch linux:
pre_remove() {
rm -f /opt/amdgpu/lib/x86_64-linux-gnu/dri/i965_dri.so
Expand Down
15 changes: 15 additions & 0 deletions update-amdgpu-dri-links-32.hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst
# Converted for arch linux (hook trigger part):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
# Target path taken from interest trigger of a debian package, corrected for arch linux
Target = usr/lib32/dri/*

[Action]
Description = Updating amdgpu dri links 32...
When = PostTransaction
Exec = . /usr/share/libalpm/scripts/update-amdgpu-dri-links-32; remove_links; create_links
28 changes: 28 additions & 0 deletions update-amdgpu-dri-links-32.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst
# Converted for arch linux (hook script part):
create_links() {
for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_dri.so; do
ln -sb $f /usr/lib32/dri
done

# Support I+A hybrid graphics
if [ -f /usr/lib32/dri/i965_dri.so ] ; then # there also was && [ "/usr/lib32/dri" != "/opt/amdgpu/lib/x86_64-linux-gnu/dri" ] , but this will always be true due to they compare two strings.
ln -s /usr/lib32/dri/i965_dri.so /opt/amdgpu/lib/i386-linux-gnu/dri
fi
}

remove_links() {
rm -f /opt/amdgpu/lib/i386-linux-gnu/dri/i965_dri.so

for f in $(readlink -e /usr/lib32/dri/*.so); do
if [ "${f%/*}" = "/opt/amdgpu/lib/i386-linux-gnu/dri" ]; then # I (Ashark) fixed ${f%%/*} -> ${f%/*}
f=${f##*/}
rm -f /usr/lib32/dri/$f
if [ -f /usr/lib32/dri/$f~ ]; then
mv -f /usr/lib32/dri/$f{~,}
fi
fi
done
}
2 changes: 1 addition & 1 deletion update-amdgpu-dri-links.hook
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-785425_amd64.deb/postinst
# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst
# Converted for arch linux (hook trigger part):

[Trigger]
Expand Down
2 changes: 1 addition & 1 deletion update-amdgpu-dri-links.script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-785425_amd64.deb/postinst
# d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst
# Converted for arch linux (hook script part):
create_links() {
for f in /opt/amdgpu/lib/x86_64-linux-gnu/dri/*_dri.so; do
Expand Down

0 comments on commit 3114830

Please sign in to comment.