vgmtrans / vgmtrans

VGMTrans - a tool to convert proprietary, sequenced videogame music to industry-standard formats
854 stars 78 forks source link

libbassmidi.so is not installed when compiling #304

Open ettolrach opened 2 years ago

ettolrach commented 2 years ago

Describe the bug After compiling the program and installing it with the install target, it doesn't install libbassmidi.so and thus cannot start.

To Reproduce Steps to reproduce the problem.

  1. Compile the program using the following AUR PKGBUILD:
    
    # Maintainer: Charlotte Ausel <ettolrach@disroot.org>

_pkgname=vgmtrans pkgname=$_pkgname-git

Use the latest commit's date and then the number of revisions using the same command as on line 19.

pkgver=20220206.r1116.8fa6f4a pkgrel=1 pkgdesc="Converter for sequenced videogame music" arch=("x86_64") url="https://github.com/vgmtrans/vgmtrans" license=('ZLIB') depends=("qt5-base" "fluidsynth" "qt5-svg" "minizip") makedepends=("qt5-tools" "cmake" "git") optdepends=("pulseaudio-alsa: to use PulseAudio instead of ALSA" "pipewire-alsa: to use PipeWire instead of ALSA") source=("$_pkgname::git+https://github.com/vgmtrans/vgmtrans") sha256sums=("SKIP")

pkgver() { cd "$srcdir/$_pkgname" printf "%s.r%s.%s" "$(git show -s --format="%cd" --date=short HEAD)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | sed 's/-//g' }

build() { cmake -B build -S "vgmtrans" -DCMAKE_BUILD_TYPE="None" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="/usr" -Wno-dev cmake --build build --target vgmtrans --parallel $(nproc) }

package() { DESTDIR="$pkgdir" cmake --install build

install -Dm755 "build/bin/vgmtrans" "$pkgdir/usr/bin/$_pkgname"

#install -Dm644 "LICENSE.txt" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
#install -Dm644 "src/ui/qt/resources/VGMTrans.desktop" "$pkgdir/usr/share/applications/VGMTrans.desktop"
#install -Dm644 "src/ui/qt/resources/vgmtrans.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/vgmtrans.png"

}


**Expected behavior**
All the required libraries are copied correctly and the program starts.

**Desktop (please complete the following information):**
 - OS: Arch Linux
 - VGMTrans version: git commit 8fa6f4a
 - VGMTrans log:

... [100%] Linking CXX executable ../../../bin/vgmtrans /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbassmidi.so: .dynsym local symbol at index 2 (>= sh_info of 2) /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbassmidi.so: .dynsym local symbol at index 3 (>= sh_info of 2) /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbassmidi.so: .dynsym local symbol at index 4 (>= sh_info of 2) /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbass.so: .dynsym local symbol at index 2 (>= sh_info of 2) /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbass.so: .dynsym local symbol at index 3 (>= sh_info of 2) /usr/bin/ld: /home/ettolrach/git/vgmtrans-git/src/vgmtrans/lib/bass/libbass.so: .dynsym local symbol at index 4 (>= sh_info of 2) [100%] Built target vgmtrans ==> Entering fakeroot environment... ==> Starting package()... -- Install configuration: "None" -- Installing: /home/ettolrach/git/vgmtrans-git/pkg/vgmtrans-git/usr/bin/vgmtrans -- Set runtime path of "/home/ettolrach/git/vgmtrans-git/pkg/vgmtrans-git/usr/bin/vgmtrans" to "" -- Installing: /home/ettolrach/git/vgmtrans-git/pkg/vgmtrans-git/usr/share/icons/hicolor/512x512/apps/vgmtrans.png -- Installing: /home/ettolrach/git/vgmtrans-git/pkg/vgmtrans-git/usr/share/applications/VGMTrans.desktop ==> Tidying install... ...

/usr/bin/vgmtrans /usr/bin/vgmtrans: error while loading shared libraries: libbassmidi.so: cannot open shared object file: No such file or directory

Additional context I am the current maintainer of the vgmtrans-git AUR entry. I have tried to follow both the instructions in the wiki and the ones from the Arch Wiki which explains the slightly odd way of installing it.

A temporary fix is to add libbassmidi as an explicit dependency, if you install this package explicitly, the program starts. But since the program ships it, I don't see a need to do this. Unless this is the intended usage, that is, unless it is expected that the user has libbassmidi already installed.

sykhro commented 2 years ago

The proper fix would be to edit https://github.com/vgmtrans/vgmtrans/blob/master/src/ui/qt/CMakeLists.txt#L207 adding an install() call for that libbassmidi.so. If we were to do this, I'd prefer for the program to be installed under /opt/vgmtrans/ (and then symlinked to /usr/bin and /usr/share/applications so that it can be found in path). This is because libbassmidi is distributed as a compiled library and our version might clash with the one from that package. Adding it as a dependency isn't a great solution because a bassmidi update might break ABI and then vgmtrans stops working until we update it to the new version of the lib.