File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ results /
Original file line number Diff line number Diff line change
1
+ pkg_name=git-subsplit
2
+ pkg_origin=dflydev
3
+ pkg_maintainer=" Beau Simensen <hello@dflydev.com>"
4
+ pkg_license=(" MIT" )
5
+ pkg_upstream_url=https://github.com/dflydev/git-subsplit
6
+
7
+ pkg_build_deps=(
8
+ core/git
9
+ )
10
+
11
+ pkg_deps=(
12
+ core/bash
13
+ )
14
+
15
+ pkg_bin_dirs=(bin)
16
+
17
+
18
+ # implement git-based dynamic version strings
19
+ pkg_version () {
20
+ if [ -n " ${pkg_last_tag} " ]; then
21
+ echo " ${pkg_last_version} -git+${pkg_last_tag_distance} .${pkg_commit} "
22
+ else
23
+ echo " ${pkg_last_version} -git+${pkg_commit} "
24
+ fi
25
+ }
26
+
27
+
28
+ # implement in-git build workflow
29
+ do_before () {
30
+ do_default_before
31
+
32
+ # configure git repository
33
+ export GIT_DIR=" ${PLAN_CONTEXT} /../.git"
34
+
35
+ # load version information from git
36
+ pkg_commit=" $( git rev-parse --short HEAD) "
37
+ pkg_last_tag=" $( git describe --tags --abbrev=0 ${pkg_commit} || true 2> /dev/null) "
38
+
39
+ if [ -n " ${pkg_last_tag} " ]; then
40
+ pkg_last_version=${pkg_last_tag# v}
41
+ pkg_last_tag_distance=" $( git rev-list ${pkg_last_tag} ..${pkg_commit} --count) "
42
+ else
43
+ pkg_last_version=" 0.0.0"
44
+ fi
45
+
46
+ # initialize pkg_version
47
+ update_pkg_version
48
+ }
49
+
50
+ do_unpack () {
51
+ mkdir " ${CACHE_PATH} "
52
+ build_line " Extracting ${GIT_DIR} #${pkg_commit} "
53
+ git archive " ${pkg_commit} " | tar -x --directory=" ${CACHE_PATH} "
54
+ }
55
+
56
+ do_build () {
57
+ pushd " ${CACHE_PATH} " > /dev/null
58
+
59
+ build_line " Fixing interpreter"
60
+ sed -e " s#\#\!/usr/bin/env bash#\#\!$( pkg_path_for bash) /bin/bash#" --in-place " ./git-subsplit.sh"
61
+
62
+ popd > /dev/null
63
+ }
64
+
65
+ do_install () {
66
+ cp -v " ${CACHE_PATH} /git-subsplit.sh" " ${pkg_prefix} /bin/git-subsplit"
67
+ }
68
+
69
+ do_strip () {
70
+ return 0
71
+ }
You can’t perform that action at this time.
0 commit comments