www-apps/laminar: new package, add 1.3

Signed-off-by: Ferenc Erki <erkiferenc@gmail.com>
This commit is contained in:
Ferenc Erki
2023-07-25 20:51:25 +02:00
parent af06ff64bd
commit 4dddb9e174
7 changed files with 190 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
DIST laminar-1.3-Chart.min-3.9.1.js 199560 BLAKE2B 58a0db202c549422b5d6745fd61b76ae19df01b1dab1fd1d92eb0a7fa2925508b133dca858f2ca1f3c310fd1af900c66a11dc9f35ff14246ef1d81031b1d75b0 SHA512 125445a0441d2391edea466fcb35e1606f4daa3b649a591f624d30afac07c54f491076a44bb50964d7a697900b93ef082a553a8c380c69b0b7be4ba646892024
DIST laminar-1.3-ansi_up-4.0.4.js 22159 BLAKE2B 8c3e3b2e42211bcf2fa56e327ba717ff0150b9d04b6f1ca420f22b976b3beb094f691c96aec9656dbe802a4558900ea8d5415a032ff1034b0f76274fb618f41a SHA512 34c8cb74f687abc77ab84c4a504a04d9b334e9224ceffd35e6e3b31f0ff1c59ee3ddb239e5d731b6839de00485d47db34f338e2943affba04a80f6ecb43eafc3
DIST laminar-1.3-vue.min-2.6.12.js 93670 BLAKE2B f5b988596e9a9b7fc150813c4f58ab92a47a6063a2de1b6de4f272a00c92a73a7ef033f99c1bb305d110d9912bee29c84dfc40bb19017aeb343719cc0bb426db SHA512 04a6d247e71fcb12dd300b04d2768b45e1522e0f3fa636e07f11e1fe4fe4502f361f2eebe87b51e612e1a1b6a59f681c4efce4cb27a1add444763a6c430cb627
DIST laminar-1.3.tar.gz 103260 BLAKE2B eb5a926da90c9abd304f0b717c18d5ef2254afa741d7e6dce79f8aa93b68cd1c84c1771828252ab050d9aea6bc17ded4b79948427b542ab3c96852830311eeda SHA512 cdcf3544e641bf6250361e8b693de90300014d86ed1053e65a2670243b8901707c16c274ea63cebb613943fa81a9a9037778a00ad4a1296c3f7efb2888fe52a3

View File

@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d32228a..72c4cbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,8 +16,8 @@
### You should have received a copy of the GNU General Public License
### along with Laminar. If not, see <http://www.gnu.org/licenses/>
###
-project(laminar)
cmake_minimum_required(VERSION 3.6)
+project(laminar)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)

View File

@@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 614f5b3..7301c5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,14 +82,7 @@ add_custom_command(OUTPUT index_html_size.h
COMMAND sh -c '( echo -n "\\#define INDEX_HTML_UNCOMPRESSED_SIZE " && wc -c < "${CMAKE_SOURCE_DIR}/src/resources/index.html" ) > index_html_size.h'
DEPENDS src/resources/index.html)
-# Download 3rd-party frontend JS libs...
-file(DOWNLOAD https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.12/vue.min.js
- js/vue.min.js EXPECTED_MD5 fb192338844efe86ec759a40152fcb8e)
-file(DOWNLOAD https://raw.githubusercontent.com/drudru/ansi_up/v4.0.4/ansi_up.js
- js/ansi_up.js EXPECTED_MD5 b31968e1a8fed0fa82305e978161f7f5)
-file(DOWNLOAD https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js
- js/Chart.min.js EXPECTED_MD5 7dd5ea7d2cf22a1c42b43c40093d2669)
-# ...and compile them
+# Compile 3rd-party frontend JS libs
generate_compressed_bins(${CMAKE_BINARY_DIR} js/vue.min.js
js/ansi_up.js js/Chart.min.js)
# (see resources.cpp where these are fetched)

View File

