December 16, 2018, 08:18:10 PMLatest Member: Petakerky

Author Topic: [Unmaintained]Update to latest SVN build shell script - Updated 2011-01-15  (Read 7433 times)

0 Members and 1 Guest are viewing this topic.

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
Hey everybody

I have made a very simple script that makes it a bit easier to keep up this the latest version of Corsix-TH. This script is created to us translators so there some things that are spefic to translators.

Its still a working progress and there are alot of room for improvements. So if you find a bug or have and idea, please let me know :-) Everyone is welcome to develop this script futher :-)

..::What it does::..
It gets the latest "Read-only" version of the SVN-Build from the website, and does the cmake/make procedure. And if exits, it creates a backup of the old "languages" folder where the translations are.

..::How to use it?!::..
Just download the zipfile, extract the shell script and then run the script in the terminal/console by doing
Code: [Select]
sh CorsixTHUpdateToLatestSVN.sh
Please note, that it starts instantly!
The first time you run the script there will be created a folder named "CorsixTHBuild" and that will contain the latest SVN build and backups
CorsixTH - Get latest SVN script demo

..::What OS's does it work in::..
It was created in openSUSE 11.3, so it will work on linux as long you have the dependencies installed.

I have tried to make a version that should work on OSX as well. Although the script does alot automatic you still need to have XCode installed and the latest Lua. 
* Download latest Lua from: http://www.lua.org/ftp/
* Extract the package-file and follow the readme file
« Last Edit: February 14, 2011, 07:46:24 PM by froksen »
//Ole Holm Frandsen aka Froksen

KasperVld

  • Community Manager
  • ****
  • Posts: 88
  • Work to ride, ride to work
    • View Profile
    • Corsix-TH Community website
Re: Update to latest SVN build shell script
« Reply #1 on: January 13, 2011, 07:46:07 PM »
Off Topic --> Hospital Caf

tobylane

  • Registered member
  • *
  • Posts: 53
    • View Profile
Re: Update to latest SVN build shell script
« Reply #2 on: January 14, 2011, 06:10:45 PM »
It won't work on mac, make doesn't do any linking.

cd ~/Downloads/corsix-th-read-only/ && svn up && /Applications/CMake.app/Contents/bin/cmake -G Xcode && cd CorsixTH && xcodebuild -configuration Release -sdk macosx10.6 && mv -f Release/CorsixTH CorsixTH

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #3 on: January 15, 2011, 10:22:39 AM »
Hey Topylane

I just tried the script on OSX my self. And now I have made a OSX version of the script that should work fine. I
« Last Edit: January 15, 2011, 11:45:02 AM by froksen »
//Ole Holm Frandsen aka Froksen

tobylane

  • Registered member
  • *
  • Posts: 53
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #4 on: January 15, 2011, 10:30:15 PM »
Thats very weird, xcodebuild is Xcode. Can you do 'which xcodebuild' which will tell you where it is.

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #5 on: January 16, 2011, 08:59:42 AM »
Hey TobyLane

I dont use the xcodebuild? But since you ask:
Code: [Select]
froksen$ which xcodebuild
/usr/bin/xcodebuild

I found that I also have installed CMAKE on my own along time ago. It
//Ole Holm Frandsen aka Froksen

tobylane

  • Registered member
  • *
  • Posts: 53
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #6 on: January 17, 2011, 07:47:51 AM »
It will always need Cmake, on all platforms. I doubt there will be any sort of merge of instructions, Windows, Mac and Linux each do it their own way and could just have separate build scripts. You don't need to delete the svn folder every time, it saves a lot of downloading to keep it.

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #7 on: January 17, 2011, 12:28:50 PM »


.... Maybe you can make the script work, s
For the end of the world spell, press Control, Alt, Delete.

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
//Ole Holm Frandsen aka Froksen

luthenis

  • Registered member
  • *
  • Posts: 2
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #9 on: January 31, 2011, 01:11:08 PM »
Hi,

I've got an error

