Skip to content

Commit

Permalink
Merge pull request #4 from LMMS/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
LostRobotMusic authored Apr 14, 2019
2 parents 6b23e64 + b3461e2 commit 271e20d
Show file tree
Hide file tree
Showing 110 changed files with 1,766 additions and 564 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist: trusty
sudo: required
cache:
directories:
- apt_mingw_cache
- $HOME/apt_mingw_cache
- $HOME/.ccache
- $HOME/pbuilder-bases
matrix:
Expand All @@ -14,9 +14,15 @@ matrix:
- env: TARGET_OS=win32
- env: TARGET_OS=win64
- env: TARGET_OS=debian-sid TARGET_DEPLOY=True
git:
depth: false
- env: TARGET_OS=debian-sid TARGET_ARCH=i386
git:
depth: false
- compiler: clang
env: TARGET_OS=debian-sid
git:
depth: false
- os: osx
osx_image: xcode8.3
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh
Expand Down
2 changes: 1 addition & 1 deletion .travis/linux..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ sudo apt-get install -y $PACKAGES
sudo add-apt-repository -y ppa:kxstudio-debian/libs
sudo add-apt-repository -y ppa:kxstudio-debian/apps
sudo apt-get update
sudo apt-get install -y carla-git
sudo apt-get install -y carla
41 changes: 36 additions & 5 deletions .travis/linux.debian-sid.script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

: "${TARGET_ARCH:=amd64}"
Expand All @@ -21,19 +21,50 @@ fi
if [ ! -e "$BASETGZ.stamp" ]
then
mkdir -p "$HOME/pbuilder-bases"
# debootstrap fails to resolve dependencies which are virtual packages
# e.g. perl-openssl-abi-1.1 provided by perl-openssl-defaults, needed for building SWH
# See also: https://bugs.launchpad.net/ubuntu/+source/debootstrap/+bug/86536
sudo pbuilder --create --basetgz "$BASETGZ" --mirror $MIRROR \
--distribution sid --architecture $TARGET_ARCH \
--debootstrapopts --variant=buildd \
--debootstrapopts --keyring=$KEYRING \
--debootstrapopts --include=perl,libxml2-utils,libxml-perl,liblist-moreutils-perl,perl-openssl-defaults
--debootstrapopts --include=perl
touch "$BASETGZ.stamp"
else
sudo pbuilder --update --basetgz "$BASETGZ"
fi

