From 48e05bd339fee1bd3d07e26cfd7db798ff0c8ea3 Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 4 Oct 2016 02:00:51 +0200 Subject: [PATCH] Add ragel package [roschuma rebase: removed main.cpp] --- .../0001-Remove-unistd.h-include-1.patch | 24 ++++ .../0002-Remove-unistd.h-include-2.patch | 24 ++++ ports/ragel/0003-Fix-rsxgoto.cpp-build.patch | 25 ++++ ports/ragel/CMakeLists.txt | 131 ++++++++++++++++++ ports/ragel/CONTROL | 3 + ports/ragel/config.h | 26 ++++ ports/ragel/portfile.cmake | 49 +++++++ 7 files changed, 282 insertions(+) create mode 100644 ports/ragel/0001-Remove-unistd.h-include-1.patch create mode 100644 ports/ragel/0002-Remove-unistd.h-include-2.patch create mode 100644 ports/ragel/0003-Fix-rsxgoto.cpp-build.patch create mode 100644 ports/ragel/CMakeLists.txt create mode 100644 ports/ragel/CONTROL create mode 100644 ports/ragel/config.h create mode 100644 ports/ragel/portfile.cmake diff --git a/ports/ragel/0001-Remove-unistd.h-include-1.patch b/ports/ragel/0001-Remove-unistd.h-include-1.patch new file mode 100644 index 000000000..d024401fc --- /dev/null +++ b/ports/ragel/0001-Remove-unistd.h-include-1.patch @@ -0,0 +1,24 @@ +From 4a337ce9475c75497f4221cadd9d2dd8126835c7 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Tue, 4 Oct 2016 17:54:22 +0200 +Subject: [PATCH 1/2] Remove unistd.h include 1 + +--- + ragel-6.9/ragel/main.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/ragel-6.9/ragel/main.cpp b/ragel-6.9/ragel/main.cpp +index f5fbd7b..e3bcc18 100644 +--- a/ragel-6.9/ragel/main.cpp ++++ b/ragel-6.9/ragel/main.cpp +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + #include + #include + #include +-- +2.10.0.windows.1 + diff --git a/ports/ragel/0002-Remove-unistd.h-include-2.patch b/ports/ragel/0002-Remove-unistd.h-include-2.patch new file mode 100644 index 000000000..bade77889 --- /dev/null +++ b/ports/ragel/0002-Remove-unistd.h-include-2.patch @@ -0,0 +1,24 @@ +From 259bb8be3f66e32063652cb4f1a456b7327ca513 Mon Sep 17 00:00:00 2001 +From: vlj +Date: Tue, 4 Oct 2016 17:54:38 +0200 +Subject: [PATCH 2/2] Remove unistd.h include 2 + +--- + ragel-6.9/ragel/main.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/ragel-6.9/ragel/main.cpp b/ragel-6.9/ragel/main.cpp +index e3bcc18..947b1c8 100644 +--- a/ragel-6.9/ragel/main.cpp ++++ b/ragel-6.9/ragel/main.cpp +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + #include + #include + #include +-- +2.10.0.windows.1 + diff --git a/ports/ragel/0003-Fix-rsxgoto.cpp-build.patch b/ports/ragel/0003-Fix-rsxgoto.cpp-build.patch new file mode 100644 index 000000000..3ab8857e1 --- /dev/null +++ b/ports/ragel/0003-Fix-rsxgoto.cpp-build.patch @@ -0,0 +1,25 @@ +From 852aebf39d85964141cf9243d89abc2d5ee761ce Mon Sep 17 00:00:00 2001 +From: vlj +Date: Tue, 4 Oct 2016 18:22:41 +0200 +Subject: [PATCH 3/3] Fix rsxgoto.cpp build. + +--- + ragel-6.9/ragel/rbxgoto.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ragel-6.9/ragel/rbxgoto.cpp b/ragel-6.9/ragel/rbxgoto.cpp +index c54cb00..9e33425 100644 +--- a/ragel-6.9/ragel/rbxgoto.cpp ++++ b/ragel-6.9/ragel/rbxgoto.cpp +@@ -658,7 +658,7 @@ void RbxGotoCodeGen::BREAK( ostream &ret, int targState ) + out << + " begin\n" + " " << P() << " += 1\n" +- " " << rbxGoto(ret, "_out") << "\n" ++ " "; rbxGoto(ret, "_out") << "\n" + " end\n"; + } + +-- +2.8.3.windows.1 + diff --git a/ports/ragel/CMakeLists.txt b/ports/ragel/CMakeLists.txt new file mode 100644 index 000000000..2d91325cf --- /dev/null +++ b/ports/ragel/CMakeLists.txt @@ -0,0 +1,131 @@ +cmake_minimum_required(VERSION 3.0) +project(ragel CXX) + +find_program(NMAKE nmake) + +file(GLOB HEADERS + ragel/buffer.h + ragel/cdgoto.h + ragel/cscodegen.h + ragel/csipgoto.h + ragel/inputdata.h + ragel/rbxgoto.h + ragel/rubyflat.h + ragel/cdcodegen.h + ragel/cdipgoto.h + ragel/csfflat.h + ragel/cssplit.h + ragel/javacodegen.h + ragel/redfsm.h + ragel/rubyftable.h + ragel/cdfflat.h + ragel/cdsplit.h + ragel/csfgoto.h + ragel/cstable.h + ragel/parsedata.h + ragel/rlparse.h + ragel/rubytable.h + ragel/cdfgoto.h + ragel/cdtable.h + ragel/csflat.h + ragel/dotcodegen.h + ragel/parsetree.h + ragel/rlscan.h + ragel/version.h + ragel/cdflat.h + ragel/common.h + ragel/csftable.h + ragel/fsmgraph.h + ragel/pcheck.h + ragel/rubycodegen.h + ragel/xmlcodegen.h + ragel/cdftable.h + ragel/csgoto.h + ragel/gendata.h + ragel/ragel.h + ragel/rubyfflat.h + ragel/gocodegen.h + ragel/gotable.h + ragel/goftable.h + ragel/goflat.h + ragel/gofflat.h + ragel/gogoto.h + ragel/gofgoto.h + ragel/goipgoto.h + ragel/gotablish.h + ragel/mlcodegen.h + ragel/mltable.h + ragel/mlftable.h + ragel/mlflat.h + ragel/mlfflat.h + ragel/mlgoto.h + ragel/mlfgoto.h +) + +file(GLOB SRC + ragel/main.cpp + ragel/parsetree.cpp + ragel/parsedata.cpp + ragel/fsmstate.cpp + ragel/fsmbase.cpp + ragel/fsmattach.cpp + ragel/fsmmin.cpp + ragel/fsmgraph.cpp + ragel/fsmap.cpp + ragel/rlscan.cpp + ragel/rlparse.cpp + ragel/inputdata.cpp + ragel/common.cpp + ragel/redfsm.cpp + ragel/gendata.cpp + ragel/cdcodegen.cpp + ragel/cdtable.cpp + ragel/cdftable.cpp + ragel/cdflat.cpp + ragel/cdfflat.cpp + ragel/cdgoto.cpp + ragel/cdfgoto.cpp + ragel/cdipgoto.cpp + ragel/cdsplit.cpp + ragel/javacodegen.cpp + ragel/rubycodegen.cpp + ragel/rubytable.cpp + ragel/rubyftable.cpp + ragel/rubyflat.cpp + ragel/rubyfflat.cpp + ragel/rbxgoto.cpp + ragel/cscodegen.cpp + ragel/cstable.cpp + ragel/csftable.cpp + ragel/csflat.cpp + ragel/csfflat.cpp + ragel/csgoto.cpp + ragel/csfgoto.cpp + ragel/csipgoto.cpp + ragel/cssplit.cpp + ragel/dotcodegen.cpp + ragel/xmlcodegen.cpp + ragel/gocodegen.cpp + ragel/gotable.cpp + ragel/goftable.cpp + ragel/goflat.cpp + ragel/gofflat.cpp + ragel/gogoto.cpp + ragel/gofgoto.cpp + ragel/goipgoto.cpp + ragel/gotablish.cpp + ragel/mlcodegen.cpp + ragel/mltable.cpp + ragel/mlftable.cpp + ragel/mlflat.cpp + ragel/mlfflat.cpp + ragel/mlgoto.cpp + ragel/mlfgoto.cpp +) + +include_directories(aapl) + +add_executable(ragel ${SRC}) + +install(TARGETS ragel DESTINATION tools) +install(FILES ${HEADERS} DESTINATION include) diff --git a/ports/ragel/CONTROL b/ports/ragel/CONTROL new file mode 100644 index 000000000..0bc53315f --- /dev/null +++ b/ports/ragel/CONTROL @@ -0,0 +1,3 @@ +Source: ragel +Version: +Description: diff --git a/ports/ragel/config.h b/ports/ragel/config.h new file mode 100644 index 000000000..dbcd06dd9 --- /dev/null +++ b/ports/ragel/config.h @@ -0,0 +1,26 @@ +/* ragel/config.h. Generated from config.h.in by configure. */ +/* ragel/config.h.in. Generated from configure.in by autoheader. */ + +/* Name of package */ +#define PACKAGE "ragel" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "ragel" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "ragel 6.9" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "ragel" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "6.9" + +/* Version number of package */ +#define VERSION "6.9" diff --git a/ports/ragel/portfile.cmake b/ports/ragel/portfile.cmake new file mode 100644 index 000000000..a00465dbc --- /dev/null +++ b/ports/ragel/portfile.cmake @@ -0,0 +1,49 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9) +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.colm.net/files/ragel/ragel-6.9.tar.gz" + FILENAME "ragel-6.9.tar.gz" + SHA512 46886a37fa0b785574c03ba6581d99bbeaa11ca65cf4fdc37ceef42f4869bd695694cd69b4b974a25cf539f004cb106e3debda17fc26e1a9a6a4295992733dbd +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}/ragel) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Remove-unistd.h-include-1.patch" +) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0002-Remove-unistd.h-include-2.patch" +) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0003-Fix-rsxgoto.cpp-build.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + GENERATOR "Visual Studio 14 2015" +) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/ragel-6.9/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ragel) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/ragel/COPYING ${CURRENT_PACKAGES_DIR}/share/ragel/copyright)