-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added support for official wine-devel and wine-staging packages. #3278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is necessary. If so, you should fix it.
cmake/modules/FindWine.cmake
Outdated
@@ -7,8 +7,8 @@ | |||
# WINE_DEFINITIONS - Compiler switches required for using wine | |||
# | |||
|
|||
FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATH_SUFFIXES wine) | |||
FIND_LIBRARY(WINE_LIBRARY NAMES wine PATH_SUFFIXES wine i386-linux-gnu/wine) | |||
FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATHS /opt/wine-devel/include /opt/wine-staging/include PATH_SUFFIXES wine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue what official means, since the official packages in Debian and Ubuntu are the wine-development packages. The expected way is to configure with CMAKE_PREFIX_PATH
rather than use PATHS
, but I guess this does no harm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now written this part using CMAKE_PREFIX_PATH.
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32) | ||
ENDIF() | ||
# Development | ||
IF("${WINEBUILD_OUTPUT}" MATCHES "/opt/wine-devel/lib64/wine/libwinecrt0.a.*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I question this workaround for a recent system, specially for a package from WineHQ. There is no way currently to mix 64-bit and 32-bit objects, so this scenario is not possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this comment. What I did is just added a 2 paths to look for libwinecrt0.a.
In addition to /usr/lib/x86_64-linux-gnu/wine/ and /usr/lib/lib64/wine/ it now looks also into /opt/wine-devel/lib64/wine/ and /opt/wine-staging/lib64/wine/. I didn't introduce any new mixing of 32bit and 64bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround is currently here because some people do not know they have to install 32-bit Wine and do not understand the linker error. If you install the package from WineHQ, you have 64-bit and 32-bit Wine, so you cannot get this error because 32-bit is selected. Did you actually run into this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remove those lines, I can't compile with Wine devel or staging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, it can be fixed later.
plugins/vst_base/CMakeLists.txt
Outdated
-I/opt/wine-devel/include | ||
-L/opt/wine-devel/lib | ||
-I/opt/wine-staging/include | ||
-I/opt/wine-staging/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks if you have multiple versions of Wine. You should include directories depending on the detected configuration. On the other hand, the expected way is to configure with WINE_CXX_FLAGS
.
Do you mean -L/opt/wine-staging/lib
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a typo, should be -L.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jasp00 here... isn't there a way to assume this in FindWine.cmake
once FIND_LIBRARY
returns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a new changeset that detects if devel or stable is installed and includes directories of only one wine version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workaround can be fixed later. You should not override preferences.
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32) | ||
ENDIF() | ||
# Development | ||
IF("${WINEBUILD_OUTPUT}" MATCHES "/opt/wine-devel/lib64/wine/libwinecrt0.a.*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, it can be fixed later.
cmake/modules/FindWine.cmake
Outdated
@@ -7,12 +7,14 @@ | |||
# WINE_DEFINITIONS - Compiler switches required for using wine | |||
# | |||
|
|||
SET(CMAKE_PREFIX_PATH /opt/wine-devel;/opt/wine-staging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are overriding user's preference. You should include the current value.
plugins/vst_base/CMakeLists.txt
Outdated
# Staging | ||
IF(EXISTS "/opt/wine-staging/lib64/libwine.so") | ||
SET(WINE_INCLUDES_AND_LIBS -I/opt/wine-staging/include -L/opt/wine-staging/lib) | ||
ENDIF() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overriding again. You should use WINE_INCLUDE_DIR
and WINE_LIBRARY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WINE_INCLUDE_DIR
gets value /opt/wine-devel/include/wine
and wine/*.h
headers cannot be found from there. Path needs to be /opt/wine-devel/include
.
WINE_LIBRARY
gets value /opt/wine-devel/lib/libwine.so
and this cannot be linked. Path needs to be /opt/wine-devel/lib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WINE_LIBRARY
gets value/opt/wine-devel/lib/libwine.so
@karmux @jasp00 can't we calculate it in FindWine.cmake
then and call it something like WINE_LIBRARY_PATH
?
wine/*.h
headers cannot be found from [wine/
]
Sounds like a bug with FindWine.cmake
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WINE_INCLUDE_DIR
gets value/opt/wine-devel/include/wine
[...] Path needs to be/opt/wine-devel/include
.
WINE_LIBRARY
gets value/opt/wine-devel/lib/libwine.so
[...] Path needs to be/opt/wine-devel/lib
.
So? Use STRING()
.
plugins/vst_base/CMakeLists.txt
Outdated
ENDIF(LMMS_HOST_X86_64) | ||
|
||
SET(WINE_CXX_FLAGS "" CACHE STRING "Extra flags passed to wineg++") | ||
|
||
STRING(REPLACE "include/wine" "include" WINE_INCLUDE_DIR ${WINE_INCLUDE_DIR}) | ||
STRING(REPLACE "lib/libwine.so" "lib" WINE_LIBRARY ${WINE_LIBRARY}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should output to new variables.
plugins/vst_base/CMakeLists.txt
Outdated
"-I\"${CMAKE_INSTALL_PREFIX}/include/wine/windows\"" | ||
"-I\"${CMAKE_INSTALL_PREFIX}/include\"" | ||
"-I\"${WINE_INCLUDE_DIR_REPLACED}\"" | ||
"-L\"${WINE_LIBRARY_REPLACED}\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With _REPLACED
, it looks like you are using an alternate directory and library. Do these variables name directories? Then you should use something like WINE_INCLUDE_BASE_DIR
and WINE_LIBRARY_DIR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. I'll fix it.
Code looks good. @karmux, did you test Wine under |
@jasp00 it compiles and runs with Wine under |
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
…S#3278) * Added support for wine-devel packages. * Added support for wine-staging packages. * Staging extra flags. * Dynamic Wine branch detection (stable, devel, staging). * Using STRING() to correct WINE_INCLUDE_DIR and WINE_LIBRARY. * Don't override CMAKE_PREFIX_PATH. * REPLACE outputs new variables. * Renamed variables.
Fixes #3245.