-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pacakge: for debian and plain old zip and tar (amd64)
Also do a makeup for the CI. It's horrendous.
- Loading branch information
1 parent
73ad988
commit f06c87d
Showing
4 changed files
with
92 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# /usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
arch=$(dpkg-architecture -q DEB_BUILD_ARCH) | ||
version_num=$(git describe --tags --abbrev=0 | sed -E 's/v([0-9]+\.[0-9]+)/\1/') | ||
commit_count=$(git rev-list --count --first-parent HEAD) | ||
|
||
version="$version_num.$commit_count" | ||
echo | ||
|
||
pkg='tree-sitter-parsers' | ||
pkg_name="$pkg-$version_num-$arch" | ||
rm -rf "$pkg" | ||
|
||
debian="$pkg/DEBIAN" | ||
mkdir -p "$debian" | ||
|
||
dst="$pkg/usr/local/lib" | ||
dst_escaped=$(printf '%s\n' "$dst" | sed -e 's/[\/&]/\\&/g') | ||
mkdir -p "$dst" | ||
|
||
cat <<-EOF > "$debian/control" | ||
Package: $pkg | ||
Version: $version | ||
Architecture: $arch | ||
Maintainer: Firas al-Khalil <firas.al-khalil@faveod.com> | ||
Description: A bunch of tree-sitter parsers. | ||
EOF | ||
|
||
for i in lib/*-"$PLATFORM".so | ||
do | ||
cp $i $(echo $i | sed -E "s/^(lib\/)(.*)-$PLATFORM(\.so)$/$dst_escaped\/\2\3/") | ||
done | ||
|
||
dpkg-deb --build "$pkg" "lib/$pkg_name.deb" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# /usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
case "$OSTYPE" in | ||
darwin*) | ||
ext="dylib" | ||
;; | ||
*) | ||
ext="so" | ||
;; | ||
esac | ||
|
||
version_num=$(git describe --tags --abbrev=0 | sed -E 's/v([0-9]+\.[0-9]+)/\1/') | ||
|
||
pkg="tree-sitter-parsers" | ||
pkg_name="$pkg-$version_num-$arch" | ||
rm -rf "$pkg" | ||
|
||
dst=$pkg | ||
dst_escaped=$(printf '%s\n' "$dst" | sed -e 's/[\/&]/\\&/g') | ||
mkdir "$dst" | ||
|
||
for i in lib/*-"$PLATFORM"."$ext" | ||
do | ||
cp $i $(echo $i | sed -E "s/^(lib\/)(.*)-$PLATFORM(\.$ext)$/$dst_escaped\/\2\3/") | ||
done | ||
|
||
zip "lib/$pkg_name.zip" "$dst"/* | ||
tar -cvzf "lib/$pkg_name.tar.gz" "$dst"/* |