Re: Where do we want PKG_ARCH in Makefile?
On Mon, Mar 21, 2016 at 07:09:52PM +, Nigel Taylor wrote: > > Should portgen be updated? > > Perl ports should have normally a PKG_ARCH = * added to the Makefile. > When perl uses C or other languages PKG_ARCH = * should not be present, > a WANTLIB += perl should. > > To find which either read MANIFEST if files listed end in .xs excluding > those under t/ xt/ inc/ or search for files using find > > $ find `make show=WRKSRC`/!(inc|t|xt) -name "*.xs" > /usr/ports/pobj/p5-Cpanel-JSON-XS-3.0213/Cpanel-JSON-XS-3.0213/XS.xs > > So this port should not have PKG_ARCH = * > needs a WANTLIB += perl in the Makefile, as a .xs file is present. > > This diff syncs portgen with the recent changes in perl ports. OK? Index: Port.pm === RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Port.pm --- Port.pm 18 Jan 2016 18:08:19 - 1.1.1.1 +++ Port.pm 25 Mar 2016 22:54:38 - @@ -222,6 +222,7 @@ sub write_makefile $other_stuff =~ s/^#//; $other_stuff =~ s/(\?\?\?|$)/$value\n/; + # handle cases where replacing '???' isn't enough if ( $other_stuff =~ /^PERMIT_PACKAGE_CDROM/ ) { $output .= "# $self->{license}\n"; } elsif ( $other_stuff =~ /_DEPENDS/ ) { @@ -229,6 +230,8 @@ sub write_makefile } elsif ( $other_stuff =~ /^COMMENT/ ) { $output .= "# original: $self->{full_comment}\n" if $self->{full_comment}; + } elsif ( $other_stuff =~ /^WANTLIB/ ) { + $other_stuff =~ s/=/+=/; } $output .= $other_stuff; Index: Port/CPAN.pm === RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port/CPAN.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 CPAN.pm --- Port/CPAN.pm18 Jan 2016 18:08:20 - 1.1.1.1 +++ Port/CPAN.pm25 Mar 2016 22:54:38 - @@ -205,6 +205,13 @@ sub postextract $self->set_descr( $self->read_descr($wrksrc) || $di->{abstract} ); $self->_find_hidden_test_deps($wrksrc); + + if ( $self->_uses_xs($wrksrc) ) { + $self->set_other( 'WANTLIB', 'perl' ); + } + else { + $self->set_other( 'PKG_ARCH', '*' ); + } } sub try_building @@ -266,6 +273,22 @@ sub _test_skips return; } } +} + +sub _uses_xs +{ + my ( $self, $dir ) = @_; + my $found_xs = 0; + + find( sub { + if ( -d && /^(inc|t|xt)$/ ) { + $File::Find::prune = 1; + return; + } + $found_xs = 1 if -f && /\.xs$/; + }, $dir ); + + return $found_xs; } 1;
Re: Where do we want PKG_ARCH in Makefile?
On 03/22/16 13:45, Stuart Henderson wrote: >> $ portcheck >> www/p5-HTML-Base >> >> portcheck fails to find this one... It could find problem by analysing >> the PLIST > >> I do have a fixed version of p5-HTML-Base. Replace ${P5ARCH} by >> ${P5SITE} in the do-install:, recreate pkg/PLIST, and bump. > > This one is odd, why is it using P5ARCH in the first place? > Just a mistake or is there a particular reason? > > It's old, 0.6 version is from 1995, it's for HTML 2.0, with some possible tags for what might be in HTML 3.0. I see no other ports using it. This has been moved from cpan to backcpan. Possible port to remove. It could still be useful in generating HTML Pages. A book references this. http://www.webbasedprogramming.com/Perl-5-Unleashed/ch23.htm Book is quite old also dates from 1997. In metacpan says this As of today (6/8/95) HTML::Base is in preliminary development, and is considered pre-Alpha code, presented solely for evaluation and discussion by the Perl community. It is possible (even likely) that radical changes will occur in the module before being released to the larger PERL world. Index: Makefile === RCS file: /home/cvs/ports/www/p5-HTML-Base/Makefile,v retrieving revision 1.17 diff -u -p -r1.17 Makefile --- Makefile 20 Mar 2016 19:57:17 - 1.17 +++ Makefile 20 Mar 2016 23:19:45 - @@ -6,7 +6,7 @@ MODULES= cpan PKG_ARCH= * DISTNAME= HTML-0.6 PKGNAME= p5-HTML-Base-0.6 -REVISION= 2 +REVISION= 3 CATEGORIES= www # GPL @@ -22,9 +22,9 @@ do-build: cd ${WRKSRC} && pod2man html_base.pod HTML::Base.3p do-install: - ${INSTALL_DATA_DIR} ${PREFIX}/${P5ARCH}/HTML + ${INSTALL_DATA_DIR} ${PREFIX}/${P5SITE}/HTML ${INSTALL_DATA} ${WRKSRC}/HTML/Base.pm \ - ${PREFIX}/${P5ARCH}/HTML/ + ${PREFIX}/${P5SITE}/HTML/ ${INSTALL_MAN_DIR} ${PREFIX}/man/man3p/ ${INSTALL_MAN} ${WRKSRC}/HTML::Base.3p ${PREFIX}/man/man3p/ Index: pkg/PLIST === RCS file: /home/cvs/ports/www/p5-HTML-Base/pkg/PLIST,v retrieving revision 1.5 diff -u -p -r1.5 PLIST --- pkg/PLIST 15 Sep 2004 18:49:51 - 1.5 +++ pkg/PLIST 9 Sep 2015 15:34:54 - @@ -1,5 +1,4 @@ @comment $OpenBSD: PLIST,v 1.5 2004/09/15 18:49:51 espie Exp $ -${P5ARCH}/ -${P5ARCH}/HTML/ -${P5ARCH}/HTML/Base.pm +${P5SITE}/HTML/ +${P5SITE}/HTML/Base.pm @man man/man3p/HTML::Base.3p
Re: Where do we want PKG_ARCH in Makefile?
We are going to have to be careful with these perl WANTLIBs, now that SHARED_ONLY isn't used they are easy to miss, and worse some people may try to remove them because they say "extra", which will mess things up for future perl updates. This might be a useful addition to portcheck. On 2016/03/21 19:09, Nigel Taylor wrote: > On 03/20/16 10:33, Stuart Henderson wrote: > > Watch out for p5-libintl, it currently does not have SHARED_ONLY=Yes > > and should do. Not touching it myself now to avoid getting in your way. > > > > > > These also are wrong, and have been for some time. > > $ pwd > /usr/ports/packages/amd64/no-arch > $ pkg_info -Sq p5-* | grep ",[A-z]" > p5-Digest-MD4-1.9p1,c.84.2 > p5-Digest-Skein-0.05p3,c.84.2 > p5-Socket-GetAddrInfo-0.22p0,c.84.2 > p5-Wx-0.9928,@p5-Alien-wxWidgets-0.67p0,@p5-ExtUtils-XSpp-0.18,@wxWidgets-media-2.8.12p7,m.9.0,pthread.20.1,stdc++.57.0,wx_base.3.0,wx_base_net.3.0,wx_base_xml.3.0,wx_gtk2_adv.3.0,wx_gtk2_aui.3.0,wx_gtk2_core.3.0,wx_gtk2_html.3.0,wx_gtk2_media.3.0,wx_gtk2_richtext.3.0,wx_gtk2_stc.3.0,wx_gtk2_xrc.3.0 Fixed. > All these are wrong also . > > $ pkg_info -Sq *.tgz | grep ",[A-z]" > glm-0.9.7.1,@gcc-libs-4.9.3p3,estdc++.17.0 > gnustep-make-2.6.7p1,@gcc-libs-4.9.3p3,@gtar-1.28p1,estdc++.17.0 > gtk3mm-documentation-3.18.0,@gcc-libs-4.9.3p3,estdc++.17.0 > kde-shared-data-4.14.3p1,@gcc-libs-4.9.3p3,@gtk-update-icon-cache-3.18.9,estdc++.17.0 > ruby-ri_docs-1.8.7.374p0,@libiconv-1.14p3,iconv.6.0 > tmake-1.10p3,@qt3-mt-3.8p9,lib/qt3/qt-mt.33.0 > unoconv-0.7p1,@gcc-libs-4.9.3p3,@libreoffice-5.1.1.3p0v0,@python-3.4.4,estdc++.17.0 I haven't looked at these yet. > $ portcheck > www/p5-HTML-Base > > portcheck fails to find this one... It could find problem by analysing > the PLIST > I do have a fixed version of p5-HTML-Base. Replace ${P5ARCH} by > ${P5SITE} in the do-install:, recreate pkg/PLIST, and bump. This one is odd, why is it using P5ARCH in the first place? Just a mistake or is there a particular reason?
Re: Where do we want PKG_ARCH in Makefile?
On 03/20/16 10:33, Stuart Henderson wrote: > Watch out for p5-libintl, it currently does not have SHARED_ONLY=Yes > and should do. Not touching it myself now to avoid getting in your way. > > These also are wrong, and have been for some time. $ pwd /usr/ports/packages/amd64/no-arch $ pkg_info -Sq p5-* | grep ",[A-z]" p5-Digest-MD4-1.9p1,c.84.2 p5-Digest-Skein-0.05p3,c.84.2 p5-Socket-GetAddrInfo-0.22p0,c.84.2 p5-Wx-0.9928,@p5-Alien-wxWidgets-0.67p0,@p5-ExtUtils-XSpp-0.18,@wxWidgets-media-2.8.12p7,m.9.0,pthread.20.1,stdc++.57.0,wx_base.3.0,wx_base_net.3.0,wx_base_xml.3.0,wx_gtk2_adv.3.0,wx_gtk2_aui.3.0,wx_gtk2_core.3.0,wx_gtk2_html.3.0,wx_gtk2_media.3.0,wx_gtk2_richtext.3.0,wx_gtk2_stc.3.0,wx_gtk2_xrc.3.0 The p5-Digest-MD4 has MD4.xs so needs a WANTLIB += perl It's has a #include perl.h in MD4.xs p5-Digest-Skein has skein.xs p5-Socket-GetAddrInfo has lib/Socket/GetAddrInfo.xs p5-Wx has .xs files everywhere All these are wrong also . $ pkg_info -Sq *.tgz | grep ",[A-z]" glm-0.9.7.1,@gcc-libs-4.9.3p3,estdc++.17.0 gnustep-make-2.6.7p1,@gcc-libs-4.9.3p3,@gtar-1.28p1,estdc++.17.0 gtk3mm-documentation-3.18.0,@gcc-libs-4.9.3p3,estdc++.17.0 kde-shared-data-4.14.3p1,@gcc-libs-4.9.3p3,@gtk-update-icon-cache-3.18.9,estdc++.17.0 ruby-ri_docs-1.8.7.374p0,@libiconv-1.14p3,iconv.6.0 tmake-1.10p3,@qt3-mt-3.8p9,lib/qt3/qt-mt.33.0 unoconv-0.7p1,@gcc-libs-4.9.3p3,@libreoffice-5.1.1.3p0v0,@python-3.4.4,estdc++.17.0 $ make SUBDIR="`cat /tmp/l.9|xargs`" show="WANTLIB PKG_ARCH" ===> converters/unoconv estdc++>=17 * ===> devel/tmake lib/qt3/qt-mt>=3 * ===> graphics/glm estdc++>=17 * ===> lang/ruby/1.8,-ri_docs iconv>=2 amd64 ===> misc/gtk3mm-documentation estdc++>=17 * ===> x11/gnustep/make estdc++>=17 * ===> x11/kde-shared-data estdc++>=17 * $ make show="WANTLIB-ri_docs PKG_ARCH-ri_docs" iconv>=2 * shouldn't use PKG_ARCH=* and WANTLIB. one of the two is wrong. Looks like portcheck agrees $ cd x11/gnustep/make/ $ portcheck non-empty WANTLIB for arch-independent package x11/gnustep/make $ portcheck non-empty WANTLIB for arch-independent package security/p5-Digest-MD4 $ portcheck www/p5-HTML-Base portcheck fails to find this one... It could find problem by analysing the PLIST PKG_ARCH = * means the expanded PLIST shouldn't contain `machine`, in file paths they should all be machine independent locations, this case ${P5ARCH} is expanded and contains machine. I do have a fixed version of p5-HTML-Base. Replace ${P5ARCH} by ${P5SITE} in the do-install:, recreate pkg/PLIST, and bump. Unexpanded PLIST files could look for ${(|P5|MACHINE-)ARCH} But don't want NO_ARCH. Should portgen be updated? Perl ports should have normally a PKG_ARCH = * added to the Makefile. When perl uses C or other languages PKG_ARCH = * should not be present, a WANTLIB += perl should. To find which either read MANIFEST if files listed end in .xs excluding those under t/ xt/ inc/ or search for files using find $ find `make show=WRKSRC`/!(inc|t|xt) -name "*.xs" /usr/ports/pobj/p5-Cpanel-JSON-XS-3.0213/Cpanel-JSON-XS-3.0213/XS.xs So this port should not have PKG_ARCH = * needs a WANTLIB += perl in the Makefile, as a .xs file is present.
Re: Where do we want PKG_ARCH in Makefile?
On Sun, March 20, 2016 12:24, Stuart Henderson wrote: > On 2016/03/20 02:04, Christian Weisgerber wrote: >> The good news is that the end of the SHARED_ONLY removal is in >> sight. >> >> The not so great news is that the final step will involve touching >> about 1600 perl ports. Most of these will gain a PKG_ARCH=* setting. >> Any particular wishes where in the port Makefile PKG_ARCH should >> go, after which other variable(s)? > > I think I'd put it on the line before the first MODULES line. (or could > be on the line after, but then it's not a simple sed substitution if > there's a multi-line MODULES). > > > As for me, this should try to match our Makefile .sample and live closer to EOF.
Re: Where do we want PKG_ARCH in Makefile?
Watch out for p5-libintl, it currently does not have SHARED_ONLY=Yes and should do. Not touching it myself now to avoid getting in your way.
Re: Where do we want PKG_ARCH in Makefile?
On 2016/03/20 02:04, Christian Weisgerber wrote: > The good news is that the end of the SHARED_ONLY removal is in > sight. > > The not so great news is that the final step will involve touching > about 1600 perl ports. Most of these will gain a PKG_ARCH=* setting. > Any particular wishes where in the port Makefile PKG_ARCH should > go, after which other variable(s)? I think I'd put it on the line before the first MODULES line. (or could be on the line after, but then it's not a simple sed substitution if there's a multi-line MODULES).