diff options
Diffstat (limited to 'patches')
-rw-r--r-- | patches/packages/vim-8.2.4649-x86_64-1_slack15.0.txt | 11 | ||||
-rw-r--r-- | patches/packages/vim-gvim-8.2.4649-x86_64-1_slack15.0.txt | 11 | ||||
-rw-r--r-- | patches/source/vim/ctags.use-conventional-unused-marker.patch | 305 | ||||
-rw-r--r-- | patches/source/vim/gvim.png | bin | 0 -> 8249 bytes | |||
-rw-r--r-- | patches/source/vim/slack-desc.vim | 19 | ||||
-rw-r--r-- | patches/source/vim/slack-desc.vim-gvim | 19 | ||||
-rwxr-xr-x | patches/source/vim/vim-gvim.SlackBuild | 207 | ||||
-rwxr-xr-x | patches/source/vim/vim.SlackBuild | 241 | ||||
-rw-r--r-- | patches/source/vim/vim.vimrc.diff | 12 |
9 files changed, 825 insertions, 0 deletions
diff --git a/patches/packages/vim-8.2.4649-x86_64-1_slack15.0.txt b/patches/packages/vim-8.2.4649-x86_64-1_slack15.0.txt new file mode 100644 index 00000000..4a843388 --- /dev/null +++ b/patches/packages/vim-8.2.4649-x86_64-1_slack15.0.txt @@ -0,0 +1,11 @@ +vim: vim (Vi IMproved) +vim: +vim: Vim is an almost compatible version of the UNIX editor vi. Many new +vim: features have been added: multi level undo, command line history, +vim: filename completion, block operations, and more. +vim: +vim: Vim's development is led by Bram Moolenaar. +vim: +vim: This package also contains the Exuberant Ctags program +vim: written by Darren Hiebert. +vim: diff --git a/patches/packages/vim-gvim-8.2.4649-x86_64-1_slack15.0.txt b/patches/packages/vim-gvim-8.2.4649-x86_64-1_slack15.0.txt new file mode 100644 index 00000000..3b81553b --- /dev/null +++ b/patches/packages/vim-gvim-8.2.4649-x86_64-1_slack15.0.txt @@ -0,0 +1,11 @@ +vim-gvim: vim-gvim (gvim, the X/GTK3 enabled version of vim) +vim-gvim: +vim-gvim: Gvim is a graphical version of vim. Vim is an almost compatible +vim-gvim: version of the UNIX editor vi. Many new features have been added, +vim-gvim: such as multi level undo, command line history, filename completion, +vim-gvim: block operations, and more. +vim-gvim: +vim-gvim: The main vim package in the AP series is required to use this package. +vim-gvim: +vim-gvim: Vim's development is led by Bram Moolenaar. +vim-gvim: diff --git a/patches/source/vim/ctags.use-conventional-unused-marker.patch b/patches/source/vim/ctags.use-conventional-unused-marker.patch new file mode 100644 index 00000000..ca450dfa --- /dev/null +++ b/patches/source/vim/ctags.use-conventional-unused-marker.patch @@ -0,0 +1,305 @@ +From 9643017460c221fed5689bcc55a41230200c40cc Mon Sep 17 00:00:00 2001 +From: Simon Chopin <simon.chopin@canonical.com> +Date: Fri, 13 Aug 2021 16:47:57 +0200 +Subject: build fix: Use conventional compiler attribute shorthand + +The `__unused` macro has been used on Linux systems for this exact +purpose for ages. On the other hand, using the non-standard __unused__ +breaks the build when compiling against glibc 2.34, as they use this +identifier internally. + +Last-Update: 2021-08-13 + +Patch-Name: use-conventional-unused-marker.patch +--- + c.c | 4 ++-- + eiffel.c | 2 +- + general.h | 6 ++++-- + lregex.c | 30 +++++++++++++++--------------- + lua.c | 2 +- + main.c | 2 +- + options.c | 24 ++++++++++++------------ + parse.c | 2 +- + python.c | 2 +- + routines.c | 2 +- + 10 files changed, 39 insertions(+), 37 deletions(-) + +diff --git a/c.c b/c.c +index 0cf0a14..c5d496b 100644 +--- a/c.c ++++ b/c.c +@@ -619,7 +619,7 @@ static const char *keywordString (const keywordId keyword) + return name; + } + +-static void __unused__ pt (tokenInfo *const token) ++static void __unused pt (tokenInfo *const token) + { + if (isType (token, TOKEN_NAME)) + printf ("type: %-12s: %-13s line: %lu\n", +@@ -634,7 +634,7 @@ static void __unused__ pt (tokenInfo *const token) + tokenString (token->type), token->lineNumber); + } + +-static void __unused__ ps (statementInfo *const st) ++static void __unused ps (statementInfo *const st) + { + unsigned int i; + printf ("scope: %s decl: %s gotName: %s gotParenName: %s\n", +diff --git a/eiffel.c b/eiffel.c +index e2f5a5c..67bfaa1 100644 +--- a/eiffel.c ++++ b/eiffel.c +@@ -807,7 +807,7 @@ static void findKeyword (tokenInfo *const token, const keywordId keyword) + + static boolean parseType (tokenInfo *const token); + +-static void parseGeneric (tokenInfo *const token, boolean declaration __unused__) ++static void parseGeneric (tokenInfo *const token, boolean declaration __unused) + { + unsigned int depth = 0; + #ifdef TYPE_REFERENCE_TOOL +diff --git a/general.h b/general.h +index 2d1d629..049e215 100644 +--- a/general.h ++++ b/general.h +@@ -57,10 +57,12 @@ + * to prevent warnings about unused variables. + */ + #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !defined (__GNUG__) +-# define __unused__ __attribute__((unused)) ++# ifndef __unused ++# define __unused __attribute__((unused)) ++# endif + # define __printf__(s,f) __attribute__((format (printf, s, f))) + #else +-# define __unused__ ++# define __unused + # define __printf__(s,f) + #endif + +diff --git a/lregex.c b/lregex.c +index 37d7ea0..964508b 100644 +--- a/lregex.c ++++ b/lregex.c +@@ -538,11 +538,11 @@ extern void findRegexTags (void) + #endif /* HAVE_REGEX */ + + extern void addTagRegex ( +- const langType language __unused__, +- const char* const regex __unused__, +- const char* const name __unused__, +- const char* const kinds __unused__, +- const char* const flags __unused__) ++ const langType language __unused, ++ const char* const regex __unused, ++ const char* const name __unused, ++ const char* const kinds __unused, ++ const char* const flags __unused) + { + #ifdef HAVE_REGEX + Assert (regex != NULL); +@@ -564,10 +564,10 @@ extern void addTagRegex ( + } + + extern void addCallbackRegex ( +- const langType language __unused__, +- const char* const regex __unused__, +- const char* const flags __unused__, +- const regexCallback callback __unused__) ++ const langType language __unused, ++ const char* const regex __unused, ++ const char* const flags __unused, ++ const regexCallback callback __unused) + { + #ifdef HAVE_REGEX + Assert (regex != NULL); +@@ -581,7 +581,7 @@ extern void addCallbackRegex ( + } + + extern void addLanguageRegex ( +- const langType language __unused__, const char* const regex __unused__) ++ const langType language __unused, const char* const regex __unused) + { + #ifdef HAVE_REGEX + if (! regexBroken) +@@ -602,7 +602,7 @@ extern void addLanguageRegex ( + */ + + extern boolean processRegexOption (const char *const option, +- const char *const parameter __unused__) ++ const char *const parameter __unused) + { + boolean handled = FALSE; + const char* const dash = strchr (option, '-'); +@@ -624,7 +624,7 @@ extern boolean processRegexOption (const char *const option, + return handled; + } + +-extern void disableRegexKinds (const langType language __unused__) ++extern void disableRegexKinds (const langType language __unused) + { + #ifdef HAVE_REGEX + if (language <= SetUpper && Sets [language].count > 0) +@@ -639,8 +639,8 @@ extern void disableRegexKinds (const langType language __unused__) + } + + extern boolean enableRegexKind ( +- const langType language __unused__, +- const int kind __unused__, const boolean mode __unused__) ++ const langType language __unused, ++ const int kind __unused, const boolean mode __unused) + { + boolean result = FALSE; + #ifdef HAVE_REGEX +@@ -660,7 +660,7 @@ extern boolean enableRegexKind ( + return result; + } + +-extern void printRegexKinds (const langType language __unused__, boolean indent __unused__) ++extern void printRegexKinds (const langType language __unused, boolean indent __unused) + { + #ifdef HAVE_REGEX + if (language <= SetUpper && Sets [language].count > 0) +diff --git a/lua.c b/lua.c +index d385544..a2699c6 100644 +--- a/lua.c ++++ b/lua.c +@@ -37,7 +37,7 @@ static kindOption LuaKinds [] = { + */ + + /* for debugging purposes */ +-static void __unused__ print_string (char *p, char *q) ++static void __unused print_string (char *p, char *q) + { + for ( ; p != q; p++) + fprintf (errout, "%c", *p); +diff --git a/main.c b/main.c +index 79948fe..38ce218 100644 +--- a/main.c ++++ b/main.c +@@ -522,7 +522,7 @@ static void makeTags (cookedArgs *args) + * Start up code + */ + +-extern int main (int __unused__ argc, char **argv) ++extern int main (int __unused argc, char **argv) + { + cookedArgs *args; + #ifdef VMS +diff --git a/options.c b/options.c +index ae773ef..029767c 100644 +--- a/options.c ++++ b/options.c +@@ -730,7 +730,7 @@ static void processEtagsInclude ( + } + + static void processExcludeOption ( +- const char *const option __unused__, const char *const parameter) ++ const char *const option __unused, const char *const parameter) + { + const char *const fileName = parameter + 1; + if (parameter [0] == '\0') +@@ -867,7 +867,7 @@ static void processFieldsOption ( + } + + static void processFilterTerminatorOption ( +- const char *const option __unused__, const char *const parameter) ++ const char *const option __unused, const char *const parameter) + { + freeString (&Option.filterTerminator); + Option.filterTerminator = stringCopy (parameter); +@@ -929,8 +929,8 @@ static void printProgramIdentification (void) + } + + static void processHelpOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __unused, ++ const char *const parameter __unused) + { + printProgramIdentification (); + putchar ('\n'); +@@ -1138,8 +1138,8 @@ static void processLanguagesOption ( + } + + static void processLicenseOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __unused, ++ const char *const parameter __unused) + { + printProgramIdentification (); + puts (""); +@@ -1165,8 +1165,8 @@ static void processListKindsOption ( + } + + static void processListMapsOption ( +- const char *const __unused__ option, +- const char *const __unused__ parameter) ++ const char *const __unused option, ++ const char *const __unused parameter) + { + if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0) + printLanguageMaps (LANG_AUTO); +@@ -1182,8 +1182,8 @@ static void processListMapsOption ( + } + + static void processListLanguagesOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __unused, ++ const char *const parameter __unused) + { + printLanguageList (); + exit (0); +@@ -1357,8 +1357,8 @@ static void processIgnoreOption (const char *const list) + } + + static void processVersionOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __unused, ++ const char *const parameter __unused) + { + printProgramIdentification (); + exit (0); +diff --git a/parse.c b/parse.c +index 0b5e2c3..7e7361b 100644 +--- a/parse.c ++++ b/parse.c +@@ -376,7 +376,7 @@ extern void freeParserResources (void) + */ + + extern void processLanguageDefineOption ( +- const char *const option, const char *const parameter __unused__) ++ const char *const option, const char *const parameter __unused) + { + #ifdef HAVE_REGEX + if (parameter [0] == '\0') +diff --git a/python.c b/python.c +index bf797de..f94e5de 100644 +--- a/python.c ++++ b/python.c +@@ -135,7 +135,7 @@ static boolean isIdentifierCharacter (int c) + * extract all relevant information and create a tag. + */ + static void makeFunctionTag (vString *const function, +- vString *const parent, int is_class_parent, const char *arglist __unused__) ++ vString *const parent, int is_class_parent, const char *arglist __unused) + { + tagEntryInfo tag; + initTagEntry (&tag, vStringValue (function)); +diff --git a/routines.c b/routines.c +index 8ebe2e0..c465626 100644 +--- a/routines.c ++++ b/routines.c +@@ -526,7 +526,7 @@ static boolean isPathSeparator (const int c) + + #if ! defined (HAVE_STAT_ST_INO) + +-static void canonicalizePath (char *const path __unused__) ++static void canonicalizePath (char *const path __unused) + { + #if defined (MSDOS_STYLE_PATH) + char *p; diff --git a/patches/source/vim/gvim.png b/patches/source/vim/gvim.png Binary files differnew file mode 100644 index 00000000..2bdc8bd8 --- /dev/null +++ b/patches/source/vim/gvim.png diff --git a/patches/source/vim/slack-desc.vim b/patches/source/vim/slack-desc.vim new file mode 100644 index 00000000..114fd7e1 --- /dev/null +++ b/patches/source/vim/slack-desc.vim @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +vim: vim (Vi IMproved) +vim: +vim: Vim is an almost compatible version of the UNIX editor vi. Many new +vim: features have been added: multi level undo, command line history, +vim: filename completion, block operations, and more. +vim: +vim: Vim's development is led by Bram Moolenaar. +vim: +vim: This package also contains the Exuberant Ctags program +vim: written by Darren Hiebert. +vim: diff --git a/patches/source/vim/slack-desc.vim-gvim b/patches/source/vim/slack-desc.vim-gvim new file mode 100644 index 00000000..cbdfa03d --- /dev/null +++ b/patches/source/vim/slack-desc.vim-gvim @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +vim-gvim: vim-gvim (gvim, the X/GTK3 enabled version of vim) +vim-gvim: +vim-gvim: Gvim is a graphical version of vim. Vim is an almost compatible +vim-gvim: version of the UNIX editor vi. Many new features have been added, +vim-gvim: such as multi level undo, command line history, filename completion, +vim-gvim: block operations, and more. +vim-gvim: +vim-gvim: The main vim package in the AP series is required to use this package. +vim-gvim: +vim-gvim: Vim's development is led by Bram Moolenaar. +vim-gvim: diff --git a/patches/source/vim/vim-gvim.SlackBuild b/patches/source/vim/vim-gvim.SlackBuild new file mode 100755 index 00000000..6eb01708 --- /dev/null +++ b/patches/source/vim/vim-gvim.SlackBuild @@ -0,0 +1,207 @@ +#!/bin/bash + +# Copyright 2008, 2009, 2010, 2013, 2016, 2018, 2019, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This package must be build right after the main vim package, and the +# generated vim package must still be in $TMP. + +# To prevent a collision with a vim.SlackBuild running at the same time (since +# we'll try to build vim too, if it isn't available), we REQUIRE_GLOBAL_LOCK for +# this package when used with make_world.sh. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=vim-gvim +VIMBRANCH=8.2 +VERSION=$(echo vim-${VIMBRANCH}*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +BUILD=${BUILD:-1_slack15.0} + +# The possible settings for this are yes/no/dynamic. +PERLINTERP=${PERLINTERP:-dynamic} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +# If dynamic support for Ruby works with this $ARCH, then allow it: +if [ "$ARCH" = "x86_64" ]; then + RUBYDYNAMIC="=dynamic" +fi + +NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} + +PYVER=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.) + +if [ "$ARCH" = "x86_64" ]; then + export SLKCFLAGS="-O2 -fPIC" + export LIBDIRSUFFIX="64" +else + export SLKCFLAGS="-O2" + export LIBDIRSUFFIX="" +fi +export SLKLDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" + +TMP=${TMP:-/tmp} +PKG=$TMP/package-vim-gvim + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf vim-$VERSION +tar xvf $CWD/vim-$VERSION.tar.?z || exit 1 + +config_vim() { +CFLAGS="$SLKCFLAGS" LDFLAGS="$SLKLDFLAGS" \ +./configure \ + $* \ + --prefix=/usr \ + --with-python-config-dir=/usr/lib${LIBDIRSUFFIX}/python$PYVER/config \ + --with-python3-config-dir=$(python3-config --configdir) \ + --enable-perlinterp=$PERLINTERP \ + --enable-pythoninterp=dynamic \ + --enable-python3interp=dynamic \ + --enable-rubyinterp${RUBYDYNAMIC} \ + --enable-tclinterp=dynamic \ + --enable-multibyte \ + --enable-cscope \ + --with-features=huge \ + --with-compiledby="<volkerdi@slackware.com>" \ + --build=$ARCH-slackware-linux || exit 1 +} + +cd $TMP/vim-$VERSION || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +config_vim --with-x --enable-gui=gtk3 || exit 1 +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +rsync -lprvt $PKG/usr/share/man/ $PKG/usr/man/ +rm -r $PKG/usr/share/man + +# Fix manpage symlinks: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +# Legacy binary links: +( cd $PKG/usr/bin ; rm -rf rview ) +( cd $PKG/usr/bin ; ln -sf vim rview ) +( cd $PKG/usr/bin ; rm -rf rvim ) +( cd $PKG/usr/bin ; ln -sf vim rvim ) +( cd $PKG/usr/bin ; rm -rf view ) +( cd $PKG/usr/bin ; ln -sf vim view ) +( cd $PKG/usr/bin ; rm -rf eview ) +( cd $PKG/usr/bin ; ln -sf vim eview ) +( cd $PKG/usr/bin ; rm -rf evim ) +( cd $PKG/usr/bin ; ln -sf vim evim ) + +# These should not be shipped: +rm -f $PKG/usr/bin/{ex,vi} + +mkdir -p $PKG/install +cat $CWD/slack-desc.vim-gvim > $PKG/install/slack-desc + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# You'll have to run "gvim" to get the graphical version. +# Seems like this is the common way for console and gui versions +# of vim to co-exist. If your "vi" symlink isn't pointed in a +# way that suits you, it is fully user serviceable. :-) +( cd $PKG/usr/bin + rm -f gvim + mv vim gvim + for programlink in $(find . -type l | cut -b3-) ; do + rm $programlink + ln -sf gvim $programlink + done +) +rm -f vimtutor xxd + +# Perfect! +# Now we get rid of everything that's not in the other vim package. +# Let's assume (dangerous ;-) that we just built that in $TMP +# and use it as a reference: +if ! /bin/ls $TMP/vim-${VERSION}-${ARCH}-${BUILD}.txz 1> /dev/null 2> /dev/null ; then + # We assumed wrong. So build it: + $CWD/vim.SlackBuild +fi +mkdir $PKG/vim +( cd $PKG + ( cd vim + echo "Extracting reference package $TMP/vim-${VERSION}-${ARCH}-${BUILD}.txz:" + explodepkg $TMP/vim-${VERSION}-${ARCH}-${BUILD}.txz 1> /dev/null + sh install/doinst.sh + ) +) +rm -r $PKG/vim/install +( cd $PKG + find vim | cut -b4- | while read sharedfile ; do + if [ ! -d $sharedfile ]; then + rm --verbose $PKG/$sharedfile + fi + done +) + +# Finally, reference purge: +rm -rf $PKG/vim + +# Get rid of the terminal-based vim.desktop file: +rm -f $PKG/usr/share/applications/vim.desktop + +# Remove empty directories: +find $PKG -type d -exec rmdir -p {} \+ 2> /dev/null + +cd $PKG +/sbin/makepkg -l y -c n $TMP/vim-gvim-$VERSION-$ARCH-$BUILD.txz + diff --git a/patches/source/vim/vim.SlackBuild b/patches/source/vim/vim.SlackBuild new file mode 100755 index 00000000..0b4f8132 --- /dev/null +++ b/patches/source/vim/vim.SlackBuild @@ -0,0 +1,241 @@ +#!/bin/bash + +# Copyright 2008, 2009, 2010, 2013, 2016, 2018, 2019, 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=vim +VIMBRANCH=8.2 +CTAGSVER=5.8 +BUILD=${BUILD:-1_slack15.0} + +# The possible settings for this are yes/no/dynamic. +PERLINTERP=${PERLINTERP:-dynamic} + +if [ -r vim-${VIMBRANCH}*.tar.?z ]; then # if there's a source archive already, use the version number from it: + VERSION=$(echo vim-${VIMBRANCH}*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev) +else # need to fetch the latest source archive for this branch: + VERSION="$(wget -q -O - https://www.vim.org | grep "^${VIMBRANCH}" | head -n 1)" + ( lftpget https://github.com/vim/vim/archive/v${VERSION}.tar.gz + gzip -d v${VERSION}.tar.gz + mv v${VERSION}.tar vim-${VERSION}.tar + plzip -9 -n 6 vim-${VERSION}.tar + if [ ! -r vim-${VERSION}.tar.lz ]; then + echo "ERROR: Something went wrong trying to fetch https://github.com/vim/vim/archive/v${VERSION}.tar.gz" + exit 1 + fi + ) || exit 1 +fi + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +# If dynamic support for Ruby works with this $ARCH, then allow it: +if [ "$ARCH" = "x86_64" ]; then + RUBYDYNAMIC="=dynamic" +fi + +NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} + +PYVER=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.) + +if [ "$ARCH" = "x86_64" ]; then + export SLKCFLAGS="-O2 -fPIC" + export LIBDIRSUFFIX="64" +else + export SLKCFLAGS="-O2" + export LIBDIRSUFFIX="" +fi +export SLKLDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" + +TMP=${TMP:-/tmp} +PKG=$TMP/package-vim + +rm -rf $PKG +mkdir -p $TMP $PKG + +# ctags was once a part of vim, +# but now we have to bundle it in +cd $TMP +rm -rf ctags-$CTAGSVER +tar xvf $CWD/ctags-$CTAGSVER.tar.?z || exit 1 +cd ctags-$CTAGSVER || exit 1 +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +# patch to solve an issue introduced by glibc-2.34 from http://deb.debian.org/debian/pool/main/e/exuberant-ctags/exuberant-ctags_5.9~svn20110310-15.debian.tar.xz +zcat $CWD/ctags.use-conventional-unused-marker.patch.gz | patch -Esp1 --verbose || exit 1 + +CFLAGS="$SLKCFLAGS" LDFLAGS="$SLKLDFLAGS" \ +./configure \ + --prefix=/usr \ + --build=$ARCH-slackware-linux +make $NUMJOBS || make || exit 1 +mkdir -p $PKG/usr/bin +cat ctags > $PKG/usr/bin/ctags +chmod 755 $PKG/usr/bin/ctags +mkdir -p $PKG/usr/man/man1 +cat ctags.1 | gzip -9c > $PKG/usr/man/man1/ctags.1.gz +mkdir -p $PKG/usr/doc/ctags-$CTAGSVER +cp -a \ + COPYING* EXTENDING.html FAQ INSTALL INSTALL.oth NEWS README* \ + $PKG/usr/doc/ctags-$CTAGSVER +chmod 644 $PKG/usr/doc/ctags-$CTAGSVER/* + +cd $TMP +rm -rf vim-${VERSION} +tar xvf $CWD/vim-${VERSION}.tar.?z || exit 1 + +config_vim() { +CFLAGS="$SLKCFLAGS" \ +./configure \ + $* \ + --prefix=/usr \ + --with-python-config-dir=/usr/lib${LIBDIRSUFFIX}/python$PYVER/config \ + --with-python3-config-dir=$(python3-config --configdir) \ + --enable-perlinterp=$PERLINTERP \ + --enable-pythoninterp=dynamic \ + --enable-python3interp=dynamic \ + --enable-rubyinterp${RUBYDYNAMIC} \ + --enable-tclinterp=dynamic \ + --disable-canberra \ + --enable-multibyte \ + --enable-cscope \ + --with-features=huge \ + --with-compiledby="<volkerdi@slackware.com>" \ + --build=$ARCH-slackware-linux || exit 1 +} + +cd $TMP/vim-$VERSION || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +config_vim --without-x --disable-gui || exit 1 +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +rsync -lprvt $PKG/usr/share/man/ $PKG/usr/man/ +rm -r $PKG/usr/share/man + +# Don't make backups in /var/spool/cron/*, which fixes "crontab -e": +zcat $CWD/vim.vimrc.diff.gz | patch -p1 --verbose || exit 1 + +cp -a runtime/vimrc_example.vim runtime/vimrc.new + +# Add patched vimrc to the package: +cat runtime/vimrc.new > $PKG/usr/share/vim/vimrc.new + +# Don't package gvim.desktop - it will be included in the vim-gvim package: +rm -f $PKG/usr/share/applications/gvim.desktop + +# Move the vim.desktop into the docs directory. There's really not much use +# for this .desktop file. It's easy enough to just open a terminal and run +# vim in it without this. +mkdir -p $PKG/usr/doc/vim-$VERSION +mv $PKG/usr/share/applications/vim.desktop $PKG/usr/doc/vim-$VERSION + +# Remove empty directory: +rmdir $PKG/usr/share/applications + +# Fix manpage symlinks: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +# Legacy binary links: +( cd $PKG/usr/bin ; rm -rf rview ) +( cd $PKG/usr/bin ; ln -sf vim rview ) +( cd $PKG/usr/bin ; rm -rf rvim ) +( cd $PKG/usr/bin ; ln -sf vim rvim ) +( cd $PKG/usr/bin ; rm -rf view ) +( cd $PKG/usr/bin ; ln -sf vim view ) +( cd $PKG/usr/bin ; rm -rf eview ) +( cd $PKG/usr/bin ; ln -sf vim eview ) +( cd $PKG/usr/bin ; rm -rf evim ) +( cd $PKG/usr/bin ; ln -sf vim evim ) + +# These should not be shipped: +rm -f $PKG/usr/bin/{ex,vi} + +mkdir -p $PKG/usr/doc/vim-$VERSION +cp -a README.txt $PKG/usr/doc/vim-$VERSION +find $PKG/usr/doc/vim-$VERSION -type f | xargs chmod 644 +( cd $PKG/usr/doc/vim-$VERSION ; rm -rf doc ) +( cd $PKG/usr/doc/vim-$VERSION ; ln -sf /usr/share/vim/vim$(echo $VIMBRANCH | tr -d .) doc ) + +mkdir -p $PKG/install +cat $CWD/slack-desc.vim > $PKG/install/slack-desc +cat << EOF > $PKG/install/doinst.sh +#!/bin/bash +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config usr/share/vim/vimrc.new +EOF + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +cd $PKG +/sbin/makepkg -l y -c n $TMP/vim-$VERSION-$ARCH-$BUILD.txz + diff --git a/patches/source/vim/vim.vimrc.diff b/patches/source/vim/vim.vimrc.diff new file mode 100644 index 00000000..ec350341 --- /dev/null +++ b/patches/source/vim/vim.vimrc.diff @@ -0,0 +1,12 @@ +--- ./runtime/vimrc_example.vim.orig 2019-01-04 17:35:22.000000000 -0600 ++++ ./runtime/vimrc_example.vim 2019-01-11 14:43:36.366302054 -0600 +@@ -49,6 +49,9 @@ + + endif " has("autocmd") + ++" Make vim work with the 'crontab -e' command ++set backupskip+=/var/spool/cron/*,/run/cron/* ++ + " Add optional packages. + " + " The matchit plugin makes the % command work better, but it is not backwards |