Hey everyone, I'm trying to figure out the best way to build dolphin-emu, citra, and medusa-emu.
I found these cmake flags in the dolphin-emu PKGBUILD on the AUR + in Void Linux's template for dolphin-emu,
-DOpenGL_GL_PREFERENCE=GLVND -DUSE_X11=1 -DUSE_EGL=0 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_QT2=TRUE -DUSE_SHARED_ENET=TRUE -DCMAKE_BUILD_TYPE=Release
I'd just like to know what some of these do, some I understand but others I don't.
-DCMAKE_BUILD_TYPE=Release
this means that it builds for playing instead of 'debugging'
-DOpenGL_GL_PREFERENCE=GLVND
this is something to do with NVIDIA, do I use this on non-NVIDIA computers too or just computers with an NVIDIA graphics card?
-DUSE_X11=1
Does this mean it compiles in X11 instead of QT5 or GTK? IDK
-DUSE_EGL=0
This is something to do with API's for OpenGL but IDK what that means
-DUSE_SHARED_ENET=TRUE
Not sure what this is supposed to do, something to do with going online with dolphin-emu I think? IDK, what does "shared" mean?
-DENABLE_QT2=TRUE
What is QT2? I thought at first it was something like QT4 or QT5 but apparently its not? What is this and what does it do? O.o
And finally, which ones do you think I should use with dolphin, with citra, and with medusa-emu?
The rest of the emulators I use are binary-installations, but I like to compile bleeding-edge emulators myself.
Now.... I want to make a PKGBUILD that will build the latest dolphin-emu from the github repo, how can I make a PKGBUILD that will clone the latest github repo? I really would love an example of this, I have minimal understanding of how to make a PKGBUILD so it'll be my first try, I need it to be as simple as possible, I'm really not good at figuring out how to make the version numbers on stuff correlate with the name of the packages and what not... I'm not even good at explaining what I am having such a hard time with in making PKGBUILDs... sorry.
Better ask the developers, it could be some relic from the past or the "2" could mean something else
Just set the source url to git repository and checksum to SKIP, you can find a lot of examples in AUR
(search for packages with "-git" suffix)
If anyone could show me a couple of those examples you're talking about, that'd be really awesome.
And the QT2 thing is in the dolphin-emu-git pkgbuild, so idk.
I'd REALLY like to understand how this works, in a few different ways:
make DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}"/usr/bin/ishiiruka-{nogui,qt2}
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/52-usb-device.rules
What is this 52-usb-devices.rules supposed to do? How am I even supposed to know what its supposed to do?????
I don't understand how the PKGBUILD understands what it is, like, what is that???? I see tons of lines in PKGBUILDs looking like this but I really can't understand them for the life of me, its supposed to write something into this specified file??? I cloned the AUR repo of another dolphin-emu-ishuriika-git, and the only file is the PKGBUILD....
Where does it get stuff to write into that file??? This is really confusing me, I'm having trouble even asking the question the right way..
So far this is what I've got:
pkgname=dolphin-emu-fresh
pkgver=0
pkgrel=1
pkgdesc='A GameCube / Wii / Triforce emulator'
arch=('x86_64')
url='http://www.dolphin-emu.org/'
license=('GPL')
depends=('alsa-lib' 'bluez-libs' 'cairo' 'enet' 'gcc-libs' 'gdk-pixbuf2'
'glib2' 'glibc' 'gtk2' 'hidapi' 'libevdev' 'libgl' 'libpng' 'libpulse'
'libsm' 'libx11' 'libxi' 'libxrandr' 'libxxf86vm' 'lzo' 'mbedtls'
'miniupnpc' 'pango' 'sfml' 'zlib' 'pulseaudio' 'ffmpeg' 'pugixml'
'bluez' 'bluez-utils-compat' 'bluez-firmware' 'bluez-plugins'
'bluez-libs' 'bluez-qt' 'bluez-tools' 'bluez-openrc' 'curl' 'xorg-xinput'
'libeudev' 'libusb' 'libgusb' 'libusb-compat' 'lib32-libusb' 'libtiger'
'pangomm' 'pangox-compat' 'libglvnd' 'sndio' 'alsa-plugins' 'alsa-firmware'
'alsa-utils' 'alsa-lib' 'pulseaudio-alsa' 'alsa-oss')
makedepends=('cmake' 'git' 'qt5-base' 'pango')
source=('dolphin-emu::git+https://github.com/dolphin-emu/dolphin.git')
sha256sums=('SKIP')
git clone https://github.com/dolphin-emu/dolphin.git
cd dolphin && mkdir -p build && cd build
cmake -DOpenGL_GL_PREFERENCE=GLVND -DUSE_X11=1 -DUSE_EGL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_QT2=TRUE -DCMAKE_BUILD_TYPE=Release ..
make -j48
what is the 'proper' way to do a make install in a PKGBUILD? not sure how to determine this
I'm doing this in small steps, adding things as I learn what they do, once I can understand how a PKGBUILD ends up looking like most PKGBUILDs do, then I'll be able to write them easy.
here is the original pkgbuild:
# Maintainer: Maxime Gauduin <[email protected]>
# Contributor: Lightning <[email protected]>
pkgbase=dolphin-emu-git
pkgname=('dolphin-emu-git' 'dolphin-emu-cli-git' 'dolphin-emu-wx-git')
pkgver=5.0.r7139.ad836b9071
pkgrel=1
pkgdesc='A GameCube / Wii / Triforce emulator'
arch=('x86_64')
url='http://www.dolphin-emu.org/'
license=('GPL')
depends=('alsa-lib' 'bluez-libs' 'enet' 'gcc-libs' 'gdk-pixbuf2' 'glib2'
'glibc' 'hidapi' 'libevdev' 'libgl' 'libpng' 'libpulse' 'libsm'
'libx11' 'libxi' 'libxrandr' 'libxxf86vm' 'lzo' 'mbedtls' 'miniupnpc'
'qt5-base' 'sfml' 'zlib'
'libavcodec.so' 'libavformat.so' 'libavutil.so' 'libcurl.so'
'libswscale.so' 'libudev.so' 'libusb-1.0.so')
makedepends=('cairo' 'cmake' 'git' 'gtk2' 'pango')
optdepends=('pulseaudio: PulseAudio backend')
options=('!emptydirs')
source=('dolphin-emu::git+https://github.com/dolphin-emu/dolphin.git')
sha256sums=('SKIP')
pkgver() {
cd dolphin-emu
git describe | sed 's/-/.r/; s/-g/./'
}
prepare() {
cd dolphin-emu
if [[ -d build ]]; then
rm -rf build
fi
mkdir build
}
build() {
cd dolphin-emu/build
cmake .. \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DENABLE_QT2='TRUE' \
-DUSE_SHARED_ENET='TRUE' \
-DDISTRIBUTOR='aur.archlinux.org'
make
}
package_dolphin-emu-git() {
provides=('dolphin-emu')
conflicts=('dolphin-emu')
cd dolphin-emu/build
make DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}"/usr/bin/dolphin-emu-{nogui,wx}
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}
package_dolphin-emu-cli-git() {
depends=('dolphin-emu-git')
cd dolphin-emu/build
install -dm 755 "${pkgdir}"/usr/bin
install -m 755 Binaries/dolphin-emu-nogui "${pkgdir}"/usr/bin/dolphin-emu-cli
}
package_dolphin-emu-wx-git() {
depends=('cairo' 'dolphin-emu-git' 'gtk2' 'pango')
cd dolphin-emu/build
install -dm 755 "${pkgdir}"/usr/bin
install -m 755 Binaries/dolphin-emu-wx "${pkgdir}"/usr/bin/
}
# vim: ts=2 sw=2 et:
I'm getting an error about install not being able to set permissions when I use the
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/share/dolphin-emu/sys
CMake Error at cmake_install.cmake:49 (file):
file INSTALL cannot set permissions on "/usr/share/dolphin-emu/sys"
make: *** [Makefile:108: install] Error 1
Those commands need to be in a "package" function. Otherwise they are running as the wrong user.
Ohh, so should it look like this then, Chris? I thought it was the build() and the package_dolphin-emu-git() that may be the reason things were failing, so I think from what you have said that that confirms this.
pkgname=dolphin-emu-fresh
pkgver=0
pkgrel=1
pkgdesc='A GameCube / Wii / Triforce emulator'
arch=('x86_64')
url='http://www.dolphin-emu.org/'
license=('GPL')
depends=('alsa-lib' 'bluez-libs' 'cairo' 'enet' 'gcc-libs' 'gdk-pixbuf2'
'glib2' 'glibc' 'gtk2' 'hidapi' 'libevdev' 'libgl' 'libpng' 'libpulse'
'libsm' 'libx11' 'libxi' 'libxrandr' 'libxxf86vm' 'lzo' 'mbedtls'
'miniupnpc' 'pango' 'sfml' 'zlib' 'pulseaudio' 'ffmpeg' 'pugixml'
'bluez' 'bluez-utils-compat' 'bluez-firmware' 'bluez-plugins'
'bluez-libs' 'bluez-qt' 'bluez-tools' 'bluez-openrc' 'curl' 'xorg-xinput'
'libeudev' 'libusb' 'libgusb' 'libusb-compat' 'lib32-libusb' 'libtiger'
'pangomm' 'pangox-compat' 'libglvnd' 'sndio' 'alsa-plugins' 'alsa-firmware'
'alsa-utils' 'alsa-lib' 'pulseaudio-alsa' 'alsa-oss')
makedepends=('cmake' 'git' 'qt5-base' 'pango' 'fakeroot')
source=('dolphin-emu::git+https://github.com/dolphin-emu/dolphin.git')
sha256sums=('SKIP')
build() {
git clone https://github.com/dolphin-emu/dolphin.git
mkdir -p dolphin/build
cd dolphin/build
cmake -DOpenGL_GL_PREFERENCE=GLVND -DUSE_X11=1 -DUSE_EGL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_QT2=TRUE -DCMAKE_BUILD_TYPE=Release ..
make -j48
}
package_dolphin-emu-fresh() {
make DESTDIR="${pkgdir}" install
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}
# make install
# install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
# vim: ts=2 sw=2 et:
Change:
package_dolphin-emu-fresh() {
To:
package() {
You only need to give names to the package when it is a split package.
Ohh ok cool, thanks man. You think it'll successfully build now? O.o
Or can you see anything else that may be wrong?
And by chance do you know what QT2 is?
I don't see anything else wrong just by looking at it, but I haven't actually tried it either. As far as QT2, I assume it's an older version of the QT libraries which right now we use QT5 for most things.
==> Entering fakeroot environment...
==> Starting package()...
make: *** No rule to make target 'install'. Stop.
==> ERROR: A failure occurred in package().
Aborting...
so, I'm not really sure what I should do now.. ?? :/
And no I don't think QT2 is like QT5, I think its something else, because when I run cmake it says it finds QT5, why would QT2 be used in the dolphin-emu-git AUR PKGBUILD if its a really early version of QT5? IDK, I think its something else but not sure what.
build() {
git clone https://github.com/dolphin-emu/dolphin.git
mkdir -p dolphin/build
cd dolphin/build
cmake -DOpenGL_GL_PREFERENCE=GLVND -DUSE_X11=1 -DUSE_EGL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_QT2=TRUE -DCMAKE_BUILD_TYPE=Release ..
make -j48
}
package() {
make DESTDIR="${pkgdir}" install
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}
IDK what I am doing wrong :/
how should it clone the git repo? maybe that's what I am doing wrong? IDK what it would look like to clone a repo in a PKGBUILD, IDK any example I can look up of this...
OK, so I think it was because I didn't have cd dolphin/build in the package() thing, but I am still wondering how other PKGBUILDs clone git repos
Change:
make DESTDIR="${pkgdir}" install
To:
cd dolphin/build
make DESTDIR="${pkgdir}" install
You forgot to go into the dolphin build directory before running make install.
Is there any particular reason why you aren't just using dolphin-emu-git from AUR? If you want different compilation options, you can just modify that PKBUILD a little bit.
Yep I just noticed that, didn't know that's how it worked but I do now! Thank you Chris!
And Dudemanguy, I am trying to learn how to build my own PKGBUILDs so I can eventually contribute to developing packages, BUT I chose dolphin-emu because I want to be able to install the most bleeding-edge version of dolphin-emu. I have taken suggestions on cmake build options from the dolphin-emu-git PKGBUILD and the Void Linux template.
Tomorrow I am going to try making a PKGBUILD like this one, but for citra and medusa-emu, it'll be great practice!
I am still wondering what a lot of these cmake build options do, if anyone has answers for those I would love to hear em.
pkgname=dolphin-emu-fresh
pkgver=0
pkgrel=1
pkgdesc='A GameCube / Wii / Triforce emulator'
arch=('x86_64')
url='http://www.dolphin-emu.org/'
license=('GPL')
depends=('alsa-lib' 'bluez-libs' 'cairo' 'enet' 'gcc-libs' 'gdk-pixbuf2'
'glib2' 'glibc' 'gtk2' 'hidapi' 'libevdev' 'libgl' 'libpng' 'libpulse'
'libsm' 'libx11' 'libxi' 'libxrandr' 'libxxf86vm' 'lzo' 'mbedtls'
'miniupnpc' 'pango' 'sfml' 'zlib' 'pulseaudio' 'ffmpeg' 'pugixml'
'bluez' 'bluez-utils-compat' 'bluez-firmware' 'bluez-plugins'
'bluez-libs' 'bluez-qt' 'bluez-tools' 'bluez-openrc' 'curl' 'xorg-xinput'
'libeudev' 'libusb' 'libgusb' 'libusb-compat' 'lib32-libusb' 'libtiger'
'pangomm' 'pangox-compat' 'libglvnd' 'sndio' 'alsa-plugins' 'alsa-firmware'
'alsa-utils' 'alsa-lib' 'pulseaudio-alsa' 'alsa-oss')
makedepends=('cmake' 'git' 'qt5-base' 'pango' 'fakeroot')
source=('dolphin-emu::git+https://github.com/dolphin-emu/dolphin.git')
sha256sums=('SKIP')
build() {
git clone https://github.com/dolphin-emu/dolphin.git
mkdir -p dolphin/build
cd dolphin/build
cmake -DOpenGL_GL_PREFERENCE=GLVND -DUSE_X11=1 -DUSE_EGL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_QT2=TRUE -DCMAKE_BUILD_TYPE=Release ..
make -j48
}
package() {
cd dolphin/build
make DESTDIR="${pkgdir}" install
install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}
# make install
# install -Dm 644 ../Data/51-usb-device.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
# vim: ts=2 sw=2 et: