lightspark: update to 0.7.2.

This commit is contained in:
Juan RP 2013-06-29 10:48:25 +02:00
parent 62485f9ec0
commit e65f418445
5 changed files with 156 additions and 119 deletions

View file

@ -0,0 +1,25 @@
From 508229a1ea169c8de7acf7f4284d6c56f08bedc4 Mon Sep 17 00:00:00 2001
From: Antti Ajanki <antti.ajanki@iki.fi>
Date: Sun, 12 May 2013 11:19:48 +0300
Subject: [PATCH 01/33] Search paths for LLVM 3.1/3.2
---
conf/FindLLVM.cmake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake
index 7bd52e2..ab8f95d 100644
--- a/conf/FindLLVM.cmake
+++ b/conf/FindLLVM.cmake
@@ -51,6 +51,8 @@ else (LLVM_INCLUDE_DIR)
/usr/lib/llvm-2.8/bin
/usr/lib/llvm-2.9/bin
/usr/lib/llvm-3.0/bin
+ /usr/lib/llvm-3.1/bin
+ /usr/lib/llvm-3.2/bin
)
find_program(LLVM_GCC_EXECUTABLE
--
1.8.3

View file

@ -0,0 +1,128 @@
From 56f4f48c47983432670d7aaa18614a98bd35961a Mon Sep 17 00:00:00 2001
From: Antti Ajanki <antti.ajanki@iki.fi>
Date: Sat, 18 May 2013 11:36:52 +0300
Subject: [PATCH 01/29] Support for LLVM 3.3
---
conf/FindLLVM.cmake | 6 ++++++
src/scripting/abc.cpp | 15 +++++++++++----
src/scripting/abc_codesynt.cpp | 25 ++++++++++++++++++-------
3 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake
index ab8f95d..c94d7d4 100644
--- a/conf/FindLLVM.cmake
+++ b/conf/FindLLVM.cmake
@@ -53,6 +53,7 @@ else (LLVM_INCLUDE_DIR)
/usr/lib/llvm-3.0/bin
/usr/lib/llvm-3.1/bin
/usr/lib/llvm-3.2/bin
+ /usr/lib/llvm-3.3/bin
)
find_program(LLVM_GCC_EXECUTABLE
@@ -170,11 +171,16 @@ else (LLVM_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR})
check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H)
+ check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H)
unset(CMAKE_REQUIRED_INCLUDES)
MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H})
+ MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H})
IF(HAVE_DATALAYOUT_H)
ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H)
ENDIF(HAVE_DATALAYOUT_H)
+ IF(HAVE_IR_DATALAYOUT_H)
+ ADD_DEFINITIONS(-DHAVE_IR_DATALAYOUT_H)
+ ENDIF(HAVE_IR_DATALAYOUT_H)
exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS )
MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS})
diff --git a/src/scripting/abc.cpp b/src/scripting/abc.cpp
index 608fe01..49f2e06 100644
--- a/src/scripting/abc.cpp
+++ b/src/scripting/abc.cpp
@@ -23,12 +23,19 @@
#include "compat.h"
-#include <llvm/Module.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/JIT.h>
#include <llvm/PassManager.h>
-#include <llvm/LLVMContext.h>
-#ifdef HAVE_DATALAYOUT_H
+#ifdef HAVE_IR_DATALAYOUT_H
+# include <llvm/IR/Module.h>
+# include <llvm/IR/LLVMContext.h>
+#else
+# include <llvm/Module.h>
+# include <llvm/LLVMContext.h>
+#endif
+#ifdef HAVE_IR_DATALAYOUT_H
+# include <llvm/IR/DataLayout.h>
+#elif defined HAVE_DATALAYOUT_H
# include <llvm/DataLayout.h>
#else
# include <llvm/Target/TargetData.h>
@@ -1516,7 +1523,7 @@ void ABCVm::Run(ABCVm* th)
assert_and_throw(th->ex);
th->FPM=new llvm::FunctionPassManager(th->module);
-#ifdef HAVE_DATALAYOUT_H
+#if defined HAVE_DATALAYOUT_H || defined HAVE_IR_DATALAYOUT_H
th->FPM->add(new llvm::DataLayout(*th->ex->getDataLayout()));
#else
th->FPM->add(new llvm::TargetData(*th->ex->getTargetData()));
diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp
index 2018be3..bb8e9a5 100644
--- a/src/scripting/abc_codesynt.cpp
+++ b/src/scripting/abc_codesynt.cpp
@@ -25,18 +25,29 @@
#endif
#include "compat.h"
-#include <llvm/Module.h>
-#include <llvm/DerivedTypes.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/PassManager.h>
-#include <llvm/Constants.h>
-#ifdef HAVE_IRBUILDER_H
+#ifdef HAVE_IR_DATALAYOUT_H
+# include <llvm/IR/Constants.h>
+# include <llvm/IR/DerivedTypes.h>
+# include <llvm/IR/Module.h>
+# include <llvm/IR/LLVMContext.h>
+#else
+# include <llvm/Constants.h>
+# include <llvm/DerivedTypes.h>
+# include <llvm/Module.h>
+# include <llvm/LLVMContext.h>
+#endif
+#ifdef HAVE_IR_DATALAYOUT_H
+# include <llvm/IR/IRBuilder.h>
+#elif defined HAVE_IRBUILDER_H
# include <llvm/IRBuilder.h>
#else
# include <llvm/Support/IRBuilder.h>
#endif
-#include <llvm/LLVMContext.h>
-#ifdef HAVE_DATALAYOUT_H
+#ifdef HAVE_IR_DATALAYOUT_H
+# include <llvm/IR/DataLayout.h>
+#elif defined HAVE_DATALAYOUT_H
# include <llvm/DataLayout.h>
#else
# include <llvm/Target/TargetData.h>
@@ -279,7 +290,7 @@ void ABCVm::registerFunctions()
llvm::FunctionType* FT=NULL;
//Create types
-#ifdef HAVE_DATALAYOUT_H
+#if defined HAVE_DATALAYOUT_H || defined HAVE_IR_DATALAYOUT_H
ptr_type=ex->getDataLayout()->getIntPtrType(llvm_context());
#else
ptr_type=ex->getTargetData()->getIntPtrType(llvm_context());
--
1.8.3

