summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Joruk2017-11-29 22:48:05 +0000
committerSteven Joruk2017-12-01 20:51:18 +0000
commit602b8f80a76bc5cf2f6b32dfdbc51ab08fc260d7 (patch)
tree21798fc34b6aa0a7777ce3f167435dbca75a9f48
downloadaur-602b8f80a76bc5cf2f6b32dfdbc51ab08fc260d7.tar.gz
Initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--0001-Add-CMake-install.patch77
-rw-r--r--PKGBUILD49
3 files changed, 142 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b9979a08ab32
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = gumbo-gq-git
+ pkgdesc = GQ is a CSS Selector Engine for Gumbo Parser written in C++11
+ pkgver = r138.f2051cc
+ pkgrel = 1
+ arch = x86_64
+ license = MIT
+ makedepends = cmake
+ makedepends = git
+ conflicts = gumbo-gq
+ source = gumbo-gq::git://github.com/TechnikEmpire/GQ.git
+ source = 0001-Add-CMake-install.patch
+ md5sums = SKIP
+ md5sums = 2a050ea524fdceac7c6af6596b7d9c80
+
+pkgname = gumbo-gq-git
+
diff --git a/0001-Add-CMake-install.patch b/0001-Add-CMake-install.patch
new file mode 100644
index 000000000000..3edaa044c151
--- /dev/null
+++ b/0001-Add-CMake-install.patch
@@ -0,0 +1,77 @@
+From fc943805cc2da8e7b715feea81ffd0038d39a9f0 Mon Sep 17 00:00:00 2001
+From: Steven Joruk <steven@joruk.com>
+Date: Fri, 1 Dec 2017 20:12:19 +0000
+Subject: [PATCH] Add CMake install
+
+---
+ CMakeLists.txt | 22 +++++++++++++++++++++-
+ GQ.pc.in | 13 +++++++++++++
+ 2 files changed, 34 insertions(+), 1 deletion(-)
+ create mode 100644 GQ.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7525ce3..aaeae60 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,6 +2,8 @@
+ # This is meant to be used within a cmake project
+ cmake_minimum_required(VERSION 3.0)
+
++set(PROJECT_VERSION 1.0.0)
++
+ if(UNIX)
+
+ # C++14
+@@ -15,6 +19,8 @@ pkg_check_modules(GUMBO REQUIRED gumbo)
+ include_directories(${GUMBO_INCLUDE_DIRS})
+ link_directories(${GUMBO_LIBRARY_DIRS})
+
++file(GLOB_RECURSE HEADERS "src/*.hpp")
++
+ add_library(GQ SHARED
+
+ src/AttributeSelector.cpp
+@@ -50,6 +56,20 @@ add_library(GQ SHARED
+
+ target_link_libraries(GQ ${GUMBO_LIBRARIES})
+
++set_target_properties(GQ PROPERTIES PUBLIC_HEADER "${HEADERS}")
+
++configure_file(
++ "${CMAKE_CURRENT_SOURCE_DIR}/GQ.pc.in"
++ "${CMAKE_CURRENT_BINARY_DIR}/GQ.pc" @ONLY
++)
+
+-
++install(
++ TARGETS GQ
++ LIBRARY DESTINATION lib
++ PUBLIC_HEADER DESTINATION include/GQ
++)
++
++install(
++ FILES "${CMAKE_CURRENT_BINARY_DIR}/GQ.pc"
++ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig"
++)
+diff --git a/GQ.pc.in b/GQ.pc.in
+new file mode 100644
+index 0000000..969b128
+--- /dev/null
++++ b/GQ.pc.in
+@@ -0,0 +1,13 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
++sharedlibdir=${libdir}
++includedir=${prefix}/include/GQ
++
++Name: GQ
++Description: A C++ CSS Selector Engine for Gumbo Parser
++Version: @PROJECT_VERSION@
++
++Requires:
++Libs: -L${libdir} -L${sharedlibdir} -lGQ
++Cflags: -I${includedir}
+--
+2.15.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5c4db97a54a4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer: Steven Joruk <steven@joruk.com>
+
+pkgname=gumbo-gq-git
+pkgver=r138.f2051cc
+pkgrel=1
+pkgdesc="GQ is a CSS Selector Engine for Gumbo Parser written in C++11"
+url=""
+arch=("x86_64")
+license=("MIT")
+makedepends=("cmake" "git")
+depends=("gumbo-git")
+
+source=(
+ "${pkgname%-git}"::"git://github.com/TechnikEmpire/GQ.git"
+ "0001-Add-CMake-install.patch"
+)
+
+md5sums=(
+ "SKIP"
+ "2a050ea524fdceac7c6af6596b7d9c80"
+)
+
+pkgver() {
+ cd "$srcdir/${pkgname%-git}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/${pkgname%-git}"
+ patch -Np1 -i "$srcdir/0001-Add-CMake-install.patch"
+}
+
+build() {
+ cd "$srcdir/${pkgname%-git}"
+
+ mkdir -p build
+ cd build
+
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib
+
+ make
+}
+
+package() {
+ cd "$srcdir/${pkgname%-git}/build"
+ make DESTDIR="$pkgdir" install
+}