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

Am making an AUR pkgbuild out of rtorrent-ps-ch #167

Closed
QDesjardin opened this issue Oct 11, 2019 · 24 comments
Closed

Am making an AUR pkgbuild out of rtorrent-ps-ch #167

QDesjardin opened this issue Oct 11, 2019 · 24 comments

Comments

@QDesjardin
Copy link

QDesjardin commented Oct 11, 2019

Sorry if this is not the right place to put this, but wanted to let you know I'm making a pkgbuild for this project so it can be put up on the AUR (Arch User Repository). To make it more palatable, I split it into two different packages:

  • libtorrent-ps-ch [done, working]
  • rtorrent-ps-ch [currently stuck on it because the build complains about undeclared tr1 in ui_pyroscope.cc]

I don't know if you are okay with it; surprised no one has done this earlier. But I would like a little help for the rtorrent pkgbuild, on the version handling section - attached are the PKGBUILD files I've made so far.
PKGBUILD-rtorrent-ps-ch.zip

@chros73
Copy link
Owner

chros73 commented Oct 11, 2019

Yes, that's fine with me, I'll take a look later if I'll have time.

@chros73
Copy link
Owner

chros73 commented Oct 11, 2019

currently stuck on it because the build complains about undeclared tr1 in ui_pyroscope.cc

tr1 is set only 2 places in the patches:

History behind this is that rtorrent used tr1 in v0.9.6 and before and it was removed later.

This error tells you that an older rtorrent is used for compiling and not the latest release one, for whatever reason.

@chros73 chros73 added the build label Oct 11, 2019
@QDesjardin
Copy link
Author

In the PKGBUILD file, it pulls rtorrent 0.9.8 as a base. For those pyroscope.cc files, there's a condition:

#if (RT_HEX_VERSION <= 0x000906)
  #define _cxxstd_ tr1
#else 
  #define _cxxstd_ std
#endif

I imagine it has something to do with the version control part not running properly in the PKGBUILD - the stuff under prepare(), I've cribbed from build.sh while the rest is borrowed from the rtorrent-ps PKGBUILD.

@chros73
Copy link
Owner

chros73 commented Oct 11, 2019

Yes, RT_HEX_VERSION is set in build.sh, dump the content of $rt_hex_version local variable there to see if it's correct.

Note: I personally never used Arch Linux :)

@QDesjardin
Copy link
Author

QDesjardin commented Oct 11, 2019

OK, so I fixed the version handling part by putting in vanilla rtorrent's version. The bad news though is it throws up another error during compiling about undefined references in libsub_root.a + ui_pyroscope.cc:
Screenshot_2019-10-11-22-07-43_selected

@QDesjardin
Copy link
Author

I've deduced that the issue, it most likely lies in the parameters given to the linker in the makefile. One thing I've tried is copying rtorrent-0.9.8 from the AUR directory (where it complains of undefined references), over to the git version, where the build.sh script is able to compile and link everything.

Another is copying LDFLAGS from build.sh, pointing rpath to /usr/bin where libtorrent-ps-ch library files are installed - still throwing up the same linker error. Bear in mind, I've separated libtorrent and rtorrent as two different packages, with libtorrent-ps-ch installed under /usr/lib:

Screenshot_2019-10-13-17-14-53

Would appreciate some pointers on getting the linker to "see" the appropriate libraries.

@chros73
Copy link
Owner

chros73 commented Oct 14, 2019