Code: [Select]
CMake Error at CorsixTH/CMakeLists.txt:86 (message):
  Error: SDL library not found, it is required to build.  Make sure the path
  is correctly defined or set the environment variable SDLDIR to the correct
  location

Any thoughts about it?

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #10 on: January 31, 2011, 01:49:15 PM »
It can not find the SDL library. Do you have it in your path?
For the end of the world spell, press Control, Alt, Delete.

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #11 on: January 31, 2011, 04:36:45 PM »
Hi,

I've got an error

Code: [Select]
CMake Error at CorsixTH/CMakeLists.txt:86 (message):
  Error: SDL library not found, it is required to build.  Make sure the path
  is correctly defined or set the environment variable SDLDIR to the correct
  location

Any thoughts about it?

Do you have the SDL Libraries installed? If not, you can download them from here: http://www.libsdl.org/download-1.2.php

(If you use a Linux-distro its propperly easier just to use your packagemanager)
//Ole Holm Frandsen aka Froksen

froksen

  • Registered member
  • *
  • Posts: 34
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #12 on: January 31, 2011, 04:42:42 PM »
Hey everybody

I have made python script that does more or less the same as the shell script. But it's in Python, so it should be easier to make it a version for Windows and other systems.

It's still demands that you have cmake and the other depencies installed. Try it out by downloading the pythonscript and run it in terminal by typing
Code: [Select]
python CorsixTHBuilder.py
Testet on openSUSE 11.3 and OSX Snow Leopard

Source:
Code: [Select]
#!/usr/bin/python

import os
#import pysvn
import shutil
import time

#Universal variables
Folder_current = os.getcwd()

#Everything that for building and getting the latest SVN version
Folder_Build = ("CorsixTH-SVNBuild")
Folder_Build_SVN = ("corsix-th-read-only")
Folder_Build_SVN_Corsix = ("CorsixTH")
Folder_Build_SVN_Corsix_Lua = ("Lua")
Folder_Build_SVN_Corsix_Lua_languages = ("languages")

Path_To_Folder_Build = Folder_current + ("/") + Folder_Build
Path_To_Folder_Build_SVN = Folder_current + ("/") + Folder_Build + ("/") + Folder_Build_SVN
Path_To_Folder_Build_SVN_Corsix = Folder_current + ("/") + Folder_Build + ("/") + Folder_Build_SVN + ("/") + Folder_Build_SVN_Corsix
Path_To_Folder_Build_SVN_Corsix_lua = Folder_current + ("/") + Folder_Build + ("/") + Folder_Build_SVN + ("/") + Folder_Build_SVN_Corsix + ("/") + Folder_Build_SVN_Corsix_Lua
Path_To_Folder_Build_SVN_Corsix_Lua_languages = Folder_current + ("/") + Folder_Build + ("/") + Folder_Build_SVN + ("/") + Folder_Build_SVN_Corsix + ("/") + Folder_Build_SVN_Corsix_Lua + ("/") + Folder_Build_SVN_Corsix_Lua_languages


#Everything for backup
Folder_Backup = ("CorsixTH-Backup")
Folder_Backup_languages = ("languages")
Folder_Backup_languages_newtitle = ("languages")
Folder_Backup_languages_newtitle_timestamp = time.strftime("%Y%m%d-%H%M%S", time.localtime())

Path_To_Folder_Backup = Folder_current + ("/") + Folder_Backup
Path_To_Folder_Backup_languages = Folder_current + ("/") + Folder_Backup + (("/")) + Folder_Backup_languages
Path_To_Folder_Backup_languages_newtitle_and_timestamp = Folder_current + ("/") + Folder_Backup + ("/") + Folder_Backup_languages + ("/") + Folder_Backup_languages_newtitle + Folder_Backup_languages_newtitle_timestamp

#Everything for the SVN server
SVN_readonly_url = ("http://corsix-th.googlecode.com/svn/trunk/ corsix-th-read-only")


#Describes with defination the script starts with
def start_with():
  createfolders()
  return
 
