Skip to content
Permalink
Browse files

Merge branch 'gamepack-manager' into 'master'

new gamepack-manager script to download and install game packs

See merge request xonotic/netradiant!98
  • Loading branch information...
MarioSMB committed Oct 31, 2018
2 parents 2e64b0b + d8d8fd4 commit 2b4ec84926bf6ebc3a9983d2dc7ec42d5e526b9f
Showing with 675 additions and 296 deletions.
  1. +8 −45 CMakeLists.txt
  2. +4 −4 Makefile
  3. +0 −179 download-gamepacks.sh
  4. +663 −0 gamepack-manager
  5. +0 −37 install-gamepack.sh
  6. +0 −31 install-gamepacks.sh
@@ -251,25 +251,16 @@ endif ()
#-----------------------------------------------------------------------

option(DOWNLOAD_GAMEPACKS "Download game packs" ON)
add_custom_target(game_packs_free
COMMAND ${CMAKE_COMMAND} -E make_directory games
COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
COMMENT "Downloading free game packs"
)
add_custom_target(game_packs_all
COMMAND ${CMAKE_COMMAND} -E make_directory games
COMMAND DOWNLOAD_GAMEPACKS=all SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
COMMENT "Downloading all game packs"
)

set(GAMEPACKS_LICENSE_LIST free CACHE STRING "Download game packs by license")
set(GAMEPACKS_NAME_LIST none CACHE STRING "Download game packs by name")

if (DOWNLOAD_GAMEPACKS)
set(DOWNLOAD_GAMEPACKS "all")
add_custom_target(game_packs ALL
COMMAND "${PROJECT_SOURCE_DIR}/gamepack-manager" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir "${PROJECT_BINARY_DIR}/download" --install-dir "${PROJECT_BINARY_DIR}" --download --install
COMMENT "Downloading ${GAMEPACKS_LICENSE_LIST} game packs"
)
endif()
if ("${DOWNLOAD_GAMEPACKS}" STREQUAL "free")
add_custom_target(game_packs_go ALL DEPENDS game_packs_free)
elseif ("${DOWNLOAD_GAMEPACKS}" STREQUAL "all")
add_custom_target(game_packs_go ALL DEPENDS game_packs_all)
endif ()

#-----------------------------------------------------------------------
# Install
@@ -290,35 +281,7 @@ install(
DESTINATION .
)

set(GAME_FILES
DarkPlaces
Nexuiz
OpenArena
Osirion
Q3
Quake2
Quake
Quetoo
Tremulous
UFOAI
Unvanquished
Warsow
Xonotic
)
unset(_tmp)
foreach (it ${GAME_FILES})
set(dir "${PROJECT_BINARY_DIR}/games/${it}Pack")
string(TOLOWER "${it}" it)
list(APPEND _tmp "${dir}/games")
list(APPEND _tmp "${dir}/${it}.game")
endforeach ()
set(GAME_FILES ${_tmp})

install(
DIRECTORY
${GAME_FILES}
DESTINATION .
OPTIONAL
install(CODE "execute_process(COMMAND \"${PROJECT_SOURCE_DIR}/gamepack-manager\" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir \"${PROJECT_BINARY_DIR}/download\" --install-dir \"${CMAKE_INSTALL_PREFIX}\" --install)"
)

include(cmake/scripts/package.cmake)
@@ -18,6 +18,7 @@ RADIANT_ABOUTMSG ?= Custom build
# warning: this directory may NOT contain any files other than the ones written by this Makefile!
# NEVER SET THIS TO A SYSTEM WIDE "bin" DIRECTORY!
INSTALLDIR ?= install
DOWNLOADDIR ?= build/download

CC ?= gcc
CXX ?= g++
@@ -36,7 +37,7 @@ ECHO_NOLF ?= echo -n
CAT ?= cat
MKDIR ?= mkdir -p
CP ?= cp
CP_R ?= $(CP) -r
CP_R ?= $(CP) -r --preserve=timestamps
LN ?= ln
LN_SNF ?= $(LN) -snf
RM ?= rm
@@ -448,6 +449,7 @@ binaries-q3map2: \
.PHONY: clean
clean:
$(RM_R) $(INSTALLDIR_BASE)/
$(RM_R) $(DOWNLOADDIR)/
$(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
$(RM) icons/*.rc

@@ -1043,15 +1045,13 @@ $(INSTALLDIR)/heretic2/h2data.$(EXE): \
.PHONY: install-data
install-data: binaries
$(MKDIR) $(INSTALLDIR)/games
$(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIPPER="$(UNZIPPER)" ECHO="$(ECHO)" SH="$(SH)" CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepacks.sh "$(INSTALLDIR)"
DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" DOWNLOADDIR="$(DOWNLOADDIR)" INSTALLDIR="$(INSTALLDIR)" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIPPER="$(UNZIPPER)" ECHO="$(ECHO)" SH="$(SH)" CP="$(CP)" CP_R="$(CP_R)" $(SH) gamepack-manager
$(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
$(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
$(ECHO) $(RADIANT_PATCH_VERSION) > $(INSTALLDIR)/RADIANT_PATCH
$(CP_R) setup/data/tools/* $(INSTALLDIR)/
$(MKDIR) $(INSTALLDIR)/docs
$(CP_R) docs/* $(INSTALLDIR)/docs/
$(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune

.PHONY: install-dll
ifeq ($(OS),Win32)

This file was deleted.

0 comments on commit 2b4ec84

Please sign in to comment.
You can’t perform that action at this time.