add clhep, cfitsio, ftgl and libverto (#667)

* add clhep

* add cfitsio

* add ftgl

* add libverto

* upload patch

* fix archlinux ci
pull/668/head
Hoildkv 3 years ago committed by GitHub
parent 5f11bb0b3d
commit 0a9e917294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/archlinux.yml
  2. 22
      packages/c/cfitsio/xmake.lua
  3. 129
      packages/c/clhep/patches/2.4.5.1/kind.patch
  4. 35
      packages/c/clhep/xmake.lua
  5. 11
      packages/f/ftgl/patches/2.4.0/cmake.patch
  6. 28
      packages/f/ftgl/xmake.lua
  7. 37
      packages/l/libverto/xmake.lua

@ -12,7 +12,7 @@ jobs:
os: [ubuntu-latest]
kind: [static, shared]
container: archlinux:latest
container: archlinux:base-devel
runs-on: ${{ matrix.os }}
steps:

@ -0,0 +1,22 @@
package("cfitsio")
set_homepage("https://heasarc.gsfc.nasa.gov/fitsio/")
set_description("CFITSIO is a library of C and Fortran subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format.")
add_urls("https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfit-$(version).zip")
add_versions("4.0.0", "b70423f831dc28919c56ff37baebb50b1eaca665ca8ca34094cb58b60c482386")
add_deps("cmake", "zlib")
if is_plat("windows") then
add_defines("WIN32")
end
on_install("windows", "macosx", "linux", function (package)
local configs = {"-DUSE_CURL=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("fits_read_wcstab", {includes = "fitsio.h"}))
end)

@ -0,0 +1,129 @@
diff --git a/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake b/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake
--- a/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake
+++ b/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake
@@ -30,29 +30,22 @@ macro(clhep_build_library package)
endif()
# Add the libraries and set properties
- ADD_LIBRARY(${package} SHARED ${CLHEP_${package}_SOURCES})
- ADD_LIBRARY(${package}S STATIC ${CLHEP_${package}_SOURCES})
+ ADD_LIBRARY(${package} ${CLHEP_${package}_SOURCES})
SET_TARGET_PROPERTIES (${package}
PROPERTIES
OUTPUT_NAME CLHEP-${package}-${VERSION}
)
- SET_TARGET_PROPERTIES(${package}S
- PROPERTIES
- OUTPUT_NAME CLHEP-${package}-${VERSION}
- )
# Do not add -Dname_EXPORTS to the command-line when building files in this
# target. Doing so is actively harmful for the modules build because it
# creates extra module variants, and not useful because we don't use these
# macros.
SET_TARGET_PROPERTIES(${package} PROPERTIES DEFINE_SYMBOL "")
- SET_TARGET_PROPERTIES(${package}S PROPERTIES DEFINE_SYMBOL "")
target_link_libraries(${package} ${package_library_list} )
- target_link_libraries(${package}S ${package_library_list_static} )
# Install the libraries
- INSTALL (TARGETS ${package} ${package}S
+ INSTALL (TARGETS ${package}
EXPORT CLHEPLibraryDepends
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
@@ -69,26 +62,20 @@ macro(clhep_build_libclhep )
endforeach()
##message( STATUS "clheplib source list ${clhep_sources}" )
- ADD_LIBRARY (CLHEP SHARED ${clhep_sources})
- ADD_LIBRARY (CLHEPS STATIC ${clhep_sources})
+ ADD_LIBRARY (CLHEP ${clhep_sources})
SET_TARGET_PROPERTIES(CLHEP
PROPERTIES
OUTPUT_NAME CLHEP-${VERSION}
)
- SET_TARGET_PROPERTIES(CLHEPS
- PROPERTIES
- OUTPUT_NAME CLHEP-${VERSION}
- )
# Do not add -Dname_EXPORTS to the command-line when building files in this
# target. Doing so is actively harmful for the modules build because it
# creates extra module variants, and not useful because we don't use these
# macros.
SET_TARGET_PROPERTIES(CLHEP PROPERTIES DEFINE_SYMBOL "")
- SET_TARGET_PROPERTIES(CLHEPS PROPERTIES DEFINE_SYMBOL "")
# export creates library dependency files for CLHEPConfig.cmake
- INSTALL(TARGETS CLHEP CLHEPS
+ INSTALL(TARGETS CLHEP
EXPORT CLHEPLibraryDepends
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
@@ -98,19 +85,28 @@ macro(clhep_build_libclhep )
if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
# copy
+ if( NOT BUILD_SHARED_LIBS )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
+ else()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin\" )" )
+ endif()
else()
# create the symbolic links
+ if( NOT BUILD_SHARED_LIBS )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
+ else()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
"execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
+ endif()
endif()
+ if( NOT BUILD_SHARED_LIBS )
INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink )
+ else()
INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink )
+ endif()
endmacro(clhep_build_libclhep )
diff --git a/CLHEP/cmake/Modules/ClhepBuildTest.cmake b/CLHEP/cmake/Modules/ClhepBuildTest.cmake
--- a/CLHEP/cmake/Modules/ClhepBuildTest.cmake
+++ b/CLHEP/cmake/Modules/ClhepBuildTest.cmake
@@ -26,14 +26,14 @@ macro( clhep_test testname )
if( CTST_NOLIB )
set(package_library_list)
else()
- set( package_library_list ${PACKAGE}S)
+ set( package_library_list ${PACKAGE})
#set( package_library_list ${PROJECT_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${PACKAGE}-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} )
endif()
if( ${PACKAGE}_DEPS )
foreach ( dep ${${PACKAGE}_DEPS} )
##message( STATUS "clhep_test ${testname} will use ${dep}")
- list(APPEND package_library_list ${PACKAGE}S)
+ list(APPEND package_library_list ${PACKAGE})
#list(APPEND package_library_list ${PROJECT_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${dep}-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} )
endforeach()
endif()
diff --git a/CLHEP/cmake/Modules/ClhepToolchain.cmake b/CLHEP/cmake/Modules/ClhepToolchain.cmake
--- a/CLHEP/cmake/Modules/ClhepToolchain.cmake
+++ b/CLHEP/cmake/Modules/ClhepToolchain.cmake
@@ -53,11 +53,8 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/CLHEPConfig.cmake.in
# This file is include()d by CLHEPConfig.cmake
# First build up list of all modular targets, static and shared
set(CLHEP_libraries_all ${CLHEP_libraries})
-foreach(_lib ${CLHEP_libraries})
- list(APPEND CLHEP_libraries_all "${_lib}S")
-endforeach()
-export(TARGETS CLHEP CLHEPS ${CLHEP_libraries_all}
+export(TARGETS CLHEP ${CLHEP_libraries_all}
NAMESPACE "CLHEP::"
FILE ${PROJECT_BINARY_DIR}/CLHEPLibraryDepends.cmake
)

@ -0,0 +1,35 @@
package("clhep")
set_homepage("https://proj-clhep.web.cern.ch/proj-clhep/")
set_description("CLHEP - A Class Library for High Energy Physics")
set_license("LGPL-3.0")
add_urls("https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-$(version).tgz", {version = function (version) return version:gsub("%+", ".") end})
add_versions("2.4.5+1", "2517c9b344ad9f55974786ae6e7a0ef8b22f4abcbf506df91194ea2299ce3813")
add_patches("2.4.5+1", path.join(os.scriptdir(), "patches", "2.4.5.1", "kind.patch"), "60a65bbe05380f6cd89752bdd662bd1685a8944081c97746f7a0bd2d046edf9d")
if is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
add_deps("cmake")
on_install("windows", "macosx", "linux", function (package)
os.cd("CLHEP")
if package:is_plat("windows") then
io.replace("cmake/Modules/ClhepVariables.cmake", "/MD", "/" .. package:config("vs_runtime"), {plain = true})
end
local configs = {"-DCLHEP_BUILD_DOCS=OFF", "-DLIB_SUFFIX="}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
HepGeom::Point3D<float> point(1, 2, 3);
point.set(4, 5, 6);
}
]]}, {configs = {languages = "c++11"}, includes = "CLHEP/Geometry/Point3D.h"}))
end)