def createfolders():
  if not os.path.exists(Path_To_Folder_Build):
    os.makedirs(Path_To_Folder_Build)
    global summary_createfolder_Folder_Build
    summary_createfolder_Folder_Build = ("Yes") 
  if not os.path.exists(Path_To_Folder_Backup):
    global summary_createfolder_Folder_Backup
    summary_createfolder_Folder_Backup = ("Yes")     
    os.makedirs(Path_To_Folder_Backup_languages)
  else:
    summary_createfolder_Folder_Build = ("No")
    summary_createfolder_Folder_Backup = ("No")
    pass
  Backup_Folder_Backup_languages_func()
  return
 
def SVN_get_latest():
  os.chdir (Path_To_Folder_Build)
  print os.system('svn checkout ' + SVN_readonly_url)
  SVN_make_and_build()
  return

def SVN_make_and_build():
  print ("\n \n* If you want to do CMAKE WITH_AUDIO=ON, then type ON and press enter")
  print ("* If you want to do CMAKE WITH_AUDIO=OFF, then type OFF and press enter")
  CMAKE_WITH_AUDIO = str(raw_input('Please choose from above : '))
  if CMAKE_WITH_AUDIO == "ON":
      global summary_CMAKE_WITH_AUDIO
      summary_CMAKE_WITH_AUDIO = ("ON")
      os.chdir(Path_To_Folder_Build_SVN)
      print os.system('cmake -D WITH_AUDIO=ON CMakeLists.txt')
      os.chdir(Path_To_Folder_Build_SVN_Corsix)
      print os.system('make')
  elif CMAKE_WITH_AUDIO == "OFF":
      summary_CMAKE_WITH_AUDIO = ("OFF")
      os.chdir(Path_To_Folder_Build_SVN)
      print os.system('cmake -D WITH_AUDIO=OFF CMakeLists.txt')
      os.chdir(Path_To_Folder_Build_SVN_Corsix)
      print os.system('make')       
  else:
      print "\n \n ------->>>>>Please pick one of the options below<<<<<--------"
      SVN_make_and_build()
  summary()
  return
 
def Backup_Folder_Backup_languages_func():
  if os.path.exists(Path_To_Folder_Build_SVN_Corsix_Lua_languages):
    global summary_Backup_languages_func
    summary_Backup_languages_func = ("Yes")
    shutil.copytree(Path_To_Folder_Build_SVN_Corsix_Lua_languages, Path_To_Folder_Backup_languages_newtitle_and_timestamp)
  else:
    summary_Backup_languages_func = ("No")
    pass
  SVN_get_latest()
  return 
 
def summary():
  print ("...........::::::::Summary::::::::...........")
  print ("Created " + Folder_Build + ":" + summary_createfolder_Folder_Build)
  print ("Created " + Folder_Backup + ":" + summary_createfolder_Folder_Backup)
  print ("Backed up " + Folder_Backup_languages + ":" + summary_Backup_languages_func)
  print ("Did CMAKE With Audio: " + summary_CMAKE_WITH_AUDIO)
  os.chdir(Path_To_Folder_Build_SVN)
  print (os.system('svn info | grep Revision:')) 
  return
 
#goto start start_with defination
start_with()


#cmake -D WITH_AUDIO=OFF CMakeLists.txt
//Ole Holm Frandsen aka Froksen

luthenis

  • Registered member
  • *
  • Posts: 2
    • View Profile
Re: Update to latest SVN build shell script - Updated 2011-01-15
« Reply #13 on: February 01, 2011, 05:39:36 PM »
Hi,

I've got an error

Code: [Select]
CMake Error at CorsixTH/CMakeLists.txt:86 (message):
  Error: SDL library not found, it is required to build.  Make sure the path
  is correctly defined or set the environment variable SDLDIR to the correct
  location

Any thoughts about it?

Do you have the SDL Libraries installed? If not, you can download them from here: http://www.libsdl.org/download-1.2.php

(If you use a Linux-distro its propperly easier just to use your packagemanager)

Hello again,

it was my foult i research a little and i have to install the packages in how to compile page A.K.A:
Quote
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install liblua5.1-0-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libsdl-mixer1.2-dev
sudo apt-get install timidity

Thanks for the help and keep up the good work!