Mercurial > vanilla
changeset 721:034a2a62a9f8
vanilla: consolidate options with lint-options.sh
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 05 Aug 2019 13:19:31 +0200 |
parents | 100b1ba8672d |
children | 1ac4747e74bb |
files | Docs/options.md Scripts/lint-options.sh Scripts/list.sh audio/libvorbis/libvorbis.sh dev/llvm/llvm.sh security/libsecret/libsecret.sh xfce/xfce4-session/xfce4-session.sh |
diffstat | 7 files changed, 152 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/Docs/options.md Mon Aug 05 12:41:20 2019 +0200 +++ b/Docs/options.md Mon Aug 05 13:19:31 2019 +0200 @@ -4,50 +4,104 @@ Use the following predefined options before creating your own. - ACL: enable access control list support +- ALSA: enable Advanced Linux Sound Architecture support +- ATTR: enable attributes support +- AUDIT: enable security audit support +- AVAHI: enable avahi support - BLUETOOTH: enable bluetooth support - BZIP2: enable bzip2 compression support +- CAIRO: enable cairo graphics +- CAP: enable capabilities support +- CDPARANOIA: enable CD-Audio support through cdparanoia +- COLORS: enable colors support +- CRYPTO: enable cryptographic functionalities +- CUPS: enable printing support through CUPS - DBUS: enable D-Bus support - DOXYGEN: enable doxygen documentation support - DRM: enable direct rendering manager support - DTD: enable XML validation support - EGL: enable EGL support +- EVDEV: enable input drivers through evdev +- FFI: enable foreign function interface support - FLAC: enable flac support - FONTCONFIG: enable fontconfig support - FREETYPE: enable freetype support - GALLIUM: enable LLVM gallium support - GDBM: enable GNU database support +- GEOLOCATION: enable geolocation positioning support - GLAMOR: enable 2D graphics support - GLES1: enable GLES1 support - GLES2: enable GLES2 support - GLES3: enable GLES3 support +- GLIB: enable glib library support - GMP: enable GNU multiple precision library +- GNOME: enable GNOME desktop support +- GSTREAMER: enable gstreamer multimedia framework support - GTK2: enable Gtk 2 toolkit support -- GTK3: enable Gtk 3 toolkit support -- GTK4: enable Gtk 4 toolkit support +- GTK: enable Gtk 3 toolkit support - GUILE: enable GNU guile support +- HARFBUZZ: enable font rendering engine support +- ICU: enable International Components for Unicode support - IDN2: enable libidn2 support +- INTROSPECTION: enable GObject introspection support +- IPV6: enable IPv6 support +- JACK: enable JACK Audio Connection Kit support +- JPEG: enable JPEG image format support +- KERBEROS: enable kerberos authentication system support - KMS: enable kernel mode settings support - LEGACY: enable obsolete or deprecated features +- LIBEDIT: enable command line completion through libedit +- LIBINPUT: enable input drivers through libinput - LLVM: enable LLVM support - LZ4: enable lz4 compression support - LZMA: enable lzma compression support +- LZO: enable lz4 compression support - MIDI: enable midi support - MNL: enable netlink minimalistic library support +- MTDEV: enable multitouch devices support +- NCURSES: enable new curses library support +- NGHTTP2: enable nghttp2 support - NLS: enable native language support +- NOTIFICATIONS: enable desktop notifications - OGG: enable libogg support +- OPENGL: enable OpenGL support +- OPENMP: enable OpenMP support +- OPUS: enable OPUS audio codec support +- OSS: enable OpenSound System support - PAM: enable PAM support +- PANGO: enable pango font engine support - PCRE: enable perl-like regular expression support +- PDF: enable PDF support +- PERL: enable Perl language +- PNG: enable PNG image format support +- POLKIT: enable polkit authentication engine support - PULSEAUDIO: enable PulseAudio support - PYTHON: enable Python 3 bindings or support - QT5: enable Qt 5 toolkit support +- READLINE: enable command line completion support through readline +- SELINUX: enable NSA SELinux support +- SPELL: enable spell check support - SPHINX: enable sphinx documentation support - SSH: enable SSH support - SSL: enable SSL/TLS, some packages offer several choices (e.g. openssl, gnutls) +- STATIC: build static libraries or executable (internal use only) +- SVG: enable SVG image format support +- SYSLOG: enable logs through syslog support +- TCL: enable TCL language support +- THEORA: enable theora video codec support +- TIFF: enable TIFF image format support +- TRUECOLOR: enable truecolor in terminal applications - UDEV: enable eudev support +- UPOWER: enable upower system support - UUID: enable UUID support +- VALA: enable vala bindings support - VORBIS: enable libvorbis support +- VULKAN: enable vulkan support - WACOM: enable wacom support - WAYLAND: enable wayland support +- WEBKIT: enable webkit web engine support +- WEBP: enable webp image format support +- WOFF2: enable woff2 font support - X: enable X.Org support - XML: enable XML support - XZ: enable XZ support
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Scripts/lint-options.sh Mon Aug 05 13:19:31 2019 +0200 @@ -0,0 +1,51 @@ +#!/bin/sh +# +# lint-options.sh -- check if packages use predefined options +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +alias basename="busybox basename" +alias dirname="busybox dirname" +alias echo="busybox echo" +alias grep="busybox grep" +alias realpath="busybox realpath" + +TOP=$(realpath $(dirname $0)/../) +PROGNAME=$(basename $0) + +check() +{( + name=$(basename $1).sh + + cd $TOP/$1 + + if [ ! -f $name ]; then + echo "warning: skipping $pkg" 1>&2 + return 1 + fi + + . ./$name + + for o in $PKGOPTIONS; do + if ! grep -q $o $TOP/Docs/options.md; then + echo "$pkg: option $o is unknown or custom" + fi + done +)} + +$TOP/Scripts/list.sh $1 | while read -r pkg; do + check $pkg +done
--- a/Scripts/list.sh Mon Aug 05 12:41:20 2019 +0200 +++ b/Scripts/list.sh Mon Aug 05 13:19:31 2019 +0200 @@ -17,13 +17,34 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +alias basename="busybox basename" +alias echo="busybox echo" alias find="busybox find" alias grep="busybox grep" +alias realpath="busybox realpath" alias sed="busybox sed" TOP=$(realpath $(dirname $0)/../) -( - cd $TOP - find -mindepth 2 -maxdepth 2 -type d | grep -v '\.hg' | sed 's|^\./||' -) +scriptfile() +{ + echo $1/$(basename $1).sh +} + +list() +{( + if [ $# -eq 0 ]; then + find -mindepth 2 -maxdepth 2 -type d | grep -v '\.hg' | sed -e 's|^./||' + else + file=$(scriptfile $1) + + if [ ! -f $file ]; then + echo "abort: invalid package specified '$1'" 1>&2 + exit 1 + fi + + echo $1 + fi +)} + +list $@
--- a/audio/libvorbis/libvorbis.sh Mon Aug 05 12:41:20 2019 +0200 +++ b/audio/libvorbis/libvorbis.sh Mon Aug 05 13:19:31 2019 +0200 @@ -22,7 +22,6 @@ PKGSUMMARY="vorbis codec library" PKGDOWNLOAD="http://downloads.xiph.org/releases/vorbis/$PKGNAME-$PKGVERSION.tar.xz" PKGDEPENDS="audio/libogg" -PKGOPTIONS="FOO BAR BAZ" : ${CHOST:=$(uname -m)-linux-musl} : ${CBUILD:=$(uname -m)-linux-musl}
--- a/dev/llvm/llvm.sh Mon Aug 05 12:41:20 2019 +0200 +++ b/dev/llvm/llvm.sh Mon Aug 05 13:19:31 2019 +0200 @@ -22,7 +22,7 @@ PKGSUMMARY="low level virtual machine compiler infrastructure" PKGDOWNLOAD="https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKGVERSION/$PKGNAME-$PKGVERSION.src.tar.xz" PKGDEPENDS="lib/ncurses python/python compression/zlib dev/cmake:build" -PKGOPTIONS="DOXYGEN FFI LIBCXX LIBEDIT LIBXML2 LLD NCURSES SPHINX STATIC TARGETS ZLIB" +PKGOPTIONS="DOXYGEN FFI LIBCXX LIBEDIT XML LLD NCURSES SPHINX STATIC TARGETS ZLIB" : ${CHOST:=$(uname -m)-linux-musl} : ${CC:=clang} @@ -33,7 +33,7 @@ : ${FFI:=no} : ${LIBCXX:=yes} : ${LIBEDIT:=yes} -: ${LIBXML2:=yes} +: ${XML:=yes} : ${LLD:=yes} : ${NCURSES:=yes} : ${SPHINX:=yes} @@ -69,11 +69,11 @@ with_libedit="-DLLVM_ENABLE_LIBEDIT=Off" fi -if [ "$LIBXML2" = "yes" ]; then +if [ "$XML" = "yes" ]; then PKGDEPENDS="text/libxml2 $PKGDEPENDS" - with_libxml2="-DLLVM_ENABLE_LIBXML2=On" + with_xml="-DLLVM_ENABLE_LIBXML2=On" else - with_libxml2="-DLLVM_ENABLE_LIBXML2=Off" + with_xml="-DLLVM_ENABLE_LIBXML2=Off" fi if [ "$LLD" = "yes" ]; then @@ -132,7 +132,7 @@ $with_ffi \ $with_libcxx \ $with_libedit \ - $with_libxml2 \ + $with_xml \ $with_lld \ $with_ncurses \ $with_sphinx \
--- a/security/libsecret/libsecret.sh Mon Aug 05 12:41:20 2019 +0200 +++ b/security/libsecret/libsecret.sh Mon Aug 05 13:19:31 2019 +0200 @@ -22,7 +22,7 @@ PKGSUMMARY="a library for storing and accessing passwords" PKGDOWNLOAD="https://download.gnome.org/sources/libsecret/${PKGVERSION%.*}/$PKGNAME-$PKGVERSION.tar.xz" PKGDEPENDS="lib/glib text/libxslt:build" -PKGOPTIONS="GCRYPT NLS VALA" +PKGOPTIONS="CRYPTO NLS VALA" : ${CHOST:=$(uname -m)-linux-musl} : ${CBUILD:=$(uname -m)-linux-musl} @@ -31,15 +31,15 @@ : ${LDFLAGS:=} : ${LIBS:=} : ${LDFLAGS:=} -: ${GCRYPT:=yes} +: ${CRYPTO:=yes} : ${NLS:=yes} : ${VALA:=yes} -if [ "$GCRYPT" = "yes" ]; then +if [ "$CRYPTO" = "yes" ]; then PKGDEPENDS="crypto/libgcrypt $PKGDEPENDS" - with_gcrypt="--enable-gcrypt" + with_crypto="--enable-gcrypt" else - with_gcrypt="--disable-gcrypt" + with_crypto="--disable-gcrypt" fi if [ "$NLS" = "yes" ]; then @@ -71,7 +71,9 @@ --host=$CHOST \ --prefix= \ --disable-static \ - --enable-shared + --enable-shared \ + $with_crypto \ + $with_vala make make install DESTDIR=$DESTDIR rm -f $DESTDIR/lib/libsecret-1.la
--- a/xfce/xfce4-session/xfce4-session.sh Mon Aug 05 12:41:20 2019 +0200 +++ b/xfce/xfce4-session/xfce4-session.sh Mon Aug 05 13:19:31 2019 +0200 @@ -32,21 +32,21 @@ xfce/libxfce4ui xfce/libxfce4util xfce/xfconf" -PKGOPTIONS="POLICYKIT UPOWER" +PKGOPTIONS="POLKIT UPOWER" : ${CC:=clang} : ${CFLAGS:=-O2} : ${LDFLAGS:=} : ${LIBS:=} -: ${POLICYKIT:=yes} +: ${POLKIT:=yes} : ${UPOWER:=yes} -if [ "$POLICYKIT" = "yes" ]; then +if [ "$POLKIT" = "yes" ]; then PKGDEPENDS="security/polkit $PKGDEPENDS" - with_policykit="--enable-polkit" + with_polkit="--enable-polkit" else - with_policykit="--disable-polkit" + with_polkit="--disable-polkit" fi if [ "$UPOWER" = "yes" ]; then @@ -70,7 +70,7 @@ --prefix= \ --localedir=/share/locale \ --with-locales-dir=/share/locale \ - $with_policykit \ + $with_polkit \ $with_upower make make install DESTDIR=$DESTDIR itlocaledir=/share/locale