@@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7301c5b..d32228a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,17 +111,8 @@ add_executable(laminarc src/client.cpp src/version.cpp laminar.capnp.c++)
target_link_libraries(laminarc capnp-rpc capnp kj-async kj pthread)
## Manpages
-macro(gzip SOURCE)
- get_filename_component(OUT_FILE ${SOURCE} NAME)
- add_custom_command(OUTPUT ${OUT_FILE}.gz
- COMMAND gzip < ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} > ${OUT_FILE}.gz
- DEPENDS ${SOURCE})
-endmacro()
-add_custom_target(laminar-manpages ALL DEPENDS laminard.8.gz laminarc.1.gz)
-gzip(etc/laminard.8)
-gzip(etc/laminarc.1)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/laminard.8.gz DESTINATION share/man/man8)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/laminarc.1.gz DESTINATION share/man/man1)
+install(FILES etc/laminard.8 DESTINATION share/man/man8)
+install(FILES etc/laminarc.1 DESTINATION share/man/man1)
## Tests
set(BUILD_TESTS FALSE CACHE BOOL "Build tests")

View File

@@ -0,0 +1,30 @@
#!/sbin/openrc-run
# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="Laminar daemon"
description="Fast and lightweight Continuous Integration"
command=/usr/sbin/laminard
pidfile=/run/laminar.pid
command_background="true"
command_user="laminar:laminar"
depend() {
need localmount
}
start_pre() {
local env
local env_args
OIFS=$IFS
IFS=$'\n'
for env in $(set | grep ^LAMINAR_); do
env_args="${env_args} --env ${env}"
done
IFS=$OIFS
start_stop_daemon_args="${start_stop_daemon_args} ${env_args}"
}

View File

@@ -0,0 +1,87 @@
# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
CMAKE_BUILD_TYPE=Release
CMAKE_IN_SOURCE_BUILD=1
declare -A BUNDLED_VERSION_FOR
BUNDLED_VERSION_FOR[vue.min]=2.6.12
BUNDLED_VERSION_FOR[ansi_up]=4.0.4
BUNDLED_VERSION_FOR[Chart.min]=3.9.1
DESCRIPTION="Fast and lightweight Continuous Integration"
HOMEPAGE="https://laminar.ohwg.net https://github.com/ohwgiles/laminar"
SRC_URI="
https://github.com/ohwgiles/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
https://cdnjs.cloudflare.com/ajax/libs/vue/${BUNDLED_VERSION_FOR[vue.min]}/vue.min.js -> ${P}-vue.min-${BUNDLED_VERSION_FOR[vue.min]}.js
https://raw.githubusercontent.com/drudru/ansi_up/v${BUNDLED_VERSION_FOR[ansi_up]}/ansi_up.js -> ${P}-ansi_up-${BUNDLED_VERSION_FOR[ansi_up]}.js
https://cdnjs.cloudflare.com/ajax/libs/Chart.js/${BUNDLED_VERSION_FOR[Chart.min]}/chart.min.js -> ${P}-Chart.min-${BUNDLED_VERSION_FOR[Chart.min]}.js
"
LICENSE="GPL-3 MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
COMMON_DEPS="
dev-db/sqlite:3
dev-libs/capnproto
sys-libs/zlib
"
DEPEND="
${COMMON_DEPS}
dev-libs/boost
dev-libs/rapidjson
test? ( dev-cpp/gtest )
"
RDEPEND="
${COMMON_DEPS}
acct-group/laminar
acct-user/laminar
"
PATCHES=(
"${FILESDIR}/${P}-skip-js-download.patch"
"${FILESDIR}/${P}-skip-manpage-compression.patch"
"${FILESDIR}/${P}-fix-cmake-warning.patch"
)
src_unpack() {
unpack "${P}.tar.gz"
mkdir "${S}/js" || die
local dep
for dep in vue.min ansi_up Chart.min; do
cp "${DISTDIR}/${P}-${dep}-${BUNDLED_VERSION_FOR[$dep]}.js" "${S}/js/${dep}.js" || die
done
}
src_configure() {
local mycmakeargs=(
-DLAMINAR_VERSION=${PV}
-DBUILD_TESTS=$(usex test)
)
cmake_src_configure
}
src_test() {
./laminar-tests || die
}
src_install() {
newinitd "${FILESDIR}/laminar.initd" laminar
dosym -r /etc/laminar.conf /etc/conf.d/laminar
cmake_src_install
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>erkiferenc@gmail.com</email>
<name>Ferenc Erki</name>
</maintainer>
<upstream>
<remote-id type="github">ohwgiles/laminar</remote-id>
</upstream>
</pkgmetadata>