Skip to content
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

manage issues with libcurl3 missing from recent editions of ubuntu #5

Merged
merged 5 commits into from Dec 16, 2018

Conversation

bryceml
Copy link
Collaborator

@bryceml bryceml commented Dec 3, 2018

This fixes the problem where recent versions of ubuntu can't have libcurl3 installed at the same time as libcurl4 or in the case of 18.10, it's not available at all. It does this by downloading the 18.04 version of libcurl3 and installing it with the name libcurl.so.3 instead of libcurl.so.4. It then patches the ePSXe executable to look for libcurl.so.3 instead of libcurl.so.4.

I haven't tried running any games with it yet, but it starts the program. Hopefully I can do some testing later. It's the best solution I can think of to get ePSXe working on ubuntu 18.04/18.10 alongside libcurl4.

It shows the output of many of the things it does instead of hides it, I don't know if you care. I would personally prefer to see the output of apt at least. It also asks permission to overwrite libcurl.so.3 if it already exists so we don't accidentally screw anyone's system.

@bryceml bryceml changed the title manage issues with libcurl3 missing from recent editions of ubuntu WIP: manage issues with libcurl3 missing from recent editions of ubuntu Dec 4, 2018
@bryceml
Copy link
Collaborator Author

bryceml commented Dec 4, 2018

This currently breaks debian compatibility, so I'll fix that later. If you want to test it right now, you can though.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 4, 2018

There, should be good to go now. Let me know if you have questions.

@bryceml bryceml changed the title WIP: manage issues with libcurl3 missing from recent editions of ubuntu manage issues with libcurl3 missing from recent editions of ubuntu Dec 4, 2018
@brandleesee
Copy link
Owner

Hey Bry, welcome back :)
Thanks for the patch.

Have you tested this with any games, pls?
From my side, I'll test while having Kodi installed as this was the predominant issue...

I hid the output not to clutter the terminal when installing. This, however, is not ideal when assessing whether everything was installed and certainly does not help when looking for errors or bugs. So, I'll stay in line with your preference.

With regards to compatibility, this patch still installs the script on Ubuntu derivatives, right?
(I can test on stock Ubuntu.)

Thank you once again, mate.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 5, 2018

I just tested it with a game and it works just as it's supposed to.

This shouldn't change any behavior with ubuntu less than version 18.04.
This change shouldn't effect debian at all.

On Ubuntu 18.04 and Ubuntu 18.10, it will install libcurl3 in an alternate location. The alternate path doesn't seem to conflict with any paths that would be on Ubuntu 18.10 or 18.04.

One thing to keep in mind is that if there is ever a newer release of epsxe, the patch will have to be updated for it. I imagine if there is another release, it will fix curl4 compatibility anyway though and we can fix it at that point. It might be good for me to add some hash checking though. I'll add that.

It should work on all ubuntu derivatives as far as I can tell.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 5, 2018

There, I changed it so it doesn't need to ask any questions about overwriting libcurl.so.3. It will just leave the original if it exists. Also, if the patching fails for whatever reason, it will just use the original binary so we don't run random code. This should all be much safer and still reliable.

@brandleesee
Copy link
Owner

Cheers, man.
Question(s)! If the checksum is not same and original executable is retained, then which libcurl will be used, 3 or 4? (or am I missing the point?) And since it won't be patched, then, apps like Kodi, cannot function, right?
Thank you.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 5, 2018

Libcurl 3 is installed alongside libcurl4 so things like kodi should work regardless of whether the checksum matches or not. The patch modifies epsxe itself, not libcurl. The only reason the patched version of epsxe should fail the checksum is if the original file we download changes. If that happens, we will just use that version. At that point we would need to verify they fixed the libcurl problem. If they did not, we will need to update the patch. If they did fix it, we can remove the patch. If the checksum failed and epsxe wasn't updated for whatever reason, the original would attempt to use libcurl4 and probably fail like it does on ubuntu 18.10 now.

@brandleesee brandleesee merged commit aefe4cb into brandleesee:master Dec 16, 2018
brandleesee added a commit that referenced this pull request Dec 16, 2018
#5

summary:
- removed quiet mode so as to have visible any errors while installing dependencies
- fixes the problem where recent versions of ubuntu can't have libcurl3 installed at the same time as libcurl4 or in the case of 18.10, it's not available at all. It does this by downloading the 18.04 version of libcurl3 and installing it with the name libcurl.so.3 instead of libcurl.so.4. It then patches the ePSXe executable to look for libcurl.so.3 instead of libcurl.so.4.
- Libcurl 3 is installed alongside libcurl4 so things like kodi should work regardless of whether the checksum matches or not.
- thanks to @bryceml
@brandleesee
Copy link
Owner

brandleesee commented Dec 16, 2018

@bryceml could you please check the below for me?

The raw code is displayed so:

image
https://raw.githubusercontent.com/brandleesee/ePSXe64Ubuntu/master/ePSXe64Ubuntu.sh

I think that

  • 000192... (whole line) should be fixed with line above it
  • there is an error in indentation .:)
    however, since I am not as conversant as you are with the syntax, I thought better to ask you then amend myself.

Thank you.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 16, 2018

It will definitely change the behavior of patch. I'm not sure if xxd would be able to handle the extra spaces at the front. My guess is patch would probably not work because a single . and new line marks the end of a patch in patch. If we wanted to have it all on one line, we could use printf and use \n's.

@brandleesee
Copy link
Owner

so how can this be fixed, pls? merging the three lines?

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 16, 2018

bryceml@f3cc7fe would put it on one line. I can open a pull request for that if you want. You should test it first, but it should work. The output of the printf is identical as shown by hashing the output.

@brandleesee
Copy link
Owner

Ah now I think I understand!
So, having those on three separate lines is actually the proper and correct way for the code to work as intended?
If positive, then I'll leave it as you originally implemented it.

@bryceml
Copy link
Collaborator Author

bryceml commented Dec 17, 2018

So, having those on three separate lines is actually the proper and correct way for the code to work as intended?

Yes

brandleesee added a commit that referenced this pull request Feb 2, 2019
@bryceml can you please check that my syntax is correct? from lines 
- 28 to 49
- 81 to 116

**Reasons for these changes**

1. Linux Mint still uses apt-get out-of-the-box instead of Apt.
issue: cromat@9deb4bc.

2. Realised through this link (https://forums.linuxmint.com/viewtopic.php?t=274477) that same may happen to Linux Mint 19 installs with regards to the libcurl3 to 4 issue (#5).

**reference**
- https://ryanstutorials.net/bash-scripting-tutorial/bash-if-statements.php
to make sure *elif* statement is used correctly
- https://forums.linuxmint.com/viewtopic.php?t=263277
checked where packages are downloaded from - resulted to be from ubuntu
- https://www.rootusers.com/check-which-linux-mint-version/
checked whether Linux Mint releases have two decimal places like ubuntu 18.*04* - resulted negative
thus, had to change *cut -c -2* to *cut -c -1* in line 38.
- https://www.tldp.org/LDP/abs/html/comparison-ops.html
- https://stackoverflow.com/a/4277753
- https://stackoverflow.com/questions/2237080/how-to-compare-strings-in-bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants