Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]Installing unsupported programs from local sources?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 6:21 am    Post subject: [Solved]Installing unsupported programs from local sources? Reply with quote

I've got a custom keyboard driver I need to get set up. I have the sources stored locally in tar.bz2 archives and naturally all the dependencies are also installed. But how do I install from the sources I've got?

I remember in arch it was as simple as running "makepkg -i" (but in there I also had a PKGBUILD file with instructions)

Considering that portage compiles everything from source anyways I imagine this can't be hard, but I've googled around and didn't find anything probably because I just can't figure out the right keyword to search :oops:

How should I proceed?

Edit:

For g15daemon I just had to move my patch to "/etc/portage/patches/app-misc/g15daemon/" and portage would automatically apply the patch.
For libg15 I had to create an overlay with an updated ebuild (keep reading) and then do the same for "/etc/portage/patches/dev-libs/libg15/"
_________________
This picture was my biggest reason for ever trying Gentoo <3


Last edited by rabcor on Mon Jun 02, 2014 8:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 7:03 am    Post subject: Reply with quote

Hi. I never did that though but have you tried the file:// URI scheme?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 8:29 am    Post subject: Reply with quote

what do you mean?
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 253
Location: Russia && Saint-Petersburg

PostPosted: Sat May 31, 2014 8:35 am    Post subject: Reply with quote

just write ebuild
_________________
sorry my bad english
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 8:42 am    Post subject: Reply with quote

don't I have to learn like.. a lot of stuff to do that? 8O

Oh we already have ebuilds for this.

libg15, libg15render and g15daemon.

However I need to use custom sources for g15daemon and libg15 (my own sources)
_________________
This picture was my biggest reason for ever trying Gentoo <3


Last edited by rabcor on Sat May 31, 2014 8:46 am; edited 1 time in total
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 8:43 am    Post subject: Reply with quote

rabcor wrote:
what do you mean?

Since you didn't mention it, I assumed you had already started to write your own ebuild for the driver. That's indeed the way to go. Ebuild writing *can* be simple, depends on what you have to do. There is a good documentation and manual.

rabcor wrote:
don't I have to learn like.. a lot of stuff to do that? 8O

Depends on how your custom driver is supposed to be installed. Maybe if you expose the detailed procedure here we'll be able to help to some extent.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 8:47 am    Post subject: Reply with quote

I think maybe I could just apply this by creating patches with diff since the packages are already available in the portage tree :)

That is probably a lot easier right?

Oh I think the ebuilds don't support patches :(

Is there a way I could modify the existing ebuilds and trick portage into my modified builds instead of the originals?
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 8:53 am    Post subject: Reply with quote

rabcor wrote:
I think maybe I could just apply this by creating patches with diff since the packages are already available in the portage tree :)

That is probably a lot easier right?

Ah, sure, if it's just a set of patches to apply to an already-existing driver, things get horribly simpler :D . You *will* have to create your own overlay though as directly modifying the official ebuild guarantees your changes *will* be overwritten the next time you --sync.

So take the official ebuild for your driver and see if there's a PATCH or PATCHES line. That's where you put the *.diff and *patch location. Typically there's a /files subdirectory in the ebuild folder. That's where patches typically go.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 9:08 am    Post subject: Reply with quote

I'm a bit noob here, (<- has never used overlays before, much less made one)

I assume I have to read this and the rest is pretty much self explanatory, yes?
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 9:58 am    Post subject: Reply with quote

Rather this page I'd say ;-) . It's a local overlay that you need. Note that I for one don't use the repoman stuff — I've been using overlays for quite some time now and I didn't even suspect that HOWTO existed so it gives you an idea how stable and reliable portage can be. Whenever I have a custom ebuild I run this command to prepare the ebuild's manifest:
Code:
ebuild <path_to_the_ebuild_in_the_overlay> digest
et voilà.

I guess repoman does that for you.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 2:13 pm    Post subject: Reply with quote

Thanks! I think I kinda understand what I gotta do, turns out there's only one ebuild that I need to change. I got it from "/usr/portage/dev-libs/libg15/" assuming thats the right place for me to get it from :P

This is what it looks like

Code:

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libg15/libg15-1.2.7-r1.ebuild,v 1.2 2012/10/12 20:01:54 robbat2 Exp $

EAPI=4

DESCRIPTION="The libg15 library gives low-level access to the Logitech G15 keyboard"
HOMEPAGE="http://g15tools.sourceforge.net/"
SRC_URI="mirror://sourceforge/g15tools/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86"
IUSE=""

