summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Beikirch2020-04-14 22:02:13 +0200
committerMax Beikirch2020-04-14 22:04:13 +0200
commit738ea72bf494fe30e8e5342f3eb1ceec6fb48993 (patch)
tree1e2f96076a0d054a0188f5291bf3febcd724175c
parent7b5f0743d4f02eac7301d66aea9c1e3e1cd5c7a1 (diff)
downloadaur-738ea72bf494fe30e8e5342f3eb1ceec6fb48993.tar.gz
Track git submodules in PKGBUILD
Use git_submodules_to_pkgbuild.py to regenerate that information.
-rw-r--r--PKGBUILD120
-rwxr-xr-xgit_submodules_to_pkgbuild.py70
2 files changed, 186 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index fdba40710fe7..2c97f4b946e4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Max Beikirch <max.beikirch (at) unitybox (dot) de>
pkgname=squash-git
-pkgver=0.7.0.r498.g713eeca
+pkgver=v0.7.0.r498.g713eeca
pkgrel=1
pkgdesc="tool for compression benchmarks"
arch=('x86_64')
@@ -8,16 +8,127 @@ url="https://quixdb.github.io/squash/"
license=('MIT')
depends=('ragel')
makedepends=('cmake' 'git')
-source=("git+https://github.com/quixdb/squash.git")
-md5sums=('SKIP')
+source=("git+https://github.com/quixdb/squash.git"
+ "git+https://github.com/nemequ/liblzf.git"
+ "git+https://github.com/nemequ/doboz.git"
+ "git+https://github.com/svn2github/fastlz.git"
+ "git+https://github.com/nemequ/lzjb.git"
+ "git+https://github.com/tinycthread/tinycthread.git"
+ "git+https://github.com/davidcatt/FastARI.git"
+ "git+https://github.com/google/gipfeli.git"
+ "git+https://github.com/richgel999/lzham_codec_devel.git"
+ "git+https://github.com/google/brotli.git"
+ "git+https://github.com/zpaq/zpaq.git"
+ "git+https://github.com/richox/libzling.git"
+ "git+https://github.com/Cyan4973/zstd.git"
+ "git+https://github.com/coderforlife/ms-compress.git"
+ "git+https://github.com/IlyaGrebnov/libbsc.git"
+ "git+https://github.com/centaurean/density.git"
+ "git+https://bitbucket.org/tkatchev/yalz77"
+ "git+https://github.com/fusiyuan2010/CSC.git"
+ "git+https://github.com/nemequ/bzip2.git"
+ "git+https://github.com/nemequ/lzo.git"
+ "git+https://github.com/google/snappy.git"
+ "git+https://github.com/madler/zlib.git"
+ "git+http://git.tukaani.org/xz.git"
+ "git+https://github.com/Cyan4973/lz4.git"
+ "git+https://github.com/ShaneWF/wflz.git"
+ "git+https://github.com/mbitsnbites/liblzg.git"
+ "git+https://github.com/Dead2/zlib-ng.git"
+ "git+https://github.com/jibsen/brieflz.git"
+ "git+https://github.com/atomicobject/heatshrink.git"
+ "git+https://github.com/ebiggers/libdeflate.git"
+ "git+https://github.com/jibsen/parg.git"
+ "git+https://github.com/win-iconv/win-iconv"
+ "git+https://github.com/richgel999/miniz.git"
+ "git+https://github.com/nemequ/munit.git"
+ "git+https://github.com/lzfse/lzfse.git"
+ "git+https://github.com/nemequ/hedley.git")
+
+
+md5sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+)
pkgver() {
cd "${srcdir}/squash"
- git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
+
prepare() {
cd "${srcdir}/squash"
+ git submodule init
+ git config submodule."plugins/lzf/liblzf".url "${srcdir}/liblzf"
+ git config submodule."plugins/doboz/doboz".url "${srcdir}/doboz"
+ git config submodule."plugins/fastlz/fastlz".url "${srcdir}/fastlz"
+ git config submodule."plugins/lzjb/lzjb".url "${srcdir}/lzjb"
+ git config submodule."squash/tinycthread".url "${srcdir}/tinycthread"
+ git config submodule."plugins/fari/FastARI".url "${srcdir}/FastARI"
+ git config submodule."plugins/gipfeli/gipfeli".url "${srcdir}/gipfeli"
+ git config submodule."plugins/lzham/lzham".url "${srcdir}/lzham_codec_devel"
+ git config submodule."plugins/brotli/brotli".url "${srcdir}/brotli"
+ git config submodule."plugins/zpaq/zpaq".url "${srcdir}/zpaq"
+ git config submodule."plugins/zling/libzling".url "${srcdir}/libzling"
+ git config submodule."plugins/zstd/zstd".url "${srcdir}/zstd"
+ git config submodule."plugins/ms-compress/ms-compress".url "${srcdir}/ms-compress"
+ git config submodule."plugins/bsc/libbsc".url "${srcdir}/libbsc"
+ git config submodule."plugins/density/density".url "${srcdir}/density"
+ git config submodule."plugins/yalz77/yalz77".url "${srcdir}/yalz77"
+ git config submodule."plugins/csc/csc".url "${srcdir}/CSC"
+ git config submodule."plugins/bzip2/bzip2".url "${srcdir}/bzip2"
+ git config submodule."plugins/lzo/lzo".url "${srcdir}/lzo"
+ git config submodule."plugins/snappy/snappy".url "${srcdir}/snappy"
+ git config submodule."plugins/zlib/zlib".url "${srcdir}/zlib"
+ git config submodule."plugins/lzma/xz".url "${srcdir}/xz"
+ git config submodule."plugins/lz4/lz4".url "${srcdir}/lz4"
+ git config submodule."plugins/wflz/wflz".url "${srcdir}/wflz"
+ git config submodule."plugins/lzg/liblzg".url "${srcdir}/liblzg"
+ git config submodule."plugins/zlib-ng/zlib-ng".url "${srcdir}/zlib-ng"
+ git config submodule."plugins/brieflz/brieflz".url "${srcdir}/brieflz"
+ git config submodule."plugins/heatshrink/heatshrink".url "${srcdir}/heatshrink"
+ git config submodule."plugins/libdeflate/libdeflate".url "${srcdir}/libdeflate"
+ git config submodule."utils/parg".url "${srcdir}/parg"
+ git config submodule."squash/win-iconv".url "${srcdir}/win-iconv"
+ git config submodule."plugins/miniz/miniz".url "${srcdir}/miniz"
+ git config submodule."tests/munit".url "${srcdir}/munit"
+ git config submodule."plugins/lzfse/lzfse".url "${srcdir}/lzfse"
+ git config submodule."squash/hedley".url "${srcdir}/hedley"
+ git submodule update
./autogen.sh --prefix=/usr
}
@@ -32,4 +143,5 @@ package() {
cd "${srcdir}/squash"
make DESTDIR="${pkgdir}" install
+ install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/LICENSE
}
diff --git a/git_submodules_to_pkgbuild.py b/git_submodules_to_pkgbuild.py
new file mode 100755
index 000000000000..2d39f7a86cff
--- /dev/null
+++ b/git_submodules_to_pkgbuild.py
@@ -0,0 +1,70 @@
+# use this script to translate a .gitmodules file into instructions that fit into
+# a PKGBUILD
+#!/usr/bin/python
+import re
+import sys
+
+def main():
+ p0 = re.compile("\[submodule (.*)\]")
+ p1 = re.compile("url = (.*)")
+ strs = list(open(sys.argv[1]))
+ module_names = []
+ urls = []
+ state = [False, False]
+ while len(strs) > 0:
+ s = strs.pop(0)
+ s = s.lstrip()
+
+ r = p0.match(s)
+ if r:
+ if state[0]:
+ # got a new list entry - the old one is saved already
+ state = [False, False]
+ module_name = r.groups()[0]
+ module_names.append(module_name)
+ state[0] = True
+ continue
+
+ r = p1.match(s)
+ if r:
+ if state[1]:
+ print("already got url - skipping")
+ else:
+ url = r.groups()[0]
+ urls.append(url)
+ state[1] = True
+ continue
+
+ # could not parse line - skip silently
+
+ # build output file
+ source_str = "source=("
+ for url in urls:
+ source_str = source_str + " " + "\"git+" + url + "\"\n"
+
+ source_str = source_str + ")\n"
+
+ md5_str = "md5sums=("
+ for _ in module_names:
+ md5_str = md5_str + " 'SKIP'\n"
+ md5_str = md5_str + ")\n"
+
+ # get the local name of the clone (group 7)
+ # taken from https://stackoverflow.com/questions/2514859/regular-expression-for-git-repository and adapted
+ p = re.compile("((git@|http(s)?:\/\/)([\w\.@]+)(\/|:*))([\w,\-,\_]*)\/([\w,\-,\_]+)(.git){0,1}((\/){0,1})")
+ prepare_str = "prepare() {"
+ for (name,url) in zip(module_names, urls):
+ print(url)
+ local_name = p.match(url).groups()[6]
+ print(local_name)
+ prepare_str = prepare_str + " git config submodule." + name + ".url " + "\"${srcdir}/" + local_name + "\"\n"
+
+ prepare_str = prepare_str + "}\n"
+
+ print(source_str)
+ print(md5_str)
+ print(prepare_str)
+
+
+if __name__=="__main__":
+ main()