Skip to content

Commit

Permalink
try to fix crosscompiling builds
Browse files Browse the repository at this point in the history
See: #58

use perl rot13
Thanks to https://github.com/leleliu008
  • Loading branch information
shlomif committed Dec 14, 2021
1 parent 9ec3ca1 commit 4b5bb26
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fortune-mod/datfiles/off/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -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}"
Expand Down
20 changes: 20 additions & 0 deletions fortune-mod/util/rot.pl
Original file line number Diff line number Diff line change
@@ -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 $_;
}

0 comments on commit 4b5bb26

Please sign in to comment.