Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 444506 - Please add epatch_user to freebsd.eclass
Summary: Please add epatch_user to freebsd.eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: Normal enhancement (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-23 21:59 UTC by Yuta SATOH
Modified: 2012-11-24 11:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for eclass/freebsd.eclass (freebsd.eclass.patch,213 bytes, patch)
2012-11-23 22:00 UTC, Yuta SATOH
Details | Diff
patch for freebsd-sources-9.1_rc3.ebuild (freebsd-sources-9_1_rc3_ebuild.patch,948 bytes, patch)
2012-11-23 22:01 UTC, Yuta SATOH
Details | Diff
patch for freebsd-sources/files/freebsd-sources-9.1-gentoo.patch (files_freebsd-sources-9_1-gentoo_patch.patch,879 bytes, patch)
2012-11-23 22:02 UTC, Yuta SATOH
Details | Diff
patch for freebsd-pam-modules-9.1_rc3.ebuild (freebsd-pam-modules-9_1_rc3.patch,896 bytes, patch)
2012-11-23 22:03 UTC, Yuta SATOH
Details | Diff
minimal patch for freebsd-sources-9.1_rc3.ebuild (freebsd-sources-9.1_rc3.ebuild.minimal.patch,415 bytes, patch)
2012-11-24 09:01 UTC, Yuta SATOH
Details | Diff
minimal patch for freebsd-pam-modules-9.1_rc3.ebuild (freebsd-pam-modules-9.1_rc3.ebuild.patch,355 bytes, patch)
2012-11-24 09:02 UTC, Yuta SATOH
Details | Diff
sample patch for freebsd-sources-9.1_rc3.ebuild (clean up) (freebsd-sources-9.1_rc3.ebuild.cleanup.patch,1.99 KB, patch)
2012-11-24 09:05 UTC, Yuta SATOH
Details | Diff
sample patch for freebsd-pam-modules-9.1_rc3.ebuild (clean up) (freebsd-pam-modules-9.1_rc3.ebuild.freebsd.eclass.patch,718 bytes, patch)
2012-11-24 09:16 UTC, Yuta SATOH
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2012-11-23 21:59:27 UTC
When you try a new patch for sys-freebsd packages, need to change the ebuild.
Call epatch_user in freebsd.eclass, we will be able to easily try new patch without changing ebuild.

Please add epatch_user to freebsd.eclass for ease the development and use.


FYI,
Function epatch_user is included in eutils.eclass.
http://devmanual.gentoo.org/eclass-reference/eutils.eclass/index.html
Comment 1 Yuta SATOH 2012-11-23 22:00:27 UTC
Created attachment 330358 [details, diff]
patch for eclass/freebsd.eclass
Comment 2 Yuta SATOH 2012-11-23 22:01:39 UTC
Created attachment 330362 [details, diff]
patch for freebsd-sources-9.1_rc3.ebuild

Must be bump to EAPI=2 for freebsd.eclass work properly.
Comment 3 Yuta SATOH 2012-11-23 22:02:40 UTC
Created attachment 330364 [details, diff]
patch for freebsd-sources/files/freebsd-sources-9.1-gentoo.patch

The change from LDADD=-ll to LDADD=-lfl by freebsd_rename_libraries of freebsd.eclass automatically.
Comment 4 Yuta SATOH 2012-11-23 22:03:22 UTC
Created attachment 330366 [details, diff]
patch for freebsd-pam-modules-9.1_rc3.ebuild

bump to EAPI=2
Comment 5 Yuta SATOH 2012-11-23 22:03:53 UTC
Steps to Reproduce:

1. Apply patches all of attachments.
2. mkdir -p /etc/portage/patches/sys-freebsd/freebsd-sources
3. wget -O /etc/portage/patches/sys-freebsd/freebsd-sources/100_CVE-2012-4576.patch http://security.FreeBSD.org/patches/SA-12:08/linux.patch
4. cd /usr/portage/sys-freebsd/freebsd-sources
5. ebuild freebsd-sources-9.1_rc3.ebuild prepare
 * freebsd-sys-9.1_rc3.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...     [ ok ]
 * checking ebuild checksums ;-) ...                                    [ ok ]
 * checking auxfile checksums ;-) ...                                   [ ok ]
 * checking miscfile checksums ;-) ...                                  [ ok ]
>>> Unpacking source...
>>> Unpacking freebsd-sys-9.1_rc3.tar.bz2 to /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work
 * Applying user patches from /etc/portage/patches//sys-freebsd/freebsd-sources ...
 *   100_CVE-2012-4576.patch ...                                        [ ok ]
 * Done with patching
 * Renaming libraries ...                                               [ ok ]
>>> Source unpacked in /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work
>>> Preparing source in /var/tmp/portage/sys-freebsd/freebsd-sources-9.1_rc3/work/sys ...
 * Applying freebsd-sources-9.0-disable-optimization.patch ...          [ ok ]
 * Applying freebsd-sources-9.1-gentoo.patch ...                        [ ok ]
