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,108 @@
diff --git a/WikipediaCleaner/resources/getdown/Bot.sh b/WikipediaCleaner/resources/getdown/Bot.sh
index c73ff234b..471b211b0 100644
--- a/WikipediaCleaner/resources/getdown/Bot.sh
+++ b/WikipediaCleaner/resources/getdown/Bot.sh
@@ -9,24 +9,24 @@
# ===== CONNECTION =====
# The first part of the parameters consists in connection information.
# You can use the following syntax:
-# Bot.sh en <username> <password> ...
+# wpcleaner-bot en <username> <password> ...
#
# Or with a credentials.txt file containing the following 2 lines :
# user=<username>
# password=<password>
# Then you can use the following syntax:
-# Bot.sh -credentials credentials.txt en ...
+# wpcleaner-bot -credentials credentials.txt en ...
#
# ===== TASKS =====
# The second part of the parameters consists in the tasks to ask to the bot.
# For example, if you want to update disambiguation warnings, you can use the following syntax:
-# Bot.sh ... UpdateDabWarnings
+# wpcleaner-bot ... UpdateDabWarnings
# Or if you want to execute a set of tasks described in a task file, you can use the following syntax:
-# Bot.sh ... DoTasks <task file>
+# wpcleaner-bot ... DoTasks <task file>
#
# ===== NOTE =====
# If you want to pass extra arguments to the JVM, like increasing the memory available to Java,
# you can create an extra.txt file in the same folder with one parameter per line.
# For example, to allow 8G of RAM, the line will be: -Xmx=8192M
-java -jar libs/getdown-launcher.jar . bot "$@"
+java -cp @wpcleaner_jar@ org.wikipediacleaner.Bot "$@"
diff --git a/WikipediaCleaner/resources/getdown/WPCleaner.sh b/WikipediaCleaner/resources/getdown/WPCleaner.sh
index 28e3726cd..8eb8563fd 100644
--- a/WikipediaCleaner/resources/getdown/WPCleaner.sh
+++ b/WikipediaCleaner/resources/getdown/WPCleaner.sh
@@ -29,33 +29,18 @@
# You can execute this script with optional parameters that will be passed to
# WPCleaner. For example, if you want to automatically login to English
# Wikipedia, you can use the following syntax:
-# WPCleaner.sh en <username> <password>
+# wpcleaner en <username> <password>
#
# Or with a credentials.txt file containing these 2 lines,
# user=<username>
# password=<password>
# you can use the following syntax to login automatically:
-# WPCleaner.sh -credentials credentials.txt en
-#
-# If you want to pass extra arguments to the JVM, like increasing the memory
-# available to Java, create a file named 'extra.txt' in the same directory as
-# this script, with read permissions for any user which might invoke it, with
-# one parameter per line. For example, to allow 8G of RAM, the line would read:
-# -Xmx=8192M
-
-JAVA_APP_DIR="$(cd "$(dirname "$0")"; pwd -P)"
-JAVA_LIB_DIR="${JAVA_APP_DIR}/libs"
-cd "$JAVA_APP_DIR" || ( echo "Unable to open install directory." >&2; exit 1; )
+# wpcleaner -credentials credentials.txt en
+# or create a $XDG_CONFIG_HOME/wpcleaner/credentials.txt file, it will be used automatically
-JAVA_PARAMS="-jar ${JAVA_LIB_DIR}/getdown-launcher.jar . client"
-
-if [ -f credentials.txt ]; then
- JAVA_PARAMS="${JAVA_PARAMS} -credentials credentials.txt"
+credentials="$XDG_CONFIG_HOME/wpcleaner/credentials.txt"
+if [[ "${credentials}" ]]; then
+ java -jar @wpcleaner_jar@ -credentials ${credentials} $@
+else
+ java -jar @wpcleaner_jar@ $@
fi
-
-case $# in
- 0) java ${JAVA_PARAMS}
- ;;
- *) java ${JAVA_PARAMS} $@
- ;;
-esac
diff --git a/WikipediaCleaner/run-task.sh b/WikipediaCleaner/run-task.sh
index fff6ab234..1c3eed957 100755
--- a/WikipediaCleaner/run-task.sh
+++ b/WikipediaCleaner/run-task.sh
@@ -1,12 +1,12 @@
#! /bin/bash
-wpcleaner_jar="build/dist/full/WikipediaCleaner.jar"
+wpcleaner_jar="@wpcleaner_jar@"
if ! [[ -f "${wpcleaner_jar}" ]]; then
echo "WPCleaner is missing at ${wpcleaner_jar}, please build"
exit 1
fi
-credentials="resources/credentials.txt"
+credentials="$XDG_CONFIG_HOME/wpcleaner/credentials.txt"
if ! [[ -f "${credentials}" ]]; then
echo "Credentials file is missing at ${credentials}, please create it"
exit 1
@@ -24,7 +24,7 @@ if [[ "${task}" == "" ]]; then
exit 1
fi
-tasks_dir="resources/tasks/${language}wiki"
+tasks_dir="@tasks@/${language}wiki"
if ! [[ -d "${tasks_dir}" ]]; then
echo "Task folder not found"
exit 1

