summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD46
-rw-r--r--cmake.patch31
3 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..876a34445c68
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = autotidy-git
+ pkgdesc = Speedier handling of clang-tidy checking
+ pkgver = 43.d77d67b
+ pkgrel = 1
+ url = https://github.com/sasq64/autotidy
+ arch = any
+ license = MIT
+ makedepends = cmake
+ makedepends = git
+ depends = yaml-cpp
+ depends = fmt
+ depends = cli11
+ provides = autotidy
+ source = git+https://github.com/sasq64/autotidy.git
+ source = git+https://github.com/abseil/abseil-cpp.git
+ source = cmake.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 930244a70099ebf81174c88114fd9aa67b6807e2149dcab221c0653d262d51f2
+
+pkgname = autotidy-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f92e5fbfa9b2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Afnan Enayet <afnan at afnan dot io>
+pkgname='autotidy-git'
+_pkgname='autotidy'
+pkgver='43.d77d67b'
+pkgrel='1'
+pkgdesc="Speedier handling of clang-tidy checking"
+provides=('autotidy')
+depends=('yaml-cpp' 'fmt' 'cli11')
+makedepends=('cmake' 'git')
+arch=('any')
+sha256sums=('SKIP'
+ 'SKIP'
+ '930244a70099ebf81174c88114fd9aa67b6807e2149dcab221c0653d262d51f2')
+url='https://github.com/sasq64/autotidy'
+license=('MIT')
+source=('git+https://github.com/sasq64/autotidy.git'
+ 'git+https://github.com/abseil/abseil-cpp.git'
+ 'cmake.patch')
+
+pkgver() {
+ cd ${_pkgname}
+ printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd ${_pkgname}
+ patch --forward --strip=1 --input="${srcdir}/cmake.patch"
+ git submodule init
+ git config submodule.abseil-cpp.url $srcdir/abseil-cpp
+ git submodule update external/abseil-cpp
+}
+
+build() {
+ cd ${_pkgname}
+ mkdir -p build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
+ make -j$(nproc)
+}
+
+package() {
+ mkdir -p $pkgdir/usr/bin
+ cd ${_pkgname}
+ ls
+ cp build/autotidy $pkgdir/usr/bin
+}
diff --git a/cmake.patch b/cmake.patch
new file mode 100644
index 000000000000..a084ea928fec
--- /dev/null
+++ b/cmake.patch
@@ -0,0 +1,31 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 139e9dc..3c12546 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,14 +43,17 @@ add_library(Warnings INTERFACE)
+ target_compile_options(Warnings INTERFACE ${WARNINGS})
+
+ # External dependencies
+-add_subdirectory(external/fmt)
++find_package(fmt)
++find_package(yaml-cpp)
++find_package(CLI11)
++#add_subdirectory(external/fmt)
+ add_subdirectory(external/abseil-cpp)
+-add_subdirectory(external/CLI11)
++#add_subdirectory(external/CLI11)
+ set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing")
+ set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Enable parse tools")
+ set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Enable contrib stuff in library")
+ set(YAML_CPP_INSTALL OFF CACHE BOOL "Enable generation of install target")
+-add_subdirectory(external/yaml-cpp)
++#add_subdirectory(external/yaml-cpp)
+
+ add_executable(testcode src/testcode.cpp)
+ target_link_libraries(testcode PRIVATE Warnings fmt absl::strings)
+@@ -62,4 +65,4 @@ add_executable(tidytest src/testmain.cpp src/patched_file.test.cpp)
+ target_link_libraries(tidytest PRIVATE Warnings absl::strings absl::algorithm)
+
+ add_executable(autotidy src/main.cpp src/autotidy.cpp src/manpages.cpp)
+-target_link_libraries(autotidy PRIVATE Warnings fmt absl::strings CLI11 yaml-cpp)
++target_link_libraries(autotidy PRIVATE Warnings fmt absl::strings yaml-cpp)