recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / x-apps / vim_huge / recipe
blob41267c15683138b7a3bb3d67921ac94ba298421c
1 # Build recipe for vim (huge).
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=vim
18 version=8.1.2124
19 release=1
21 # Define hash tag to categorize the package name output
22 pkghashtag=x-apps
24 pkgname=vim_huge
26 # The installation of this package replaces to
27 replace=vim_tiny
29 tarname=${program}-${version}.tar.gz
31 # Remote source(s)
32 fetch=http://github.com/vim/vim/archive/v${version}/$tarname
34 homepage=http://www.vim.org
36 description="
37 The ubiquitous text editor (huge version, with X11 support).
39 Vim is a highly configurable text editor built to make creating and
40 changing any kind of text very efficient.  It is included as \"vi\"
41 with most UNIX systems and with Apple OS X.
43 For more information, visit:  $homepage
46 license=Custom
48 # Source documentation
49 docs="CONTRIBUTING.md README.md"
50 docsdir="${docdir}/${pkgname}-${pkgversion}"
52 build()
54     set -e
56     unpack "${tardir}/$tarname"
58     cd $srcdir
60     # Workaround for the special 'srcdir' variable, it is internally
61     # imported and exported from vim's ./configure
62     saved_srcdir=$srcdir
63     unset srcdir
65     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66      $configure_args \
67      --libdir=/usr/lib${libSuffix} \
68      --mandir=$mandir \
69      --docdir=$docsdir \
70      --enable-gui=gtk2 \
71      --enable-multibyte \
72      --enable-perlinterp \
73      --enable-pythoninterp \
74      --enable-python3interp \
75      --enable-rubyinterp \
76      --enable-tclinterp \
77      --disable-netbeans \
78      --with-features=huge \
79      --with-compiledby="Dragora GNU/Linux-Libre" \
80      --with-x \
81      --build="$(cc -dumpmachine)"
83     # Restore 'srcdir'
84     srcdir=$saved_srcdir
85     unset saved_srcdir
87     make -j${jobs} V=1
88     make -j${jobs} DESTDIR="$destdir" install
90     # Add wrappers script from Dragora for compatibility mode (vi)
91     cp -f "${worktree}/archive/vim/usr/bin/vi" \
92           "${destdir}/usr/bin"
93     chmod 755 "${destdir}/usr/bin/vi"
95     # Compress and link man pages (if needed)
96     if test -d "${destdir}/$mandir"
97     then
98         (
99             cd "${destdir}/$mandir"
100             find . -type f -exec lzip -9 '{}' +
101             find . -type l | while read -r file
102             do
103                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
104                 rm -- "$file"
105             done
106         )
107     fi
109     # Copy documentation
110     mkdir -p "${destdir}${docsdir}"
111     cp -p $docs "${destdir}${docsdir}"