Skip to content

Commit 271e20d

Browse files
Merge pull request #4 from LMMS/master
Master
2 parents 6b23e64 + b3461e2 commit 271e20d

File tree

110 files changed

+1766
-564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1766
-564
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dist: trusty
44
sudo: required
55
cache:
66
directories:
7-
- apt_mingw_cache
7+
- $HOME/apt_mingw_cache
88
- $HOME/.ccache
99
- $HOME/pbuilder-bases
1010
matrix:
@@ -14,9 +14,15 @@ matrix:
1414
- env: TARGET_OS=win32
1515
- env: TARGET_OS=win64
1616
- env: TARGET_OS=debian-sid TARGET_DEPLOY=True
17+
git:
18+
depth: false
1719
- env: TARGET_OS=debian-sid TARGET_ARCH=i386
20+
git:
21+
depth: false
1822
- compiler: clang
1923
env: TARGET_OS=debian-sid
24+
git:
25+
depth: false
2026
- os: osx
2127
osx_image: xcode8.3
2228
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh

.travis/linux..install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ sudo apt-get install -y $PACKAGES
2323
sudo add-apt-repository -y ppa:kxstudio-debian/libs
2424
sudo add-apt-repository -y ppa:kxstudio-debian/apps
2525
sudo apt-get update
26-
sudo apt-get install -y carla-git
26+
sudo apt-get install -y carla

.travis/linux.debian-sid.script.sh

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33

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