sync_version() {
local VERSION
local MMR
local STAGE
local EXTRA

VERSION=$(git describe --tags --match v[0-9].[0-9].[0-9]*)
VERSION=${VERSION#v}
MMR=${VERSION%%-*}
case $VERSION in
*-*-*-*)
VERSION=${VERSION%-*}
STAGE=${VERSION#*-}
STAGE=${STAGE%-*}
EXTRA=${VERSION##*-}
VERSION=$MMR~$STAGE.$EXTRA
;;
*-*-*)
VERSION=${VERSION%-*}
EXTRA=${VERSION##*-}
VERSION=$MMR.$EXTRA
;;
*-*)
STAGE=${VERSION#*-}
VERSION=$MMR~$STAGE
;;
esac

sed "1 s/@VERSION@/$VERSION/" -i debian/changelog
echo "Set Debian version to $VERSION"
}

sync_version

DIR="$PWD"
cd ..
dpkg-source -b "$DIR"
Expand Down
2 changes: 1 addition & 1 deletion .travis/linux.win.download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1
CACHE_DIR=$HOME/apt_mingw_cache/$1
mkdir -p "$CACHE_DIR"

pushd "$CACHE_DIR"
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ OPTION(WANT_STK "Include Stk (Synthesis Toolkit) support" ON)
OPTION(WANT_SWH "Include Steve Harris's LADSPA plugins" ON)
OPTION(WANT_TAP "Include Tom's Audio Processing LADSPA plugins" ON)
OPTION(WANT_VST "Include VST support" ON)
OPTION(WANT_VST_NOWINE "Include partial VST support (without wine)" OFF)
OPTION(WANT_VST_32 "Include 32-bit VST support" ON)
OPTION(WANT_VST_64 "Include 64-bit VST support" ON)
OPTION(WANT_WINMM "Include WinMM MIDI support" OFF)
OPTION(WANT_DEBUG_FPE "Debug floating point exceptions" OFF)


IF(LMMS_BUILD_APPLE)
# Fix linking on 10.14+. See issue #4762 on github
LINK_DIRECTORIES(/usr/local/lib)
SET(WANT_SOUNDIO OFF)
SET(WANT_ALSA OFF)
SET(WANT_PULSEAUDIO OFF)
SET(WANT_VST OFF)
Expand Down
11 changes: 7 additions & 4 deletions cmake/linux/package_linux.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real"
cat >"${APPDIR}usr/bin/lmms" <<EOL
#!/usr/bin/env bash
DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$PATH:/sbin"
if which carla > /dev/null 2>&1; then
CARLAPATH="\$(which carla)"
CARLAPREFIX="\${CARLAPATH%/bin*}"
Expand Down Expand Up @@ -134,15 +135,15 @@ export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":$LD_LIBRARY_PATH

# Handle wine linking
if [ -d "@WINE_32_LIBRARY_DIR@" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_LIBRARY_PATH/wine/:@WINE_32_LIBRARY_DIR@:@WINE_32_LIBRARY_DIR@wine/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_32_LIBRARY_DIRS@
fi
if [ -d "@WINE_64_LIBRARY_DIR@" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_LIBRARY_PATH/wine/:@WINE_64_LIBRARY_DIR@:@WINE_64_LIBRARY_DIR@wine/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_64_LIBRARY_DIRS@
fi

# Move executables so linuxdeployqt can find them
ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx"
VSTLIB32="${APPDIR}usr/lib/lmms/RemoteVstPlugin32.exe.so"
VSTLIB32="${APPDIR}usr/lib/lmms/32/RemoteVstPlugin32.exe.so"
VSTLIB64="${APPDIR}usr/lib/lmms/RemoteVstPlugin64.exe.so"

ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx"
Expand Down Expand Up @@ -172,8 +173,10 @@ executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale
# Bundle both qt and non-qt dependencies into appimage format
echo -e "\nBundling and relinking system dependencies..."
echo -e ">>>>> linuxdeployqt" > "$LOGFILE"
# FIXME: -unsupported-allow-new-glibc may result in an AppImage which is unusable on old systems.

# shellcheck disable=SC2086
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -unsupported-allow-new-glibc -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
success "Bundled and relinked dependencies"

# Link to original location so lmms can find them
Expand Down
27 changes: 27 additions & 0 deletions cmake/modules/CheckWineGcc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
INCLUDE(CheckCXXSourceCompiles)

FUNCTION(CheckWineGcc BITNESS WINEGCC_EXECUTABLE RESULT)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx" "
#include <iostream>
#define USE_WS_PREFIX
#include <windows.h>
int main(int argc, const char* argv[]) {
return 0;
}
")
EXECUTE_PROCESS(COMMAND ${WINEGCC_EXECUTABLE} "-m${BITNESS}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
"-o" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE WINEGCC_RESULT
)
FILE(REMOVE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.exe.so"
)
IF(WINEGCC_RESULT EQUAL 0)
SET(${RESULT} True PARENT_SCOPE)
ELSE()
SET(${RESULT} False PARENT_SCOPE)
ENDIF()
ENDFUNCTION()
117 changes: 88 additions & 29 deletions cmake/modules/FindWine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,113 @@
# WINE_DEFINITIONS - Compiler switches required for using wine
#

LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging /usr/lib/wine/)
MACRO(_findwine_find_flags output expression result)
STRING(REPLACE " " ";" WINEBUILD_FLAGS "${output}")
FOREACH(FLAG ${WINEBUILD_FLAGS})
IF("${FLAG}" MATCHES "${expression}")
SET(${result} "${FLAG}")
ENDIF()
ENDFOREACH()
ENDMACRO()

LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging /usr/lib/wine/)

FIND_PATH(WINE_INCLUDE_DIR wine/exception.h PATH_SUFFIXES wine)
FIND_PROGRAM(WINE_CXX
NAMES wineg++ winegcc winegcc64 winegcc32 winegcc-stable
PATHS /usr/lib/wine)
PATHS /usr/lib/wine
)
FIND_PROGRAM(WINE_BUILD NAMES winebuild)
# Detect wine paths and handle linking problems
IF(WINE_CXX)
EXEC_PROGRAM(${WINE_CXX} ARGS "-m32 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_32)
EXEC_PROGRAM(${WINE_CXX} ARGS "-m64 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_64)
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem/usr/include$" BUGGED_WINEGCC)
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem" WINEGCC_INCLUDE_DIR)
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "libwinecrt0\\.a.*" WINECRT_32)
_findwine_find_flags("${WINEBUILD_OUTPUT_64}" "libwinecrt0\\.a.*" WINECRT_64)
STRING(REGEX REPLACE "^-isystem" "" WINE_INCLUDE_HINT "${WINEGCC_INCLUDE_DIR}")
STRING(REGEX REPLACE "/wine/windows$" "" WINE_INCLUDE_HINT "${WINE_INCLUDE_HINT}")
STRING(REGEX REPLACE "libwinecrt0\\.a.*" "" WINE_32_LIBRARY_DIR "${WINECRT_32}")
STRING(REGEX REPLACE "libwinecrt0\\.a.*" "" WINE_64_LIBRARY_DIR "${WINECRT_64}")

IF(BUGGED_WINEGCC)
MESSAGE(WARNING "Your winegcc is unusable due to https://bugs.winehq.org/show_bug.cgi?id=46293,\n
Consider either upgrading or downgrading wine.")
RETURN()
ENDIF()
IF(WINE_32_LIBRARY_DIR STREQUAL WINE_64_LIBRARY_DIR)
MESSAGE(STATUS "Old winegcc detected, trying to use workaround linking")
# Fix library search directory according to the target bitness
IF(WINE_32_LIBRARY_DIR MATCHES "/lib/(x86_64|i386)-")
# Debian systems
STRING(REPLACE "/lib/x86_64-" "/lib/i386-" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
STRING(REPLACE "/lib/i386-" "/lib/x86_64-" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/(lib|lib64)/wine/$")
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
STRING(REGEX REPLACE "/lib64/wine/$" "/lib/wine/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
STRING(REGEX REPLACE "/lib/wine/$" "/lib64/wine/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/.*/wine/")
# Systems with old multilib layout
STRING(REPLACE "/lib32/" "/lib/" WINE_64_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/.*/wine/")
# We need to test if the corresponding 64bit library directory is lib or lib32
STRING(REPLACE "/lib64/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
STRING(REPLACE "/lib64/" "/lib/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ENDIF()
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/.*/wine/")
# Test if this directory is for 32bit or 64bit
STRING(REPLACE "/lib/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
SET(WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
STRING(REPLACE "/lib/" "/lib64/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ENDIF()
ELSE()
MESSAGE(WARNING "Can't detect wine installation layout. You may get some build errors.")
ENDIF()
SET(WINE_LIBRARY_FIX "${WINE_32_LIBRARY_DIR} and ${WINE_64_LIBRARY_DIR}")
ENDIF()
ENDIF()

FIND_PATH(WINE_INCLUDE_DIR wine/exception.h
HINTS "${WINE_INCLUDE_HINT}"
)

SET(_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})

FIND_LIBRARY(WINE_LIBRARY NAMES wine PATH_SUFFIXES wine i386-linux-gnu/wine)
FIND_LIBRARY(WINE_LIBRARY NAMES wine
PATH_SUFFIXES wine i386-linux-gnu/wine
HINTS "${WINE_32_LIBRARY_DIR}" "${WINE_64_LIBRARY_DIR}"
)

SET(CMAKE_LIBRARY_ARCHITECTURE ${_ARCHITECTURE})

SET(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
SET(WINE_LIBRARIES ${WINE_LIBRARY} )

# Handle wine linking problems
EXEC_PROGRAM(${WINE_CXX} ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT)
STRING(REPLACE " " ";" WINEBUILD_FLAGS "${WINEBUILD_OUTPUT}")

FOREACH(FLAG ${WINEBUILD_FLAGS})
IF("${FLAG}" MATCHES "libwinecrt0.a.*")
STRING(REGEX REPLACE "/wine/libwinecrt0.a.*" "" FLAG "${FLAG}")

SET(WINE_64_LIBRARY_DIR "${FLAG}/")

# Debian systems
STRING(REPLACE "/lib/x86_64-" "/lib/i386-" FLAG "${FLAG}")
# Fedora systems
STRING(REPLACE "/lib/lib64" "/lib/i386" FLAG "${FLAG}")
# Gentoo systems
STRING(REPLACE "/lib/wine-" "/lib32/wine-" FLAG "${FLAG}")
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
STRING(REGEX REPLACE "/lib64$" "/lib" FLAG "${FLAG}")

SET(WINE_32_LIBRARY_DIR "${FLAG}/")
ENDIF()
ENDFOREACH()
SET(WINE_LIBRARIES ${WINE_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_LIBRARIES WINE_INCLUDE_DIRS)

mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)

IF(WINE_32_LIBRARY_DIR)
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}wine/ -L${WINE_32_LIBRARY_DIR}")
IF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
ELSE()
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
ENDIF()
ENDIF()

IF(WINE_64_LIBRARY_DIR)
IF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
ELSE()
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
ENDIF()
ENDIF()

# Create winegcc wrapper
Expand Down
11 changes: 11 additions & 0 deletions cmake/modules/winegcc_wrapper.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ while [ $# -gt 0 ]; do
-m32)
win32=true
;;
-m64)
win64=true
;;
*)

;;
Expand All @@ -42,11 +45,19 @@ fi
# by FindWine.cmake
extra_args="-I@WINE_INCLUDE_DIR@ -I@WINE_INCLUDE_DIR@/wine/windows"

# Apply manually specified flags
extra_args="$extra_args @WINE_CXX_FLAGS@"

# Apply -m32 library fix if necessary
if [ "$win32" = true ] && [ "$no_link" != true ]; then
extra_args="$extra_args @WINE_32_FLAGS@"
fi

# Apply -m64 library fix if necessary
if [ "$win64" = true ] && [ "$no_link" != true ]; then
extra_args="$extra_args @WINE_64_FLAGS@"
fi

# Run winegcc
export WINEBUILD=@WINE_BUILD@
@WINE_CXX@ $extra_args $args
Expand Down
1 change: 0 additions & 1 deletion debian/calf-ladspa.install

This file was deleted.

2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lmms (1.2.0~rc7.1) unstable; urgency=low
lmms (@VERSION@) unstable; urgency=low

* Upstream integration.
* Drop Debian menu entry (policy 9.6).
Expand Down
Loading

0 comments on commit 271e20d

Please sign in to comment.