View file

@ -1,39 +0,0 @@
diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake
index 32d32b4..19a3934 100644
--- a/conf/FindLLVM.cmake
+++ b/conf/FindLLVM.cmake
@@ -156,6 +156,15 @@ else (LLVM_INCLUDE_DIR)
IF(HAVE_SUPPORT_TARGETSELECT_H)
ADD_DEFINITIONS(-DHAVE_SUPPORT_TARGETSELECT_H)
ENDIF(HAVE_SUPPORT_TARGETSELECT_H)
+
+ set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_DEFINITIONS -D__STDC_LIMIT_MACROS=1 -D__STDC_CONSTANT_MACROS=1)
+ check_include_file_cxx("llvm/IRBuilder.h" HAVE_IRBUILDER_H)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ MESSAGE(STATUS "HAVE_IRBUILDER_H: " ${HAVE_IRBUILDER_H})
+ IF(HAVE_IRBUILDER_H)
+ ADD_DEFINITIONS(-DHAVE_IRBUILDER_H)
+ ENDIF(HAVE_IRBUILDER_H)
exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS )
MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS})
diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp
index d00521b..2648bbf 100644
--- a/src/scripting/abc_codesynt.cpp
+++ b/src/scripting/abc_codesynt.cpp
@@ -29,8 +29,12 @@
#include <llvm/DerivedTypes.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/PassManager.h>
-#include <llvm/Constants.h>
-#include <llvm/Support/IRBuilder.h>
+#include <llvm/Constants.h>
+#ifdef HAVE_IRBUILDER_H
+# include <llvm/IRBuilder.h>
+#else
+# include <llvm/Support/IRBuilder.h>
+#endif
#include <llvm/LLVMContext.h>
#include <llvm/Target/TargetData.h>
#include <sstream>

View file