View File

@@ -0,0 +1,13 @@
diff --git a/WikipediaCleaner/build.xml b/WikipediaCleaner/build.xml
index 9437c1dd6..37a33509f 100644
--- a/WikipediaCleaner/build.xml
+++ b/WikipediaCleaner/build.xml
@@ -172,7 +172,7 @@
</taskdef>
<!-- Build WPCleaner -->
- <target name="main" description="Build WPCleaner" depends="init,clean,main-i18n,javadoc">
+ <target name="main" description="Build WPCleaner" depends="init,clean,main-i18n">
<!-- Initialize -->
<input message="Please enter Password for keystore:" addproperty="WPCleaner.keystore.password" />

View File

@@ -0,0 +1,123 @@
{
lib,
stdenv,
fetchFromGitHub,
makeDesktopItem,
copyDesktopItems,
makeBinaryWrapper,
jdk17,
ant,
stripJavaArchivesHook,
gettext,
}:
let
wpcleanerJar = "$out/share/wpcleaner/WikipediaCleaner.jar";
clientScript = "$out/bin/wpcleaner";
botScript = "$out/bin/wpcleaner-bot";
runTaskScript = "$out/bin/wpcleaner-run-task";
extraJavaArgs = [
"-Dawt.useSystemAAFontSettings=gasp"
"-Xms1g"
"-Xmx8g"
];
in
stdenv.mkDerivation {
pname = "wpcleaner";
version = "2.0.5-unstable-2025-04-25";
src = fetchFromGitHub {
owner = "WPCleaner";
repo = "wpcleaner";
rev = "7fd357cf26349658183517658139870dd45eaedc";
hash = "sha256-iaAP/5Z+ghvMAn4ke7lhRqKov/3jXr0LMwbPDZ052j0=";
};
dontConfigure = true;
patches = [
# The names of the scripts are too generic (e.g. Bot.sh) and the scripts
# run the jar through getdown, which is a tool which checks if there is a
# new version of the jar automatically and update itself if it is the case,
# therefore we want to disable it.
./0001-fix-script-names-and-remove-getdown.patch
# Building the documentation requires internet access to docs.oracle.com,
# which is not available at build time and is not useful to the user.
./0002-dont-build-javadoc.patch
];
nativeBuildInputs = [
jdk17
ant
gettext
makeBinaryWrapper
copyDesktopItems
stripJavaArchivesHook
];
buildInputs = [ jdk17 ];
buildPhase = ''
runHook preBuild
cd WikipediaCleaner
echo "" | ant
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm744 build/dist/full/WikipediaCleaner.jar ${wpcleanerJar}
install -Dm744 resources/getdown/WPCleaner.sh ${clientScript}
install -Dm744 resources/getdown/Bot.sh ${botScript}
install -Dm744 run-task.sh ${runTaskScript}
substituteInPlace \
${clientScript} ${botScript} ${runTaskScript} \
--subst-var-by wpcleaner_jar "${wpcleanerJar}" \
--subst-var-by tasks "$out/share/wpcleaner/tasks"
wrapProgram ${clientScript} \
--prefix PATH : ${lib.makeBinPath [ jdk17 ]} \
--prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}"
wrapProgram ${botScript} \
--prefix PATH : ${lib.makeBinPath [ jdk17 ]} \
--prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}"
wrapProgram ${runTaskScript} \
--prefix PATH : ${lib.makeBinPath [ jdk17 ]} \
--prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}"
cp -r resources/tasks $out/share/wpcleaner
install -Dm644 resources/commons-nuvola-web-broom-64px.png $out/share/icons/hicolor/64x64/apps/wpcleaner.png
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "wpcleaner";
desktopName = "WPCleaner";
comment = "Perform maintenance on Wikipedia";
icon = "wpcleaner";
exec = "wpcleaner";
categories = [ "Utility" ];
keywords = [ "Wikipedia" ];
})
];
meta = {
description = "Utility for performing maintenance on Wikipedia";
longDescription = ''
WPCleaner is a tool designed to help with various maintenance tasks, especially repairing
links to disambiguation pages, checking Wikipedia, fixing spelling and typography, and
helping with translation of articles coming from other wikis.
'';
homepage = "https://wpcleaner.toolforge.org/";
downloadPage = "https://github.com/WPCleaner/wpcleaner";
license = lib.licenses.asl20;
mainProgram = "wpcleaner";
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ jeancaspar ];
};
}