-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/mwxml2sql/0001-Makefile-remove-hardcoded-tool-paths.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From a58b67c8eeabc7ced0f41129ed41bbf48ceea804 Mon Sep 17 00:00:00 2001 | ||
From: Leon Schumacher <[email protected]> | ||
Date: Fri, 17 Jan 2025 10:47:13 +0100 | ||
Subject: [PATCH 1/2] Makefile: remove hardcoded tool paths | ||
|
||
--- | ||
xmlfileutils/Makefile | 16 ++++++---------- | ||
1 file changed, 6 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/xmlfileutils/Makefile b/xmlfileutils/Makefile | ||
index 7f0f770..8b11209 100644 | ||
--- a/xmlfileutils/Makefile | ||
+++ b/xmlfileutils/Makefile | ||
@@ -13,10 +13,6 @@ NAME_SQLFILTER = "filter MySQL INSERT commands with fields matching values" | ||
BINDIR = $(DESTDIR)$(PREFIX)/usr/bin/ | ||
MANDIR = $(DESTDIR)$(PREFIX)/usr/share/man/man1/ | ||
|
||
-GZIP = /bin/gzip | ||
-HELP2MAN = /usr/bin/help2man | ||
-SHELL = /bin/sh | ||
- | ||
CC=gcc | ||
LDFLAGS= | ||
#LDFLAGS= -g | ||
@@ -41,16 +37,16 @@ sqlfilter: sqlfilter.o filebuffers.o sqlutils.o | ||
manpages: mwxml2sql.1.gz sql2txt.1.gz sqlfilter.1.gz | ||
|
||
mwxml2sql.1.gz: mwxml2sql | ||
- $(HELP2MAN) --section 1 --no-info --name $(NAME_MWXML2SQL) \ | ||
- --no-discard-stderr ./mwxml2sql | $(GZIP) > mwxml2sql.1.gz | ||
+ help2man --section 1 --no-info --name $(NAME_MWXML2SQL) \ | ||
+ --no-discard-stderr ./mwxml2sql | gzip > mwxml2sql.1.gz | ||
|
||
sql2txt.1.gz: sql2txt | ||
- $(HELP2MAN) --section 1 --no-info --name $(NAME_SQL2TXT) \ | ||
- --no-discard-stderr ./sql2txt | $(GZIP) > sql2txt.1.gz | ||
+ help2man --section 1 --no-info --name $(NAME_SQL2TXT) \ | ||
+ --no-discard-stderr ./sql2txt | gzip > sql2txt.1.gz | ||
|
||
sqlfilter.1.gz: sqlfilter | ||
- $(HELP2MAN) --section 1 --no-info --name $(NAME_SQLFILTER) \ | ||
- --no-discard-stderr ./sqlfilter | $(GZIP) > sqlfilter.1.gz | ||
+ help2man --section 1 --no-info --name $(NAME_SQLFILTER) \ | ||
+ --no-discard-stderr ./sqlfilter | gzip > sqlfilter.1.gz | ||
|
||
install: mwxml2sql sql2txt sqlfilter | ||
install --directory $(BINDIR) | ||
-- | ||
2.47.0 | ||
|
27 changes: 27 additions & 0 deletions
27
packages/mwxml2sql/0002-Makefile-dont-install-into-usr.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 38f5a9e8815e028788e664480e24bcf7c939b78c Mon Sep 17 00:00:00 2001 | ||
From: Leon Schumacher <[email protected]> | ||
Date: Fri, 17 Jan 2025 10:52:38 +0100 | ||
Subject: [PATCH 2/2] Makefile: dont install into /usr | ||
|
||
--- | ||
xmlfileutils/Makefile | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/xmlfileutils/Makefile b/xmlfileutils/Makefile | ||
index 8b11209..e394d5d 100644 | ||
--- a/xmlfileutils/Makefile | ||
+++ b/xmlfileutils/Makefile | ||
@@ -10,8 +10,8 @@ NAME_MWXML2SQL = "convert MediaWiki XML dump file to MySQL INSERT commands" | ||
NAME_SQL2TXT = "convert MySQL INSERT commands to tab-separated data" | ||
NAME_SQLFILTER = "filter MySQL INSERT commands with fields matching values" | ||
|
||
-BINDIR = $(DESTDIR)$(PREFIX)/usr/bin/ | ||
-MANDIR = $(DESTDIR)$(PREFIX)/usr/share/man/man1/ | ||
+BINDIR = $(DESTDIR)$(PREFIX)/bin/ | ||
+MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1/ | ||
|
||
CC=gcc | ||
LDFLAGS= | ||
-- | ||
2.47.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pkgs: pkgs.stdenv.mkDerivation rec { | ||
pname = "mwxml2sql"; | ||
version = "2017-11-02"; | ||
|
||
src = pkgs.fetchgit { | ||
url = "https://gerrit.wikimedia.org/r/operations/dumps/import-tools"; | ||
rev = "2e3e5ec62e22bba7e7599512019d44dd4e8d005a"; | ||
hash = "sha256-EL1rAfJXg0bqKiCefxjbUlZUgfYMPydGp3cCQ4qzJe8="; | ||
}; | ||
|
||
patches = [ | ||
./0001-Makefile-remove-hardcoded-tool-paths.patch | ||
./0002-Makefile-dont-install-into-usr.patch | ||
]; | ||
|
||
makeFlags = [ | ||
"--directory=xmlfileutils" | ||
"PREFIX=$(out)" | ||
]; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
help2man | ||
]; | ||
|
||
buildInputs = with pkgs; [ | ||
bzip2 | ||
libz | ||
]; | ||
|
||
meta = { | ||
description = "Convert Mediawiki XML dumps to SQL"; | ||
homepage = "https://gerrit.wikimedia.org/g/operations/dumps/import-tools"; | ||
mainProgram = pname; | ||
}; | ||
} |