Add scripts/lint-packages.py

Harmonize the layout by having the first two lines of a package
definition always be the homepage and the description.
This commit is contained in:
Fredrik Fornwall 2017-12-05 22:48:12 +01:00
parent dc7554a8d6
commit ea61862721
15 changed files with 53 additions and 22 deletions

View File

@ -1,6 +1,3 @@
# FIXME: We would like to enable checksums when downloading
# tar files, but they change each time as the tar metadata
# differs: https://github.com/google/gitiles/issues/84
TERMUX_PKG_HOMEPAGE=http://elinux.org/Android_aapt
TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool"
_TAG_VERSION=7.1.2
@ -11,6 +8,10 @@ TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_DEPENDS="libexpat, libpng, libzopfli"
termux_step_make_install () {
# FIXME: We would like to enable checksums when downloading
# tar files, but they change each time as the tar metadata
# differs: https://github.com/google/gitiles/issues/84
local _TAGNAME=${_TAG_VERSION}_r${_TAG_REVISION}
SYSTEM_CORE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/system_core_include_${_TAGNAME}.tar.gz

View File

@ -11,7 +11,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--without-pthread
--without-tcl
--with-system-pinerc=${TERMUX_PREFIX}/etc/pine.conf
--with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile
--with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile
"
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_SHA256=6030b6881b8168546756ab3a5e43628d8d564539b0476578e287775573a77438

View File

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://apr.apache.org/
TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Library"
TERMUX_PKG_VERSION=1.6.3
TERMUX_PKG_SHA256=131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172
TERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Library"
TERMUX_PKG_DEPENDS="libuuid"
TERMUX_PKG_BUILD_IN_SRC="yes"
# "ac_cv_search_crypt=" to avoid needlessly linking to libcrypt.

View File

@ -12,5 +12,5 @@ termux_step_post_extract_package () {
termux_step_post_massage () {
perl -p -i -e "s|/usr/bin/m4|$TERMUX_PREFIX/bin/m4|" bin/*
perl -p -i -e "s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|" bin/autoconf
perl -p -i -e "s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|" bin/autoconf
}

View File

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://ccache.samba.org
TERMUX_PKG_DESCRIPTION="Compiler cache for fast recompilation of C/C++ code"
TERMUX_PKG_VERSION=3.3.4
TERMUX_PKG_SRCURL=https://www.samba.org/ftp/ccache/ccache-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_DESCRIPTION="Compiler cache for fast recompilation of C/C++ code"
TERMUX_PKG_SHA256=24f15bf389e38c41548c9c259532187774ec0cb9686c3497bbb75504c8dc404f

View File

@ -1,5 +1,5 @@
TERMUX_PKG_DESCRIPTION="Application used in shell scripts which displays text user interface widgets"
TERMUX_PKG_HOMEPAGE=http://invisible-island.net/dialog/
TERMUX_PKG_DESCRIPTION="Application used in shell scripts which displays text user interface widgets"
TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_VERSION="1.3-20170509"
TERMUX_PKG_SHA256=2ff1ba74c632b9d13a0d0d2c942295dd4e8909694eeeded7908a467d0bcd4756

View File

@ -14,7 +14,7 @@ termux_step_configure() {
termux_step_make () {
cd src/
make cli
make cli
}
termux_step_make_install() {

View File

@ -9,7 +9,7 @@ TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_KEEP_SHARE_DOC=yes
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-visualizer --enable-outputs --enable-clock"
termux_step_pre_configure() {
termux_step_pre_configure() {
./autogen.sh
CXXFLAGS+=" -DNCURSES_WIDECHAR -U_XOPEN_SOURCE"
}

View File

@ -41,7 +41,7 @@ termux_step_pre_configure() {
termux_step_post_make_install () {
cd $TERMUX_PREFIX/lib
for lib in form menu ncurses panel; do
for file in lib${lib}w.so*; do
for file in lib${lib}w.so*; do
ln -s -f $file `echo $file | sed 's/w//'`
done
(cd pkgconfig && ln -s -f ${lib}w.pc `echo $lib | sed 's/w//'`.pc)

View File

@ -1,6 +1,6 @@
TERMUX_PKG_MAINTAINER="Muhammad Herdiansyah @konimex"
TERMUX_PKG_HOMEPAGE=https://github.com/dylanaraps/neofetch
TERMUX_PKG_DESCRIPTION="Simple system information script"
TERMUX_PKG_MAINTAINER="Muhammad Herdiansyah @konimex"
TERMUX_PKG_DEPENDS="bash"
TERMUX_PKG_VERSION=3.3.0
TERMUX_PKG_SRCURL=https://github.com/dylanaraps/neofetch/archive/${TERMUX_PKG_VERSION}/neofetch-${TERMUX_PKG_VERSION}.tar.gz

View File

@ -1,7 +1,7 @@
TERMUX_PKG_VERSION=6.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_HOMEPAGE=http://www.info-zip.org/
TERMUX_PKG_DESCRIPTION="Tools for working with zip files"
TERMUX_PKG_VERSION=6.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/infozip/unzip60.tar.gz
TERMUX_PKG_SHA256=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37
TERMUX_PKG_DEPENDS="libandroid-support"

View File

@ -1,10 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/Vala
_VALA_MAJOR=0
_VALA_MINOR=36
_VALA_PATCH=4
TERMUX_PKG_VERSION=$_VALA_MAJOR.$_VALA_MINOR.$_VALA_PATCH
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_SRCURL=https://download.gnome.org/sources/vala/$_VALA_MAJOR.$_VALA_MINOR/vala-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_DESCRIPTION="C# like language for the GObject system"
TERMUX_PKG_VERSION=0.36.4
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_SRCURL=https://download.gnome.org/sources/vala/${TERMUX_PKG_VERSION:0:4}/vala-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_DEPENDS="clang, glib-dev, pkg-config"
TERMUX_PKG_SHA256=e9f23ce711c1a72ce664d10946fbc5953f01b0b7f2a3562e7a01e362d86de059

View File

@ -1,5 +1,5 @@
TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
TERMUX_PKG_HOMEPAGE=http://www.vim.org/
TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
TERMUX_PKG_DEPENDS="ncurses, vim-runtime, python"
# vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR.

View File

@ -1,5 +1,5 @@
TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
TERMUX_PKG_HOMEPAGE=http://www.vim.org/
TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
TERMUX_PKG_DEPENDS="ncurses, vim-runtime"
# vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR.

33
scripts/lint-packages.py Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env python3
import os
import sys
def main():
package_dir = 'packages'
for pkgdir_name in sorted(os.listdir(package_dir)):
dir_path = package_dir + '/' + pkgdir_name
build_sh_path = dir_path + '/build.sh'
if not os.path.isfile(build_sh_path):
sys.exit('No build.sh file in: ' + pkgdir_name)
with open(build_sh_path) as build_sh:
lines = build_sh.readlines()
validate_package(pkgdir_name, lines)
def validate_package(package_name, lines):
if len(lines) < 3:
print('Too few lines in package: ' + package_name)
return
if not lines[0].startswith('TERMUX_PKG_HOMEPAGE='):
print('The first line is not TERMUX_PKG_HOMEPAGE: ' + package_name)
if not lines[1].startswith('TERMUX_PKG_DESCRIPTION='):
print('The second line is not TERMUX_PKG_DESCRIPTION: ' + package_name)
line_number = 1
for line in lines:
if line.endswith(' \n'):
print('Line ' + str(line_number) + ' has trailing whitespace: ' + package_name)
line_number += 1
if __name__ == '__main__':
main()