wok-current view gvim/receipt @ rev 25574

asterisk: make install-headers inserted
author Hans-G?nter Theisgen
date Sat May 13 17:20:22 2023 +0100 (19 months ago)
parents 5cb11e361a0a
children
line source
1 # SliTaz package receipt.
3 PACKAGE="gvim"
4 VERSION="9.0.0133"
5 basever=${VERSION%.*}
6 basever=${basever/./}
7 CATEGORY="editors"
8 TAGS="text-editor"
9 SHORT_DESC="Advanced text editor, with gtk+ GUI."
10 MAINTAINER="erjo@slitaz.org"
11 LICENSE="other"
12 WEB_SITE="https://www.vim.org/"
14 SOURCE="vim"
15 TARBALL="$SOURCE-$VERSION.tar.gz"
16 WGET_URL="https://github.com/$SOURCE/$SOURCE/archive/v$VERSION.tar.gz"
18 PROVIDES="xxd"
19 DEPENDS="gtk+ ncurses xorg-libXau xorg-libXdmcp xorg-libXt"
20 BUILD_DEPENDS="gtk+-dev"
21 CONFIG_FILES="/etc/vim/vimrc"
23 # What is the latest version available today?
24 current_version()
25 {
26 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
27 sed '/vim-[0-9]/!d;/tar/!d;s|.*vim-||;s|.tar.*||' | sort -Vr | sed q
28 }
30 # Rules to configure and make the package.
31 compile_rules()
32 {
33 export LDFLAGS="$LDFLAGS -ltinfo"
35 # define the place for the global vimrc file (set to /etc/vim/vimrc)
36 # (patch from Arch Linux PKGBUILD)
37 sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' \
38 $src/src/feature.h
39 # and global gvimrc file (set to /etc/vim/gvimrc)
40 sed -i 's|^.*\(#define SYS_GVIMRC_FILE\).*$|\1 "/etc/vim/gvimrc"|' \
41 $src/src/feature.h
43 # 9.0.0133 unrecognised:
44 # --disable-athena-check
46 ./configure \
47 --prefix=/usr \
48 --cache-file=$PWD/config.cache \
49 --infodir=/usr/share/info \
50 --mandir=/usr/share/man \
51 --with-features=normal \
52 --with-x=yes \
53 --enable-gui=gtk2 \
54 --enable-multibyte \
55 --disable-motif-check \
56 $CONFIGURE_ARGS &&
58 make \
59 VIMRCLOC=/etc/vim \
60 VIMRUNTIMEDIR=/usr/share/vim/vim$basever\
61 MAKE="make -e" &&
62 make install \
63 DESTDIR=$DESTDIR
65 mkdir -p $DESTDIR/etc/vim
66 cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc
68 for i in GenericName Keywords
69 do
70 l="$(grep $i= $DESTDIR/usr/share/applications/vim.desktop)"
71 sed -i "/$i=/d;s|$i\[de].*|$l\n&|" $DESTDIR/usr/share/applications/vim.desktop
72 done
73 }
75 # Rules to gen a SliTaz package suitable for Tazpkg.
76 genpkg_rules()
77 {
78 mkdir -p $fs/usr/share/icons/hicolor/16x16/apps
79 mkdir -p $fs/usr/share/applications
80 mkdir -p $fs/etc
82 cp -a $install/usr/bin $fs/usr
83 cp -a $install/usr/share/vim $fs/usr/share
84 cp -a $src/runtime/vim16x16.png $fs/usr/share/icons/hicolor/16x16/apps/gvim.png
85 cp -a stuff/gvim.desktop $fs/usr/share/applications
86 cp -a $install/etc/vim $fs/etc
87 }
89 post_install()
90 {
91 cmd=$(readlink "$1/bin/vi")
92 if [ ! "$cmd" = '/usr/bin/vim' ]
93 then
94 echo ""
95 echo "**** Actual vi link : $cmd"
96 echo ""
97 echo -n "Do you want vim for /bin/vi (y/N) ? : "
98 read -t 30 answer
99 if [ "$answer" = 'y' ]
100 then
101 echo ""
102 echo -n "Removing vi link to make a new one pointing on /usr/bin/vim..."
103 rm "$1/bin/vi" &&
104 ln -sf /usr/bin/vim "$1/bin/vi"
105 status
106 else
107 echo ""
108 echo "Leaving /bin/vi to : $cmd"
109 fi
110 fi
111 }
113 post_remove()
114 {
115 # restore previous symbolic link
116 ln -sf busybox "$1/bin/vi"
117 }