diff -Nru pkg-kde-tools-0.15.20~ubuntu4/CMakeLists.txt pkg-kde-tools-0.15.20~ubuntu5/CMakeLists.txt --- pkg-kde-tools-0.15.20~ubuntu4/CMakeLists.txt 2016-01-07 20:35:31.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/CMakeLists.txt 2016-03-20 21:04:50.000000000 +0000 @@ -75,6 +75,7 @@ pkgkde-gensymbols pkgkde-getbuildlogs pkgkde-mark-private-symbols + pkgkde-mark-qt5-private-symbols pkgkde-override-sc-dev-latest pkgkde-symbolshelper pkgkde-vcs diff -Nru pkg-kde-tools-0.15.20~ubuntu4/debian/changelog pkg-kde-tools-0.15.20~ubuntu5/debian/changelog --- pkg-kde-tools-0.15.20~ubuntu4/debian/changelog 2016-01-07 20:37:23.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/debian/changelog 2016-03-20 21:24:22.000000000 +0000 @@ -1,3 +1,10 @@ +pkg-kde-tools (0.15.20~ubuntu5) xenial; urgency=medium + + * Cherry picking from Debian to get new tool + pkgkde-mark-qt5-private-symbols working. Fixes (LP: #1559538) + + -- Clive Johnston Sun, 20 Mar 2016 21:02:33 +0000 + pkg-kde-tools (0.15.20~ubuntu4) xenial; urgency=medium * Add eo to the locale list diff -Nru pkg-kde-tools-0.15.20~ubuntu4/debian/pkg-kde-tools.install pkg-kde-tools-0.15.20~ubuntu5/debian/pkg-kde-tools.install --- pkg-kde-tools-0.15.20~ubuntu4/debian/pkg-kde-tools.install 2016-01-07 20:35:31.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/debian/pkg-kde-tools.install 2016-03-20 21:10:15.000000000 +0000 @@ -8,6 +8,7 @@ usr/bin/pkgkde-getbuildlogs usr/bin/pkgkde-git usr/bin/pkgkde-mark-private-symbols +usr/bin/pkgkde-mark-qt5-private-symbols usr/bin/pkgkde-override-sc-dev-latest usr/bin/pkgkde-symbolshelper usr/bin/pkgkde-vcs @@ -17,8 +18,11 @@ usr/share/man/man1/pkgkde-gensymbols.1 usr/share/man/man1/pkgkde-git.1 usr/share/man/man1/pkgkde-mark-private-symbols.1 +usr/share/man/man1/pkgkde-mark-qt5-private-symbols.1 usr/share/man/man1/pkgkde-override-sc-dev-latest.1 +usr/share/man/man1/pkgkde-vcs.1 usr/share/man/man1/pkgkde-symbolshelper.1 +usr/share/man/man1/pkgkde-gensymbols.1 usr/share/man/man1/pkgkde-vcs.1 usr/share/perl5/Debian/Debhelper/ usr/share/perl5/Debian/PkgKde* diff -Nru pkg-kde-tools-0.15.20~ubuntu4/debian/rules pkg-kde-tools-0.15.20~ubuntu5/debian/rules --- pkg-kde-tools-0.15.20~ubuntu4/debian/rules 2016-01-07 20:35:31.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/debian/rules 2016-03-20 21:12:04.000000000 +0000 @@ -5,42 +5,3 @@ override_dh_install: $(overridden_command) --list-missing -# KDE branch to use. Various scripts are coming from kdesdk or other parts of -# KDE, those will preferrably be fetched from the branch (still taking into -# account the revision from below). -KDEBRANCH=v4.13.0 - -KDEGIT=git://anongit.kde.org -TARGET=kubuntu/libexec -CPTARGET=../kubuntu/libexec -EXPORT=export -r$(SVNREV) --force - -# Note that for git we use single branch shallow clone of the git tags. This is -# about as fast as it gets with git. -syncl10ninternal: - svn $(EXPORT) svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/scripts/createdesktopcontext.pl $(TARGET)/createdesktopcontext.pl - svn $(EXPORT) svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/scripts/extract-messages.sh $(TARGET)/extract-messages.sh - svn $(EXPORT) svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/scripts/extract-xml.sh $(TARGET)/extract-xml.sh - svn $(EXPORT) svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/scripts/msgsplit $(TARGET)/msgsplit - @echo "Working on kde-dev-scripts" - git clone --branch $(KDEBRANCH) --depth 1 --single-branch $(KDEGIT)/kde-dev-scripts.git && \ - cd kde-dev-scripts && \ - cp extractattr $(CPTARGET) && \ - cp extractrc $(CPTARGET) - @echo "Working on kdelibs" - git clone --branch $(KDEBRANCH) --depth 1 --single-branch $(KDEGIT)/kdelibs.git && \ - cd kdelibs && \ - cp kdeui/preparetips $(CPTARGET) - -syncl10nclean: - rm -rf kde-dev-scripts - rm -rf kdelibs - -# Clean git directories before and after to prevent problems. -syncl10n: syncl10nclean syncl10ninternal syncl10nclean - -# ...also clean git directories as part of regular clean. -override_dh_auto_clean: syncl10nclean - dh_auto_clean - -.PHONY: override_dh_auto_clean syncl10n syncl10nclean syncl10ninternal diff -Nru pkg-kde-tools-0.15.20~ubuntu4/man1/pkgkde-mark-qt5-private-symbols.1 pkg-kde-tools-0.15.20~ubuntu5/man1/pkgkde-mark-qt5-private-symbols.1 --- pkg-kde-tools-0.15.20~ubuntu4/man1/pkgkde-mark-qt5-private-symbols.1 1970-01-01 00:00:00.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/man1/pkgkde-mark-qt5-private-symbols.1 2016-03-20 21:16:17.000000000 +0000 @@ -0,0 +1,25 @@ +.TH pkgkde\-mark\-qt5\-private\-symbols 1 "2015-12-29" "0.15.20" "Mark private symbols in Qt symbols files" + +.SH NAME +.B pkgkde\-mark\-qt5\-private\-symbols +\- a helper tool to mark private symbols in Qt symbols files + +.SH SYNOPSIS +.B pkgkde\-mark\-qt5\-private\-symbols [ \-\-write\-results | \-\-print\-diff ] + +.SH DESCRIPTION +\fBpkgkde\-mark\-qt5\-private\-symbols\fR is a helper tool to mark private +symbols inside symbols files based on version tags inserted by the Qt +buildsystem. + +Symbols that are tagged with \fBQt_5_PRIVATE_API\fR will be marked as private. + +If \fB\-\-print\-diff\fR option is passed, this script will print the diff +into stdout instead of overwriting the original symbols files. + +.SH LICENSE +This program is free software distributed under the terms of the Expat license. + +.SH AUTHORS +Dmitry Shachnev + diff -Nru pkg-kde-tools-0.15.20~ubuntu4/pkgkde-mark-qt5-private-symbols pkg-kde-tools-0.15.20~ubuntu5/pkgkde-mark-qt5-private-symbols --- pkg-kde-tools-0.15.20~ubuntu4/pkgkde-mark-qt5-private-symbols 1970-01-01 00:00:00.000000000 +0000 +++ pkg-kde-tools-0.15.20~ubuntu5/pkgkde-mark-qt5-private-symbols 2016-03-20 21:17:23.000000000 +0000 @@ -0,0 +1,81 @@ +#!/usr/bin/python3 + +# Script to mark private symbols +# Copyright: 2015 Dmitry Shachnev + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +'''Mark private symbols based on Qt version tags (symbols that are tagged +with Qt_5_PRIVATE_API will be marked as private).''' + + +from argparse import ArgumentParser +from difflib import unified_diff +from glob import glob +from sys import stdout, stderr + + +def process_symbols_file(symbols_file_path, write_results=False): + old_lines = [] + new_lines = [] + has_alternative = False + with open(symbols_file_path) as symbols_file: + for line in symbols_file: + old_lines.append(line) + line = line.rstrip() + if line.endswith(' 1'): + line = line[:-2] + if '@Qt_5_PRIVATE_API' in line: + line += ' 1' + if line.startswith('| '): + has_alternative = True + new_lines.append(line + '\n') + if not has_alternative: + print('Skipping file %s, no alternative dependency specified.' % + symbols_file_path) + elif write_results: + with open(symbols_file_path, 'w') as symbols_file: + for line in new_lines: + symbols_file.write(line) + else: + for line in unified_diff(old_lines, new_lines, + fromfile=symbols_file_path, + tofile=symbols_file_path): + stdout.write(line) + + +if __name__ == '__main__': + parser = ArgumentParser(description=__doc__) + group = parser.add_mutually_exclusive_group() + group.add_argument('--write-results', + help='write results back into symbols files (default)', + action='store_false') + group.add_argument('--print-diff', + help='print diffs into stdout instead of applying them', + action='store_true') + args = parser.parse_args() + + symbols_files = glob('debian/*.symbols') + if not symbols_files: + print('No symbols files found!', file=stderr) + for symbols_file_path in symbols_files: + process_symbols_file(symbols_file_path, not args.print_diff) +