diff --git a/fortune-mod/datfiles/off/CMakeLists.txt b/fortune-mod/datfiles/off/CMakeLists.txt index 6d6b57a..25b29dd 100644 --- a/fortune-mod/datfiles/off/CMakeLists.txt +++ b/fortune-mod/datfiles/off/CMakeLists.txt @@ -1,8 +1,9 @@ # See: https://github.com/shlomif/fortune-mod/issues/58 +SET (_target_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot") if ("${IS_CROSS}") - SET (_rot "rot") + SET (_rot ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/../../util/rot.pl") else() - SET (_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot") + SET (_rot "${_target_rot}") endif() SET (rot_dir "${CMAKE_CURRENT_BINARY_DIR}/rotated") FILE(MAKE_DIRECTORY "${rot_dir}") @@ -16,9 +17,8 @@ FOREACH(c ${OFFENSIVE_COOKIES}) SET(PATH_PERL ${PERL_EXECUTABLE}) ADD_CUSTOM_COMMAND( OUTPUT "${rot_dest}" - COMMAND "${_rot}" - ARGS "<" "${SOURCE}" ">" "${rot_dest}" - DEPENDS "${SOURCE}" "${_rot}" + COMMAND ${_rot} "<" "${SOURCE}" ">" "${rot_dest}" + DEPENDS "${SOURCE}" "${_target_rot}" ) ADD_CUSTOM_COMMAND( OUTPUT "${DEST}" diff --git a/fortune-mod/util/rot.pl b/fortune-mod/util/rot.pl new file mode 100644 index 0000000..5331520 --- /dev/null +++ b/fortune-mod/util/rot.pl @@ -0,0 +1,20 @@ +#! /usr/bin/env perl +# +# Short description for rot.pl +# +# rot13 for cross compiling builds: +# https://github.com/shlomif/fortune-mod/issues/58 +# Version 0.0.1 +# Copyright (C) 2021 Shlomi Fish < https://www.shlomifish.org/ > +# +# Licensed under the terms of the MIT license. + +use strict; +use warnings; +use autodie; + +while (<>) +{ + tr/A-Za-z/N-ZA-Mn-za-m/; + print $_; +}