Skip to content

Commit

Permalink
fix wps
Browse files Browse the repository at this point in the history
  • Loading branch information
pugaizai committed Sep 6, 2024
1 parent b957322 commit e98bb5c
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pugaizai's Flatpaks

## Use My Repo (X86_64 Only)
## Use My Repo

### Add Repo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mv deb-package/opt/kingsoft/wps-office .
mv deb-package/usr/bin/{wps,wpp,et,wpspdf} wps-office/
mv deb-package/usr/share/{icons,applications,mime} export/share/

YEAR_SUFFIX=2019
YEAR_SUFFIX=2023

rename --no-overwrite "wps-office-" "${FLATPAK_ID}." export/share/{icons/hicolor/*/*,applications,mime/packages}/wps-office-*.*
rename --no-overwrite "wps-office${YEAR_SUFFIX}-" "${FLATPAK_ID}." export/share/icons/hicolor/*/*/wps-office${YEAR_SUFFIX}-*.*
Expand Down Expand Up @@ -41,15 +41,11 @@ for a in wps wpp et pdf prometheus; do
done
sed -i "s/generic-icon name=\"wps-office-/icon name=\"${FLATPAK_ID}./g" "export/share/mime/packages/${FLATPAK_ID}".*.xml

# Just use libstdc++.so.6 from the runtime; allows working with runtime 22.08+
# Just use libstdc++.so.6 from the runtime; allows working with runtime 23.08+
rm wps-office/office6/libstdc++.so.6

rm -r wps-office.deb deb-package

# Remove plugin path so we can override the default path with based on QT_PLUGIN_PATH
sed -i 's|^Plugins=.*||g' wps-office/office6/qt.conf

# Fix wps deprecated python2 command
# https://aur.archlinux.org/cgit/aur.git/tree/fix-wps-python-parse.patch?h=wps-office-cn
sed -i 's/python -c '\''import sys, urllib; print urllib.unquote(sys.argv\[1\])'\''/python -c '\''import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))'\''/' wps-office/wps

2 changes: 1 addition & 1 deletion manifests/cn.wps.office/cn.wps.office.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Comment=Use WPS Writer to office work.
Comment[zh_CN]=使用 WPS 2019进行办公
Comment[zh_CN]=使用 WPS 2023进行办公
Exec=wps %f
GenericName=WPS
GenericName[zh_CN]=WPS 2019
Expand Down
24 changes: 24 additions & 0 deletions manifests/cn.wps.office/cn.wps.office.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 7 additions & 34 deletions manifests/cn.wps.office/cn.wps.office.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,60 +35,33 @@ modules:

- shared-modules/glu/glu-9.json

# Needed by wpspdf
- name: libtiff5
buildsystem: cmake
sources:
- type: archive
url: https://download.osgeo.org/libtiff/tiff-4.4.0.tar.gz
sha256: 917223b37538959aca3b790d2d73aa6e626b688e02dcda272aec24c2f498abed

# https://github.com/flathub/cn.wps.office/issues/150
- name: freetype
buildsystem: meson
sources:
- type: archive
url: https://download-mirror.savannah.gnu.org/releases/freetype/freetype-2.13.0.tar.xz
sha256: 5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c

- name: wps
buildsystem: simple
build-commands:
- install -Dm755 apply_extra /app/bin
- install -Dm755 apply_extra.sh /app/bin/apply_extra
- install -Dm755 wps.sh /app/bin/wps
- ln -s wps /app/bin/et
- ln -s wps /app/bin/wpp
- ln -s wps /app/bin/wpspdf
- install -Dm755 /usr/bin/desktop-file-edit -t /app/bin/
- install -Dm644 ${FLATPAK_ID}.metainfo.xml -t /app/share/metainfo/
- install -Dm644 cn.wps.office.desktop -t /app/share/applications
- for icon_size in 64 128 256 512; do install -Dm644 wps_office_${icon_size}.png
/app/share/icons/hicolor/${icon_size}x${icon_size}/apps/cn.wps.office.png;
done
- install -Dm644 cn.wps.office.desktop -t /app/share/applications/
- install -Dm644 cn.wps.office.svg -t /app/share/icons/hicolor/scalable/apps/
sources:
- type: file
path: apply_extra
path: apply_extra.sh

- type: file
path: cn.wps.office.metainfo.xml

- type: file
path: wps.sh

- type: file
path: icons/wps_office_64.png

- type: file
path: icons/wps_office_128.png

- type: file
path: icons/wps_office_256.png
path: cn.wps.office.desktop

- type: file
path: icons/wps_office_512.png
path: cn.wps.office.svg

- type: file
path: cn.wps.office.desktop
path: wps.sh

- type: extra-data
filename: wps-office.deb
Expand Down
Binary file removed manifests/cn.wps.office/icons/wps_office_128.png
Binary file not shown.
Binary file removed manifests/cn.wps.office/icons/wps_office_256.png
Binary file not shown.
Binary file removed manifests/cn.wps.office/icons/wps_office_512.png
Binary file not shown.
Binary file removed manifests/cn.wps.office/icons/wps_office_64.png
Binary file not shown.

0 comments on commit e98bb5c

Please sign in to comment.