Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

use bsdtar instead of ar to extract the binary deb #59

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions apply_extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -e

ar p teams.deb data.tar.xz | tar -vxJ --exclude=rect-overlay

mv usr/share/teams .

rm -rf teams.deb usr
bsdtar -Oxf teams.deb 'data.tar.*' |
bsdtar -xf - \
--strip-components=3 \
--exclude='./usr/bin/' \
--exclude='./usr/share/applications/' \
--exclude='./usr/share/pixmaps/'

rm -rf teams.deb
8 changes: 0 additions & 8 deletions com.microsoft.Teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@
}
]
},
{
"name": "ar",
"buildsystem": "simple",
"build-commands": [
"install -Dm0755 /usr/lib/$(gcc -print-multiarch)/libbfd-*.so -t ${FLATPAK_DEST}/lib/",
"install -Dm0755 $(which ar) ${FLATPAK_DEST}/bin/"
]
},
{
"name": "teams",
"buildsystem": "simple",
Expand Down
22 changes: 13 additions & 9 deletions teams-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

set -eux

install -Dm0755 apply_extra.sh ${FLATPAK_DEST}/bin/apply_extra
install -Dm0755 teams.sh ${FLATPAK_DEST}/bin/teams
install -Dm0644 ${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
install -Dm0755 apply_extra.sh "${FLATPAK_DEST}/bin/apply_extra"
install -Dm0755 teams.sh "${FLATPAK_DEST}/bin/teams"
install -Dm0644 "${FLATPAK_ID}.metainfo.xml" "${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml"

ar p teams.deb data.tar.xz | tar -xJf -
bsdtar -Oxf teams.deb 'data.tar.*' |
bsdtar -xf - \
--strip-components=3 \
--exclude='./usr/bin/' \
--exclude='./usr/share/teams/'

install -Dm0644 usr/share/applications/teams.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
sed -i s:Exec=/usr/bin/teams:Exec=teams: ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
desktop-file-edit --set-key="Icon" --set-value=${FLATPAK_ID} ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
install -Dm0644 applications/teams.desktop "${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop"
sed -i s:Exec=/usr/bin/teams:Exec=teams: "${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop"
desktop-file-edit --set-key="Icon" --set-value="${FLATPAK_ID}" "${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop"

for size in 64 128 264 512; do
convert usr/share/pixmaps/teams.png -resize ${size} ${FLATPAK_ID}.png
install -Dm0644 ${FLATPAK_ID}.png ${FLATPAK_DEST}/share/icons/hicolor/${size}x${size}/apps/${FLATPAK_ID}.png
convert pixmaps/teams.png -resize ${size} "${FLATPAK_ID}.png"
install -Dm0644 "${FLATPAK_ID}.png" "${FLATPAK_DEST}/share/icons/hicolor/${size}x${size}/apps/${FLATPAK_ID}.png"
done
2 changes: 1 addition & 1 deletion teams.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ timezone_workaround()

timezone_workaround

exec env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/extra/teams/teams "$@"
exec env TMPDIR="$XDG_CACHE_HOME" zypak-wrapper /app/extra/teams/teams "$@"