34+
sync_version() {
35+
local VERSION
36+
local MMR
37+
local STAGE
38+
local EXTRA
39+
40+
VERSION=$(git describe --tags --match v[0-9].[0-9].[0-9]*)
41+
VERSION=${VERSION#v}
42+
MMR=${VERSION%%-*}
43+
case $VERSION in
44+
*-*-*-*)
45+
VERSION=${VERSION%-*}
46+
STAGE=${VERSION#*-}
47+
STAGE=${STAGE%-*}
48+
EXTRA=${VERSION##*-}
49+
VERSION=$MMR~$STAGE.$EXTRA
50+
;;
51+
*-*-*)
52+
VERSION=${VERSION%-*}
53+
EXTRA=${VERSION##*-}
54+
VERSION=$MMR.$EXTRA
55+
;;
56+
*-*)
57+
STAGE=${VERSION#*-}
58+
VERSION=$MMR~$STAGE
59+
;;
60+
esac
61+
62+
sed "1 s/@VERSION@/$VERSION/" -i debian/changelog
63+
echo "Set Debian version to $VERSION"
64+
}
65+
66+
sync_version
67+
3768
DIR="$PWD"
3869
cd ..
3970
dpkg-source -b "$DIR"

.travis/linux.win.download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1
5+
CACHE_DIR=$HOME/apt_mingw_cache/$1
66
mkdir -p "$CACHE_DIR"
77

88
pushd "$CACHE_DIR"

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ OPTION(WANT_STK "Include Stk (Synthesis Toolkit) support" ON)
6767
OPTION(WANT_SWH "Include Steve Harris's LADSPA plugins" ON)
6868
OPTION(WANT_TAP "Include Tom's Audio Processing LADSPA plugins" ON)
6969
OPTION(WANT_VST "Include VST support" ON)
70-
OPTION(WANT_VST_NOWINE "Include partial VST support (without wine)" OFF)
70+
OPTION(WANT_VST_32 "Include 32-bit VST support" ON)
71+
OPTION(WANT_VST_64 "Include 64-bit VST support" ON)
7172
OPTION(WANT_WINMM "Include WinMM MIDI support" OFF)
7273
OPTION(WANT_DEBUG_FPE "Debug floating point exceptions" OFF)
7374

7475

7576
IF(LMMS_BUILD_APPLE)
7677
# Fix linking on 10.14+. See issue #4762 on github
7778
LINK_DIRECTORIES(/usr/local/lib)
79+
SET(WANT_SOUNDIO OFF)
7880
SET(WANT_ALSA OFF)
7981
SET(WANT_PULSEAUDIO OFF)
8082
SET(WANT_VST OFF)

cmake/linux/package_linux.sh.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real"
101101
cat >"${APPDIR}usr/bin/lmms" <<EOL
102102
#!/usr/bin/env bash
103103
DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
104+
export PATH="$PATH:/sbin"
104105
if which carla > /dev/null 2>&1; then
105106
CARLAPATH="\$(which carla)"
106107
CARLAPREFIX="\${CARLAPATH%/bin*}"
@@ -134,15 +135,15 @@ export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":$LD_LIBRARY_PATH
134135

135136
# Handle wine linking
136137
if [ -d "@WINE_32_LIBRARY_DIR@" ]; then
137-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_LIBRARY_PATH/wine/:@WINE_32_LIBRARY_DIR@:@WINE_32_LIBRARY_DIR@wine/
138+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_32_LIBRARY_DIRS@
138139
fi
139140
if [ -d "@WINE_64_LIBRARY_DIR@" ]; then
140-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_LIBRARY_PATH/wine/:@WINE_64_LIBRARY_DIR@:@WINE_64_LIBRARY_DIR@wine/
141+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_64_LIBRARY_DIRS@
141142
fi
142143

143144
# Move executables so linuxdeployqt can find them
144145
ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx"
145-
VSTLIB32="${APPDIR}usr/lib/lmms/RemoteVstPlugin32.exe.so"
146+
VSTLIB32="${APPDIR}usr/lib/lmms/32/RemoteVstPlugin32.exe.so"
146147
VSTLIB64="${APPDIR}usr/lib/lmms/RemoteVstPlugin64.exe.so"
147148

148149
ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx"
@@ -172,8 +173,10 @@ executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale
172173
# Bundle both qt and non-qt dependencies into appimage format
173174
echo -e "\nBundling and relinking system dependencies..."
174175
echo -e ">>>>> linuxdeployqt" > "$LOGFILE"
176+
# FIXME: -unsupported-allow-new-glibc may result in an AppImage which is unusable on old systems.
177+
175178
# shellcheck disable=SC2086
176-
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
179+
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -unsupported-allow-new-glibc -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
177180
success "Bundled and relinked dependencies"
178181

179182
# Link to original location so lmms can find them

cmake/modules/CheckWineGcc.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
INCLUDE(CheckCXXSourceCompiles)
2+
3+
FUNCTION(CheckWineGcc BITNESS WINEGCC_EXECUTABLE RESULT)
4+
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx" "
5+
#include <iostream>
6+
#define USE_WS_PREFIX
7+
#include <windows.h>
8+
int main(int argc, const char* argv[]) {
9+
return 0;
10+
}
11+
")
12+
EXECUTE_PROCESS(COMMAND ${WINEGCC_EXECUTABLE} "-m${BITNESS}"
13+
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
14+
"-o" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
15+
OUTPUT_QUIET ERROR_QUIET
16+
RESULT_VARIABLE WINEGCC_RESULT
17+
)
18+
FILE(REMOVE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
19+
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
20+
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.exe.so"
21+
)
22+
IF(WINEGCC_RESULT EQUAL 0)
23+
SET(${RESULT} True PARENT_SCOPE)
24+
ELSE()
25+
SET(${RESULT} False PARENT_SCOPE)
26+
ENDIF()
27+
ENDFUNCTION()

cmake/modules/FindWine.cmake

Lines changed: 88 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,113 @@
77
# WINE_DEFINITIONS - Compiler switches required for using wine
88
#
99

10-
LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging /usr/lib/wine/)
10+
MACRO(_findwine_find_flags output expression result)
11+
STRING(REPLACE " " ";" WINEBUILD_FLAGS "${output}")
12+
FOREACH(FLAG ${WINEBUILD_FLAGS})
13+
IF("${FLAG}" MATCHES "${expression}")
14+
SET(${result} "${FLAG}")
15+
ENDIF()
16+
ENDFOREACH()
17+
ENDMACRO()
1118

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

13-
FIND_PATH(WINE_INCLUDE_DIR wine/exception.h PATH_SUFFIXES wine)
1421
FIND_PROGRAM(WINE_CXX
1522
NAMES wineg++ winegcc winegcc64 winegcc32 winegcc-stable
16-
PATHS /usr/lib/wine)
23+
PATHS /usr/lib/wine
24+
)
1725
FIND_PROGRAM(WINE_BUILD NAMES winebuild)
26+
# Detect wine paths and handle linking problems
27+
IF(WINE_CXX)
28+
EXEC_PROGRAM(${WINE_CXX} ARGS "-m32 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_32)
29+
EXEC_PROGRAM(${WINE_CXX} ARGS "-m64 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_64)
30+
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem/usr/include$" BUGGED_WINEGCC)
31+
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem" WINEGCC_INCLUDE_DIR)
32+
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "libwinecrt0\\.a.*" WINECRT_32)
33+
_findwine_find_flags("${WINEBUILD_OUTPUT_64}" "libwinecrt0\\.a.*" WINECRT_64)
34+
STRING(REGEX REPLACE "^-isystem" "" WINE_INCLUDE_HINT "${WINEGCC_INCLUDE_DIR}")
35+
STRING(REGEX REPLACE "/wine/windows$" "" WINE_INCLUDE_HINT "${WINE_INCLUDE_HINT}")
36+
STRING(REGEX REPLACE "libwinecrt0\\.a.*" "" WINE_32_LIBRARY_DIR "${WINECRT_32}")
37+
STRING(REGEX REPLACE "libwinecrt0\\.a.*" "" WINE_64_LIBRARY_DIR "${WINECRT_64}")
38+
39+
IF(BUGGED_WINEGCC)
40+
MESSAGE(WARNING "Your winegcc is unusable due to https://bugs.winehq.org/show_bug.cgi?id=46293,\n
41+
Consider either upgrading or downgrading wine.")
42+
RETURN()
43+
ENDIF()
44+
IF(WINE_32_LIBRARY_DIR STREQUAL WINE_64_LIBRARY_DIR)
45+
MESSAGE(STATUS "Old winegcc detected, trying to use workaround linking")
46+
# Fix library search directory according to the target bitness
47+
IF(WINE_32_LIBRARY_DIR MATCHES "/lib/(x86_64|i386)-")
48+
# Debian systems
49+
STRING(REPLACE "/lib/x86_64-" "/lib/i386-" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
50+
STRING(REPLACE "/lib/i386-" "/lib/x86_64-" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
51+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/(lib|lib64)/wine/$")
52+
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
53+
STRING(REGEX REPLACE "/lib64/wine/$" "/lib/wine/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
54+
STRING(REGEX REPLACE "/lib/wine/$" "/lib64/wine/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
55+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/.*/wine/")
56+
# Systems with old multilib layout
57+
STRING(REPLACE "/lib32/" "/lib/" WINE_64_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
58+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/.*/wine/")
59+
# We need to test if the corresponding 64bit library directory is lib or lib32
60+
STRING(REPLACE "/lib64/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
61+
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
62+
STRING(REPLACE "/lib64/" "/lib/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
63+
ENDIF()
64+
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/.*/wine/")
65+
# Test if this directory is for 32bit or 64bit
66+
STRING(REPLACE "/lib/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
67+
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
68+
SET(WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
69+
STRING(REPLACE "/lib/" "/lib64/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
70+
ENDIF()
71+
ELSE()
72+
MESSAGE(WARNING "Can't detect wine installation layout. You may get some build errors.")
73+
ENDIF()
74+
SET(WINE_LIBRARY_FIX "${WINE_32_LIBRARY_DIR} and ${WINE_64_LIBRARY_DIR}")
75+
ENDIF()
76+
ENDIF()
77+
78+
FIND_PATH(WINE_INCLUDE_DIR wine/exception.h
79+
HINTS "${WINE_INCLUDE_HINT}"
80+
)
1881

1982
SET(_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})
2083

21-
FIND_LIBRARY(WINE_LIBRARY NAMES wine PATH_SUFFIXES wine i386-linux-gnu/wine)
84+
FIND_LIBRARY(WINE_LIBRARY NAMES wine
85+
PATH_SUFFIXES wine i386-linux-gnu/wine
86+
HINTS "${WINE_32_LIBRARY_DIR}" "${WINE_64_LIBRARY_DIR}"
87+
)
2288

2389
SET(CMAKE_LIBRARY_ARCHITECTURE ${_ARCHITECTURE})
2490

2591
SET(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
26-
SET(WINE_LIBRARIES ${WINE_LIBRARY} )
27-
28-
# Handle wine linking problems
29-
EXEC_PROGRAM(${WINE_CXX} ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT)
30-
STRING(REPLACE " " ";" WINEBUILD_FLAGS "${WINEBUILD_OUTPUT}")
31-
32-
FOREACH(FLAG ${WINEBUILD_FLAGS})
33-
IF("${FLAG}" MATCHES "libwinecrt0.a.*")
34-
STRING(REGEX REPLACE "/wine/libwinecrt0.a.*" "" FLAG "${FLAG}")
35-
36-
SET(WINE_64_LIBRARY_DIR "${FLAG}/")
37-
38-
# Debian systems
39-
STRING(REPLACE "/lib/x86_64-" "/lib/i386-" FLAG "${FLAG}")
40-
# Fedora systems
41-
STRING(REPLACE "/lib/lib64" "/lib/i386" FLAG "${FLAG}")
42-
# Gentoo systems
43-
STRING(REPLACE "/lib/wine-" "/lib32/wine-" FLAG "${FLAG}")
44-
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
45-
STRING(REGEX REPLACE "/lib64$" "/lib" FLAG "${FLAG}")
46-
47-
SET(WINE_32_LIBRARY_DIR "${FLAG}/")
48-
ENDIF()
49-
ENDFOREACH()
92+
SET(WINE_LIBRARIES ${WINE_LIBRARY})
5093

5194
include(FindPackageHandleStandardArgs)
5295
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_LIBRARIES WINE_INCLUDE_DIRS)
5396

5497
mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)
5598

5699
IF(WINE_32_LIBRARY_DIR)
57-
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}wine/ -L${WINE_32_LIBRARY_DIR}")
100+
IF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
101+
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
102+
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
103+
ELSE()
104+
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
105+
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
106+
ENDIF()
107+
ENDIF()
108+
109+
IF(WINE_64_LIBRARY_DIR)
110+
IF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
111+
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
112+
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
113+
ELSE()
114+
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
115+
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
116+
ENDIF()
58117
ENDIF()
59118

60119
# Create winegcc wrapper

cmake/modules/winegcc_wrapper.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ while [ $# -gt 0 ]; do
2222
-m32)
2323
win32=true
2424
;;
25+
-m64)
26+
win64=true
27+
;;
2528
*)
2629

2730
;;
@@ -42,11 +45,19 @@ fi
4245
# by FindWine.cmake
4346
extra_args="-I@WINE_INCLUDE_DIR@ -I@WINE_INCLUDE_DIR@/wine/windows"
4447

48+
# Apply manually specified flags
49+
extra_args="$extra_args @WINE_CXX_FLAGS@"
50+
4551
# Apply -m32 library fix if necessary
4652
if [ "$win32" = true ] && [ "$no_link" != true ]; then
4753
extra_args="$extra_args @WINE_32_FLAGS@"
4854
fi
4955

56+
# Apply -m64 library fix if necessary
57+
if [ "$win64" = true ] && [ "$no_link" != true ]; then
58+
extra_args="$extra_args @WINE_64_FLAGS@"
59+
fi
60+
5061
# Run winegcc
5162
export WINEBUILD=@WINE_BUILD@
5263
@WINE_CXX@ $extra_args $args

debian/calf-ladspa.install

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)