wpcleaner: init at 2.0.5-unstable-2025-04-25

https://wpcleaner.toolforge.org/

+244
+108
pkgs/by-name/wp/wpcleaner/0001-fix-script-names-and-remove-getdown.patch
··· 1 + diff --git a/WikipediaCleaner/resources/getdown/Bot.sh b/WikipediaCleaner/resources/getdown/Bot.sh 2 + index c73ff234b..471b211b0 100644 3 + --- a/WikipediaCleaner/resources/getdown/Bot.sh 4 + +++ b/WikipediaCleaner/resources/getdown/Bot.sh 5 + @@ -9,24 +9,24 @@ 6 + # ===== CONNECTION ===== 7 + # The first part of the parameters consists in connection information. 8 + # You can use the following syntax: 9 + -# Bot.sh en <username> <password> ... 10 + +# wpcleaner-bot en <username> <password> ... 11 + # 12 + # Or with a credentials.txt file containing the following 2 lines : 13 + # user=<username> 14 + # password=<password> 15 + # Then you can use the following syntax: 16 + -# Bot.sh -credentials credentials.txt en ... 17 + +# wpcleaner-bot -credentials credentials.txt en ... 18 + # 19 + # ===== TASKS ===== 20 + # The second part of the parameters consists in the tasks to ask to the bot. 21 + # For example, if you want to update disambiguation warnings, you can use the following syntax: 22 + -# Bot.sh ... UpdateDabWarnings 23 + +# wpcleaner-bot ... UpdateDabWarnings 24 + # Or if you want to execute a set of tasks described in a task file, you can use the following syntax: 25 + -# Bot.sh ... DoTasks <task file> 26 + +# wpcleaner-bot ... DoTasks <task file> 27 + # 28 + # ===== NOTE ===== 29 + # If you want to pass extra arguments to the JVM, like increasing the memory available to Java, 30 + # you can create an extra.txt file in the same folder with one parameter per line. 31 + # For example, to allow 8G of RAM, the line will be: -Xmx=8192M 32 + 33 + -java -jar libs/getdown-launcher.jar . bot "$@" 34 + +java -cp @wpcleaner_jar@ org.wikipediacleaner.Bot "$@" 35 + diff --git a/WikipediaCleaner/resources/getdown/WPCleaner.sh b/WikipediaCleaner/resources/getdown/WPCleaner.sh 36 + index 28e3726cd..8eb8563fd 100644 37 + --- a/WikipediaCleaner/resources/getdown/WPCleaner.sh 38 + +++ b/WikipediaCleaner/resources/getdown/WPCleaner.sh 39 + @@ -29,33 +29,18 @@ 40 + # You can execute this script with optional parameters that will be passed to 41 + # WPCleaner. For example, if you want to automatically login to English 42 + # Wikipedia, you can use the following syntax: 43 + -# WPCleaner.sh en <username> <password> 44 + +# wpcleaner en <username> <password> 45 + # 46 + # Or with a credentials.txt file containing these 2 lines, 47 + # user=<username> 48 + # password=<password> 49 + # you can use the following syntax to login automatically: 50 + -# WPCleaner.sh -credentials credentials.txt en 51 + -# 52 + -# If you want to pass extra arguments to the JVM, like increasing the memory 53 + -# available to Java, create a file named 'extra.txt' in the same directory as 54 + -# this script, with read permissions for any user which might invoke it, with 55 + -# one parameter per line. For example, to allow 8G of RAM, the line would read: 56 + -# -Xmx=8192M 57 + - 58 + -JAVA_APP_DIR="$(cd "$(dirname "$0")"; pwd -P)" 59 + -JAVA_LIB_DIR="${JAVA_APP_DIR}/libs" 60 + -cd "$JAVA_APP_DIR" || ( echo "Unable to open install directory." >&2; exit 1; ) 61 + +# wpcleaner -credentials credentials.txt en 62 + +# or create a $XDG_CONFIG_HOME/wpcleaner/credentials.txt file, it will be used automatically 63 + 64 + -JAVA_PARAMS="-jar ${JAVA_LIB_DIR}/getdown-launcher.jar . client" 65 + - 66 + -if [ -f credentials.txt ]; then 67 + - JAVA_PARAMS="${JAVA_PARAMS} -credentials credentials.txt" 68 + +credentials="$XDG_CONFIG_HOME/wpcleaner/credentials.txt" 69 + +if [[ "${credentials}" ]]; then 70 + + java -jar @wpcleaner_jar@ -credentials ${credentials} $@ 71 + +else 72 + + java -jar @wpcleaner_jar@ $@ 73 + fi 74 + - 75 + -case $# in 76 + - 0) java ${JAVA_PARAMS} 77 + - ;; 78 + - *) java ${JAVA_PARAMS} $@ 79 + - ;; 80 + -esac 81 + diff --git a/WikipediaCleaner/run-task.sh b/WikipediaCleaner/run-task.sh 82 + index fff6ab234..1c3eed957 100755 83 + --- a/WikipediaCleaner/run-task.sh 84 + +++ b/WikipediaCleaner/run-task.sh 85 + @@ -1,12 +1,12 @@ 86 + #! /bin/bash 87 + 88 + -wpcleaner_jar="build/dist/full/WikipediaCleaner.jar" 89 + +wpcleaner_jar="@wpcleaner_jar@" 90 + if ! [[ -f "${wpcleaner_jar}" ]]; then 91 + echo "WPCleaner is missing at ${wpcleaner_jar}, please build" 92 + exit 1 93 + fi 94 + 95 + -credentials="resources/credentials.txt" 96 + +credentials="$XDG_CONFIG_HOME/wpcleaner/credentials.txt" 97 + if ! [[ -f "${credentials}" ]]; then 98 + echo "Credentials file is missing at ${credentials}, please create it" 99 + exit 1 100 + @@ -24,7 +24,7 @@ if [[ "${task}" == "" ]]; then 101 + exit 1 102 + fi 103 + 104 + -tasks_dir="resources/tasks/${language}wiki" 105 + +tasks_dir="@tasks@/${language}wiki" 106 + if ! [[ -d "${tasks_dir}" ]]; then 107 + echo "Task folder not found" 108 + exit 1
+13
pkgs/by-name/wp/wpcleaner/0002-dont-build-javadoc.patch
··· 1 + diff --git a/WikipediaCleaner/build.xml b/WikipediaCleaner/build.xml 2 + index 9437c1dd6..37a33509f 100644 3 + --- a/WikipediaCleaner/build.xml 4 + +++ b/WikipediaCleaner/build.xml 5 + @@ -172,7 +172,7 @@ 6 + </taskdef> 7 + 8 + <!-- Build WPCleaner --> 9 + - <target name="main" description="Build WPCleaner" depends="init,clean,main-i18n,javadoc"> 10 + + <target name="main" description="Build WPCleaner" depends="init,clean,main-i18n"> 11 + 12 + <!-- Initialize --> 13 + <input message="Please enter Password for keystore:" addproperty="WPCleaner.keystore.password" />
+123
pkgs/by-name/wp/wpcleaner/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + makeDesktopItem, 6 + copyDesktopItems, 7 + makeBinaryWrapper, 8 + jdk17, 9 + ant, 10 + stripJavaArchivesHook, 11 + gettext, 12 + }: 13 + 14 + let 15 + wpcleanerJar = "$out/share/wpcleaner/WikipediaCleaner.jar"; 16 + clientScript = "$out/bin/wpcleaner"; 17 + botScript = "$out/bin/wpcleaner-bot"; 18 + runTaskScript = "$out/bin/wpcleaner-run-task"; 19 + extraJavaArgs = [ 20 + "-Dawt.useSystemAAFontSettings=lcd" 21 + "-Xms1g" 22 + "-Xmx8g" 23 + ]; 24 + in 25 + stdenv.mkDerivation { 26 + pname = "wpcleaner"; 27 + version = "2.0.5-unstable-2025-04-25"; 28 + src = fetchFromGitHub { 29 + owner = "WPCleaner"; 30 + repo = "wpcleaner"; 31 + rev = "7fd357cf26349658183517658139870dd45eaedc"; 32 + hash = "sha256-iaAP/5Z+ghvMAn4ke7lhRqKov/3jXr0LMwbPDZ052j0="; 33 + }; 34 + 35 + dontConfigure = true; 36 + 37 + patches = [ 38 + # The names of the scripts are too generic (e.g. Bot.sh) and the scripts 39 + # run the jar through getdown, which is a tool which checks if there is a 40 + # new version of the jar automatically and update itself if it is the case, 41 + # therefore we want to disable it. 42 + ./0001-fix-script-names-and-remove-getdown.patch 43 + # Building the documentation requires internet access to docs.oracle.com, 44 + # which is not available at build time and is not useful to the user. 45 + ./0002-dont-build-javadoc.patch 46 + ]; 47 + 48 + nativeBuildInputs = [ 49 + jdk17 50 + ant 51 + gettext 52 + makeBinaryWrapper 53 + copyDesktopItems 54 + stripJavaArchivesHook 55 + ]; 56 + 57 + buildInputs = [ jdk17 ]; 58 + 59 + buildPhase = '' 60 + runHook preBuild 61 + 62 + cd WikipediaCleaner 63 + echo "" | ant 64 + 65 + runHook postBuild 66 + ''; 67 + 68 + installPhase = '' 69 + runHook preInstall 70 + 71 + install -Dm744 build/dist/full/WikipediaCleaner.jar ${wpcleanerJar} 72 + install -Dm744 resources/getdown/WPCleaner.sh ${clientScript} 73 + install -Dm744 resources/getdown/Bot.sh ${botScript} 74 + install -Dm744 run-task.sh ${runTaskScript} 75 + 76 + substituteInPlace \ 77 + ${clientScript} ${botScript} ${runTaskScript} \ 78 + --subst-var-by wpcleaner_jar "${wpcleanerJar}" \ 79 + --subst-var-by tasks "$out/share/wpcleaner/tasks" 80 + 81 + wrapProgram ${clientScript} \ 82 + --prefix PATH : ${lib.makeBinPath [ jdk17 ]} \ 83 + --prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}" 84 + wrapProgram ${botScript} \ 85 + --prefix PATH : ${lib.makeBinPath [ jdk17 ]} \ 86 + --prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}" 87 + wrapProgram ${runTaskScript} \ 88 + --prefix PATH : ${lib.makeBinPath [ jdk17 ]} \ 89 + --prefix JAVA_JDK_OPTIONS " " "${lib.strings.concatStringsSep " " extraJavaArgs}" 90 + 91 + cp -r resources/tasks $out/share/wpcleaner 92 + install -Dm644 resources/commons-nuvola-web-broom-64px.png $out/share/icons/hicolor/64x64/apps/wpcleaner.png 93 + 94 + runHook postInstall 95 + ''; 96 + 97 + desktopItems = [ 98 + (makeDesktopItem { 99 + name = "wpcleaner"; 100 + desktopName = "WPCleaner"; 101 + comment = "Perform maintenance on Wikipedia"; 102 + icon = "wpcleaner"; 103 + exec = "wpcleaner"; 104 + categories = [ "Utility" ]; 105 + keywords = [ "Wikipedia" ]; 106 + }) 107 + ]; 108 + 109 + meta = { 110 + description = "An utility for performing maintenance on Wikipedia"; 111 + longDescription = '' 112 + WPCleaner is a tool designed to help with various maintenance tasks, especially repairing 113 + links to disambiguation pages, checking Wikipedia, fixing spelling and typography, and 114 + helping with translation of articles coming from other wikis. 115 + ''; 116 + homepage = "https://wpcleaner.toolforge.org/"; 117 + downloadPage = "https://github.com/WPCleaner/wpcleaner"; 118 + license = lib.licenses.asl20; 119 + mainProgram = "wpcleaner"; 120 + platforms = lib.platforms.all; 121 + maintainers = with lib.maintainers; [ jeancaspar ]; 122 + }; 123 + }