diff --git a/Makefile b/Makefile index 46aa323..b953e29 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,9 @@ # Created by falkTX # -VERSION = 1.1.0 +VERSION = 1.2.0 + +PREFIX ?= /usr all: @echo "error: you must pass '32' or '64' as an argument to this Makefile in order to build WineASIO" diff --git a/Makefile.mk b/Makefile.mk index 3351d5e..991fd5d 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -12,7 +12,7 @@ ifeq ($(M),) $(error incorrect use of Makefile, M var is missing) endif -wineasio_dll_MODULE = wineasio.dll +wineasio_dll_MODULE = wineasio$(M).dll PREFIX = /usr SRCDIR = . @@ -62,7 +62,7 @@ wineasio_dll_C_SRCS = asio.c \ wineasio_dll_LDFLAGS = -shared \ -m$(M) \ -mnocygwin \ - $(wineasio_dll_MODULE:%=%.spec) \ + wineasio.dll.spec \ -L/usr/lib$(M)/wine \ -L/usr/lib/wine \ -L/usr/lib/$(ARCH)-linux-gnu/wine \ @@ -104,7 +104,7 @@ build$(M)/%.c.o: %.c ### Target specific build rules build$(M)/$(wineasio_dll_MODULE): $(wineasio_dll_OBJS) - $(WINEBUILD) -m$(M) --dll --fake-module -E $(wineasio_dll_MODULE).spec $^ -o $@ + $(WINEBUILD) -m$(M) --dll --fake-module -E wineasio.dll.spec $^ -o $@ build$(M)/$(wineasio_dll_MODULE).so: $(wineasio_dll_OBJS) $(WINECC) $^ $(wineasio_dll_LDFLAGS) $(LIBRARIES) \ diff --git a/README.md b/README.md index 9186baa..6319fd1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can, for example, use with FLStudio under GNU/Linux systems (together with J For best results with Debian-based distributions, enable the [KXStudio repositories](https://kx.studio/Repositories) and install WineASIO from there. -### INSTALLATION +### BUILDING Do the following to build for 32-bit Wine. @@ -24,77 +24,47 @@ Do the following to build for 64-bit Wine. make 64 ``` -#### LEGACY WINE +### INSTALLING -To install on 32bit wine <= 6.5 (substitute with the path to the 32-bit wine libs for your distro). +To install 32-bit WineASIO (substitute with the path to the 32-bit wine libs for your distro). ```sh -sudo cp build32/wineasio.dll.so /usr/lib/i386-linux-gnu/wine/wineasio.dll.so +sudo cp build32/wineasio32.dll /usr/lib/i386-linux-gnu/wine/i386-windows/ +sudo cp build32/wineasio32.dll.so /usr/lib/i386-linux-gnu/wine/i386-unix/ ``` -To install on 64bit wine <= 6.5 (substitute with the path to the 64-bit wine libs for your distro). +To install 64bit WineASIO (substitute with the path to the 64-bit wine libs for your distro). ```sh -sudo cp build64/wineasio.dll.so /usr/lib/x86_64-linux-gnu/wine/wineasio.dll.so +sudo cp build64/wineasio64.dll /usr/lib/x86_64-linux-gnu/wine/x86_64-windows/wineasio.dll +sudo cp build64/wineasio64.dll.so /usr/lib/x86_64-linux-gnu/wine/x86_64-unix/wineasio.dll.so ``` -Finally the dll must be registered in the wineprefix. -For both 32 and 64-bit wine do: +#### EXTRAS -```sh -regsvr32 wineasio.dll - -``` - -On a 64-bit system with wine supporting both 32 and 64-bit applications, -regsrv32 will register the 32-bit driver in a 64-bit prefix, -use the following command to register the 64-bit driver in a 64-bit wineprefix: - -```sh -wine64 regsvr32 wineasio.dll -``` - -#### WINE > 6.5 +For user convenience a `wineasio-register` script is included in this repo, if you are packaging WineASIO consider installing it as part of WineASIO. -To install on 32bit wine > 6.5 (substitute with the path to the 32-bit wine libs for your distro). +Additionally a control panel GUI is provided in this repository's `gui` subdir, which requires PyQt5 to build and run. +The WineASIO driver will use this GUI as the ASIO control panel. -```sh -sudo cp build32/wineasio.dll /usr/lib/i386-linux-gnu/wine/i386-windows/wineasio.dll -sudo cp build32/wineasio.dll.so /usr/lib/i386-linux-gnu/wine/i386-unix/wineasio.dll.so -``` +### REGISTERING -To install on 64bit wine > 6.5 (substitute with the path to the 64-bit wine libs for your distro). +After building and installing WineASIO, we still need to register it on each Wine prefix. +For your convenience a script is provided on this repository, so you can simply run: ```sh -sudo cp build64/wineasio.dll /usr/lib/x86_64-linux-gnu/wine/x86_64-windows/wineasio.dll -sudo cp build64/wineasio.dll.so /usr/lib/x86_64-linux-gnu/wine/x86_64-unix/wineasio.dll.so +wineasio-register ``` -Finally the dll must be registered in the wineprefix. -For both 32 and 64-bit wine do: -(substitute with the path to the 32-bit wine libs for your distro) - -```sh -regsvr32 /usr/lib/i386-linux-gnu/wine/i386-windows/wineasio.dll - -``` - -On a 64-bit system with wine supporting both 32 and 64-bit applications, -regsrv32 will register the 32-bit driver in a 64-bit prefix, -use the following command to register the 64-bit driver in a 64-bit wineprefix: -(substitute with the path to the 64-bit wine libs for your distro) - -```sh -wine64 regsvr32 /usr/lib/x86_64-linux-gnu/wine/x86_64-windows/wineasio.dll -``` +to activate WineASIO for the current Wine prefix. #### CUSTOM WINEPREFIX -regsvr32 registers the ASIO COM object in the default prefix `~/.wine`. -To use another prefix specify it explicitly, like: +The `wineasio-register` script will register the WineASIO driver in the default Wine prefix `~/.wine`. +You can specify another prefix like so: ```sh -env WINEPREFIX=~/asioapp regsvr32 wineasio.dll +env WINEPREFIX=~/asioapp wineasio-register ``` ### GENERAL INFORMATION @@ -148,6 +118,10 @@ that overrides the JACK client name derived from the program name. ### CHANGE LOG +#### 1.2.0 +* 29-SEP-2023: Fix compatibility with Wine > 8 +* 29-SEP-2023: Add wineasio-register script for simplifying driver registration + #### 1.1.0 * 18-FEB-2022: Various bug fixes (falkTX) * 24-NOV-2021: Fix compatibility with Wine > 6.5 diff --git a/wineasio-register b/wineasio-register new file mode 100755 index 0000000..862fb0e --- /dev/null +++ b/wineasio-register @@ -0,0 +1,56 @@ +#!/bin/bash + +# exit if any command fails +set -e + +# read WINEPREFIX from environment, with fallback if unset +WINEPREFIX=${WINEPREFIX:=~/.wine} + +# make sure the WINEPREFIX directory exists +if [ ! -d "${WINEPREFIX}" ]; then + wineboot -u +fi + +# define possible locations for wineasio DLLs +u32=( +"/opt/wine-devel/lib/wine/i386-unix/wineasio32.dll.so" +"/opt/wine-stable/lib/wine/i386-unix/wineasio32.dll.so" +"/opt/wine-staging/lib/wine/i386-unix/wineasio32.dll.so" +"/usr/lib/wine/i386-unix/wineasio32.dll.so" +"/usr/lib32/wine/i386-unix/wineasio32.dll.so" +"/usr/lib/i386-linux-gnu/wine/i386-unix/wineasio32.dll.so" +) + +u64=( +"/opt/wine-devel/lib64/wine/x86_64-unix/wineasio64.dll.so" +"/opt/wine-stable/lib64/wine/x86_64-unix/wineasio64.dll.so" +"/opt/wine-staging/lib64/wine/x86_64-unix/wineasio64.dll.so" +"/usr/lib/wine/x86_64-unix/wineasio64.dll.so" +"/usr/lib64/wine/x86_64-unix/wineasio64.dll.so" +"/usr/lib/x86_64-linux-gnu/wine/x86_64-unix/wineasio64.dll.so" +) + +# try to register 32bit DLL +for u in ${u32[@]}; do + w=$(echo ${u} | sed -e 's|/i386-unix/wineasio32.dll.so|/i386-windows/wineasio32.dll|g') + if [ -e "${u}" ] && [ -e "${w}" ]; then + cp -v "${w}" "${WINEPREFIX}/drive_c/windows/system32" + regsvr32 "${u}" + break + fi +done + +# only continue past this point if wine64 command is available and prefix supports 64bit +if ! command -v wine64 > /dev/null || [ ! -d "${WINEPREFIX}/drive_c/windows/syswow64" ]; then + exit 0 +fi + +# try to register 64bit DLL +for u in ${u64[@]}; do + w=$(echo ${u} | sed -e 's|/x86_64-unix/wineasio64.dll.so|/x86_64-windows/wineasio64.dll|g') + if [ -e "${u}" ] && [ -e "${w}" ]; then + cp -v "${w}" "${WINEPREFIX}/drive_c/windows/system32" + wine64 regsvr32 "${u}" + break + fi +done