summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorGreyson Christoforo2021-01-15 15:28:06 +0000
committerGreyson Christoforo2021-01-15 15:28:06 +0000
commitcf02b819e111d58e248043320aea8727e1525e6d (patch)
tree4cd66d82aaac42cf82ff143b1cc55aa11d51dad8 /PKGBUILD
parent25ae84565dd554865a89c451144df79cbca8a17a (diff)
downloadaur-cf02b819e111d58e248043320aea8727e1525e6d.tar.gz
stop shallow cloning
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD44
1 files changed, 11 insertions, 33 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bbea4e7601cc..d38f563c7153 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,65 +2,43 @@
pkgname=kicad-packages3d-git
_gitlab_repo=kicad/libraries/kicad-packages3D
-pkgver=20201014.0.1602698909
+pkgver=5.1.6.r26.gd8b7e8c5
pkgrel=1
pkgdesc="KiCad component 3D model libraries from the official git repo"
arch=('any')
-url=https://gitlab.com/${_gitlab_repo}
+url=https://gitlab.com/kicad/libraries/kicad-packages3D
license=('GPL')
options=('!strip')
makedepends=(
cmake
git
ninja
-jq
-curl
)
conflicts=('kicad-library-bzr' 'kicad-library-git' 'kicad-library-3d' 'kicad-library' 'kicad-packages' 'kicad-packages3d')
provides=('kicad-packages3d')
-source=()
-
-# do a shallow clone because the whole history here is annoying
-prepare(){
- if [ -d $(basename ${_gitlab_repo}) ]; then
- cd $(basename ${_gitlab_repo})
- git fetch --depth 1
- git checkout master
- else
- git clone --depth 1 https://gitlab.com/${_gitlab_repo}.git
- fi
-}
+source=(git+https://gitlab.com/kicad/libraries/kicad-packages3D)
+sha256sums=('SKIP')
pkgver() {
- cd $(basename ${_gitlab_repo})
- # since we did a shallow clone in prepare, we need to find a way to version this...
- local _gitlab_repo_id=$(printf "${_gitlab_repo}" | jq -sRr @uri)
- local _latest_commit_timestamp=$(curl -s "https://gitlab.com/api/v4/projects/${_gitlab_repo_id}/repository/commits" | jq -r '.[0]["created_at"]')
-
- local _version_day=$(date --date=${_latest_commit_timestamp} +'%Y%m%d')
- local _version_epoch=$(date --date=${_latest_commit_timestamp} +"%s")
-
- # notes for github repos
- #_num_commits=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/octocat/hello-world/stats/code_frequency" | jq -r '. | length')
-
- printf "%s.0.%s" "${_version_day}" "${_version_epoch}"
+ cd kicad-packages3D
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
- cd $(basename ${_gitlab_repo})
+ cd kicad-packages3D
cmake \
- -B "${srcdir}"/build_dir \
+ -B build_dir \
-D CMAKE_BUILD_TYPE=None \
-D CMAKE_INSTALL_PREFIX=/usr \
-G Ninja \
-S .
- cmake --build "${srcdir}"/build_dir
+ cmake --build build_dir
}
package() {
- cd $(basename ${_gitlab_repo})
- DESTDIR="${pkgdir}" cmake --build "${srcdir}/build_dir" -- install
+ cd kicad-packages3D
+ DESTDIR="${pkgdir}" cmake --build build_dir -- install
install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 LICENSE.md
}