From ecf3b87690b94314dc715c7a047bc90ca0a4acdd Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 20 Jul 2017 23:02:49 +0200 Subject: CI/GitLab: Speed up build by limiting clone depth --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9860f4f0f..357372dc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,9 @@ # the new ones here in these builds. image: registry.gitlab.com/inkscape/inkscape-ci-docker/master +variables: + GIT_DEPTH: "10" + cache: paths: - ccache/ -- cgit v1.2.3 From f7b19ac5c3e315281b219ced064065d77a2cf852 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 20 Jul 2017 23:03:00 +0200 Subject: cmake: cleanup man page generation - move code from main CMakeLists.txt to separate cmake file in /man - root dir tidying: move fix-roff-punct --- CMakeLists.txt | 34 ++--------- CMakeScripts/Pod2man.cmake | 8 +-- fix-roff-punct | 139 --------------------------------------------- man/CMakeLists.txt | 23 ++++++++ man/fix-roff-punct | 139 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 170 insertions(+), 173 deletions(-) delete mode 100755 fix-roff-punct create mode 100644 man/CMakeLists.txt create mode 100755 man/fix-roff-punct diff --git a/CMakeLists.txt b/CMakeLists.txt index 094ebacab..c91713ee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,7 @@ add_custom_target(uninstall # ----------------------------------------------------------------------------- -# Subdirs (on only 1 atm), but a lot happens here +# Subdirectories # ----------------------------------------------------------------------------- add_subdirectory(src) @@ -195,36 +195,10 @@ if(ENABLE_NLS) add_subdirectory(po) endif(ENABLE_NLS) -# ----------------------------------------------------------------------------- -# Man pages -# ----------------------------------------------------------------------------- if(NOT WIN32) - include("CMakeScripts/Pod2man.cmake") - - # Load AUTHORS file contents into $INKSCAPE_AUTHORS - file(READ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS content) - string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}") - - join(INKSCAPE_AUTHORS "," "${content_list}") - - foreach(podfile - man/inkscape.pod - man/inkscape.de.pod - man/inkscape.el.pod - man/inkscape.fr.pod - man/inkscape.ja.pod - man/inkscape.sk.pod - man/inkscape.zh_TW.pod - man/inkview.pod) - - set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in) - set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile}) - - configure_file(${POD_IN} ${POD_OUT}) - - pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual") - endforeach() -endif() + include(CMakeScripts/Pod2man.cmake) + add_subdirectory(man) +endif(NOT WIN32) # ----------------------------------------------------------------------------- # Installation diff --git a/CMakeScripts/Pod2man.cmake b/CMakeScripts/Pod2man.cmake index 21010fb33..348319b4a 100644 --- a/CMakeScripts/Pod2man.cmake +++ b/CMakeScripts/Pod2man.cmake @@ -26,13 +26,13 @@ macro(pod2man PODFILE_FULL RELEASE SECTION CENTER) if(POD2MAN) if(LANG) set(MANPAGE_TARGET "man-${NAME}-${LANG}") - set(MANFILE_TEMP "${CMAKE_CURRENT_BINARY_DIR}/man/${NAME}.${LANG}.tmp") - set(MANFILE_FULL "${CMAKE_CURRENT_BINARY_DIR}/man/${NAME}.${LANG}.${SECTION}") + set(MANFILE_TEMP "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.${LANG}.tmp") + set(MANFILE_FULL "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.${LANG}.${SECTION}") set(MANFILE_DEST "${CMAKE_INSTALL_PREFIX}/${SHARE_INSTALL}/man/${LANG}/man${SECTION}") else() set(MANPAGE_TARGET "man-${NAME}") - set(MANFILE_TEMP "${CMAKE_CURRENT_BINARY_DIR}/man/${NAME}.tmp") - set(MANFILE_FULL "${CMAKE_CURRENT_BINARY_DIR}/man/${NAME}.${SECTION}") + set(MANFILE_TEMP "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tmp") + set(MANFILE_FULL "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.${SECTION}") set(MANFILE_DEST "${CMAKE_INSTALL_PREFIX}/${SHARE_INSTALL}/man/man${SECTION}") endif() add_custom_command( diff --git a/fix-roff-punct b/fix-roff-punct deleted file mode 100755 index dc3c96c10..000000000 --- a/fix-roff-punct +++ /dev/null @@ -1,139 +0,0 @@ -#! /usr/bin/perl -w -use strict; - -# fix-roff-punct: Fix up punctuation usage in automatically-generated -# troff files (man pages). - -# Authors: -# Peter Moulder -# -# Copyright (C) 2004 Monash University -# -# Gnu GPL v2+: -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Background: Humans use a number of dash-like characters: -# -# - ASCII hyphen/minus needed for command-line options and other computer -# input; -# - hyphen (`one-to-one'); -# - en dash (`2000-2003'); -# - em dash -- like this. [Not currently handled.] -# -# Troff input spells them as \-, -, \[en], \[em] respectively. (See the -# groff_char.7 man page for a full list of such punctuation characters.) If -# you run `man' with your LC_CTYPE indicating a rich character set like unicode -# (UTF-8 encoding), then it uses different output characters for each of the -# above. -# -# In particular, if your man page source has plain `-' when giving an example -# of a flag or command or other program input, then users won't be able to use -# mouse copy&paste from the formatted man page. - -# This script is something of a hack: it is only big enough to handle a few man -# pages of interest (produced by pod2man). You should manually check the -# changes it makes. - -# Approach: we handle each line a word at a time, and typically make the same -# hyphen-vs-ASCII decision throughout the word. We're a bit haphazard about -# word-splitting, but it's hard to find an example of where we'd be hurt by -# that, and by luck we would do the right thing for many gcc options like -# `-fconstant-string-class=\fICLASS-NAME\fR' (where CLASS-NAME should use a -# hyphen and the others should be ASCII hyphen-minus). -# -# Perl's /e (execute) flag for substitutions does just what we want -# for preserving non-word bits while transforming "words". -# -# We don't currently handle special things like `apt-get' that look like -# hyphenated english words but are actually program names. In general the -# problem is AI complete, e.g. `apt-gettable' could be either hyphen (gettable -# by apt) or ASCII hyphen-minus (able to be processed by the `apt-get' -# program). -# -# We don't currently take hints from font choice. (E.g. text in CR font should -# probably use ASCII hyphen-minus.) -# -# We currently only handle a couple troff requests and escapes (see groff.7). - -sub frob ($); - -my $yearRE = qr/(?:19[6-9]|20[013])[0-9]/; - -sub frob ($) { - my ($x) = @_; - - # Consider splitting into two words. - if ($x =~ m{\A(.*?)(\\(?:[&/,~:d]|f[BRI]|s-?[0-9]+))(.*)\z}) { - my ($before, $s, $after) = ($1, $2, $3); - return frob($before) . $s . frob($after); - } - - if ($x =~ m{\A(.*?)(\.+)\z}) { - my $d = $2; - return frob($1) . $d; - } - - # `32-bit', `5-page'. - if ($x =~ m{\A[0-9]+-[a-z]+\z}) { - return $x; - } - - # Year range: `(C) 1998-2003'. - if ($x =~ m{\A$yearRE\\?-$yearRE\z}) { - $x =~ s{\\?-}{\\[en]}; - return $x; - } - - # ISO date. - if ($x =~ m{\A$yearRE-[01][0-9]-[0-3][0-9]\z}) { - return $x; - } - - # Things likely to be computer input. - if ($x =~ m{[0-9]|\.[a-zA-Z]|\A(?:[-/.]|\\-|\[.*\]\z)}) { - $x =~ s/\\?-/\\-/g; - return $x; - } - - $x =~ s/\\?-/-/g; - return $x; -} - -while(<>) { - if ($_ eq '.tr \(*W-|\(bv\*(Tr' . "\n") { - # Get rid of pod2man's "helpful" munging of pipe symbol. - next; - } - - # Leave ASCII apostrophe unchanged (i.e. \[aq]) for examples. - if (/\A\\\& /) { - s/'/\\[aq]/g; # `\[aq]' = "ascii quote" - } - - if (/\A\.IP /) { - s/\\?-/\\-/g; - s/\\s\\-1/\\s-1/g; - } - elsif (/\A\.IX /) { - s/\\?-/-/g; - } - elsif (!/\A\. *(?:\\"|ds|if|ie)/) { - # As an optimization, we process only words containing `-'. - s{([.@/\\[:alnum:]]*-[-.@/\\[:alnum:]]*)}{frob($1)}ge; - } - print; -} diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt new file mode 100644 index 000000000..8ee1548e4 --- /dev/null +++ b/man/CMakeLists.txt @@ -0,0 +1,23 @@ +# Load AUTHORS file contents into $INKSCAPE_AUTHORS +file(READ ${CMAKE_SOURCE_DIR}/AUTHORS content) +string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}") + +join(INKSCAPE_AUTHORS "," "${content_list}") + +foreach(podfile + inkscape.pod + inkscape.de.pod + inkscape.el.pod + inkscape.fr.pod + inkscape.ja.pod + inkscape.sk.pod + inkscape.zh_TW.pod + inkview.pod) + + set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in) + set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile}) + + configure_file(${POD_IN} ${POD_OUT}) + + pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual") +endforeach() diff --git a/man/fix-roff-punct b/man/fix-roff-punct new file mode 100755 index 000000000..dc3c96c10 --- /dev/null +++ b/man/fix-roff-punct @@ -0,0 +1,139 @@ +#! /usr/bin/perl -w +use strict; + +# fix-roff-punct: Fix up punctuation usage in automatically-generated +# troff files (man pages). + +# Authors: +# Peter Moulder +# +# Copyright (C) 2004 Monash University +# +# Gnu GPL v2+: +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +# Background: Humans use a number of dash-like characters: +# +# - ASCII hyphen/minus needed for command-line options and other computer +# input; +# - hyphen (`one-to-one'); +# - en dash (`2000-2003'); +# - em dash -- like this. [Not currently handled.] +# +# Troff input spells them as \-, -, \[en], \[em] respectively. (See the +# groff_char.7 man page for a full list of such punctuation characters.) If +# you run `man' with your LC_CTYPE indicating a rich character set like unicode +# (UTF-8 encoding), then it uses different output characters for each of the +# above. +# +# In particular, if your man page source has plain `-' when giving an example +# of a flag or command or other program input, then users won't be able to use +# mouse copy&paste from the formatted man page. + +# This script is something of a hack: it is only big enough to handle a few man +# pages of interest (produced by pod2man). You should manually check the +# changes it makes. + +# Approach: we handle each line a word at a time, and typically make the same +# hyphen-vs-ASCII decision throughout the word. We're a bit haphazard about +# word-splitting, but it's hard to find an example of where we'd be hurt by +# that, and by luck we would do the right thing for many gcc options like +# `-fconstant-string-class=\fICLASS-NAME\fR' (where CLASS-NAME should use a +# hyphen and the others should be ASCII hyphen-minus). +# +# Perl's /e (execute) flag for substitutions does just what we want +# for preserving non-word bits while transforming "words". +# +# We don't currently handle special things like `apt-get' that look like +# hyphenated english words but are actually program names. In general the +# problem is AI complete, e.g. `apt-gettable' could be either hyphen (gettable +# by apt) or ASCII hyphen-minus (able to be processed by the `apt-get' +# program). +# +# We don't currently take hints from font choice. (E.g. text in CR font should +# probably use ASCII hyphen-minus.) +# +# We currently only handle a couple troff requests and escapes (see groff.7). + +sub frob ($); + +my $yearRE = qr/(?:19[6-9]|20[013])[0-9]/; + +sub frob ($) { + my ($x) = @_; + + # Consider splitting into two words. + if ($x =~ m{\A(.*?)(\\(?:[&/,~:d]|f[BRI]|s-?[0-9]+))(.*)\z}) { + my ($before, $s, $after) = ($1, $2, $3); + return frob($before) . $s . frob($after); + } + + if ($x =~ m{\A(.*?)(\.+)\z}) { + my $d = $2; + return frob($1) . $d; + } + + # `32-bit', `5-page'. + if ($x =~ m{\A[0-9]+-[a-z]+\z}) { + return $x; + } + + # Year range: `(C) 1998-2003'. + if ($x =~ m{\A$yearRE\\?-$yearRE\z}) { + $x =~ s{\\?-}{\\[en]}; + return $x; + } + + # ISO date. + if ($x =~ m{\A$yearRE-[01][0-9]-[0-3][0-9]\z}) { + return $x; + } + + # Things likely to be computer input. + if ($x =~ m{[0-9]|\.[a-zA-Z]|\A(?:[-/.]|\\-|\[.*\]\z)}) { + $x =~ s/\\?-/\\-/g; + return $x; + } + + $x =~ s/\\?-/-/g; + return $x; +} + +while(<>) { + if ($_ eq '.tr \(*W-|\(bv\*(Tr' . "\n") { + # Get rid of pod2man's "helpful" munging of pipe symbol. + next; + } + + # Leave ASCII apostrophe unchanged (i.e. \[aq]) for examples. + if (/\A\\\& /) { + s/'/\\[aq]/g; # `\[aq]' = "ascii quote" + } + + if (/\A\.IP /) { + s/\\?-/\\-/g; + s/\\s\\-1/\\s-1/g; + } + elsif (/\A\.IX /) { + s/\\?-/-/g; + } + elsif (!/\A\. *(?:\\"|ds|if|ie)/) { + # As an optimization, we process only words containing `-'. + s{([.@/\\[:alnum:]]*-[-.@/\\[:alnum:]]*)}{frob($1)}ge; + } + print; +} -- cgit v1.2.3