DEPEND="=virtual/libusb-0*"
RDEPEND=${DEPEND}

DOCS=( AUTHORS README ChangeLog )

src_configure() {
   econf \
      --disable-static
}

src_install() {
   default

   find "${ED}" -name '*.la' -exec rm -f {} +
}


What do I do to make it read patches from /etc/portage/patches/...?
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13867

PostPosted: Sat May 31, 2014 2:56 pm    Post subject: Reply with quote

Immediately after the EAPI= line, add inherit eutils. Add a new bash function above src_configure(), with the text as follows:
Code:
src_prepare() {
    epatch_user
}
The implementation of epatch_user comes from eutils.eclass, which will be made available by the inherit line. The function epatch_user is responsible for reading patches from /etc/portage/patches/CATEGORY/PACKAGE.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 3:37 pm    Post subject: Reply with quote

Hu wrote:
Immediately after the EAPI= line, add inherit eutils. [...] The function epatch_user is responsible for reading patches from /etc/portage/patches/CATEGORY/PACKAGE.

Isn't there a PATCHES clause in ebuilds that spares writing a custom patching function? I remember using that method to add patches to ebuilds. Has that method been deprecated?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13867

PostPosted: Sat May 31, 2014 3:56 pm    Post subject: Reply with quote

VinzC wrote:
Hu wrote:
Immediately after the EAPI= line, add inherit eutils. [...] The function epatch_user is responsible for reading patches from /etc/portage/patches/CATEGORY/PACKAGE.

Isn't there a PATCHES clause in ebuilds that spares writing a custom patching function? I remember using that method to add patches to ebuilds. Has that method been deprecated?
That method exists, and now that you mention it, I recall seeing it. I am not aware of any deprecation for it, and it is provided by using inherit base instead of inherit eutils. Based on the implementation, if you inherit base, then you receive a default src_prepare that will do what my example above did, as well as some other features. Therefore, OP can inherit base, get epatch_user for free as a side effect of base_src_prepare, and have access to the PATCHES behaviour you mentioned.
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sat May 31, 2014 4:14 pm    Post subject: Reply with quote

Thanks Hu, this means I have the ebuild (already have the patch too, I'll be sharing this in the kernel & hardware section soon (it's a way for people with the Logitech G510 keyboard to make full use of it) :)

Also, all I'm really doing with the ebuild is adding the user patch functionality to it, is there any chance I could forward it to portage's management so that I won't need the overlay later on (or if I am giving the patch to others that they don't need to create the overlay)

Here is how I created the overlay: (Can be turned into a script if "&" is added to the end of every line and "#!/bin/bash" is added to the start of the file first to automate the process)

Code:

mkdir -p /usr/local/portage
mkdir -p /usr/local/portage/{metadata,profiles}
echo libg510 > /usr/local/portage/profiles/dev-libs
echo 'masters = gentoo' > /usr/local/portage/metadata/layout.conf
chown -R portage:portage /usr/local/portage
echo 'PORTDIR_OVERLAY="/usr/local/portage ${PORTDIR_OVERLAY}"' >> /etc/portage/make.conf

mkdir -p /usr/local/portage/dev-libs
mkdir -p /usr/local/portage/dev-libs/libg15
cp /mnt/storage/Forrit/Linux/Core/G510/Gentoo/libg15-1.2.7-r1.ebuild /usr/local/portage/dev-libs/libg15/
cd /usr/local/portage/dev-libs/libg15 && repoman manifest
chown -R portage:portage /usr/local/portage

_________________
This picture was my biggest reason for ever trying Gentoo <3


Last edited by rabcor on Wed Jun 04, 2014 12:35 am; edited 3 times in total
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5004
Location: Dark side of the mood

PostPosted: Sat May 31, 2014 5:26 pm    Post subject: Reply with quote

rabcor wrote:
[...] is there any chance I could forward it to portage's management so that I won't need the overlay later on (or if I am giving the patch to others that they don't need to create the overlay)

IMHO quite an excellent to file a bug @ bugs.gentoo.org . You can send and explain your patch there.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Sun Jun 01, 2014 5:18 am    Post subject: Reply with quote

There we go, thanks :)

Not uploading my patch though, it's just better if users can apply it themselves (it adds support for an unsupported keyboard for this driver while potentially compromising the existing support for other devices) it would need to be a separate package and the patches also need to be modified by the users to better suit their system (for example I have hardcoded the functionality of the extra keys)
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum