mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-08-03 20:57:55 -04:00
remove win-textfile script (#530)
* remove python scripts * retore convert-icon script * fix docs destination * fix docs->doc
This commit is contained in:
parent
66724b6391
commit
7e81350578
@ -145,23 +145,16 @@ find_package(SDL2_net)
|
|||||||
# FluidSynth backend
|
# FluidSynth backend
|
||||||
find_package(FluidSynth)
|
find_package(FluidSynth)
|
||||||
|
|
||||||
# Python 3.
|
|
||||||
#
|
|
||||||
# Optional, not needed for most things. If you're missing it you need to
|
|
||||||
# install it yourself.
|
|
||||||
find_package(Python3 COMPONENTS Interpreter)
|
|
||||||
|
|
||||||
configure_file(config.h.in config.h)
|
configure_file(config.h.in config.h)
|
||||||
|
|
||||||
# Files that should be installed with the install target.
|
|
||||||
configure_file(WoofInstall.cmake.in WoofInstall.cmake ESCAPE_QUOTES @ONLY)
|
|
||||||
install(SCRIPT "${PROJECT_BINARY_DIR}/WoofInstall.cmake")
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install(FILES "${PROJECT_BINARY_DIR}/COPYING.txt" DESTINATION .)
|
install(FILES COPYING DESTINATION .)
|
||||||
install(FILES "${PROJECT_BINARY_DIR}/README.txt" DESTINATION .)
|
install(FILES README.md DESTINATION .)
|
||||||
install(FILES betagrph.wad DESTINATION .)
|
install(FILES betagrph.wad DESTINATION .)
|
||||||
install(FILES betalevl.wad DESTINATION .)
|
install(FILES betalevl.wad DESTINATION .)
|
||||||
install(FILES watermap.wad DESTINATION .)
|
install(FILES watermap.wad DESTINATION .)
|
||||||
|
install(DIRECTORY docs/ DESTINATION docs)
|
||||||
|
install(DIRECTORY examples/ DESTINATION docs/examples)
|
||||||
install(DIRECTORY autoload/ DESTINATION autoload)
|
install(DIRECTORY autoload/ DESTINATION autoload)
|
||||||
if(FluidSynth_FOUND)
|
if(FluidSynth_FOUND)
|
||||||
install(DIRECTORY soundfonts/ DESTINATION soundfonts)
|
install(DIRECTORY soundfonts/ DESTINATION soundfonts)
|
||||||
@ -172,6 +165,8 @@ else()
|
|||||||
install(FILES betagrph.wad DESTINATION "share/${PROJECT_TARNAME}")
|
install(FILES betagrph.wad DESTINATION "share/${PROJECT_TARNAME}")
|
||||||
install(FILES betalevl.wad DESTINATION "share/${PROJECT_TARNAME}")
|
install(FILES betalevl.wad DESTINATION "share/${PROJECT_TARNAME}")
|
||||||
install(FILES watermap.wad DESTINATION "share/${PROJECT_TARNAME}")
|
install(FILES watermap.wad DESTINATION "share/${PROJECT_TARNAME}")
|
||||||
|
install(DIRECTORY docs/ DESTINATION "share/doc/${PROJECT_TARNAME}")
|
||||||
|
install(DIRECTORY examples/ DESTINATION "share/doc/${PROJECT_TARNAME}/examples")
|
||||||
install(DIRECTORY autoload/ DESTINATION "share/${PROJECT_TARNAME}/autoload")
|
install(DIRECTORY autoload/ DESTINATION "share/${PROJECT_TARNAME}/autoload")
|
||||||
if(FluidSynth_FOUND)
|
if(FluidSynth_FOUND)
|
||||||
install(DIRECTORY soundfonts/ DESTINATION "share/${PROJECT_TARNAME}/soundfonts")
|
install(DIRECTORY soundfonts/ DESTINATION "share/${PROJECT_TARNAME}/soundfonts")
|
||||||
@ -191,8 +186,6 @@ include(CPack)
|
|||||||
|
|
||||||
# Where to find other CMakeLists.txt files.
|
# Where to find other CMakeLists.txt files.
|
||||||
add_subdirectory(data)
|
add_subdirectory(data)
|
||||||
add_subdirectory(docs)
|
|
||||||
add_subdirectory(examples)
|
|
||||||
add_subdirectory(opl)
|
add_subdirectory(opl)
|
||||||
add_subdirectory(textscreen)
|
add_subdirectory(textscreen)
|
||||||
add_subdirectory(Source)
|
add_subdirectory(Source)
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
# This script is stamped out by CMake and run by `make install`.
|
|
||||||
|
|
||||||
set(PROJECT_SOURCE_DIR "@PROJECT_SOURCE_DIR@")
|
|
||||||
set(PROJECT_BINARY_DIR "@PROJECT_BINARY_DIR@")
|
|
||||||
set(Python3_EXECUTABLE "@Python3_EXECUTABLE@")
|
|
||||||
set(WIN32 "@WIN32@")
|
|
||||||
|
|
||||||
function(win_textfile SOURCE DESTINATION)
|
|
||||||
execute_process(COMMAND
|
|
||||||
"${Python3_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/win-textfile"
|
|
||||||
"${SOURCE}" "${DESTINATION}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
message(FATAL_ERROR "Python 3 not found, can't run install scripts.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Convert text files to a format Windows Notepad can read without issue.
|
|
||||||
win_textfile(
|
|
||||||
"${PROJECT_SOURCE_DIR}/COPYING" "${PROJECT_BINARY_DIR}/COPYING.txt")
|
|
||||||
win_textfile(
|
|
||||||
"${PROJECT_SOURCE_DIR}/README.md" "${PROJECT_BINARY_DIR}/README.txt")
|
|
||||||
endif()
|
|
@ -1,10 +1,3 @@
|
|||||||
if(Python3_FOUND)
|
|
||||||
add_custom_target(convert-icon
|
|
||||||
COMMAND "${Python3_EXECUTABLE}" "convert-icon"
|
|
||||||
"woof.png" "../Source/icon.c"
|
|
||||||
VERBATIM WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
install(FILES woof.6 DESTINATION share/man/man6)
|
install(FILES woof.6 DESTINATION share/man/man6)
|
||||||
install(FILES woof.desktop DESTINATION share/applications)
|
install(FILES woof.desktop DESTINATION share/applications)
|
||||||
|
0
data/convert-icon
Executable file → Normal file
0
data/convert-icon
Executable file → Normal file
@ -1,34 +0,0 @@
|
|||||||
# Files that need no conversion.
|
|
||||||
set(WOOF_DOCS_FILES
|
|
||||||
mbf-bugs.html)
|
|
||||||
|
|
||||||
# Plain text files that should be converted on Windows.
|
|
||||||
set(WOOF_DOCS_TEXTS
|
|
||||||
boomdeh.txt
|
|
||||||
boomref.txt
|
|
||||||
boom.txt
|
|
||||||
dckboom.txt
|
|
||||||
mapcolors_vanilla.cfg
|
|
||||||
mbf-bugs.html
|
|
||||||
mbfedit.txt
|
|
||||||
mbffaq.txt
|
|
||||||
mbf.txt
|
|
||||||
options.txt
|
|
||||||
umapinfo.txt
|
|
||||||
winmbf02s.txt
|
|
||||||
winmbf02.txt)
|
|
||||||
|
|
||||||
configure_file(WoofInstall.cmake.in WoofInstall.cmake ESCAPE_QUOTES @ONLY)
|
|
||||||
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/WoofInstall.cmake")
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
install(FILES ${WOOF_DOCS_FILES} DESTINATION docs)
|
|
||||||
foreach(WOOF_DOCS_TEXT ${WOOF_DOCS_TEXTS})
|
|
||||||
install(
|
|
||||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/${WOOF_DOCS_TEXT}"
|
|
||||||
DESTINATION docs)
|
|
||||||
endforeach()
|
|
||||||
else()
|
|
||||||
install(DIRECTORY . DESTINATION "share/doc/${PROJECT_TARNAME}"
|
|
||||||
PATTERN CMakeLists.txt EXCLUDE PATTERN *.cmake.in EXCLUDE)
|
|
||||||
endif()
|
|
@ -1,28 +0,0 @@
|
|||||||
# This script is stamped out by CMake and run by `make install`.
|
|
||||||
|
|
||||||
set(PROJECT_SOURCE_DIR "@PROJECT_SOURCE_DIR@")
|
|
||||||
set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
|
||||||
set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
|
|
||||||
set(Python3_EXECUTABLE "@Python3_EXECUTABLE@")
|
|
||||||
set(WIN32 "@WIN32@")
|
|
||||||
|
|
||||||
set(WOOF_TEXTS "@WOOF_DOCS_TEXTS@")
|
|
||||||
|
|
||||||
function(win_textfile SOURCE DESTINATION)
|
|
||||||
execute_process(COMMAND
|
|
||||||
"${Python3_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/win-textfile"
|
|
||||||
"${SOURCE}" "${DESTINATION}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
message(FATAL_ERROR "Python 3 not found, can't run install scripts.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Convert text files to a format Windows Notepad can read without issue.
|
|
||||||
foreach(WOOF_TEXT ${WOOF_TEXTS})
|
|
||||||
win_textfile(
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${WOOF_TEXT}"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${WOOF_TEXT}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
@ -1,37 +0,0 @@
|
|||||||
# Files that need no conversion.
|
|
||||||
set(WOOF_EXAMPLES_FILES
|
|
||||||
battle.wad
|
|
||||||
dogfly.deh
|
|
||||||
donut.wad
|
|
||||||
fireplas.deh
|
|
||||||
fly.deh
|
|
||||||
friend.deh
|
|
||||||
grenade.deh
|
|
||||||
hockey.wad
|
|
||||||
mbfedit.wad
|
|
||||||
mine.deh
|
|
||||||
mushroom.deh
|
|
||||||
playbud.deh
|
|
||||||
possbud.deh
|
|
||||||
sky.wad
|
|
||||||
touchy.deh)
|
|
||||||
|
|
||||||
# Plain text files that should be converted on Windows.
|
|
||||||
set(WOOF_EXAMPLES_TEXTS
|
|
||||||
donut.txt
|
|
||||||
mbfedit.txt)
|
|
||||||
|
|
||||||
configure_file(WoofInstall.cmake.in WoofInstall.cmake ESCAPE_QUOTES @ONLY)
|
|
||||||
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/WoofInstall.cmake")
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
install(FILES ${WOOF_EXAMPLES_FILES} DESTINATION docs/examples)
|
|
||||||
foreach(WOOF_EXAMPLES_TEXT ${WOOF_EXAMPLES_TEXTS})
|
|
||||||
install(
|
|
||||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/${WOOF_EXAMPLES_TEXT}"
|
|
||||||
DESTINATION docs/examples)
|
|
||||||
endforeach()
|
|
||||||
else()
|
|
||||||
install(DIRECTORY . DESTINATION "share/doc/${PROJECT_TARNAME}/examples"
|
|
||||||
PATTERN CMakeLists.txt EXCLUDE PATTERN *.cmake.in EXCLUDE)
|
|
||||||
endif()
|
|
@ -1,28 +0,0 @@
|
|||||||
# This script is stamped out by CMake and run by `make install`.
|
|
||||||
|
|
||||||
set(PROJECT_SOURCE_DIR "@PROJECT_SOURCE_DIR@")
|
|
||||||
set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
|
||||||
set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
|
|
||||||
set(Python3_EXECUTABLE "@Python3_EXECUTABLE@")
|
|
||||||
set(WIN32 "@WIN32@")
|
|
||||||
|
|
||||||
set(WOOF_TEXTS "@WOOF_EXAMPLES_TEXTS@")
|
|
||||||
|
|
||||||
function(win_textfile SOURCE DESTINATION)
|
|
||||||
execute_process(COMMAND
|
|
||||||
"${Python3_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/win-textfile"
|
|
||||||
"${SOURCE}" "${DESTINATION}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
message(FATAL_ERROR "Python 3 not found, can't run install scripts.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Convert text files to a format Windows Notepad can read without issue.
|
|
||||||
foreach(WOOF_TEXT ${WOOF_TEXTS})
|
|
||||||
win_textfile(
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${WOOF_TEXT}"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${WOOF_TEXT}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
53
win-textfile
53
win-textfile
@ -1,53 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
#
|
|
||||||
# Copyright(C) 2020 Alex Mayfield
|
|
||||||
#
|
|
||||||
# This program 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 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Converts text files to a format usable by Windows Notepad.
|
|
||||||
#
|
|
||||||
|
|
||||||
import io
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
|
||||||
print("Usage: win-textfile <src> <dest>")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
src = open(sys.argv[1], "rb")
|
|
||||||
dest_stream = io.BytesIO()
|
|
||||||
|
|
||||||
# Check for BOM and if it doesn't exist, add it.
|
|
||||||
bom = src.read(3)
|
|
||||||
if (bom != b"\xef\xbb\xbf"):
|
|
||||||
dest_stream.write(b"\xef\xbb\xbf")
|
|
||||||
src.seek(0)
|
|
||||||
|
|
||||||
# Read the text file byte by byte.
|
|
||||||
while True:
|
|
||||||
byte = src.read(1)
|
|
||||||
if (not byte):
|
|
||||||
# End of file.
|
|
||||||
break
|
|
||||||
if (byte == b"\r"):
|
|
||||||
# Found a CR, omit it so we don't double-up.
|
|
||||||
continue
|
|
||||||
if (byte == b"\n"):
|
|
||||||
# Replace LF with CRLF.
|
|
||||||
dest_stream.write(b"\r\n")
|
|
||||||
else:
|
|
||||||
# Everything else is copied verbatim.
|
|
||||||
dest_stream.write(byte)
|
|
||||||
|
|
||||||
# Don't write file until last possible moment.
|
|
||||||
dest = open(sys.argv[2], "wb")
|
|
||||||
dest.write(dest_stream.getbuffer())
|
|
Loading…
x
Reference in New Issue
Block a user