flathub / net.pcsx2.PCSX2

https://flathub.org/apps/details/net.pcsx2.PCSX2
12 stars 11 forks source link

Building the pcsx2 flatpak now fails #19

Closed Shoegzer closed 4 years ago

Shoegzer commented 4 years ago

When launching the following command:

flatpak-builder builddir --arch=i386 --default-branch=stable --force-clean --install-deps-from=flathub net.pcsx2.PCSX2.json --user --install

Eventually the build fails with:

checking for OpenGL headers... found in /usr/include
checking for GL/gl.h... yes
checking for GL/glu.h... no
configure: error: OpenGL libraries not available
Error: module wxWidgets: Child process exited with code 1

Note that I've updated the net.pcsx2.PCSX2.json file with the latest upstream build. The above command worked as of August 30th against this upstream commit: https://github.com/PCSX2/pcsx2/commit/99f814d3764bc4ce87491ebeedac84762b3d68f3

System is Linux Mint 19.2 with kernel 5.0 and flatpak 1.4.3.

Shoegzer commented 4 years ago

Update: Working to trace this down but to no avail as of yet. Note that both gl.h and glu.h files are installed in the directory the command above is looking for (the glu.h header was installed from the "libglu1-mesa-dev" package):

shoegzer@testsys:/usr/include/GL$ ls -la
total 2872
drwxr-xr-x   3 root root    4096 Sep 23 10:29 .
drwxr-xr-x 157 root root   12288 Sep 23 10:29 ..
-rw-r--r--   1 root root    9007 Aug 23  2016 freeglut_ext.h
-rw-r--r--   1 root root     681 Aug 23  2016 freeglut.h
-rw-r--r--   1 root root   26523 Aug 23  2016 freeglut_std.h
-rw-r--r--   1 root root  410096 Jun 26 16:14 glcorearb.h
-rw-r--r--   1 root root 1038496 Aug 24  2017 glew.h
-rw-r--r--   1 root root  832367 Jun 26 16:14 glext.h
-rw-r--r--   1 root root   80631 Jun 26 16:14 gl.h
-rw-r--r--   1 root root  158833 Jun 26 16:14 gl_mangle.h
-rw-r--r--   1 root root   17255 May 21  2016 glu.h
...

So why can flatpak-builder find gl.h but not glu.h? Note the differences in timestamps - could glu.h be outdated, and if so, why didn't this trigger on August 30th when it last executed successfully?

In case it matters: prior to the above flatak-builder command I run a "git submodule update --init" and then a "git pull origin master" inside the shared-modules branch.

@TingPing any ideas what could be happening here? At the very least I'd like to eliminate this being flatpak-related if we feel it's an upstream issue.

TingPing commented 4 years ago

I just don't have the time to look into this. I suggest reading the build files to avoid any guessing.

Shoegzer commented 4 years ago

@TingPing understood. I just looked a bit deeper and this actually appears to be caused by recent commits to flathub's shared-modules, specifically https://github.com/flathub/shared-modules/commit/1e7ab554938ae182e873d8d91bf38c6cbafa3059 and https://github.com/flathub/shared-modules/commit/7e682ca943a16609be394542493848137a3877f8. Perhaps I should open an issue there?

Take a look at the following in my own build logs (specifically references to glu renaming):

$ git pull origin master
From https://github.com/flathub/shared-modules
 * branch            master     -> FETCH_HEAD
Updating c0bdf79..0726b4f
Fast-forward
 glu/{glu-9.0.0.json => glu-9.json}                            |   4 +-
 gtk2/gtk2.json                                                |   6 +-
 libappindicator/libappindicator-gtk2-12.10.json               |  14 +-
 libappindicator/libappindicator-gtk3-12.10.json               |  14 +-
 libappindicator/libappindicator-gtk3-introspection-12.10.json |  14 +-
 libappindicator/libappindicator-no-python.patch               | 888 +++++++++++++++++++++++++++++++++++++++++++++++
 libappindicator/libappindicator.json.in                       |  14 +-
 7 files changed, 917 insertions(+), 37 deletions(-)
 rename glu/{glu-9.0.0.json => glu-9.json} (54%)
 create mode 100644 libappindicator/libappindicator-no-python.patch

Update: confirmed - flatpak-builder is successful when not first doing a "git pull origin master" on shared-modules. So this issue is related to the above two commits.

TingPing commented 4 years ago

Ok well what changed, what are the different files it installs now? Did you simply forget to change the reference to glu-9.json?

Shoegzer commented 4 years ago

Thanks, that was it. Updating the reference in net.pcsx2.PCSX2 to glu-9.json as you mentioned fixed the issue. I'm new to flatpaks and especially compiling within flatpak environments or this wouldn't have caught me sideways.

When you have time can you please update the source so others don't have this issue either? Thanks.

TingPing commented 4 years ago

You must have a very old flatpak-builder because it should have loudly errored the file was missing.

Shoegzer commented 4 years ago

Using 1.0.9 which is apparently the newest release. I didn't get any notice other than what I posted above (which did indicate the file was missing). Regardless though, this could be fixed with a one-line mod to net.pcsx2.PCSX2.json.

TingPing commented 4 years ago

Sure, when its updated it will be updated.