push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,156 @@
{
lib,
stdenv,
dpkg,
autoPatchelfHook,
alsa-lib,
at-spi2-core,
libtool,
libxkbcommon,
nspr,
udev,
gtk3,
libgbm,
libusb1,
libsForQt5,
xorg,
cups,
pango,
bzip2,
libmysqlclient,
runCommandLocal,
curl,
coreutils,
cacert,
}:
let
pname = "wpsoffice-cn";
sources = import ./sources.nix;
version = sources.version;
fetch =
{
url,
uri,
hash,
}:
runCommandLocal "wpsoffice-cn-${version}-src"
{
outputHashAlgo = "sha256";
outputHash = hash;
nativeBuildInputs = [
curl
coreutils
];
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
}
''
readonly SECURITY_KEY="7f8faaaa468174dc1c9cd62e5f218a5b"
timestamp10=$(date '+%s')
md5hash=($(printf '%s' "$SECURITY_KEY${uri}$timestamp10" | md5sum))
curl --retry 3 --retry-delay 3 "${url}?t=$timestamp10&k=$md5hash" > $out
'';
srcs = {
x86_64-linux = fetch sources.x86_64;
};
src =
srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation {
inherit pname src version;
unpackCmd = "dpkg -x $src .";
sourceRoot = ".";
nativeBuildInputs = [
dpkg
autoPatchelfHook
];
buildInputs = [
alsa-lib
at-spi2-core
libtool
libxkbcommon
nspr
udev
gtk3
libgbm
libusb1
libsForQt5.qtbase
xorg.libXdamage
xorg.libXtst
xorg.libXv
];
dontWrapQtApps = true;
stripAllList = [ "opt" ];
runtimeDependencies = map lib.getLib [
cups
pango
];
autoPatchelfIgnoreMissingDeps = [
"libpeony.so.3"
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r opt $out
cp -r usr/{bin,share} $out
for i in $out/bin/*; do
substituteInPlace $i \
--replace-fail /opt/kingsoft/wps-office $out/opt/kingsoft/wps-office
done
for i in $out/share/applications/*; do
substituteInPlace $i \
--replace-fail /usr/bin $out/bin
done
runHook postInstall
'';
preFixup = ''
# libbz2 dangling symlink
ln -sf ${bzip2.out}/lib/libbz2.so $out/opt/kingsoft/wps-office/office6/libbz2.so
# dlopen dependency
patchelf --add-needed libudev.so.1 $out/opt/kingsoft/wps-office/office6/addons/cef/libcef.so
# libmysqlclient dependency
patchelf --replace-needed libmysqlclient.so.18 libmysqlclient.so $out/opt/kingsoft/wps-office/office6/libFontWatermark.so
patchelf --add-rpath ${libmysqlclient}/lib/mariadb $out/opt/kingsoft/wps-office/office6/libFontWatermark.so
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Office suite, formerly Kingsoft Office";
homepage = "https://www.wps.com";
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
hydraPlatforms = [ ];
license = licenses.unfree;
maintainers = with maintainers; [
mlatus
th0rgal
wineee
pokon548
chillcicada
];
};
}

View File

@@ -0,0 +1,10 @@
# Generated by ./update.sh - do not update manually!
# Last updated: 2025-09-15
{
version = "12.1.2.22571";
x86_64 = {
url = "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2023/22571/wps-office_12.1.2.22571.AK.preread.sw_480057_amd64.deb";
uri = "/wps/download/ep/Linux2023/22571/wps-office_12.1.2.22571.AK.preread.sw_480057_amd64.deb";
hash = "sha256-aB1EWP0Ev5WuAuzih3ybD23qaRRTUjlES1emas+sUDA=";
};
}

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix curl cacert
set -euo pipefail
export SSL_CERT_FILE=$NIX_SSL_CERT_FILE
readonly SECURITY_KEY="7f8faaaa468174dc1c9cd62e5f218a5b"
prefix="https://wps-linux-personal.wpscdn.cn"
payload=$(curl -s "https://www.wps.cn/product/wpslinux")
version=$(echo "$payload" | grep -oP '(?<=banner_txt">)[^<]+')
amd64_url=$(echo "$payload" | grep -oP "downLoad\('[^']*'" | head -1 | sed "s/downLoad('//;s/'$//")
amd64_uri="${amd64_url#$prefix}"
timestamp10=$(date '+%s')
md5hash=($(printf '%s' "$SECURITY_KEY$amd64_uri$timestamp10" | md5sum))
amd64_hash=$(nix-prefetch-url --name "wpsoffice-cn-$version.deb" "$amd64_url?t=$timestamp10&k=$md5hash")
amd64_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$amd64_hash")
cat > sources.nix << EOF
# Generated by ./update.sh - do not update manually!
# Last updated: $(date +%F)
{
version = "$version";
x86_64 = {
url = "$amd64_url";
uri = "$amd64_uri";
hash = "$amd64_hash";
};
}
EOF