<snip>
Comment 6 Alexis Ballier gentoo-dev 2012-11-24 01:08:39 UTC
ok let me see if i get it correctly: adding epatch_user to freebsd_src_unpack is trivial; but then some ebuilds do not call it properly so you need to change them right ? and one of freebsd-sources patches isnt needed anymore ?
Comment 7 Yuta SATOH 2012-11-24 08:52:08 UTC
(In reply to comment #6)
> ok let me see if i get it correctly: adding epatch_user to
> freebsd_src_unpack is trivial; but then some ebuilds do not call it properly
> so you need to change them right ? 

sorry, patches that I attached to the first was wrong.
ebuild that is defined src_unpack don't call freebsd_src_unpack always. (regardless of definition of EAPI)

freebsd_do_patches not called only 2 packages that I attach patches.
Otherwise, freebsd_src_unpack or freebsd_do_patches are included in src_unpack or not is defined src_unpack.

I'll attach patches to make minimal changes.


> and one of freebsd-sources patches isnt needed anymore ?
Are you about 330364 attachment ?

freebsd-sources-9.1-gentoo.patch is patch for two files.
Requires part of sys/conf/kern.mk. please don't remove it.

The only changes to -lfl from -ll in sys/dev/aic7xxx/aicasm/Makefile.
freebsd_src_unpack or freebsd_rename_libraries if called in ebuild, this part is not required.
I think better to call freebsd_rename_libraries instead of patch.


details, please see freebsd_rename_libraries function in freebsd.eclass.

FYI, http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/freebsd.eclass
freebsd_rename_libraries() {
<snip>
	# flex provides libfl, not libl
	find "${S}" -name Makefile -print0 | xargs -0 \
	sed -i -e 's:-ll$:-lfl:g; s:-ll :-lfl :g; s:{LIBL}:{LIBFL}:g'
<snip>
}
Comment 8 Yuta SATOH 2012-11-24 09:01:45 UTC
Created attachment 330396 [details, diff]
minimal patch for freebsd-sources-9.1_rc3.ebuild

add freebsd_do_patches and freebsd_rename_libraries to src_unpack.
Comment 9 Yuta SATOH 2012-11-24 09:02:48 UTC
Created attachment 330400 [details, diff]
minimal patch for freebsd-pam-modules-9.1_rc3.ebuild
Comment 10 Yuta SATOH 2012-11-24 09:05:21 UTC
Created attachment 330404 [details, diff]
sample patch for freebsd-sources-9.1_rc3.ebuild (clean up)

freebsd-sources have a lot of patches. and call many times epatch.
This patch clean up ebuild to use the functionality of freebsd.eclass.

In addition remove
sed -e 's/elf64-sparc/elf64-sparc-freebsd/g' -i "${S}/conf/ldscript.sparc64" || die

Currently, fixed in upstream.
http://svnweb.freebsd.org/base/releng/9.1/sys/conf/ldscript.sparc64?revision=239080&view=markup
Comment 11 Yuta SATOH 2012-11-24 09:16:49 UTC
Created attachment 330408 [details, diff]
sample patch for freebsd-pam-modules-9.1_rc3.ebuild (clean up)

changed to use the functionality of freebsd.eclass
Comment 12 Yuta SATOH 2012-11-24 09:45:00 UTC
@aballier
I confirm success of emerge freebsd-pam-modules freebsd-sources.
I have confirmed to kernel build also.
Of course, both clean up patch and minimal patch.

Please apply patches that you want.
Comment 13 Yuta SATOH 2012-11-24 10:01:08 UTC
(In reply to comment #6)
> ok let me see if i get it correctly: adding epatch_user to
> freebsd_src_unpack is trivial;

I had overlooked.
Please add epatch_user to freebsd_do_patches.

freebsd-contrib don't call freebsd_src_unpack.
Includes only freebsd_do_patches and freebsd_rename_libraries in src_unpack.
Comment 14 Alexis Ballier gentoo-dev 2012-11-24 11:22:55 UTC
(In reply to comment #13)
> (In reply to comment #6)
> > ok let me see if i get it correctly: adding epatch_user to
> > freebsd_src_unpack is trivial;
> 
> I had overlooked.
> Please add epatch_user to freebsd_do_patches.

done this, lemme check the other patches
Comment 15 Alexis Ballier gentoo-dev 2012-11-24 11:24:59 UTC
Comment on attachment 330358 [details, diff]
patch for eclass/freebsd.eclass

applid
Comment 16 Alexis Ballier gentoo-dev 2012-11-24 11:25:57 UTC
Comment on attachment 330408 [details, diff]
sample patch for freebsd-pam-modules-9.1_rc3.ebuild (clean up)

applied
Comment 17 Alexis Ballier gentoo-dev 2012-11-24 11:26:19 UTC
Comment on attachment 330400 [details, diff]
minimal patch for freebsd-pam-modules-9.1_rc3.ebuild

shouldnt be needed anymore
Comment 18 Alexis Ballier gentoo-dev 2012-11-24 11:31:10 UTC
all done, thanks a lot!