@ -1,77 +0,0 @@
diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake
index 19a3934..7bd52e2 100644
--- a/conf/FindLLVM.cmake
+++ b/conf/FindLLVM.cmake
@@ -165,6 +165,14 @@ else (LLVM_INCLUDE_DIR)
IF(HAVE_IRBUILDER_H)
ADD_DEFINITIONS(-DHAVE_IRBUILDER_H)
ENDIF(HAVE_IRBUILDER_H)
+
+ set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR})
+ check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H})
+ IF(HAVE_DATALAYOUT_H)
+ ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H)
+ ENDIF(HAVE_DATALAYOUT_H)
exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS )
MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS})
diff --git a/src/scripting/abc.cpp b/src/scripting/abc.cpp
index 710eaec..a0546cb 100644
--- a/src/scripting/abc.cpp
+++ b/src/scripting/abc.cpp
@@ -28,7 +28,11 @@
#include <llvm/ExecutionEngine/JIT.h>
#include <llvm/PassManager.h>
#include <llvm/LLVMContext.h>
-#include <llvm/Target/TargetData.h>
+#ifdef HAVE_DATALAYOUT_H
+# include <llvm/DataLayout.h>
+#else
+# include <llvm/Target/TargetData.h>
+#endif
#ifdef HAVE_SUPPORT_TARGETSELECT_H
#include <llvm/Support/TargetSelect.h>
#else
@@ -1456,7 +1460,11 @@ void ABCVm::Run(ABCVm* th)
assert_and_throw(th->ex);
th->FPM=new llvm::FunctionPassManager(th->module);
+#ifdef HAVE_DATALAYOUT_H
+ th->FPM->add(new llvm::DataLayout(*th->ex->getDataLayout()));
+#else
th->FPM->add(new llvm::TargetData(*th->ex->getTargetData()));
+#endif
#ifdef EXPENSIVE_DEBUG
//This is pretty heavy, do not enable in release
th->FPM->add(llvm::createVerifierPass());
diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp
index 2648bbf..83c1d5f 100644
--- a/src/scripting/abc_codesynt.cpp
+++ b/src/scripting/abc_codesynt.cpp
@@ -36,7 +36,11 @@
# include <llvm/Support/IRBuilder.h>
#endif
#include <llvm/LLVMContext.h>
-#include <llvm/Target/TargetData.h>
+#ifdef HAVE_DATALAYOUT_H
+# include <llvm/DataLayout.h>
+#else
+# include <llvm/Target/TargetData.h>
+#endif
#include <sstream>
#include "scripting/abc.h"
#include "swftypes.h"
@@ -275,7 +279,11 @@ void ABCVm::registerFunctions()
llvm::FunctionType* FT=NULL;
//Create types
+#ifdef HAVE_DATALAYOUT_H
+ ptr_type=ex->getDataLayout()->getIntPtrType(llvm_context());
+#else
ptr_type=ex->getTargetData()->getIntPtrType(llvm_context());
+#endif
//Pointer to 8 bit type, needed for pointer arithmetic
voidptr_type=llvm::IntegerType::get(getVm()->llvm_context(),8)->getPointerTo();
number_type=llvm::Type::getDoubleTy(llvm_context());

View file

@ -1,7 +1,7 @@
# Template file for 'lightspark'
pkgname=lightspark
version=0.7.0
revision=6
version=0.7.2
revision=1
patch_args="-Np1"
build_style=cmake
configure_args="-DAUDIO_BACKEND=pulse -DENABLE_CURL=1 -DCOMPILE_PLUGIN=1"
@ -15,7 +15,7 @@ maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://lightspark.github.com/"
license="LGPL-3"
distfiles="http://launchpad.net/lightspark/trunk/$pkgname-$version/+download/$pkgname-$version.tar.gz"
checksum=f3df63692ad8409888336a58f4db96b3344737d492df3a3f06c7359fdf26c85b
checksum=70479bac90f3455a5ff6d0aaf6bccaedfbaac3c70bd602680f68ce75eab2dd1b
lightspark_package() {
conf_files="/etc/xdg/lightspark.conf"