From 5779c6e369e71b55f3b2a0a106d07be1d1e253e9 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 16 Feb 2024 14:18:11 +0800 Subject: [PATCH] Fix #8038 - switch to meson --- .gitignore | 1 + .roobuilder.jcfg | 71 +++++ CMakeLists.txt | 120 -------- ChangeLog | 12 +- INSTALL | 9 +- README.md | 11 +- autogen.sh | 11 - bin/CMakeLists.txt | 65 ----- cmake/AddCompilerFlags.cmake | 186 ------------ cmake/FindGLib.cmake | 257 ----------------- cmake/FindGObjectIntrospection.cmake | 62 ---- cmake/FindVala.cmake | 409 --------------------------- cmake/FindValadoc.cmake | 96 ------- config1.builder | 52 ---- configure | 322 --------------------- debian/README | 6 - debian/README.Debian | 4 +- debian/README.source | 6 +- debian/changelog | 12 +- debian/compat | 1 - debian/control | 14 +- debian/copyright | 43 ++- debian/files | 6 +- debian/manpage.1.ex | 6 +- debian/manpage.md.ex | 126 +++++++++ debian/manpage.sgml.ex | 10 +- debian/manpage.xml.ex | 6 +- debian/menu.ex | 2 - debian/postinst.ex | 22 +- debian/postrm.ex | 26 +- debian/preinst.ex | 18 +- debian/prerm.ex | 22 +- debian/roojspacker-docs.docs | 1 - debian/roojspacker.cron.d.ex | 2 +- debian/roojspacker.debhelper.log | 1 - debian/roojspacker.doc-base.EX | 20 -- debian/roojspacker.substvars | 2 +- debian/rules | 28 +- debian/salsa-ci.yml.ex | 11 + debian/source/format | 2 +- debian/upstream/metadata.ex | 10 + debian/watch.ex | 37 +++ meson.build | 110 +++++++ old_deb_control | 17 ++ roojspacker/CMakeLists.txt | 171 ----------- roojspacker/CompressWhite.vala | 2 +- roojspacker/Lang.vala | 5 +- roojspacker/Packer.vala | 110 +++---- roojspacker/ScopeParser.vala | 9 +- 49 files changed, 599 insertions(+), 1953 deletions(-) create mode 100644 .roobuilder.jcfg delete mode 100644 CMakeLists.txt delete mode 100755 autogen.sh delete mode 100644 bin/CMakeLists.txt delete mode 100644 cmake/AddCompilerFlags.cmake delete mode 100644 cmake/FindGLib.cmake delete mode 100644 cmake/FindGObjectIntrospection.cmake delete mode 100644 cmake/FindVala.cmake delete mode 100644 cmake/FindValadoc.cmake delete mode 100644 config1.builder delete mode 100755 configure delete mode 100644 debian/README delete mode 100644 debian/compat create mode 100644 debian/manpage.md.ex delete mode 100644 debian/menu.ex delete mode 100644 debian/roojspacker.debhelper.log delete mode 100644 debian/roojspacker.doc-base.EX create mode 100644 debian/salsa-ci.yml.ex create mode 100644 debian/upstream/metadata.ex create mode 100644 debian/watch.ex create mode 100644 meson.build create mode 100644 old_deb_control delete mode 100644 roojspacker/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 6326733..b08aa9a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build/ debian/.debhelper/ debian/roojspacker/ obj-x86_64-linux-gnu/ +.gdb_history diff --git a/.roobuilder.jcfg b/.roobuilder.jcfg new file mode 100644 index 0000000..1e9d8fa --- /dev/null +++ b/.roobuilder.jcfg @@ -0,0 +1,71 @@ +{ + "xtype" : "Gtk", + "compilegroups" : [ + { + "name" : "roojspacker", + "is_library" : false, + "execute_args" : "", + "sources" : [ + "roojspacker/Collapse.vala", + "roojspacker/CompressWhite.vala", + "roojspacker/DocBuilder.vala", + "roojspacker/DocComment.vala", + "roojspacker/DocParser.vala", + "bin/main.vala", + "roojspacker/DocTag.vala", + "roojspacker/Identifier.vala", + "roojspacker/Lang.vala", + "roojspacker/PackerRun.vala", + "roojspacker/Packer.vala", + "roojspacker/PrettyPrint.vala", + "roojspacker/ScopeParser.vala", + "roojspacker/Scope.vala", + "roojspacker/SymbolSet.vala", + "roojspacker/Symbol.vala", + "roojspacker/TextStream.vala", + "roojspacker/TokenReader.vala", + "roojspacker/TokenStream.vala", + "roojspacker/Token.vala", + "roojspacker/Walker.vala" + ] + }, + { + "name" : "roojspack", + "is_library" : true, + "execute_args" : "", + "sources" : [ + "roojspacker/Collapse.vala", + "roojspacker/CompressWhite.vala", + "roojspacker/DocBuilder.vala", + "roojspacker/DocComment.vala", + "roojspacker/DocParser.vala", + "roojspacker/DocTag.vala", + "roojspacker/Identifier.vala", + "roojspacker/Lang.vala", + "roojspacker/PackerRun.vala", + "roojspacker/Packer.vala", + "roojspacker/PrettyPrint.vala", + "roojspacker/ScopeParser.vala", + "roojspacker/Scope.vala", + "roojspacker/SymbolSet.vala", + "roojspacker/Symbol.vala", + "roojspacker/TextStream.vala", + "roojspacker/TokenReader.vala", + "roojspacker/TokenStream.vala", + "roojspacker/Token.vala", + "roojspacker/Walker.vala" + ] + } + ], + "compile_flags" : "", + "version" : "1.5", + "licence" : "LGPL", + "packages" : [ + "gobject-2.0", + "gio-2.0", + "gio-unix-2.0", + "gee-0.8", + "json-glib-1.0", + "posix" + ] +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 597c468..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,120 +0,0 @@ -project("roojspacker" C CXX) - -cmake_minimum_required(VERSION 3.2) - - -set(PROJECT_WEB "https://www.roojs.com/") -# Where to report bugs; usually either an e-mail address or an issue -# tracker URL. -set(PROJECT_BUGS "https://www.roojs.com/mtrack/") -# Gettext package name -#set(GETTEXT_PACKAGE ${PROJECT_NAME}) - -# Library version -# -# This should be incremented with every release. See semver.org. -set (ROOJSPACKER_VERSION_MAJOR 1) -set (ROOJSPACKER_VERSION_MINOR 4) -set (ROOJSPACKER_VERSION_REVISION 0) - -# API version. -# -# This will go in the pkg-config and shared library names. Should -# only be changed if the API breaks backwards compatibility. -set (ROOJSPACKER_VERSION_API "1.4") -set (ROOJSPACKER_SOVERSION_CURRENT ${ROOJSPACKER_VERSION_MAJOR}) -set (ROOJSPACKER_SOVERSION_REVISION ${ROOJSPACKER_VERSION_MINOR}) -set (ROOJSPACKER_SOVERSION_AGE ${ROOJSPACKER_VERSION_REVISION}) - - - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) - - -find_package(GLib "2.38" REQUIRED) -find_package(Vala "0.36.0" REQUIRED) - - - -find_package(PkgConfig) -pkg_check_modules(GOBJECT REQUIRED gobject-2.0) -pkg_check_modules(GIO REQUIRED gio-2.0) -pkg_check_modules(GEE REQUIRED gee-0.8) -pkg_check_modules(GTHREAD REQUIRED gthread-2.0) -# this was optional?? -pkg_check_modules(JSON REQUIRED json-glib-1.0) - - -set(ROOJSPACKER_VALA_PACKAGES - glib-2.0 - gobject-2.0 - gee-0.8 - posix - gio-2.0 - json-glib-1.0 -) - - - -set(CFLAGS - ${GOBJECT_CFLAGS} ${GOBJECT_CFLAGS_OTHER} - ${GIO_CFLAGS} ${GIO_CFLAGS_OTHER} - ${GTHREAD_CFLAGS} ${GTHREAD_CFLAGS_OTHER} - ${GEE_CFLAGS} ${GEE_CFLAGS_OTHER} - ${JSON_CFLAGS} ${JSON_CFLAGS_OTHER} -) -add_definitions(${CFLAGS}) - - - -if(CMAKE_BUILD_TYPE STREQUAL "") - set(CMAKE_BUILD_TYPE "Debug") -endif(CMAKE_BUILD_TYPE STREQUAL "") - -list(APPEND VALA_COMPILER_FLAGS - "--target-glib=2.38" - "-g" - "--thread" - "--vapidir=${CMAKE_SOURCE_DIR}/vapi" -) -list(APPEND VALA_COMPILER_FLAGs_DEBUG "--debug") -# "-X -shared" -#"-X -lm" - - - -include(AddCompilerFlags) - -global_add_compiler_flags(-Wno-incompatible-pointer-types) - - -set(LIBS - ${GOBJECT_LIBRARIES} - ${GIO_LIBRARIES} - ${GEE_LIBRARIES} - ${GTHREAD_LIBRARIES} - ${JSON_LIBRARIES} -) -link_libraries(${LIBS}) - - -set(LIB_PATHS - ${GOBJECT_LIBRARY_DIRS} - ${GIO_LIBRARY_DIRS} - ${GEE_LIBRARY_DIRS} - ${GTHREAD_LIBRARY_DIRS} - ${JSON_LIBRARY_DIRS} -) -link_directories(${LIB_PATHS}) - -set (LIBRARY_PATH "src") -set(ROOJSPACKER_LIBRARY_NAME ${PROJECT_NAME}-${ROOJSPACKER_VERSION_API}) -set(ROOJSPACKER_PKG_NAME ${PROJECT_NAME}-${ROOJSPACKER_VERSION_API}) - -# Name of the GObject Introspection repository for the library. -set(ROOJSPACKER_GIR_NAME "MyProject-${ROOJSPACKER_VERSION_API}") - -set (LIBRARY_PATH "roojspacker") - -add_subdirectory(roojspacker) -add_subdirectory(bin) diff --git a/ChangeLog b/ChangeLog index 7b99b00..54762e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,11 @@ -Nothing to see here yet... +roojspacker (1.4) UNRELEASED; urgency=medium + + * Upgrading detection of multiple features , including adding child depenancies and value lists etc. + + -- Alan Knowles Mon, 02 May 2022 10:37:20 +0800 + +roojspacker (1.2) unstable; urgency=medium + + * Initial Release. + + -- Alan Thu, 16 May 2019 17:52:08 +0800 diff --git a/INSTALL b/INSTALL index 28814ab..718b5da 100644 --- a/INSTALL +++ b/INSTALL @@ -1,11 +1,10 @@ -## -- this is designed to run make from the 'build' directory.... - it's hard coded in configure (called from autogen) + git clone https://github.com/roojs/roojspacker.git -apt-get install valac cmake gcc libgee-0.8-dev libtool libjson-glib-dev +apt-get install valac meson gcc libgee-0.8-dev libtool libjson-glib-dev cd roojspacker -./autogen.sh --prefix=/usr -cd build -sudo make install \ No newline at end of file +meson setup build +ninja -C build install diff --git a/README.md b/README.md index 1383935..98ef8c3 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,14 @@ Building it. git clone https://github.com/roojs/roojspacker.git - apt-get install valac cmake gcc libgee-0.8-dev libtool libjson-glib-dev + apt-get install valac meson gcc libgee-0.8-dev libtool libjson-glib-dev ## -- this is designed to run make from the 'build' directory.... - it's hard coded in configure (called from autogen) cd roojspacker - ./autogen.sh --prefix=/usr - cd build - sudo make install + meson setup build + ninja -C build install --- @@ -39,7 +38,9 @@ Update Package details. Build it.. - debuild -us -uc + dpkg-buildpackage -rfakeroot -us -uc -b + + diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index b6d4636..0000000 --- a/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Calling this script is basically the same as calling the configure -# script directly, except that if your project uses submodules calling -# this script will automatically initialize them. - -if [ -e $(dirname "$0")/.gitmodules ]; then - (cd "$(dirname "$0")" && git submodule update --init --recursive) -fi - -$(dirname $0)/configure "$@" \ No newline at end of file diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt deleted file mode 100644 index 6fcf8e6..0000000 --- a/bin/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# -# -# Main target -set(ROOJSPACKER_MAIN_VALA_SOURCES - main.vala) - - -set(ROOJS_VALA_CUSTOM_VAPIS - ${CMAKE_BINARY_DIR}/${LIBRARY_PATH}/${ROOJSPACKER_PKG_NAME}.vapi) - -set(ROOJSPACKER_VALA_PACKAGES - glib-2.0 - gobject-2.0 - gee-0.8 - posix - gio-2.0 - json-glib-1.0 -) - - -# Compile Vala sources to C -vala_precompile_target( - "${PROJECT_NAME}-valabin" - ROOJSPACKER_MAIN_C_SOURCES - ${ROOJS_VALA_CUSTOM_VAPIS} - ${ROOJSPACKER_MAIN_VALA_SOURCES} - PACKAGES ${ROOJSPACKER_VALA_PACKAGES} - DEPENDS "${ROOJSPACKER_LIBRARY_NAME}-vala") - -# Tell CMake to create an executable named "my-project" -add_executable(${PROJECT_NAME} - ${ROOJSPACKER_MAIN_C_SOURCES}) - -# Make sure the Vala sources are compiled to C before attempting to -# build the executable. -add_dependencies("${PROJECT_NAME}" "${PROJECT_NAME}-valabin") - -# We need to add the directory where the C header for our library is -# installed, otherwise we'll get an error from the C compiler. -set_target_properties(${PROJECT_NAME} PROPERTIES - INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/roojspacker) - -# Any libraries that your tests need to link to should go here. -# Usually this will just be your library. -target_link_libraries(${PROJECT_NAME} - ${ROOJSPACKER_LIBRARY_NAME}) - -# Install the executable. -install (TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION bin # On Windows, the DLL goes in the same place as the executables - LIBRARY DESTINATION lib # This is where shared libraries (*.so on Linux, *.dynlib on OS X) - ARCHIVE DESTINATION lib) # Finally, this is where static libraries (*.a) go - - -# Generate a .gitignore -file(WRITE ".gitignore" "# Automatically generated by CMake, do not modify.\n") -foreach(file - ".gitignore" - "roojspacker${CMAKE_EXECUTABLE_SUFFIX}") - file(APPEND ".gitignore" "/${file}\n") -endforeach(file) -foreach(file ${ROOJSPACKER_MAIN_SOURCES}) - string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" file ${file}) - file(APPEND ".gitignore" "/${file}\n") -endforeach(file) diff --git a/cmake/AddCompilerFlags.cmake b/cmake/AddCompilerFlags.cmake deleted file mode 100644 index c8e6077..0000000 --- a/cmake/AddCompilerFlags.cmake +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (c) 2016 Evan Nemerson -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# This module provides a convenient way to add C/C++ compiler flags if -# the compiler supports them. - -include (CheckCCompilerFlag) -include (CheckCXXCompilerFlag) - -# Depending on the settings, some compilers will accept unknown flags. -# We try to disable this behavior by also passing these flags when we -# check if a flag is supported. -set (ADD_COMPILER_FLAGS_PREPEND "") - -if ("GNU" STREQUAL "${CMAKE_C_COMPILER_ID}") - set (ADD_COMPILER_FLAGS_PREPEND "-Wall -Wextra -Werror") -elseif ("Clang" STREQUAL "${CMAKE_C_COMPILER_ID}") - set (ADD_COMPILER_FLAGS_PREPEND "-Werror=unknown-warning-option") -endif () - -## -# Set a variable to different flags, depending on which compiler is in -# use. -# -# Example: -# set_compiler_flags(VARIABLE varname MSVC /wd666 INTEL /wd1729) -# -# This will set varname to /wd666 if the compiler is MSVC, and /wd1729 -# if it is Intel. -# -# Possible compilers: -# - GCC: GNU C Compiler -# - GCCISH: A compiler that (tries to) be GCC-compatible on the CLI -# (i.e., anything but MSVC). -# - CLANG: clang -# - MSVC: Microsoft Visual C++ compiler -# - INTEL: Intel C Compiler -# -# Note: the compiler is determined based on the value of the -# CMAKE_C_COMPILER_ID variable, not CMAKE_CXX_COMPILER_ID. -## -function (set_compiler_specific_flags) - set (oneValueArgs VARIABLE) - set (multiValueArgs GCC GCCISH INTEL CLANG MSVC) - cmake_parse_arguments(COMPILER_SPECIFIC_FLAGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - set (compiler_flags) - - if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - list (APPEND compiler_flags ${COMPILER_SPECIFIC_FLAGS_GCC}) - elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") - list (APPEND compiler_flags ${COMPILER_SPECIFIC_FLAGS_CLANG}) - elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel") - list (APPEND compiler_flags ${COMPILER_SPECIFIC_FLAGS_INTEL}) - elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") - list (APPEND compiler_flags ${COMPILER_SPECIFIC_FLAGS_MSVC}) - endif() - - if (NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") - list (APPEND compiler_flags ${COMPILER_SPECIFIC_FLAGS_GCCISH}) - endif () - - set (${COMPILER_SPECIFIC_FLAGS_VARIABLE} "${compiler_flags}" PARENT_SCOPE) -endfunction () - -function (source_file_add_compiler_flags_unchecked file) - set (flags ${ARGV}) - list (REMOVE_AT flags 0) - get_source_file_property (sources ${file} SOURCES) - - foreach (flag ${flags}) - get_source_file_property (existing ${file} COMPILE_FLAGS) - if ("${existing}" STREQUAL "NOTFOUND") - set_source_files_properties (${file} - PROPERTIES COMPILE_FLAGS "${flag}") - else () - set_source_files_properties (${file} - PROPERTIES COMPILE_FLAGS "${existing} ${flag}") - endif () - endforeach (flag) -endfunction () - -function (source_file_add_compiler_flags file) - set (flags ${ARGV}) - list (REMOVE_AT flags 0) - get_source_file_property (sources ${file} SOURCES) - - foreach (flag ${flags}) - if ("GNU" STREQUAL "${CMAKE_C_COMPILER_ID}") - # Because https://gcc.gnu.org/wiki/FAQ#wnowarning - string (REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}") - else () - set (flag_to_test ${flag}) - endif () - - if ("${file}" MATCHES "\\.c$") - string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" test_name "CFLAG_${flag_to_test}") - CHECK_C_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${test_name}) - elseif ("${file}" MATCHES "\\.(cpp|cc|cxx)$") - string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" test_name "CXXFLAG_${flag_to_test}") - CHECK_CXX_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${test_name}) - endif () - - if (${test_name}) - source_file_add_compiler_flags_unchecked (${file} ${flag}) - endif () - - unset (test_name) - unset (flag_to_test) - endforeach (flag) - - unset (flags) -endfunction () - -function (target_add_compiler_flags target) - set (flags ${ARGV}) - list (REMOVE_AT flags 0) - get_target_property (sources ${target} SOURCES) - - foreach (source ${sources}) - source_file_add_compiler_flags (${source} ${flags}) - endforeach (source) - - unset (flags) - unset (sources) -endfunction (target_add_compiler_flags) - -# global_add_compiler_flags (flag1 [flag2 [flag3 ...]]): -# -# This just adds the requested compiler flags to -# CMAKE_C/CXX_FLAGS variable if they work with the compiler. -function (global_add_compiler_flags) - set (flags ${ARGV}) - - foreach (flag ${flags}) - if ("GNU" STREQUAL "${CMAKE_C_COMPILER_ID}") - # Because https://gcc.gnu.org/wiki/FAQ#wnowarning - string (REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}") - else () - set (flag_to_test "${flag}") - endif () - - string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" c_test_name "CFLAG_${flag_to_test}") - CHECK_C_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${c_test_name}) - if (${c_test_name}) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") - endif () - unset (c_test_name) - - string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" cxx_test_name "CFLAG_${flag_to_test}") - CHECK_CXX_COMPILER_FLAG ("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${cxx_test_name}) - if (${cxx_test_name}) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") - endif () - unset (cxx_test_name) - - unset (flag_to_test) - endforeach (flag) - - unset (flags) - - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE) -endfunction (global_add_compiler_flags) \ No newline at end of file diff --git a/cmake/FindGLib.cmake b/cmake/FindGLib.cmake deleted file mode 100644 index 1213561..0000000 --- a/cmake/FindGLib.cmake +++ /dev/null @@ -1,257 +0,0 @@ -# FindGLib.cmake -# -# -# CMake support for GLib/GObject/GIO. -# -# License: -# -# Copyright (c) 2016 Evan Nemerson -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation -# files (the "Software"), to deal in the Software without -# restriction, including without limitation the rights to use, copy, -# modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -find_package(PkgConfig) - -if(PKG_CONFIG_FOUND) - pkg_search_module(GLIB_PKG glib-2.0) - pkg_search_module(GOBJECT_PKG gobject-2.0) - pkg_search_module(GIO_PKG gio-2.0) -endif() - -find_library(GLIB glib-2.0 HINTS ${GLIB_PKG_LIBRARY_DIRS}) -find_library(GOBJECT gobject-2.0 HINTS ${GOBJECT_PKG_LIBRARY_DIRS}) -find_library(GIO gio-2.0 HINTS ${GIO_PKG_LIBRARY_DIRS}) - -if(GLIB) - add_library(glib-2.0 SHARED IMPORTED) - set_property(TARGET glib-2.0 PROPERTY IMPORTED_LOCATION "${GLIB}") - - find_path(GLIB_INCLUDE_DIRS "glib.h" - HINTS ${GLIB_PKG_INCLUDE_DIRS} - PATH_SUFFIXES "glib-2.0") - - get_filename_component(GLIB_LIBDIR "${GLIB}" DIRECTORY) - find_path(GLIB_CONFIG_INCLUDE_DIR "glibconfig.h" - HINTS - ${GLIB_LIBDIR} - ${GLIB_PKG_INCLUDE_DIRS} - PATHS - "${CMAKE_LIBRARY_PATH}" - PATH_SUFFIXES - "glib-2.0/include" - "glib-2.0") - unset(GLIB_LIBDIR) - - if(NOT GLIB_CONFIG_INCLUDE_DIR) - unset(GLIB_INCLUDE_DIRS) - else() - file(STRINGS "${GLIB_CONFIG_INCLUDE_DIR}/glibconfig.h" GLIB_MAJOR_VERSION REGEX "^#define GLIB_MAJOR_VERSION +([0-9]+)") - string(REGEX REPLACE "^#define GLIB_MAJOR_VERSION ([0-9]+)$" "\\1" GLIB_MAJOR_VERSION "${GLIB_MAJOR_VERSION}") - file(STRINGS "${GLIB_CONFIG_INCLUDE_DIR}/glibconfig.h" GLIB_MINOR_VERSION REGEX "^#define GLIB_MINOR_VERSION +([0-9]+)") - string(REGEX REPLACE "^#define GLIB_MINOR_VERSION ([0-9]+)$" "\\1" GLIB_MINOR_VERSION "${GLIB_MINOR_VERSION}") - file(STRINGS "${GLIB_CONFIG_INCLUDE_DIR}/glibconfig.h" GLIB_MICRO_VERSION REGEX "^#define GLIB_MICRO_VERSION +([0-9]+)") - string(REGEX REPLACE "^#define GLIB_MICRO_VERSION ([0-9]+)$" "\\1" GLIB_MICRO_VERSION "${GLIB_MICRO_VERSION}") - set(GLIB_VERSION "${GLIB_MAJOR_VERSION}.${GLIB_MINOR_VERSION}.${GLIB_MICRO_VERSION}") - unset(GLIB_MAJOR_VERSION) - unset(GLIB_MINOR_VERSION) - unset(GLIB_MICRO_VERSION) - - list(APPEND GLIB_INCLUDE_DIRS ${GLIB_CONFIG_INCLUDE_DIR}) - endif() -endif() - -if(GOBJECT) - add_library(gobject-2.0 SHARED IMPORTED) - set_property(TARGET gobject-2.0 PROPERTY IMPORTED_LOCATION "${GOBJECT}") - - find_path(GOBJECT_INCLUDE_DIRS "glib-object.h" - HINTS ${GOBJECT_PKG_INCLUDE_DIRS} - PATH_SUFFIXES "glib-2.0") - if(GOBJECT_INCLUDE_DIRS) - list(APPEND GOBJECT_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS}) - list(REMOVE_DUPLICATES GOBJECT_INCLUDE_DIRS) - endif() -endif() - -if(GIO) - add_library(gio-2.0 SHARED IMPORTED) - set_property(TARGET gio-2.0 PROPERTY IMPORTED_LOCATION "${GIO}") - - find_path(GIO_INCLUDE_DIRS "gio/gio.h" - HINTS ${GIO_PKG_INCLUDE_DIRS} - PATH_SUFFIXES "glib-2.0") - if(GIO_INCLUDE_DIRS) - list(APPEND GIO_INCLUDE_DIRS ${GOBJECT_INCLUDE_DIRS}) - list(REMOVE_DUPLICATES GIO_INCLUDE_DIRS) - endif() -endif() - -find_program(GLIB_GENMARSHAL glib-genmarshal) -if(GLIB_GENMARSHAL) - add_executable(glib-genmarshal IMPORTED) - set_property(TARGET glib-genmarshal PROPERTY IMPORTED_LOCATION "${GLIB_GENMARSHAL}") -endif() - -find_program(GLIB_MKENUMS glib-mkenums) -if(GLIB_MKENUMS) - add_executable(glib-mkenums IMPORTED) - set_property(TARGET glib-mkenums PROPERTY IMPORTED_LOCATION "${GLIB_MKENUMS}") -endif() - -find_program(GLIB_COMPILE_SCHEMAS glib-compile-schemas) -if(GLIB_COMPILE_SCHEMAS) - add_executable(glib-compile-schemas IMPORTED) - set_property(TARGET glib-compile-schemas PROPERTY IMPORTED_LOCATION "${GLIB_COMPILE_SCHEMAS}") -endif() - -# glib_install_schemas( -# [DESTINATION directory] -# schemas…) -# -# Validate and install the listed schemas. -function(glib_install_schemas) - set (options) - set (oneValueArgs DESTINATION) - set (multiValueArgs) - cmake_parse_arguments(GSCHEMA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - foreach(schema ${GSCHEMA_UNPARSED_ARGUMENTS}) - get_filename_component(schema_name "${schema}" NAME) - string(REGEX REPLACE "^(.+)\.gschema.xml$" "\\1" schema_name "${schema_name}") - set(schema_output "${CMAKE_CURRENT_BINARY_DIR}/${schema_name}.gschema.xml.valid") - - add_custom_command( - OUTPUT "${schema_output}" - COMMAND glib-compile-schemas - --strict - --dry-run - --schema-file="${schema}" - COMMAND "${CMAKE_COMMAND}" ARGS -E touch "${schema_output}" - DEPENDS "${schema}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Validating ${schema}") - - add_custom_target("gsettings-schema-${schema_name}" ALL - DEPENDS "${schema_output}") - - if(CMAKE_INSTALL_FULL_DATADIR) - set(SCHEMADIR "${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas") - else() - set(SCHEMADIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas") - endif() - install(FILES "${schema}" - DESTINATION "${SCHEMADIR}") - install(CODE "execute_process(COMMAND \"${GLIB_COMPILE_SCHEMAS}\" \"${SCHEMADIR}\")") - endforeach() -endfunction() - -find_program(GLIB_COMPILE_RESOURCES glib-compile-resources) -if(GLIB_COMPILE_RESOURCES) - add_executable(glib-compile-resources IMPORTED) - set_property(TARGET glib-compile-resources PROPERTY IMPORTED_LOCATION "${GLIB_COMPILE_RESOURCES}") -endif() - -function(glib_compile_resources SPEC_FILE) - set (options INTERNAL) - set (oneValueArgs TARGET SOURCE_DIR HEADER SOURCE C_NAME) - set (multiValueArgs) - cmake_parse_arguments(GLIB_COMPILE_RESOURCES "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - if(NOT GLIB_COMPILE_RESOURCES_SOURCE_DIR) - set(GLIB_COMPILE_RESOURCES_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - endif() - - set(FLAGS) - - if(GLIB_COMPILE_RESOURCES_INTERNAL) - list(APPEND FLAGS "--internal") - endif() - - if(GLIB_COMPILE_RESOURCES_C_NAME) - list(APPEND FLAGS "--c-name" "${GLIB_COMPILE_RESOURCES_C_NAME}") - endif() - - get_filename_component(SPEC_FILE "${SPEC_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - - execute_process( - COMMAND glib-compile-resources - --generate-dependencies - --sourcedir "${GLIB_COMPILE_RESOURCES_SOURCE_DIR}" - "${SPEC_FILE}" - OUTPUT_VARIABLE deps - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(GLIB_COMPILE_RESOURCES_HEADER) - get_filename_component(GLIB_COMPILE_RESOURCES_HEADER "${GLIB_COMPILE_RESOURCES_HEADER}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") - - add_custom_command( - OUTPUT "${GLIB_COMPILE_RESOURCES_HEADER}" - COMMAND glib-compile-resources - --sourcedir "${GLIB_COMPILE_RESOURCES_SOURCE_DIR}" - --generate-header - --target "${GLIB_COMPILE_RESOURCES_HEADER}" - ${FLAGS} - "${SPEC_FILE}" - DEPENDS "${SPEC_FILE}" ${deps} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - endif() - - if(GLIB_COMPILE_RESOURCES_SOURCE) - get_filename_component(GLIB_COMPILE_RESOURCES_SOURCE "${GLIB_COMPILE_RESOURCES_SOURCE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") - - add_custom_command( - OUTPUT "${GLIB_COMPILE_RESOURCES_SOURCE}" - COMMAND glib-compile-resources - --sourcedir "${GLIB_COMPILE_RESOURCES_SOURCE_DIR}" - --generate-source - --target "${GLIB_COMPILE_RESOURCES_SOURCE}" - ${FLAGS} - "${SPEC_FILE}" - DEPENDS "${SPEC_FILE}" ${deps} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - endif() -endfunction() - -find_program(GDBUS_CODEGEN gdbus-codegen) -if(GDBUS_CODEGEN) - add_executable(gdbus-codegen IMPORTED) - set_property(TARGET gdbus-codegen PROPERTY IMPORTED_LOCATION "${GDBUS_CODEGEN}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GLib - REQUIRED_VARS - GLIB_INCLUDE_DIRS - GOBJECT_INCLUDE_DIRS - GIO_INCLUDE_DIRS - GLIB_MKENUMS - GLIB_GENMARSHAL - GLIB_COMPILE_SCHEMAS - GLIB_COMPILE_RESOURCES - GDBUS_CODEGEN - VERSION_VAR - GLIB_VERSION) \ No newline at end of file diff --git a/cmake/FindGObjectIntrospection.cmake b/cmake/FindGObjectIntrospection.cmake deleted file mode 100644 index 9d190f6..0000000 --- a/cmake/FindGObjectIntrospection.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# FindGObjectIntrospection.cmake -# © 2016 Evan Nemerson - -find_program(GI_COMPILER_EXECUTABLE g-ir-compiler) -find_program(GI_SCANNER_EXECUTABLE g-ir-scanner) - -if(CMAKE_INSTALL_FULL_DATADIR) - set(GI_REPOSITORY_DIR "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0") -else() - set(GI_REPOSITORY_DIR "${CMAKE_INSTALL_PREFIX}/share/gir-1.0") -endif() - -if(CMAKE_INSTALL_FULL_LIBDIR) - set(GI_TYPELIB_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0") -else() - set(GI_TYPELIB_DIR "${CMAKE_INSTALL_LIBDIR}/girepository-1.0") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GObjectIntrospection - REQUIRED_VARS - GI_COMPILER_EXECUTABLE - GI_SCANNER_EXECUTABLE) - -function(gobject_introspection_compile TYPELIB) - set (options DEBUG VERBOSE) - set (oneValueArgs MODULE SHARED_LIBRARY) - set (multiValueArgs FLAGS INCLUDE_DIRS) - cmake_parse_arguments(GI_COMPILER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - get_filename_component(TYPELIB "${TYPELIB}" ABSOLUTE - BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") - - if(GI_COMPILER_DEBUG) - list(APPEND GI_COMPILER_FLAGS "--debug") - endif() - - if(GI_COMPILER_VERBOSE) - list(APPEND GI_COMPILER_FLAGS "--verbose") - endif() - - if(GI_SHARED_LIBRARY) - list(APPEND GI_COMPILER_FLAGS "--shared-library" "${GI_SHARED_LIBRARY}") - endif() - - foreach(include_dir ${GI_COMPILER_INCLUDE_DIRS}) - list(APPEND GI_COMPILER_FLAGS "--includedir" "${include_dir}") - endforeach() - - add_custom_command( - OUTPUT "${TYPELIB}" - COMMAND "${GI_COMPILER_EXECUTABLE}" - ARGS - "-o" "${TYPELIB}" - ${GI_COMPILER_FLAGS} - ${GI_COMPILER_UNPARSED_ARGUMENTS} - DEPENDS - ${GI_COMPILER_UNPARSED_ARGUMENTS}) -endfunction() \ No newline at end of file diff --git a/cmake/FindVala.cmake b/cmake/FindVala.cmake deleted file mode 100644 index aaec9c5..0000000 --- a/cmake/FindVala.cmake +++ /dev/null @@ -1,409 +0,0 @@ -# FindVala.cmake -# -# -# This file contains functions which can be used to integrate Vala -# compilation with CMake. It is intended as a replacement for Jakob -# Westhoff's FindVala.cmake and UseVala.cmake. It uses fast-vapis for -# faster parallel compilation, and per-target directories for -# generated sources to allow reusing source files across, even with -# different options. -# -# License: -# -# Copyright (c) 2016 Evan Nemerson -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation -# files (the "Software"), to deal in the Software without -# restriction, including without limitation the rights to use, copy, -# modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -set(VALAC_NAMES valac) - -set(_FIND_VALA_CURRENT_VERSION 98) -while(_FIND_VALA_CURRENT_VERSION GREATER 0) - list(APPEND VALAC_NAME "valac-1.${_FIND_VALA_CURRENT_VERSION}") - math(EXPR _FIND_VALA_CURRENT_VERSION "${_FIND_VALA_CURRENT_VERSION} - 2") -endwhile() -set(_FIND_VALA_CURRENT_VERSION 98) -while(_FIND_VALA_CURRENT_VERSION GREATER 0) - list(APPEND VALAC_NAME "valac-1.${_FIND_VALA_CURRENT_VERSION}") - math(EXPR _FIND_VALA_CURRENT_VERSION "${_FIND_VALA_CURRENT_VERSION} - 2") -endwhile() -unset(_FIND_VALA_CURRENT_VERSION) - -find_program(VALA_EXECUTABLE - NAMES ${VALAC_NAMES}) -mark_as_advanced(VALA_EXECUTABLE) - -unset(VALAC_NAMES) - -if(VALA_EXECUTABLE) - # Determine valac version - execute_process(COMMAND ${VALA_EXECUTABLE} "--version" - OUTPUT_VARIABLE VALA_VERSION) - string(REGEX REPLACE "^.*Vala ([0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+(\\-[0-9a-f]+)?)?).*$" "\\1" VALA_VERSION "${VALA_VERSION}") - - add_executable(valac IMPORTED) - set_property(TARGET valac PROPERTY IMPORTED_LOCATION "${VALA_EXECUTABLE}") -endif(VALA_EXECUTABLE) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Vala - REQUIRED_VARS VALA_EXECUTABLE - VERSION_VAR VALA_VERSION) - -function(_vala_mkdir_for_file file) - get_filename_component(dir "${file}" DIRECTORY) - file(MAKE_DIRECTORY "${dir}") -endfunction() - -macro(_vala_parse_source_file_path source) - set (options) - set (oneValueArgs SOURCE TYPE OUTPUT_PATH OUTPUT_DIR GENERATED_SOURCE FAST_VAPI) - set (multiValueArgs) - cmake_parse_arguments(VALAPATH "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - if(VALAPATH_SOURCE) - get_filename_component("${VALAPATH_SOURCE}" "${source}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - endif() - - if(VALAPATH_TYPE) - string(REGEX MATCH "[^\\.]+$" "${VALAPATH_TYPE}" "${source}") - string(TOLOWER "${${VALAPATH_TYPE}}" "${VALAPATH_TYPE}") - endif() - - if(VALAPATH_OUTPUT_PATH OR VALAPATH_GENERATED_SOURCE OR VALAPATH_OUTPUT_DIR OR VALAPATH_FAST_VAPI) - get_filename_component(srcfile "${source}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - - string(LENGTH "${CMAKE_BINARY_DIR}" dirlen) - string(SUBSTRING "${srcfile}" 0 ${dirlen} tmp) - if("${CMAKE_BINARY_DIR}" STREQUAL "${tmp}") - string(SUBSTRING "${srcfile}" ${dirlen} -1 tmp) - set(outpath "build${tmp}") - else() - string(LENGTH "${CMAKE_SOURCE_DIR}" dirlen) - string(SUBSTRING "${srcfile}" 0 ${dirlen} tmp) - if("${CMAKE_SOURCE_DIR}" STREQUAL "${tmp}") - string(SUBSTRING "${srcfile}" ${dirlen} -1 tmp) - set(outpath "source${tmp}") - else () - # TODO: this probably doesn't work correctly on Windows… - set(outpath "root${tmp}") - endif() - endif() - - unset(tmp) - unset(dirlen) - unset(srcfile) - endif() - - if(VALAPATH_OUTPUT_PATH) - set("${VALAPATH_OUTPUT_PATH}" "${outpath}") - endif() - - if(VALAPATH_GENERATED_SOURCE) - string(REGEX REPLACE "\\.(vala|gs)$" ".c" "${VALAPATH_GENERATED_SOURCE}" "${outpath}") - endif() - - if(VALAPATH_FAST_VAPI) - string(REGEX REPLACE "\\.(vala|gs)$" ".vapi" "${VALAPATH_FAST_VAPI}" "${outpath}") - endif() - - if(VALAPATH_OUTPUT_DIR) - get_filename_component("${VALAPATH_OUTPUT_DIR}" "${outpath}" DIRECTORY) - endif() - - unset(outpath) -endmacro() - -# vala_precompile_target( -# TARGET -# GENERATED_SOURCES -# SOURCES… -# [VAPI vapi-name.vapi] -# [GIR name-version.gir] -# [HEADER name.h] -# [FLAGS …] -# [PACKAGES …] -# [DEPENDS …]) -# -# This function will use valac to generate C code. -# -# This function uses fast VAPIs to help improve parallelization and -# incremental build times. The problem with this is that CMake -# doesn't allow file-level dependencies across directories; if you're -# generating code in one directory (for example, a library) and would -# like to use it in another directory and are building in parallel, -# the build can fail. To prevent this, this function will create a -# ${TARGET}-vala top-level target (which *is* usable from other -# directories). -# -# Options: -# -# TARGET -# Target to create; it's generally best to make this similar to -# your executable or library target name (e.g., for a "foo" -# executable, "foo-vala" might be a good name), but not -# technically required. -# GENERATED_SOURCES -# Variable in which to store the list of generated sources (which -# you should pass to add_executable or add_library). -# SOURCES -# Vala sources to generate C from. You should include *.vala, -# *.gs, and uninstalled *.vapi files here; you may also include -# C/C++ sources (they will simply be passed directly through to -# the GENERATED_SOURCES variable). -# VAPI name.vapi -# If you would like to have valac generate a VAPI (basically, if -# you are generating a library not an executable), pass the file -# name here. -# GIR name-version.gir -# If you would like to have valac generate a GIR, pass the file -# name here. -# HEADER name.h -# If you would like to have valac generate a C header, pass the -# file name here. -# FLAGS … -# List of flags you wish to pass to valac. They will be added to -# the flags in VALA_COMPILER_FLAGS and VALA_COMPILER_FLAGS_DEBUG -# (for Debug builds) or VALA_COMPILER_FLAGS_RELEASE (for Release -# builds). -# PACKAGES -# List of dependencies to pass to valac. -# DEPENDS -# Any additional dependencies you would like. -macro(vala_precompile_target TARGET GENERATED_SOURCES) - set (options) - set (oneValueArgs VAPI GIR HEADER) - set (multiValueArgs FLAGS PACKAGES DEPENDS) - cmake_parse_arguments(VALAC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - set(VALA_SOURCES) - set(VALA_VAPIS) - set(VALA_OUTPUT_SOURCES) - - if(VALAC_VAPI) - list(APPEND non_source_out_files "${VALAC_VAPI}") - list(APPEND non_source_valac_args "--vapi" "${VALAC_VAPI}") - endif() - - if(VALAC_GIR) - list(APPEND non_source_out_files "${VALAC_GIR}") - list(APPEND non_source_valac_args - "--gir" "${VALAC_GIR}" - "--library" "${TARGET}" - "--shared-library" "${CMAKE_SHARED_LIBRARY_PREFIX}${TARGET}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() - - if(VALAC_HEADER) - list(APPEND non_source_out_files "${VALAC_HEADER}") - list(APPEND non_source_valac_args --header "${VALAC_HEADER}") - endif() - - # Split up the input files into three lists; one containing vala and - # genie sources, one containing VAPIs, and one containing C files - # (which may seem a bit silly, but it does open up the possibility - # of declaring your source file list once instead of having separate - # lists for Vala and C). - foreach(source ${VALAC_UNPARSED_ARGUMENTS}) - _vala_parse_source_file_path("${source}" - SOURCE source_full - TYPE type) - - if("vala" STREQUAL "${type}" OR "gs" STREQUAL "${type}") - list(APPEND VALA_SOURCES "${source_full}") - elseif("vapi" STREQUAL "${type}") - list(APPEND VALA_VAPIS "${source_full}") - elseif( - "c" STREQUAL "${type}" OR - "h" STREQUAL "${type}" OR - "cpp" STREQUAL "${type}" OR - "cxx" STREQUAL "${type}" OR - "hpp" STREQUAL "${type}") - list(APPEND VALA_OUTPUT_SOURCES "${source_full}") - endif() - - unset(type) - unset(source_full) - endforeach() - - # Set the common flags to pass to every valac invocation. - set(VALAFLAGS ${VALAC_FLAGS} ${VALA_VAPIS}) - foreach(pkg ${VALAC_PACKAGES}) - list(APPEND VALAFLAGS "--pkg" "${pkg}") - endforeach() - list(APPEND VALAFLAGS ${VALA_COMPILER_FLAGS}) - if (CMAKE_BUILD_TYPE MATCHES "Debug") - list(APPEND VALAFLAGS ${VALA_COMPILER_FLAGS_DEBUG}) - elseif(CMAKE_BUILD_TYPE MATCHES "Release") - list(APPEND VALAFLAGS ${VALA_COMPILER_FLAGS_RELEASE}) - endif() - - # Where to put the output - set(TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}") - - set(FAST_VAPI_STAMPS) - - # Create fast VAPI targets for each vala source - foreach(source ${VALA_SOURCES}) - _vala_parse_source_file_path("${source}" - FAST_VAPI fast_vapi_path) - - # We need somewhere to put the output… - _vala_mkdir_for_file("${TARGET_DIR}/${fast_vapi_path}") - - # Create the target - add_custom_command( - OUTPUT "${TARGET_DIR}/${fast_vapi_path}.stamp" - BYPRODUCTS "${TARGET_DIR}/${fast_vapi_path}" - DEPENDS - "${source}" - ${VALA_VAPIS} - ${VALAC_DEPENDS} - COMMAND "${VALA_EXECUTABLE}" - ARGS - "${source}" - --fast-vapi "${TARGET_DIR}/${fast_vapi_path}" - ${VALAFLAGS} - COMMAND "${CMAKE_COMMAND}" ARGS -E touch "${TARGET_DIR}/${fast_vapi_path}.stamp" - COMMENT "Generating fast VAPI ${TARGET_DIR}/${fast_vapi_path}") - - list(APPEND FAST_VAPI_STAMPS "${TARGET_DIR}/${fast_vapi_path}.stamp") - - unset(fast_vapi_path) - endforeach() - - # Create a ${TARGET_DIR}-fast-vapis target which depens on all the fast - # vapi stamps. We can use this as a dependency to make sure all - # fast-vapis are up to date. - add_custom_command( - OUTPUT "${TARGET_DIR}/fast-vapis.stamp" - COMMAND "${CMAKE_COMMAND}" ARGS -E touch "${TARGET_DIR}/fast-vapis.stamp" - DEPENDS - ${FAST_VAPI_STAMPS} - ${VALAC_DEPENDS} - COMMENT "Generating fast VAPIs for ${TARGET}") - - add_custom_target("${TARGET}-fast-vapis" - DEPENDS "${TARGET_DIR}/fast-vapis.stamp") - - set(VALA_GENERATED_SOURCE_STAMPS) - - # Add targets to generate C sources - foreach(source ${VALA_SOURCES}) - _vala_parse_source_file_path("${source}" - OUTPUT_PATH output_path - OUTPUT_DIR output_dir - GENERATED_SOURCE generated_source) - - set(use_fast_vapi_flags) - foreach(src ${VALA_SOURCES}) - if(NOT "${src}" STREQUAL "${source}") - _vala_parse_source_file_path("${src}" - FAST_VAPI src_fast_vapi_path) - - list(APPEND use_fast_vapi_flags --use-fast-vapi "${TARGET_DIR}/${src_fast_vapi_path}") - - unset(src_fast_vapi_path) - endif() - endforeach() - - add_custom_command( - OUTPUT "${TARGET_DIR}/${generated_source}.stamp" - BYPRODUCTS "${TARGET_DIR}/${generated_source}" - COMMAND "${VALA_EXECUTABLE}" - ARGS - -d "${TARGET_DIR}/${output_dir}" - -C - "${source}" - ${VALAFLAGS} - ${use_fast_vapi_flags} - COMMAND "${CMAKE_COMMAND}" ARGS -E touch "${TARGET_DIR}/${generated_source}.stamp" - DEPENDS - "${TARGET}-fast-vapis" - "${source}" - ${VALA_VAPIS} - COMMENT "Generating ${TARGET_DIR}/${generated_source}") - unset(use_fast_vapi_flags) - - list(APPEND VALA_OUTPUT_SOURCES "${TARGET_DIR}/${generated_source}") - list(APPEND VALA_GENERATED_SOURCE_STAMPS "${TARGET_DIR}/${generated_source}.stamp") - - unset(fast_vapi_path) - unset(output_dir) - unset(generated_source) - endforeach() - - add_custom_command( - OUTPUT "${TARGET_DIR}/stamp" - COMMAND "${CMAKE_COMMAND}" ARGS -E touch "${TARGET_DIR}/stamp" - DEPENDS ${VALA_GENERATED_SOURCE_STAMPS} - COMMENT "Generating sources from Vala for ${TARGET}") - - set("${GENERATED_SOURCES}" ${VALA_OUTPUT_SOURCES}) - - if(non_source_out_files) - set(use_fast_vapi_flags) - foreach(source ${VALA_SOURCES}) - _vala_parse_source_file_path("${source}" - FAST_VAPI fast_vapi_path) - - list(APPEND use_fast_vapi_flags --use-fast-vapi "${TARGET_DIR}/${fast_vapi_path}") - - unset(fast_vapi_path) - endforeach() - - add_custom_command(OUTPUT ${non_source_out_files} - COMMAND ${VALA_EXECUTABLE} - ARGS - -C - ${non_source_valac_args} - ${VALAFLAGS} - ${use_fast_vapi_flags} - DEPENDS - "${TARGET}-fast-vapis" - ${VALA_VAPIS}) - unset(use_fast_vapi_flags) - endif() - - # CMake doesn't allow file-level dependencies across directories, so - # we provide a target we can depend on from other directories. - add_custom_target("${TARGET}" - DEPENDS - "${TARGET_DIR}/stamp" - ${non_source_out_files} - ${VALAC_DEPENDS} - ${VALA_GENERATED_SOURCE_STAMPS}) - - unset(non_source_out_files) - unset(non_source_valac_args) - - unset(VALA_GENERATED_SOURCE_STAMPS) - unset(FAST_VAPI_STAMPS) - unset(TARGET_DIR) - unset(VALAFLAGS) - unset(VALA_SOURCES) - unset(VALA_VAPIS) - unset(VALA_OUTPUT_SOURCES) -endmacro() \ No newline at end of file diff --git a/cmake/FindValadoc.cmake b/cmake/FindValadoc.cmake deleted file mode 100644 index 983b70b..0000000 --- a/cmake/FindValadoc.cmake +++ /dev/null @@ -1,96 +0,0 @@ -# CMake Valadoc support -# Copyright (c) 2016 Evan Nemerson -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -find_program(VALADOC_EXECUTABLE - NAMES valadoc - DOC "Valadoc") - -if(VALADOC_EXECUTABLE) - execute_process(COMMAND ${VALADOC_EXECUTABLE} "--version" OUTPUT_VARIABLE VALADOC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - string(SUBSTRING "${VALADOC_VERSION}" 8 -1 VALADOC_VERSION) -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Valadoc - FOUND_VAR VALADOC_FOUND - REQUIRED_VARS VALADOC_EXECUTABLE - VERSION_VAR VALADOC_VERSION) - -# valadoc_generate(OUTPUT_DIR -# PACKAGE_NAME name -# [PACKAGE_VERSION version] -# [FLAGS flags…] -# [PACKAGES packages…] -# [DOCLET doclet] -# [ALL]) -# -# PACKAGE_NAME name -# VAPI name to generate documentation for. -# PACKAGE_VERSION version -# Version number of the package. -# FLAGS … -# List of flags you wish to pass to valadoc. -# PACKAGES -# List of dependencies to pass to valac. -# DOCLET doclet-name -# Name of the doclet to use (default: html) -function(valadoc_generate OUTPUT_DIR) - set (options) - set (oneValueArgs DOCLET PACKAGE_NAME PACKAGE_VERSION) - set (multiValueArgs SOURCES PACKAGES FLAGS DEFINITIONS CUSTOM_VAPIS) - cmake_parse_arguments(VALADOC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - unset (options) - unset (oneValueArgs) - unset (multiValueArgs) - - if("${VALADOC_DOCLET}" STREQUAL "") - list(APPEND VALADOC_FLAGS "--doclet=html") - else() - list(APPEND VALADOC_FLAGS "--doclet=${VALADOC_DOCLET}") - endif() - - if(NOT "${VALADOC_PACKAGE_NAME}" STREQUAL "") - list(APPEND VALADOC_FLAGS "--package-name=${VALADOC_PACKAGE_NAME}") - endif() - - if(NOT "${VALADOC_PACKAGE_VERSION}" STREQUAL "") - list(APPEND VALADOC_FLAGS "--package-version=${VALADOC_PACKAGE_VERSION}") - endif() - - foreach(pkg ${VALADOC_PACKAGES}) - list(APPEND VALADOC_FLAGS "--pkg=${pkg}") - endforeach(pkg) - - add_custom_command( - OUTPUT "${OUTPUT_DIR}" - COMMAND "${VALADOC_EXECUTABLE}" - ARGS - --force - -o "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIR}" - ${VALADOC_FLAGS} - ${VALADOC_SOURCES} - DEPENDS - ${VALADOC_SOURCES} - COMMENT "Generating documentation with Valadoc" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") -endfunction() \ No newline at end of file diff --git a/config1.builder b/config1.builder deleted file mode 100644 index f735f93..0000000 --- a/config1.builder +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "name" : "jspacker", - "compile_flags" : "", - "execute_args" : "-i /home/alan/gitlive/roojs1/buildSDK/dependancy_core.txt -b /home/alan/gitlive/roojs1 -s", - "target_bin" : "/tmp/jspacker", - "sources" : [ - "/src/jsdoc/Collapse.vala", - "/src/jsdoc/CompressWhite.vala", - "/src/jsdoc/Identifier.vala", - "/src/jsdoc/Lang.vala", - "/src/jsdoc/PackerRun.vala", - "/src/jsdoc/Packer.vala", - "/src/jsdoc/ScopeParser.vala", - "/src/jsdoc/Scope.vala", - "/src/jsdoc/TextStream.vala", - "/src/jsdoc/TokenReader.vala", - "/src/jsdoc/TokenStream.vala", - "/src/jsdoc/Token.vala", - "/src/jsdoc", - "/src/jsdoc/DocTag.vala", - "/src/jsdoc/DocParser.vala", - "/src/jsdoc/Symbol.vala", - "/src/jsdoc/SymbolSet.vala", - "/src/jsdoc/DocComment.vala", - "/src/jsdoc/DocBuilder.vala", - "/src/jsdoc/PrettyPrint.vala", - "/src/jsdoc/Walker.vala" - ], - "packages" : [] - }, - { - "name" : "_default_", - "compile_flags" : "", - "execute_args" : "", - "target_bin" : "", - "sources" : [ - "..//roojspacker", - "../../../../usr/share/vala/vapi", - "/roojspacker", - "/bin" - ], - "packages" : [ - "glib-2.0", - "gio-2.0", - "posix", - "gee-1.0", - "json-glib-1.0", - "gee-0.8" - ] - } -] \ No newline at end of file diff --git a/configure b/configure deleted file mode 100755 index 67404c3..0000000 --- a/configure +++ /dev/null @@ -1,322 +0,0 @@ -#!/bin/sh - -# Autotools-style (./configure) wrapper for CMake -# -# -# *** IMPORTANT *** -# -# You must include the GNUInstallDirs module (which comes with -# CMake) in your project. Just put "include (GNUInstallDirs)" in -# you CMakeLists.txt and you should be good. -# -# This script was originally written for Squash -# by Evan Nemerson -# , but has been spun off into a separate -# repository. Please feel free to copy it into your own repository, -# though I would appreciate it if you would post improvements, bugs, -# feature requests, etc. to the issue tracker at -# . -# -# To the extent possible under law, the author(s) hereby waive all -# copyright and related or neighboring rights to this work. For -# details, see - -TOP_SRCDIR="$(dirname $0)" -CMAKE_CMD="cmake ${TOP_SRCDIR}" - -BUILD_TYPE="Debug" -PREFIX=/usr -DATA_DIR=${PREFIX}/share -INCLUDE_DIR=include/roojspacker -LIBDIR= -CMAKE_ARGS= - -if [ -e "${TOP_SRCDIR}/.configure-custom.sh" ]; then - . "${TOP_SRCDIR}/.configure-custom.sh" -fi - -quote() { - echo "$1" | sed -e "s|'|'\\\\''|g; 1s/^/'/; \$s/\$/'/" -} - -extract_var_string() { - VAR_NAME=$1 - VAR_NAME=$(echo $1 | sed -e 's/[ \t]*$//') - if [ "x$2" != "x" ]; then - VAR_VALUE=$2 - else - VAR_VALUE=yes - fi - - if [ "x$3" != "x" ]; then - VAR_UC_NAME=$3 - else - VAR_UC_NAME=$(echo "$1" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_' | sed 's/_$//g') - fi -} - -set_config_var() { - is_with=n - case "$1" in - "--enable-"*) - name="${1#--enable-}" - cfg="${ENABLE_VARS}" - ;; - "--disable-"*) - name="${1#--disable-}"; - cfg="${DISABLE_VARS}"; - ;; - "--with-"*) - # IFS="=" read -ra WITHARGS <<< "${1}" - name="${1#--with-}" - cfg="${WITH_VARS}" - is_with=y - ;; - esac - - found=n - for varstring in $cfg; do - extract_var_string $(echo "${varstring}" | tr '|' ' ') - if [ "x$VAR_NAME" = "x$name" ]; then - found=y - break; - fi - done - - if [ "$found" = "y" ]; then - if [ "x$is_with" = "xy" ]; then - CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "$2")" - else - CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "${VAR_VALUE}")" - fi - else - echo "Unknown parameter: ${1}" - exit 1 - fi -} - -prefix_to_offset() { - expr $(echo "${1}" | awk '{ print length }') + 1 -} - -print_help() { - cat <&2 - -h, --help display this help and exit - --disable-debug disable debugging mode - --pass-thru pass remaining arguments through to CMake - --prefix=PREFIX install architecture-independent files in PREFIX - [$PREFIX] - --bindir=DIR user executables [PREFIX/bin] - --sbindir=DIR system admin executables [PREFIX/sbin] - --libexecdir=DIR program executables [PREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [PREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PROJECT_NAME] -EOF - - first=y - for varstring in ${ENABLE_VARS}; do - if [ $first = 'y' ]; then - echo "" - first=n - fi - extract_var_string $(echo "${varstring}" | tr '|' ' ') - var_doc_name="ENABLE_${VAR_UC_NAME}_DOC" - eval "docstring=\$$var_doc_name" - if [ "x${docstring}" = "x" ]; then - printf " --enable-%-14s enable %s support\n" "${VAR_NAME}" "$(echo -n "${VAR_NAME}" | tr '-' ' ')" - else - printf " --enable-%-14s %s\n" "${VAR_NAME}" "$docstring" - fi - done - - first=y - for varstring in ${DISABLE_VARS}; do - if [ $first = 'y' ]; then - echo "" - first=n - fi - extract_var_string $(echo "${varstring}" | tr '|' ' ') - var_doc_name="DISABLE_${VAR_UC_NAME}_DOC" - eval "docstring=\$$var_doc_name" - if [ "x${docstring}" = "x" ]; then - printf " --disable-%-13s disable %s support\n" "${VAR_NAME}" "$(echo -n "${VAR_NAME}" | tr '-' ' ')" - else - printf " --disable-%-13s %s\n" "${VAR_NAME}" "$docstring" - fi - done - - first=y - for varstring in ${WITH_VARS}; do - if [ $first = 'y' ]; then - echo "" - first=n - fi - extract_var_string $(echo "${varstring}" | tr '|' ' ') - var_doc_name="WITH_${VAR_UC_NAME}_DOC" - eval "docstring=\$$var_doc_name" - paraminfo="${VAR_NAME}=${VAR_VALUE}" - if [ "x${docstring}" = "x" ]; then - printf " --with-%-16s enable %s support\n" "$paraminfo" "$(echo -n "${VAR_NAME}" | tr '-' ' ')" - else - printf " --with-%-16s %s\n" "$paraminfo" "$docstring" - fi - done - - exit 0 -} - -while [ $# != 0 ]; do - case "$1" in - "--prefix="*) - PREFIX="${1#*=}";; - "--prefix") - PREFIX="${2}"; shift;; - "--bindir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_BINDIR=$(quote "${1#*=}")";; - "--bindir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_BINDIR=$(quote "$2")"; shift;; - "--sbindir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SBINDIR=$(quote "${1#*=}")";; - "--sbindir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SBINDIR=$(quote "$2")"; shift;; - "--libexecdir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LIBEXECDIR=$(quote "${1#*=}")";; - "--libexecdir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LIBEXECDIR=$(quote "$2")"; shift;; - "--sysconfdir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SYSCONFDIR=$(quote "${1#*=}")";; - "--sysconfdir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SYSCONFDIR=$(quote "$2")"; shift;; - "--sharedstatedir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SHAREDSTATEDIR=$(quote "${1#*=}")";; - "--sharedstatedir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SHAREDSTATEDIR=$(quote "$2")"; shift;; - "--localstatedir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALSTATEDIR=$(quote "${1#*=}")";; - "--localstatedir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALSTATEDIR=$(quote "$2")"; shift;; - "--libdir="*) - LIBDIR="${1#*=}";; - "--libdir") - LIBDIR="${2}"; shift;; - "--includedir="*) - INCLUDE_DIR="${1#*=}";; - "--includedir") - INCLUDE_DIR="${2}"; shift;; - "--oldincludedir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_OLDINCLUDEDIR=$(quote "${1#*=}")";; - "--oldincludedir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_OLDINCLUDEDIR=$(quote "$2")"; shift;; - "--datarootdir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATAROOTDIR=$(quote "${1#*=}")";; - "--datarootdir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATAROOTDIR=$(quote "$2")"; shift;; - "--datadir="*) - DATA_DIR="$(quote "${1#*=}")"; shift;; - "--datadir") - DATA_DIR="$(quote "$2")"; shift;; - "--infodir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INFODIR=$(quote "${1#*=}")";; - "--infodir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INFODIR=$(quote "$2")"; shift;; - "--localedir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALEDIR=$(quote "${1#*=}")";; - "--localedir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALEDIR=$(quote "$2")"; shift;; - "--mandir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_MANDIR=$(quote "${1#*=}")";; - "--mandir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_MANDIR=$(quote "$2")"; shift;; - "--docdir="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DOCDIR=$(quote "${1#*=}")";; - "--docdir") - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DOCDIR=$(quote "$2")"; shift;; - - "CC="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_COMPILER=$(quote "${1#*=}")";; - "CXX="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_COMPILER=$(quote "${1#*=}")";; - "CFLAGS="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_FLAGS=$(quote "${1#*=}")";; - "CXXFLAGS="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_FLAGS=$(quote "${1#*=}")";; - "LDFLAGS="*) - LDFLAGS="$LDFLAGS ${1#*=}";; - - "--help") - print_help;; - "-h") - print_help;; - - # This flag is the only one which may be a bit surprising to - # people. Autotools always builds with debugging symbols enabled - # (AFAIK), but for cmake you have to do -DCMAKE_BUILD_TYPE=Debug. - # Unfortunately this can change other things as well, so although - # I realize there is no --disable-debug flag I thought it would be - # prudent to support one here. - "--disable-debug") - BUILD_TYPE="Release";; - - "--pass-thru") - shift; - while [ $# != 0 ]; do - CMAKE_ARGS="$CMAKE_ARGS $(quote "${1}")"; - shift; - done;; - - "--enable-"*) - set_config_var "$1" - ;; - - "--disable-"*) - set_config_var "$1" - ;; - - "--with-"*) - name=$(echo "${1#--with-}" | awk '{split($1,v,"="); print v[1]}') - case "${1}" in - "--with-${name}="*) - set_config_var "--with-${name}" "${1#--with-${name}=}";; - "--with-${name}") - set_config_var "$1" "$2"; - shift;; - esac - ;; - - *) - echo "$0: error: unrecognized option: \`$1'" >&2 - echo "Try \`$0 --help' for more information" >&2 - exit -1 - esac; - shift -done - -if [ "x${LIBDIR}" = "x" ]; then - LIBDIR="${PREFIX}/lib" -fi - -# Unlike CFLAGS/CXXFLAGS/CC/CXX, LDFLAGS isn't handled by CMake, so we -# need to parse it here. -if [ "x${LDFLAGS}" != "x" ]; then - for varname in EXE MODULE SHARED STATIC; do - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_${varname}_LINKER_FLAGS=$(quote "$LDFLAGS")" - done -fi - -CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=${BUILD_TYPE}" -CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX}" -CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATADIR=${DATA_DIR}" -CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INCLUDEDIR=${INCLUDE_DIR}" -CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=${LIBDIR} ${CMAKE_ARGS}" - -eval "cmake -Bbuild -H${TOP_SRCDIR} ${CMAKE_ARGS}" diff --git a/debian/README b/debian/README deleted file mode 100644 index 72d0cd6..0000000 --- a/debian/README +++ /dev/null @@ -1,6 +0,0 @@ -The Debian Package roojspacker ----------------------------- - -Comments regarding the Package - - -- Alan Thu, 16 May 2019 17:52:08 +0800 diff --git a/debian/README.Debian b/debian/README.Debian index e366a8f..1eb98b1 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -1,6 +1,6 @@ roojspacker for Debian --------------------- - + - -- Alan Thu, 16 May 2019 17:52:08 +0800 + -- Alan Thu, 15 Feb 2024 16:05:29 +0800 diff --git a/debian/README.source b/debian/README.source index 8f2e9d5..cc730e4 100644 --- a/debian/README.source +++ b/debian/README.source @@ -1,10 +1,10 @@ roojspacker for Debian --------------------- - + - -- Alan Thu, 16 May 2019 17:52:08 +0800 + -- Alan Thu, 15 Feb 2024 16:05:29 +0800 diff --git a/debian/changelog b/debian/changelog index 54762e4..9046123 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,11 @@ -roojspacker (1.4) UNRELEASED; urgency=medium +roojspacker (1.5) UNRELEASED; urgency=medium + + * Converted to Meson build + * PackerRun result format changed (closer to LSP) + + -- Alan Knowles Thu, 15 Feb 2024 16:05:29 +0800 + +roojspacker (1.4) unstable; urgency=medium * Upgrading detection of multiple features , including adding child depenancies and value lists etc. @@ -8,4 +15,5 @@ roojspacker (1.2) unstable; urgency=medium * Initial Release. - -- Alan Thu, 16 May 2019 17:52:08 +0800 + -- Alan Knowles Thu, 16 May 2019 17:52:08 +0800 + diff --git a/debian/compat b/debian/compat deleted file mode 100644 index b4de394..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 diff --git a/debian/control b/debian/control index b6c429d..33f2d9d 100644 --- a/debian/control +++ b/debian/control @@ -2,16 +2,20 @@ Source: roojspacker Section: unknown Priority: optional Maintainer: Alan -Build-Depends: debhelper (>= 11), autotools-dev -Standards-Version: 4.1.3 +Rules-Requires-Root: no +Build-Depends: + debhelper-compat (= 13), +Standards-Version: 4.6.2 Homepage: https://github.com/roojs/roojspacker Vcs-Git: https://github.com/roojs/roojspacker.git + Package: roojspacker Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: foreign +Depends: + ${shlibs:Depends}, + ${misc:Depends}, Description: Javascript compressor, packer and documentation tool includes sharable library for use with C / Gnome etc.. - - diff --git a/debian/copyright b/debian/copyright index dd5472b..3ef29d2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,20 +1,29 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: roojspacker Source: +Upstream-Name: roojspacker +Upstream-Contact: -Files: * -Copyright: - -License: GPL-3.0+ - -Files: debian/* -Copyright: 2019 Alan -License: GPL-3.0+ +Files: + * +Copyright: + + +License: + + + . + -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: + debian/* +Copyright: + 2024 Alan +License: GPL-2+ + This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, @@ -23,12 +32,16 @@ License: GPL-3.0+ GNU General Public License for more details. . You should have received a copy of the GNU General Public License - along with this program. If not, see . - . + along with this program. If not, see +Comment: On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". # Please also look if there are files or directories which have a # different copyright/license attached and list them here. # Please avoid picking licenses with terms that are more restrictive than the # packaged work, as it may make Debian's contributions unacceptable upstream. +# +# If you need, there are some extra license texts available in two places: +# /usr/share/debhelper/dh_make/licenses/ +# /usr/share/common-licenses/ diff --git a/debian/files b/debian/files index 5a58ab3..ffffa28 100644 --- a/debian/files +++ b/debian/files @@ -1,3 +1,3 @@ -roojspacker-dbgsym_1.4_amd64.ddeb debug optional automatic=yes -roojspacker_1.4_amd64.buildinfo unknown optional -roojspacker_1.4_amd64.deb unknown optional +roojspacker-dbgsym_1.5_amd64.ddeb debug optional automatic=yes +roojspacker_1.5_amd64.buildinfo unknown optional +roojspacker_1.5_amd64.deb unknown optional diff --git a/debian/manpage.1.ex b/debian/manpage.1.ex index 6a60a6b..9ea8d97 100644 --- a/debian/manpage.1.ex +++ b/debian/manpage.1.ex @@ -1,10 +1,10 @@ .\" Hey, EMACS: -*- nroff -*- -.\" (C) Copyright 2019 Alan , +.\" (C) Copyright 2024 Alan , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH Roojspacker SECTION "May 16 2019" +.TH Roojspacker SECTION "February 15 2024" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -38,7 +38,7 @@ commands. \fBroojspacker\fP is a program that... .SH OPTIONS These programs follow the usual GNU command line syntax, with long -options starting with two dashes (`-'). +options starting with two dashes ('\-'). A summary of options is included below. For a complete description, see the Info files. .TP diff --git a/debian/manpage.md.ex b/debian/manpage.md.ex new file mode 100644 index 0000000..5f5fe4e --- /dev/null +++ b/debian/manpage.md.ex @@ -0,0 +1,126 @@ +% roojspacker(SECTION) | User Commands +% +% "February 15 2024" + +[comment]: # The lines above form a Pandoc metadata block. They must be +[comment]: # the first ones in the file. +[comment]: # See https://pandoc.org/MANUAL.html#metadata-blocks for details. + +[comment]: # pandoc -s -f markdown -t man package.md -o package.1 +[comment]: # +[comment]: # A manual page package.1 will be generated. You may view the +[comment]: # manual page with: nroff -man package.1 | less. A typical entry +[comment]: # in a Makefile or Makefile.am is: +[comment]: # +[comment]: # package.1: package.md +[comment]: # pandoc --standalone --from=markdown --to=man $< --output=$@ +[comment]: # +[comment]: # The pandoc binary is found in the pandoc package. Please remember +[comment]: # that if you create the nroff version in one of the debian/rules +[comment]: # file targets, such as build, you will need to include pandoc in +[comment]: # your Build-Depends control field. + +[comment]: # Remove the lines starting with '[comment]:' in this file in order +[comment]: # to avoid warning messages from pandoc. + +# NAME + +roojspacker - program to do something + +# SYNOPSIS + +**roojspacker** **-e** _this_ [**\-\-example=that**] [{**-e** | **\-\-example**} _this_] + [{**-e** | **\-\-example**} {_this_ | _that_}] + +**roojspacker** [{**-h** | *\-\-help**} | {**-v** | **\-\-version**}] + +# DESCRIPTION + +This manual page documents briefly the **roojspacker** and **bar** commands. + +This manual page was written for the Debian distribution because the +original program does not have a manual page. Instead, it has documentation +in the GNU info(1) format; see below. + +**roojspacker** is a program that... + +# OPTIONS + +The program follows the usual GNU command line syntax, with long options +starting with two dashes ('-'). A summary of options is included below. For +a complete description, see the **info**(1) files. + +**-e** _this_, **\-\-example=**_that_ +: Does this and that. + +**-h**, **\-\-help** +: Show summary of options. + +**-v**, **\-\-version** +: Show version of program. + +# FILES + +/etc/foo.conf +: The system-wide configuration file to control the behaviour of + roojspacker. See **foo.conf**(5) for further details. + +${HOME}/.foo.conf +: The per-user configuration file to control the behaviour of + roojspacker. See **foo.conf**(5) for further details. + +# ENVIRONMENT + +**FOO_CONF** +: If used, the defined file is used as configuration file (see also + the section called “FILES”). + +# DIAGNOSTICS + +The following diagnostics may be issued on stderr: + +Bad configuration file. Exiting. +: The configuration file seems to contain a broken configuration + line. Use the **\-\-verbose** option, to get more info. + +**roojspacker** provides some return codes, that can be used in scripts: + + Code Diagnostic + 0 Program exited successfully. + 1 The configuration file seems to be broken. + +# BUGS + +The program is currently limited to only work with the foobar library. + +The upstream BTS can be found at http://bugzilla.foo.tld. + +# SEE ALSO + +**bar**(1), **baz**(1), **foo.conf**(5) + +The programs are documented fully by The Rise and Fall of a Fooish Bar +available via the **info**(1) system. + +# AUTHOR + +Alan +: Wrote this manpage for the Debian system. + +# COPYRIGHT + +Copyright © 2007 Alan + +This manual page was written for the Debian system (and may be used by +others). + +Permission is granted to copy, distribute and/or modify this document under +the terms of the GNU General Public License, Version 2 or (at your option) +any later version published by the Free Software Foundation. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL. + +[comment]: # Local Variables: +[comment]: # mode: markdown +[comment]: # End: diff --git a/debian/manpage.sgml.ex b/debian/manpage.sgml.ex index cf0c12b..a8ef853 100644 --- a/debian/manpage.sgml.ex +++ b/debian/manpage.sgml.ex @@ -1,8 +1,8 @@ manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | + page: 'docbook-to-man manpage.sgml > manpage.1'. You may view + the manual page with: 'docbook-to-man manpage.sgml | nroff -man | less'. A typical entry in a Makefile or Makefile.am is: manpage.1: manpage.sgml @@ -20,11 +20,11 @@ manpage.1: manpage.sgml FIRSTNAME"> SURNAME"> - May 16 2019"> + February 15 2024"> SECTION"> - alan@roojs.com"> + alan@office.roojs.com"> Roojspacker"> @@ -87,7 +87,7 @@ manpage.1: manpage.sgml OPTIONS These programs follow the usual &gnu; command line syntax, - with long options starting with two dashes (`-'). A summary of + with long options starting with two dashes ('-'). A summary of options is included below. For a complete description, see the Info files. diff --git a/debian/manpage.xml.ex b/debian/manpage.xml.ex index 131ca7b..c13f14c 100644 --- a/debian/manpage.xml.ex +++ b/debian/manpage.xml.ex @@ -9,7 +9,7 @@ -''-param make.year.ranges "1" \ -''-param make.single.year.ranges "1" \ /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \ - manpage.xml' + manpage.xml` A manual page .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry @@ -49,7 +49,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ - + @@ -159,7 +159,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ OPTIONS The program follows the usual GNU command line syntax, - with long options starting with two dashes (`-'). A summary of + with long options starting with two dashes ('-'). A summary of options is included below. For a complete description, see the info diff --git a/debian/menu.ex b/debian/menu.ex deleted file mode 100644 index f8587d4..0000000 --- a/debian/menu.ex +++ /dev/null @@ -1,2 +0,0 @@ -?package(roojspacker):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\ - title="roojspacker" command="/usr/bin/roojspacker" diff --git a/debian/postinst.ex b/debian/postinst.ex index 944049f..a0b45d8 100644 --- a/debian/postinst.ex +++ b/debian/postinst.ex @@ -1,21 +1,21 @@ #!/bin/sh -# postinst script for roojspacker +# postinst script for roojspacker. # -# see: dh_installdeb(1) +# See: dh_installdeb(1). set -e -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' +# Summary of how this script can be called: +# * 'configure' +# * 'abort-upgrade' +# * 'abort-remove' 'in-favour' # -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' +# * 'abort-remove' +# * 'abort-deconfigure' 'in-favour' +# 'removing' # # for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# the debian-policy package. case "$1" in @@ -26,7 +26,7 @@ case "$1" in ;; *) - echo "postinst called with unknown argument \`$1'" >&2 + echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/debian/postrm.ex b/debian/postrm.ex index 0fb28fb..d9bfe07 100644 --- a/debian/postrm.ex +++ b/debian/postrm.ex @@ -1,22 +1,22 @@ #!/bin/sh -# postrm script for roojspacker +# postrm script for roojspacker. # -# see: dh_installdeb(1) +# See: dh_installdeb(1). set -e -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' +# Summary of how this script can be called: +# * 'remove' +# * 'purge' +# * 'upgrade' +# * 'failed-upgrade' +# * 'abort-install' +# * 'abort-install' +# * 'abort-upgrade' +# * 'disappear' # # for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# the debian-policy package. case "$1" in @@ -24,7 +24,7 @@ case "$1" in ;; *) - echo "postrm called with unknown argument \`$1'" >&2 + echo "postrm called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/debian/preinst.ex b/debian/preinst.ex index ce3414f..03292b9 100644 --- a/debian/preinst.ex +++ b/debian/preinst.ex @@ -1,17 +1,17 @@ #!/bin/sh -# preinst script for roojspacker +# preinst script for roojspacker. # -# see: dh_installdeb(1) +# See: dh_installdeb(1). set -e -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' +# Summary of how this script can be called: +# * 'install' +# * 'install' +# * 'upgrade' +# * 'abort-upgrade' # for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# the debian-policy package. case "$1" in @@ -22,7 +22,7 @@ case "$1" in ;; *) - echo "preinst called with unknown argument \`$1'" >&2 + echo "preinst called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/debian/prerm.ex b/debian/prerm.ex index 9c1be9c..03a3d34 100644 --- a/debian/prerm.ex +++ b/debian/prerm.ex @@ -1,20 +1,20 @@ #!/bin/sh -# prerm script for roojspacker +# prerm script for roojspacker. # -# see: dh_installdeb(1) +# See: dh_installdeb(1). set -e -# summary of how this script can be called: -# * `remove' -# * `upgrade' -# * `failed-upgrade' -# * `remove' `in-favour' -# * `deconfigure' `in-favour' -# `removing' +# Summary of how this script can be called: +# * 'remove' +# * 'upgrade' +# * 'failed-upgrade' +# * 'remove' 'in-favour' +# * 'deconfigure' 'in-favour' +# 'removing' # # for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# the debian-policy package. case "$1" in @@ -25,7 +25,7 @@ case "$1" in ;; *) - echo "prerm called with unknown argument \`$1'" >&2 + echo "prerm called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/debian/roojspacker-docs.docs b/debian/roojspacker-docs.docs index d6341a0..7319041 100644 --- a/debian/roojspacker-docs.docs +++ b/debian/roojspacker-docs.docs @@ -1,3 +1,2 @@ README.source -README README.Debian diff --git a/debian/roojspacker.cron.d.ex b/debian/roojspacker.cron.d.ex index 432533f..6a2817e 100644 --- a/debian/roojspacker.cron.d.ex +++ b/debian/roojspacker.cron.d.ex @@ -1,4 +1,4 @@ # -# Regular cron jobs for the roojspacker package +# Regular cron jobs for the roojspacker package. # 0 4 * * * root [ -x /usr/bin/roojspacker_maintenance ] && /usr/bin/roojspacker_maintenance diff --git a/debian/roojspacker.debhelper.log b/debian/roojspacker.debhelper.log deleted file mode 100644 index 6991c52..0000000 --- a/debian/roojspacker.debhelper.log +++ /dev/null @@ -1 +0,0 @@ -dh_auto_configure diff --git a/debian/roojspacker.doc-base.EX b/debian/roojspacker.doc-base.EX deleted file mode 100644 index 83aafb2..0000000 --- a/debian/roojspacker.doc-base.EX +++ /dev/null @@ -1,20 +0,0 @@ -Document: roojspacker -Title: Debian roojspacker Manual -Author: -Abstract: This manual describes what roojspacker is - and how it can be used to - manage online manuals on Debian systems. -Section: unknown - -Format: debiandoc-sgml -Files: /usr/share/doc/roojspacker/roojspacker.sgml.gz - -Format: postscript -Files: /usr/share/doc/roojspacker/roojspacker.ps.gz - -Format: text -Files: /usr/share/doc/roojspacker/roojspacker.text.gz - -Format: HTML -Index: /usr/share/doc/roojspacker/html/index.html -Files: /usr/share/doc/roojspacker/html/*.html diff --git a/debian/roojspacker.substvars b/debian/roojspacker.substvars index ead1b51..ad8015a 100644 --- a/debian/roojspacker.substvars +++ b/debian/roojspacker.substvars @@ -1,3 +1,3 @@ -shlibs:Depends=libc6 (>= 2.34), libgee-0.8-2 (>= 0.8.3), libglib2.0-0 (>= 2.37.3), libjson-glib-1.0-0 (>= 1.5.2), roojspacker +shlibs:Depends=libc6 (>= 2.34), libgee-0.8-2 (>= 0.8.3), libglib2.0-0 (>= 2.54.0), libjson-glib-1.0-0 (>= 1.5.2) misc:Depends= misc:Pre-Depends= diff --git a/debian/rules b/debian/rules index 20669fb..f1d1d25 100755 --- a/debian/rules +++ b/debian/rules @@ -1,28 +1,26 @@ #!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. + +# See debhelper(7) (uncomment to enable). +# Output every command that modifies files on the build system. #export DH_VERBOSE = 1 -# see FEATURE AREAS in dpkg-buildflags(1) +# See FEATURE AREAS in dpkg-buildflags(1). #export DEB_BUILD_MAINT_OPTIONS = hardening=+all -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS +# See ENVIRONMENT in dpkg-buildflags(1). +# Package maintainers to append CFLAGS. #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS +# Package maintainers to append LDFLAGS. #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -#override_dh_auto_test: -#override_dh_usrlocal: - %: - dh $@ --buildsystem=cmake - + dh $@ -# dh_make generated override targets -# This is example for Cmake (See https://bugs.debian.org/641051 ) -override_dh_auto_configure: - dh_auto_configure -- -DCMAKE_INSTALL_DATADIR=share +# dh_make generated override targets. +# This is an example for Cmake (see ). +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/debian/salsa-ci.yml.ex b/debian/salsa-ci.yml.ex new file mode 100644 index 0000000..a6fb8bd --- /dev/null +++ b/debian/salsa-ci.yml.ex @@ -0,0 +1,11 @@ +# For more information on what jobs are run see: +# https://salsa.debian.org/salsa-ci-team/pipeline +# +# To enable the jobs, go to your repository (at salsa.debian.org) +# and click over Settings > CI/CD > Expand (in General pipelines). +# In "CI/CD configuration file" write debian/salsa-ci.yml and click +# in "Save Changes". The CI tests will run after the next commit. +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff --git a/debian/source/format b/debian/source/format index 89ae9db..163aaf8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt) diff --git a/debian/upstream/metadata.ex b/debian/upstream/metadata.ex new file mode 100644 index 0000000..2bc070e --- /dev/null +++ b/debian/upstream/metadata.ex @@ -0,0 +1,10 @@ +# Example file for upstream/metadata. +# See https://wiki.debian.org/UpstreamMetadata for more info/fields. +# Below an example based on a github project. + +# Bug-Database: https://github.com//roojspacker/issues +# Bug-Submit: https://github.com//roojspacker/issues/new +# Changelog: https://github.com//roojspacker/blob/master/CHANGES +# Documentation: https://github.com//roojspacker/wiki +# Repository-Browse: https://github.com//roojspacker +# Repository: https://github.com//roojspacker.git diff --git a/debian/watch.ex b/debian/watch.ex new file mode 100644 index 0000000..2d3d567 --- /dev/null +++ b/debian/watch.ex @@ -0,0 +1,37 @@ +# Example watch control file for uscan. +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# See uscan(1) for format. + +# Compulsory line, this is a version 4 file. +version=4 + +# PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig. +#opts="pgpsigurlmangle=s%$%.sig%" + +# HTTP site (basic). +#http://example.com/downloads.html \ +# files/roojspacker-([\d\.]+)\.tar\.gz + +# Uncomment to examine an FTP server. +#ftp://ftp.example.com/pub/roojspacker-(.*)\.tar\.gz + +# SourceForge hosted projects. +#http://sf.net/roojspacker/ roojspacker-(.*)\.tar\.gz + +# GitHub hosted projects. +#opts="filenamemangle=s%(?:.*?)?v?(@ANY_VERSION@@ARCHIVE_EXT@)%@PACKAGE@-$1%" \ +# https://github.com///tags \ +# (?:.*?/)v?@ANY_VERSION@@ARCHIVE_EXT@ + +# GitLab hosted projects. +#opts="filenamemangle=s%(?:.*?)?v?(@ANY_VERSION@@ARCHIVE_EXT@)%@PACKAGE@-$1%" \ +# https://gitlab.com///-/tags \ +# archive/v?@ANY_VERSION@/-v?\d\S*@ARCHIVE_EXT@ + +# PyPI. +#https://pypi.debian.net/roojspacker/roojspacker-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) + +# Direct Git. +#opts="mode=git" http://git.example.com/roojspacker.git \ +# refs/tags/v([\d\.]+) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..25e5049 --- /dev/null +++ b/meson.build @@ -0,0 +1,110 @@ +project('roojspacker', 'vala', 'c', + version: '1.5', + license: 'LGPL', + default_options: [ + 'default_library=static', + 'c_std=gnu11' # for C subprojects + ] +) +gnome = import('gnome') + +valac = meson.get_compiler('vala') + +extra_vala_sources = [] + + + +deps = [ + dependency('gobject-2.0'), + dependency('gio-2.0'), + dependency('gio-unix-2.0'), + dependency('gee-0.8'), + dependency('json-glib-1.0'), + valac.find_library('posix'), + +] + +# let Vala add the appropriate defines for GLIB_X_X +add_project_arguments(['--target-glib=auto'], language: 'vala') + + + +conf = configuration_data() +conf.set('PROJECT_NAME', meson.project_name()) + + + + + + + + + +roojspacker_src = files([ + 'roojspacker/Collapse.vala', + 'roojspacker/CompressWhite.vala', + 'roojspacker/DocBuilder.vala', + 'roojspacker/DocComment.vala', + 'roojspacker/DocParser.vala', + 'bin/main.vala', + 'roojspacker/DocTag.vala', + 'roojspacker/Identifier.vala', + 'roojspacker/Lang.vala', + 'roojspacker/PackerRun.vala', + 'roojspacker/Packer.vala', + 'roojspacker/PrettyPrint.vala', + 'roojspacker/ScopeParser.vala', + 'roojspacker/Scope.vala', + 'roojspacker/SymbolSet.vala', + 'roojspacker/Symbol.vala', + 'roojspacker/TextStream.vala', + 'roojspacker/TokenReader.vala', + 'roojspacker/TokenStream.vala', + 'roojspacker/Token.vala', + 'roojspacker/Walker.vala', +]) + + +roojspacker = executable('roojspacker', + dependencies: deps, + sources: [ roojspacker_src ], + install: true +) +roojspack_src = files([ + 'roojspacker/Collapse.vala', + 'roojspacker/CompressWhite.vala', + 'roojspacker/DocBuilder.vala', + 'roojspacker/DocComment.vala', + 'roojspacker/DocParser.vala', + 'roojspacker/DocTag.vala', + 'roojspacker/Identifier.vala', + 'roojspacker/Lang.vala', + 'roojspacker/PackerRun.vala', + 'roojspacker/Packer.vala', + 'roojspacker/PrettyPrint.vala', + 'roojspacker/ScopeParser.vala', + 'roojspacker/Scope.vala', + 'roojspacker/SymbolSet.vala', + 'roojspacker/Symbol.vala', + 'roojspacker/TextStream.vala', + 'roojspacker/TokenReader.vala', + 'roojspacker/TokenStream.vala', + 'roojspacker/Token.vala', + 'roojspacker/Walker.vala', +]) + + +roojspack_lib = shared_library('roojspack', + sources : [ roojspack_src ], + vala_vapi: 'roojspack-1.5.vapi', + dependencies: deps, + install: true, + install_dir: [true, true, true] +) +pkg = import('pkgconfig') +pkg.generate( roojspack_lib, + filebase: 'roojspack-1.5', + requires : ['gobject-2.0','gio-2.0','gio-unix-2.0','gee-0.8','json-glib-1.0'] +) + + diff --git a/old_deb_control b/old_deb_control new file mode 100644 index 0000000..b6c429d --- /dev/null +++ b/old_deb_control @@ -0,0 +1,17 @@ +Source: roojspacker +Section: unknown +Priority: optional +Maintainer: Alan +Build-Depends: debhelper (>= 11), autotools-dev +Standards-Version: 4.1.3 +Homepage: https://github.com/roojs/roojspacker +Vcs-Git: https://github.com/roojs/roojspacker.git + +Package: roojspacker +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Javascript compressor, packer and documentation tool + includes sharable library for use with C / Gnome etc.. + + + diff --git a/roojspacker/CMakeLists.txt b/roojspacker/CMakeLists.txt deleted file mode 100644 index 85abf2b..0000000 --- a/roojspacker/CMakeLists.txt +++ /dev/null @@ -1,171 +0,0 @@ -# -# -# Library Target: linked against executable and tests. - -# Generate a config.vala file, which can be used for version -# information and feature detection. -#configure_file( -# "${CMAKE_CURRENT_SOURCE_DIR}/config.vala.in" -# "${CMAKE_CURRENT_BINARY_DIR}/config.vala" -# @ONLY) - -# You can re-type these if you prefer; putting them in variables makes -# it easier to reuse them, and helps explain what each command needs -# to include. - -# The name of the C header, without the trailing ".h" -set(ROOJSPACKER_HEADER ${PROJECT_NAME}) - -# These are the Vala sources you want to build your library out of. -set(ROOJSPACKER_VALA_SOURCES - Collapse.vala - CompressWhite.vala - Identifier.vala - Lang.vala - Packer.vala - ScopeParser.vala - Scope.vala - TextStream.vala - TokenReader.vala - TokenStream.vala - Token.vala - PackerRun.vala - Walker.vala - SymbolSet.vala - DocBuilder.vala - DocComment.vala - DocParser.vala - DocTag.vala - PrettyPrint.vala - Symbol.vala -) - - - -# Compile Vala -> C -vala_precompile_target( - "${ROOJSPACKER_LIBRARY_NAME}-vala" - ROOJSPACKER_C_SOURCES - PACKAGES ${ROOJSPACKER_VALA_PACKAGES} - VAPI "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.vapi" -# GIR "${ROOJSPACKER_GIR_NAME}.gir" - HEADER "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.h" - ${ROOJSPACKER_VALA_SOURCES}) - -# Compile the library. -# -# By default, we create and install a shared library. If you don't -# want to do that, you can change "SHARED" in the below function call -# to "STATIC". -add_library(${ROOJSPACKER_LIBRARY_NAME} - SHARED - ${ROOJSPACKER_C_SOURCES}) - -# Make sure the Vala sources are compiled to C before attempting to -# build the library. -add_dependencies("${ROOJSPACKER_LIBRARY_NAME}" "${ROOJSPACKER_LIBRARY_NAME}-vala") - -# Generate a .gitignore -file(WRITE ".gitignore" "# Automatically generated by CMake, do not modify.\n") -foreach(file - ".gitignore" - "${CMAKE_SHARED_LIBRARY_PREFIX}${ROOJSPACKER_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}*" - "${CMAKE_STATIC_LIBRARY_PREFIX}${ROOJSPACKER_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" - "${CMAKE_SHARED_LIBRARY_PREFIX}${ROOJSPACKER_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ROOJSPACKER_VERSION_API}" - "${CMAKE_SHARED_LIBRARY_PREFIX}${ROOJSPACKER_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ROOJSPACKER_VERSION_API}.${ROOJSPACKER_VERSION_REVISION}" - "${ROOJSPACKER_PKG_NAME}.pc" - "config.vala") - file(APPEND ".gitignore" "/${file}\n") -endforeach(file) -foreach(file ${ROOJSPACKER_C_SOURCES}) - string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" file ${file}) - file(APPEND ".gitignore" "/${file}\n") -endforeach(file) - -# Define the gettext domain -#set_property (TARGET ${ROOJSPACKER_LIBRARY_NAME} -# APPEND PROPERTY COMPILE_DEFINITIONS GETTEXT_PACKAGE="${GETTEXT_PACKAGE}") - -# If you don't want to build and install a shared library, comment out -# (or remove) everything below this point. - -# Set the library's version information -set_target_properties (${ROOJSPACKER_LIBRARY_NAME} PROPERTIES - SOVERSION "${ROOJSPACKER_SOVERSION_CURRENT}.${ROOJSPACKER_SOVERSION_REVISION}.${ROOJSPACKER_SOVERSION_AGE}" - VERSION "${ROOJSPACKER_SOVERSION_CURRENT}.${ROOJSPACKER_SOVERSION_REVISION}") - -# GObject Introspection support -#find_package(GObjectIntrospection REQUIRED) -# Gir Repositories support -#find_file(GIREPOSITORY_FILE GObject-2.0.gir /usr/share/gir-1.0 ) -#if(GIREPOSITORY_FILE) -#else() -# message(FATAL_ERROR "Package libgirepository-dev not found.") -#endif() - -# We already had valac write a GIR, now we need to compile it to a -# typelib. -#gobject_introspection_compile( -# "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_GIR_NAME}.typelib" -# "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_GIR_NAME}.gir") - -# Telling CMake you want to install a file doesn't actually get it to -# *build* that file. The workaround is to add a custom target which -# is always built and depens on the file we want to install. -#add_custom_target(typelib ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_GIR_NAME}.typelib") - -# Install our typelib -#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_GIR_NAME}.typelib" -# DESTINATION "${GI_TYPELIB_DIR}") - -# Install our GIR -#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_GIR_NAME}.gir" -# DESTINATION "${GI_REPOSITORY_DIR}") - -# Install our VAPI -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.vapi - DESTINATION ${CMAKE_INSTALL_DATADIR}/vala/vapi) - -# Install the library -install ( - TARGETS ${ROOJSPACKER_LIBRARY_NAME} - RUNTIME DESTINATION bin # On Windows, the DLL goes in the same place as the executables - LIBRARY DESTINATION lib # This is where shared libraries (*.so on Linux, *.dynlib on OS X) - ARCHIVE DESTINATION lib) # Finally, this is where static libraries (*.a) go - -# Install the C header -#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.h -# DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/) - -INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.h - DESTINATION include) - - -# Generate and install a pkg-config file -configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.pc" - @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ROOJSPACKER_PKG_NAME}.pc - DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig) - -# Generate documentation -#find_package(Valadoc) -#if(${VALADOC_FOUND}) -# valadoc_generate(html -# PACKAGE_NAME ${ROOJSPACKER_PKG_NAME} -# PACKAGE_VERSION "${ROOJSPACKER_VERSION_MAJOR}.${ROOJSPACKER_VERSION_MINOR}.${ROOJSPACKER_VERSION_REVISION}" -# SOURCES ${ROOJSPACKER_VALA_SOURCES} -# PACKAGES ${ROOJSPACKER_VALA_PACKAGES}) -# valadoc_generate(devhelp -# DOCLET devhelp -# PACKAGE_NAME ${ROOJSPACKER_PKG_NAME} -# PACKAGE_VERSION "${ROOJSPACKER_VERSION_MAJOR}.${ROOJSPACKER_VERSION_MINOR}.${ROOJSPACKER_VERSION_REVISION}" -# SOURCES ${ROOJSPACKER_VALA_SOURCES} -# PACKAGES ${ROOJSPACKER_VALA_PACKAGES}) -# -# install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/devhelp/${ROOJSPACKER_PKG_NAME}" -# DESTINATION "${CMAKE_INSTALL_DATADIR}/devhelp/books") -# add_custom_target(doc ALL -# DEPENDS html devhelp) -#endif() diff --git a/roojspacker/CompressWhite.vala b/roojspacker/CompressWhite.vala index a3971af..d647621 100644 --- a/roojspacker/CompressWhite.vala +++ b/roojspacker/CompressWhite.vala @@ -20,7 +20,7 @@ namespace JSDOC //ts.dumpAllFlat(); GLib.Process.exit(1); //var str = File.read(fn); - var rep_var = 1; + diff --git a/roojspacker/Lang.vala b/roojspacker/Lang.vala index 0161220..a772440 100644 --- a/roojspacker/Lang.vala +++ b/roojspacker/Lang.vala @@ -109,8 +109,7 @@ namespace JSDOC { case TokenName.RIGHT_BRACE: return TokenName.LEFT_BRACE; default: throw new LangError.ArgumentError("invalid matching character : %s", name.to_string()); - - return null; + }; //return this.matchingNames.get(name); @@ -118,7 +117,7 @@ namespace JSDOC { public bool isKeyword(string word) { try { - var x = this.keyword(word); + this.keyword(word); return true; } catch (LangError e) { return false; diff --git a/roojspacker/Packer.vala b/roojspacker/Packer.vala index 782e40c..7821864 100644 --- a/roojspacker/Packer.vala +++ b/roojspacker/Packer.vala @@ -124,8 +124,8 @@ namespace JSDOC // this could be another class really.. public enum ResultType { - err , - warn; + err = 1 , + warn = 2; public string to_string() { switch(this) { case err: return "ERR"; @@ -150,68 +150,74 @@ namespace JSDOC //#if HAVE_JSON_GLIB + // loosely based on diagnostics in LSP + // key/value key = filename / value = LSP.Diagnostic + public Json.Object result; // output - what's the complication result + - public void logError(ResultType type, string filename, int line, string message) { - - if (!this.result.has_member(type.to_string()+"-TOTAL")) { - this.result.set_int_member(type.to_string()+"-TOTAL", 1); - } else { - this.result.set_int_member(type.to_string()+"-TOTAL", - this.result.get_int_member(type.to_string()+"-TOTAL") +1 - ); - } - - - if (!this.result.has_member(type.to_string())) { - this.result.set_object_member(type.to_string(), new Json.Object()); - } - var t = this.result.get_object_member(type.to_string()); - if (!t.has_member(filename)) { - t.set_object_member(filename, new Json.Object()); - } - var tt = t.get_object_member(filename); - if (!tt.has_member(line.to_string())) { - tt.set_array_member(line.to_string(), new Json.Array()); - } - var tl = tt.get_array_member(line.to_string()); - tl.add_string_element(message); + public void logError(ResultType type, string filename, int line, string message) + { + if (!this.result.has_member(type.to_string())) { + this.result.set_array_member(filename, new Json.Array()); + } + var fa = this.result.get_array_member( filename); + var diag = new Json.Object(); + diag.set_string_member( "message", message ); + diag.set_int_member( "severity", (int) type ); + diag.set_int_member( "line", line ); + fa.add_object_element(diag); + } - + public bool hasErrors(string fn) { - if (!this.result.has_member(ResultType.err.to_string())) { - return false; - } - - if (fn.length < 1) { - return true; - } - var t = this.result.get_object_member(ResultType.err.to_string()); - - if (t.has_member(fn)) { - return true; - } - return false; + var ret = false; + this.result.foreach_member((obj, filename, node) => { + if (ret) { + return; + } + var ar = this.result.get_array_member(filename.to_string()); + if (fn == "") { + if (ar.get_length() > 0) { + ret = true; + return; + } + return; // next. + } + + if (fn != filename) { + return; // next; + } + if (ar.get_length() > 0) { + ret = true; + return; + } + + }); + + return ret; } + public void dumpErrors(ResultType type) { - if (!this.result.has_member(type.to_string())) { - return; - } - var t = this.result.get_object_member(type.to_string()); - t.foreach_member((obj, filename, node) => { - var linelist = node.dup_object(); - linelist.foreach_member((linelistobj, linestr, nodear) => { - var errors= nodear.dup_array(); - errors.foreach_element((errorar, ignore, nodestr) => { - print("%s: %s:%s %s\n", type.to_string(), filename, linestr, nodestr.get_string()); - }); - }); + this.result.foreach_member((obj, filename, node) => { + + var ar = this.result.get_array_member(filename.to_string()); + for(var i = 0; i < ar.get_length(); i++) { + var el = ar.get_object_element(i); + var ty = el.get_int_member("severity"); + if ((int)ty != type) { + continue; + } + print("%s: %s:%d %s\n", type.to_string(), filename, (int)el.get_int_member("line"), el.get_string_member("message")); + + } }); } + /*#else public Gee.HashMap result_count; // output - what's the complication result diff --git a/roojspacker/ScopeParser.vala b/roojspacker/ScopeParser.vala index 616fd23..ea58d87 100644 --- a/roojspacker/ScopeParser.vala +++ b/roojspacker/ScopeParser.vala @@ -700,7 +700,14 @@ namespace JSDOC { TokenKeyMap val = token.props.get(k); if (val == null) { - print("failed to get %s val from token %s\n", k, token.asString()); + this.packer.logError( + Packer.ResultType.warn, + this.filename, + token.line, + "could not get '" + k+ "' but got token " + token.asString() + ); + + //print("failed to get %s val from token %s\n", k, token.asString()); continue; } -- 2.39.2