@ -0,0 +1,11 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -26,7 +26,6 @@ SET(libftgl_la_SOURCES
FTGlyphContainer.h
FTInternals.h
FTLibrary.cpp
- FTLibrary.h
FTList.h
FTPoint.cpp
FTSize.cpp

@ -0,0 +1,28 @@
package("ftgl")
set_homepage("https://github.com/frankheckenbach/ftgl")
set_description("FTGL is a free open source library to enable developers to use arbitrary fonts in their OpenGL applications.")
set_license("MIT")
add_urls("https://github.com/frankheckenbach/ftgl/archive/refs/tags/$(version).tar.gz")
add_versions("v2.4.0", "aa97da1c3442a8fd3941037655df18016d70b5266381c81d81e8b5335f196ea8")
add_patches("v2.4.0", path.join(os.scriptdir(), "patches", "2.4.0", "cmake.patch"), "9006ccfba2632c5ffee50c76f163a98d9867a3e11c6390c14ed07ab401a85f29")
add_deps("cmake", "freetype", "opengl")
on_load("windows", function (package)
if not package:config("shared") then
package:add("defines", "FTGL_LIBRARY_STATIC")
end
end)
on_install("windows", "macosx", "linux", function (package)
local configs = {"-DBUILD_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cxxtypes("FTPixmapFont", {includes = "FTGL/ftgl.h"}))
end)

@ -0,0 +1,37 @@
package("libverto")
set_homepage("https://github.com/latchset/libverto")
set_description("An async event loop abstraction library")
set_license("MIT")
add_urls("https://github.com/latchset/libverto/releases/download/$(version)/libverto-$(version).tar.gz")
add_versions("0.3.2", "8d1756fd704f147549f606cd987050fb94b0b1ff621ea6aa4d6bf0b74450468a")
local cdeps = {"glib", "libev", "libevent"}
for _, cdep in ipairs(cdeps) do
add_configs(cdep, {description = "Enable " .. cdep .. " support.", default = false, type = "boolean"})
end
on_load("macosx", "linux", function (package)
for _, cdep in ipairs(cdeps) do
if package:config(cdep) then
package:add("deps", cdep)
end
end
end)
on_install("macosx", "linux", function (package)
local configs = {"--disable-dependency-tracking"}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
for _, cdep in ipairs(cdeps) do
table.insert(configs, "--with-" .. cdep .. "=" .. (package:config(cdep) and "yes" or "no"))
end
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package)
end)
on_test(function (package)
assert(package:has_cfuncs("verto_get_supported_types", {includes = "verto-module.h"}))
end)
Loading…
Cancel
Save