-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
346 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,98 @@ | ||
# this one is important | ||
SET(CMAKE_SYSTEM_NAME Windows) | ||
#this one not so much | ||
SET(CMAKE_SYSTEM_VERSION 1) | ||
|
||
# where is the target environment | ||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) | ||
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX}) | ||
|
||
SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) | ||
|
||
# specify the cross compiler | ||
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) | ||
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++) | ||
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}gcc) | ||
|
||
IF(WIN64) | ||
# specify the cross compiler | ||
SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-) | ||
SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc) | ||
SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++) | ||
ENDIF() | ||
# Required by cmake if `uname -s` is inadaquate | ||
SET(CMAKE_SYSTEM_NAME Windows) | ||
SET(CMAKE_SYSTEM_VERSION 1) | ||
|
||
# The target environment | ||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) | ||
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX}) | ||
|
||
# Windows msys mingw ships with a mostly-suitable preconfigured environment | ||
IF(LMMS_BUILD_MSYS) | ||
SET(STRIP ${MINGW_PREFIX}/bin/strip) | ||
SET(WINDRES ${MINGW_PREFIX}/bin/windres) | ||
SET(CMAKE_RC_COMPILER ${WINDRES}) | ||
SET(CMAKE_C_COMPILER ${MINGW_PREFIX}/bin/gcc) | ||
SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}/bin/g++) | ||
|
||
# specify location of some tools | ||
SET(STRIP ${MINGW_TOOL_PREFIX}strip) | ||
SET(WINDRES ${MINGW_TOOL_PREFIX}windres) | ||
SET(PKG_CONFIG_EXECUTABLE ${MINGW_TOOL_PREFIX}pkg-config) | ||
SET(PKG_CONFIG_FOUND TRUE) | ||
# For 32-bit vst support | ||
IF(WIN64) | ||
# Specify the 32-bit cross compiler | ||
SET(CMAKE_C_COMPILER32 ${MINGW_PREFIX32}/bin/gcc) | ||
SET(CMAKE_CXX_COMPILER32 ${MINGW_PREFIX32}/bin/g++) | ||
ENDIF() | ||
|
||
# Msys compiler does not support @CMakeFiles/Include syntax | ||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF) | ||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF) | ||
|
||
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin) | ||
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake) | ||
# FIXME: There should be a cleaner way to do this | ||
# Allows "Debug" msys builds to link against Qt "Release" libraries | ||
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
SET(QT_LIBRARIES | ||
optimized;${MINGW_PREFIX}/bin/QtGui4.dll; | ||
optimized;${MINGW_PREFIX}/bin/QtCore4.dll; | ||
optimized;${MINGW_PREFIX}/bin/QtXml4.dll; | ||
debug;${MINGW_PREFIX}/bin/QtGui4.dll; | ||
debug;${MINGW_PREFIX}/bin/QtCore4.dll; | ||
debug;${MINGW_PREFIX}/bin/QtXml4.dll; | ||
) | ||
ENDIF() | ||
# Linux mingw requires explicitly defined tools to prevent clash with native system tools | ||
ELSE() | ||
SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) | ||
|
||
# search for programs in the build host directories | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
# for libraries and headers in the target directories | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
# Specify the cross compiler | ||
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) | ||
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++) | ||
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}gcc) | ||
|
||
# Mingw tools | ||
SET(STRIP ${MINGW_TOOL_PREFIX}strip) | ||
SET(WINDRES ${MINGW_TOOL_PREFIX}windres) | ||
SET(PKG_CONFIG_EXECUTABLE ${MINGW_TOOL_PREFIX}pkg-config) | ||
SET(PKG_CONFIG_FOUND TRUE) | ||
|
||
# Search for programs in the build host directories | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
# For libraries and headers in the target directories | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
# For 32-bit vst support | ||
IF(WIN64) | ||
# Specify the 32-bit cross compiler | ||
SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-) | ||
SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc) | ||
SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++) | ||
ENDIF() | ||
|
||
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include) | ||
ENDIF() | ||
|
||
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include) | ||
LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin) | ||
|
||
# Qt tools | ||
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin) | ||
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake) | ||
|
||
# Echo modified cmake vars to screen for debugging purposes | ||
IF(NOT DEFINED ENV{MINGW_DEBUG_INFO}) | ||
MESSAGE("") | ||
MESSAGE("Custom cmake vars: (blank = system default)") | ||
MESSAGE("-----------------------------------------") | ||
MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}") | ||
MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}") | ||
MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}") | ||
MESSAGE("* WINDRES : ${WINDRES}") | ||
MESSAGE("* PKG_CONFIG_EXECUTABLE : ${PKG_CONFIG_EXECUTABLE}") | ||
MESSAGE("* MINGW_TOOL_PREFIX32 : ${MINGW_TOOL_PREFIX32}") | ||
MESSAGE("* CMAKE_C_COMPILER32 : ${CMAKE_C_COMPILER32}") | ||
MESSAGE("* CMAKE_CXX_COMPILER32 : ${CMAKE_CXX_COMPILER32}") | ||
MESSAGE("* STRIP : ${STRIP}") | ||
MESSAGE("* QT_BINARY_DIR : ${QT_BINARY_DIR}") | ||
MESSAGE("* QT_QMAKE_EXECUTABLE : ${QT_QMAKE_EXECUTABLE}") | ||
MESSAGE("") | ||
# So that the debug info only appears once | ||
SET(ENV{MINGW_DEBUG_INFO} SHOWN) | ||
ENDIF() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
SET(MINGW_PREFIX /opt/mingw32) | ||
IF(LMMS_BUILD_MSYS) | ||
SET(MINGW_PREFIX /mingw32) | ||
ELSE() | ||
SET(MINGW_PREFIX /opt/mingw32) | ||
ENDIF() | ||
|
||
SET(CMAKE_SYSTEM_PROCESSOR i686) | ||
SET(CMAKE_SYSTEM_PROCESSOR i686) | ||
|
||
INCLUDE(MinGWCrossCompile) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
ppa_dir=./ppa/ | ||
|
||
pushd $ppa_dir | ||
|
||
for f in *.deb; do | ||
echo "Extracting $f..." | ||
ar xv $f | ||
rm debian-binary | ||
rm control.tar.* | ||
tar xf data.tar.* | ||
rm data.tar.* | ||
done | ||
|
||
popd | ||
|
||
echo "Your extracted files should be located in $ppa_dir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# Trusty=14.04, Precise=12.04 | ||
PPA_DISTRO=trusty | ||
|
||
# Architecture=i386, amd64 | ||
PPA_ARCH=amd64 | ||
|
||
# These shouldn't change | ||
PPA_HOST=http://ppa.launchpad.net | ||
PPA_USER=tobydox | ||
PPA_PROJECT=mingw-x-trusty | ||
PPA_ROOT=$PPA_HOST/$PPA_USER/$PPA_PROJECT/ubuntu | ||
|
||
PPA_URL=$PPA_ROOT/dists/$PPA_DISTRO/main/binary-$PPA_ARCH/Packages | ||
|
||
ppa_dir=./ppa/ | ||
|
||
temp_file=/tmp/ppa_listing_$$ | ||
|
||
echo "Connecting to $PPA_HOST to get list of packages..." | ||
wget -qO- $PPA_URL |grep "Filename:" > $temp_file | ||
|
||
line_count=`wc -l $temp_file |awk '{print $1}'` | ||
|
||
echo "Found $line_count packages for download..." | ||
|
||
echo "Downloading packages. They will be saved to $ppa_dir" | ||
|
||
mkdir $ppa_dir | ||
|
||
for j in `cat $temp_file` ; do | ||
if [ "$j" = "Filename:" ] ; then | ||
continue | ||
fi | ||
echo "Downloading $j..." | ||
wget -O $ppa_dir$(basename $j) $PPA_ROOT/$j | ||
done | ||
|
||
|
||
echo "Cleaning up temporary files..." | ||
rm -rf $temp_file | ||
|
||
echo "Packages have been saved to $ppa_dir. Please run extract_debs.sh" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/bin/bash | ||
|
||
# Console colors | ||
red="\\x1B[1;31m" | ||
green="\\x1B[1;32m" | ||
yellow="\\x1B[1;33m" | ||
plain="\\x1B[0m" | ||
|
||
function info() { echo -e "\n${green}$1${plain}"; } | ||
function warn() { echo -e "\n${yellow}$1${plain}"; } | ||
function err() { echo -e "\n${red}$1${plain}"; exit 1;} | ||
|
||
info "Checking for mingw environment" | ||
env |grep MINGW | ||
if [ $? -ne 0 ]; then | ||
err " - Failed. Please relaunch using MinGW shell" | ||
fi | ||
|
||
info "Preparing the git directory..." | ||
mkdir $HOME/.git; touch $HOME/.git/config > /dev/null &2>1 | ||
git config --global http.sslverify false | ||
|
||
info "Cloning the repository..." | ||
if [ -d ./lmms ]; then | ||
warn " - Skipping, ./lmms already exists" | ||
else | ||
#FIXME change "tresf" to "lmms" | ||
git clone -b master https://github.com/tresf/lmms.git | ||
fi | ||
|
||
|
||
info "Fetching ppa using cmake/msys/fetch_ppas.sh..." | ||
if [ -d $HOME/ppa ]; then | ||
warn " - Skipping, $HOME/ppa already exists" | ||
else | ||
./lmms/cmake/msys/fetch_ppa.sh | ||
fi | ||
|
||
|
||
info "Extracting debs to $HOME/ppa/opt/, etc..." | ||
if [ -d $HOME/ppa/opt ]; then | ||
warn " - Skipping, $HOME/ppa/opt already exists" | ||
else | ||
./lmms/cmake/msys/extract_debs.sh | ||
fi | ||
|
||
info "Preparing library merge, making all qt headers writable..." | ||
chmod u+w /mingw64/include/qt4 -R | ||
chmod u+w /mingw32/include/qt4 -R | ||
|
||
info "Merging mingw headers and libraries from ppa over existing system libraries..." | ||
find /mingw64 |grep sndfile.h | ||
|
||
if [ $? -ne 0 ]; then | ||
\cp -r $HOME/ppa/opt/mingw* / | ||
else | ||
warn " - Skipping, sndfile.h has already been merged" | ||
fi | ||
|
||
fltkver="1.3.3" | ||
|
||
info "Downloading and building fltk $fltkver" | ||
|
||
mingw_root="/$(echo $MSYSTEM|tr '[:upper:]' '[:lower:]')" | ||
which fluid | ||
if [ $? -ne 0 ]; then | ||
wget http://fltk.org/pub/fltk/$fltkver/fltk-$fltkver-source.tar.gz -O $HOME/fltk-source.tar.gz | ||
if [ $? -ne 0 ]; then | ||
err "ERROR: Could not download fltk. Exiting." | ||
fi | ||
tar zxf $HOME/fltk-source.tar.gz -C $HOME/ | ||
pushd $HOME/fltk-$fltkver | ||
|
||
info " - Compiling fltk $fltkver..." | ||
./configure | ||
|
||
make | ||
|
||
info " - Installing fltk..." | ||
make install DESTDIR=$mingw_root | ||
|
||
if [ $? -ne 0 ]; then | ||
err "ERROR: Could not build/install fltk -- Zyn needs this. Exiting." | ||
fi | ||
|
||
ln -s $mingw_root/usr/local/bin/fluid.exe $mingw_root/bin/fluid.exe | ||
else | ||
warn " - Skipping, fluid binary already exists" | ||
fi | ||
|
||
popd | ||
|
||
info "Cleaning up..." | ||
rm -rf $HOME/fltk-$fltkver | ||
info "Done." |
Oops, something went wrong.