Browse Source

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.
android-5
Fredrik Fornwall 7 years ago
parent
commit
de35794692
  1. 7
      packages/aapt/build.sh
  2. 2
      packages/apr/build.sh
  3. 2
      packages/ccache/build.sh
  4. 2
      packages/dialog/build.sh
  5. 2
      packages/neofetch/build.sh
  6. 4
      packages/unzip/build.sh
  7. 9
      packages/valac/build.sh
  8. 2
      packages/vim-python/build.sh
  9. 2
      packages/vim/build.sh
  10. 33
      scripts/lint-packages.py

7
packages/aapt/build.sh

@ -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

2
packages/apr/build.sh

@ -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.

2
packages/ccache/build.sh

@ -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

2
packages/dialog/build.sh

@ -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

2
packages/neofetch/build.sh

@ -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

4
packages/unzip/build.sh

@ -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"

9
packages/valac/build.sh

@ -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

2
packages/vim-python/build.sh

@ -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.

2
packages/vim/build.sh

@ -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

@ -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()
Loading…
Cancel
Save