Honestly, I don't know. I never use Arch before (as I mentioned) and it seems you also modified the build script.
Your best bet is to ask help from the Arch community, it works fine on Debian and Ubuntu (I don't have the time to deal with every distro that exists :) ). You can compile it on latest Ubuntu LTS (18.04) and see the logs what the linker gets, maybe it will help.

@QDesjardin
Copy link
Author

It turns out that "libsub_root.a" was the culprit. From what I can tell, it's a file that is generated during the build process, and opening it up, it's missing command_pyroscope.o. I got around the issue by copying libsub_root.a from the successful build, and rtorrent runs at last! [And no, it's not relying on the libtorrent libraries from the home/bin folder.]

Yes, you don't "use arch btw" :) but now that I've narrowed it down -- do you know what is behind the generation of the libsub_*.a files?

Once that's addressed, rtorrent-ps-ch can be up and ready on the AUR for all to use.

@chros73
Copy link
Owner

chros73 commented Oct 15, 2019

do you know what is behind the generation of the libsub_*.a files?

Unfortunately no, I don't, that's a binary file.

First of all:

  • I don't know which dependencies are required on Arch (these are on Debian for compilation, and these are for runtime)
  • what happens if you run the build.sh script as it is (without any modification) ? Check out the project again and start it from scratch.

@QDesjardin
Copy link
Author

As it turns out, I typed in $pyroport instead of $pyropatch during the patching process, so it didn't apply the pyroscope_all.patch. Oopsie.

But yes, now it builds correctly. Am submitting it to the AUR and will provide the link to it.

@chros73
Copy link
Owner

chros73 commented Oct 17, 2019

Awesome!
One more thing popped into my mind: are you sure that this libtorrent has to be separated from this package?
I mean:

  • as far as I know no one uses it by itself
  • the provided debian/ubuntu packages also include it
  • you will loose relative rpath linking by separating it (and can cause confusion if the original is installed as well)

If you managed to compile it, can you try out as well, here's a reported issue that states it doesn't even start :)

@QDesjardin
Copy link
Author

Links:

Instructions for Arch Linux users:

You may also install rtorrent-ps-ch through the “Arch User Repository” (AUR) PKGBUILDs maintained by @QDesjardin. These use a standard Arch build process, but include the pyroscope patches.

There is one package for libtorrent-ps-ch, and one for rtorrent-ps-ch, and both take their dependencies from the normal OS packages:

Before building binaries or packages yourself, install these packages on top of the base and base-devel groups (list is user-provided, report any problems):

pacman -S \
    lsb-release subversion git time lsof tmux wget \
    python2-setuptools python2-virtualenv python2 python2-cffi \
    cppunit libxml2 libxslt

I'm merely copying what the other package maintainer has done for rtorrent-ps, it's separated into two packages (which conflict with the original versions). Have tested it out myself, fetching from the AUR, compiling and installing -- did not encountered that rtorrent crash issue.

@chros73
Copy link
Owner

chros73 commented Oct 17, 2019

Thanks for the info, I'll update the readme with the links, good job! :)

@chros73
Copy link
Owner

chros73 commented Oct 17, 2019

One more thing about the version numbering:

  • you used rtorrent-ps-ch 1.8.3-1
  • I use 1.8.3-0.9.8 (e. g. the previous release was 1.8.3-0.9.7)

@QDesjardin
Copy link
Author

QDesjardin commented Oct 17, 2019

You versioned it based off your release + base release, but for AUR, the 1.8.3 -1 means it's the first package release of rtorrent-ps-ch 1.8.3. Say if I were to update the PKGBUILD, while there's no update to the actual code, it would become version 1.8.3-2. It's the standard for how Arch package releases work.

@chros73
Copy link
Owner

chros73 commented Oct 17, 2019

I know that part, thanks, I was referring to the rtorrent version number in tbe end of mine, but it's up to you what you do.

@mhertz
Copy link

mhertz commented Oct 20, 2019

Just noticed this, and also wondered why none never made such package before, just like pyrocore, but thanks alot QDesjardin, and of course as always, chros! :)

Anyway, if I please could just ask a quick question to chros, thanks. I normally use a shell script I made, to install from source, rtorrent-ps-ch, pyrocore, and at times, for testing, also regular rtorrent-ps(the "user-submitted" list of arch packages needed, from the quoted text above, I sent to Pyroscope a couple of years ago). Anyway, sorry sidetracking, I was thinking what will I miss if changing from normal build settings and instead using the new AUR package? Im thinking rpath relative linking, CPU-optimization and c-ares support.. Am I missing something more possibly, well, except maybe slight diffs in package-versions used in the deps possibly, but besides that. Of those three, I'm thinking only c-ares would possibly be somewhat important to me, though honestly never looked into it and just remember reading it was recommended, long ago, like a caching-dns-server too, like dnsmasq or alike(though admittedly, never gotten around to that yet, I must confess). Thanks in advance.

-Martin.

@chros73
Copy link
Owner

chros73 commented Oct 20, 2019

A specific curl version is linked in rtorrent-ps*, because OS versions can have bugs, but if it's not the case then it shouldn't matter.

@mhertz
Copy link

mhertz commented Oct 20, 2019

Much appreciated mate, thank you! :) Thanks again also QDesjardin for your contribution. Take care guys.

@chros73
Copy link
Owner

chros73 commented Oct 21, 2019

A specific curl version is linked

Oh, and the same applies to xmlrpc and cares as well.

@QDesjardin
Copy link
Author

I suggest you add in install instructions for Arch Linux users :)

@chros73
Copy link
Owner

chros73 commented Nov 4, 2019

:) Can you make a pull request for it?

@chros73
Copy link
Owner

chros73 commented Nov 6, 2019

Thanks, I'll refactor it a bit later.

@chros73
Copy link
Owner

chros73 commented Nov 11, 2019

Fixed via 063247d , thanks!

@chros73 chros73 closed this as completed Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants