From 49ddbcd18972610f33ff05ef7e6550db9ed19ef8 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Mon, 25 Jun 2012 11:16:57 +0000 Subject: [PATCH 01/92] multimedia/ffmpeg1: add option to generate tools --- multimedia/ffmpeg1/Makefile | 12 ++++++++++-- multimedia/ffmpeg1/PLIST | 6 ++++++ multimedia/ffmpeg1/options.mk | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/multimedia/ffmpeg1/Makefile b/multimedia/ffmpeg1/Makefile index fd46d1dbb9817..e8ebac9e65e22 100644 --- a/multimedia/ffmpeg1/Makefile +++ b/multimedia/ffmpeg1/Makefile @@ -32,13 +32,21 @@ CONFIGURE_ARGS+= --host-ld=${NATIVE_CC:Q} TEST_TARGET= check +.include "options.mk" + +FFTOOLS= cws2fws graph2dot pktdumper +FFTOOLS+= probetest qt-faststart trasher + post-install: ${INSTALL_DATA} ${WRKSRC}/doc/*.txt \ ${DESTDIR}${PREFIX}/share/doc/ffmpeg1 ${INSTALL_DATA} ${WRKSRC}/doc/ffserver.conf \ ${DESTDIR}${PREFIX}/share/examples/ffmpeg1 - -.include "options.mk" +.if !empty(PKG_OPTIONS:Mtools) +. for tool in ${FFTOOLS} + ${INSTALL_PROGRAM} ${WRKSRC}/tools/${tool} ${DESTDIR}${PREFIX}/bin +. endfor +.endif .include "../../mk/compiler.mk" diff --git a/multimedia/ffmpeg1/PLIST b/multimedia/ffmpeg1/PLIST index 9cf8da8d621d1..4a72e388dabe3 100644 --- a/multimedia/ffmpeg1/PLIST +++ b/multimedia/ffmpeg1/PLIST @@ -2,6 +2,12 @@ bin/ffmpeg1 bin/ffprobe1 bin/ffserver1 +${PLIST.tools}bin/cws2fws +${PLIST.tools}bin/graph2dot +${PLIST.tools}bin/pktdumper +${PLIST.tools}bin/probetest +${PLIST.tools}bin/qt-faststart +${PLIST.tools}bin/trasher include/ffmpeg1/libavcodec/avcodec.h include/ffmpeg1/libavcodec/avfft.h include/ffmpeg1/libavcodec/dxva2.h diff --git a/multimedia/ffmpeg1/options.mk b/multimedia/ffmpeg1/options.mk index 1a6f5df7bd376..43b18425a7636 100644 --- a/multimedia/ffmpeg1/options.mk +++ b/multimedia/ffmpeg1/options.mk @@ -6,6 +6,7 @@ PKG_OPTIONS_VAR= PKG_OPTIONS.ffmpeg PKG_SUPPORTED_OPTIONS= faac lame ass libvpx theora vorbis xvid \ opencore-amr rtmp #PKG_SUPPORTED_OPTIONS+=x264 +PKG_SUPPORTED_OPTIONS+= tools PKG_SUGGESTED_OPTIONS= lame ass libvpx theora vorbis xvid #PKG_OPTIONS_OPTIONAL_GROUPS= aac-decoder #PKG_OPTIONS_GROUP.aac-decoder= faac @@ -153,3 +154,10 @@ CONFIGURE_ARGS+= --enable-libvpx .else CONFIGURE_ARGS+= --disable-libvpx .endif + +PLIST_VARS+= tools +.if !empty(PKG_OPTIONS:Mtools) +BUILD_TARGET= all alltools +MAKE_JOBS_SAFE= no +PLIST.tools= yes +.endif From 55cd00f9e47f3cf18993f42d7139097bd3cb1d98 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Mon, 25 Jun 2012 11:42:24 +0000 Subject: [PATCH 02/92] www/nginx: Add compiled-in Passenger support --- www/nginx/MESSAGE.passenger | 25 +++++++++++++++++++++++++ www/nginx/options.mk | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 www/nginx/MESSAGE.passenger diff --git a/www/nginx/MESSAGE.passenger b/www/nginx/MESSAGE.passenger new file mode 100644 index 0000000000000..bde9c3c22f37b --- /dev/null +++ b/www/nginx/MESSAGE.passenger @@ -0,0 +1,25 @@ +=========================================================================== +$NetBSD$ + +To enable Passenger in Nginx, add these lines to your nginx.conf file, +under the 'http' block: + + http { + ... + passenger_root ${PREFIX}; + passenger_ruby ${RUBY}; + ... + } + +To deploy a Rails/Rack application, set a 'server' block's root to the +'public' directory of your application, and add the 'passenger_enabled' +directive, like this: + + server { + listen 80; + server_name www.yourhost.com; + root /path/to/application/public; + passenger_enabled on; + } + +=========================================================================== diff --git a/www/nginx/options.mk b/www/nginx/options.mk index 40a933f7e3ca8..3b80c57425d9e 100644 --- a/www/nginx/options.mk +++ b/www/nginx/options.mk @@ -12,6 +12,8 @@ PKG_SUGGESTED_OPTIONS= inet6 pcre ssl PLIST_VARS+= naxsi perl uwsgi +PKG_SUPPORTED_OPTIONS+= passenger + .include "../../mk/bsd.options.mk" # documentation says naxsi must be the first module @@ -201,6 +203,24 @@ CONFIGURE_ARGS+= --with-http_image_filter_module CONFIGURE_ARGS+= --with-http_stub_status_module .endif +.if !empty(PKG_OPTIONS:Mpassenger) +PKGNAME= ${DISTNAME:S/nginx/nginx-passenger/} + +DEPENDS+= ${RUBY_PKGPREFIX}-passenger-[0-9]*:../../wip/ruby-passenger + +CONFIGURE_ARGS+= --add-module=${WRKDIR}/passenger/ext/nginx + +MESSAGE_SRC= MESSAGE +MESSAGE_SRC+= MESSAGE.passenger + +.include "../../wip/ruby-passenger/inplace.mk" + +pre-configure: build-passenger-files + +build-passenger-files: + cd ${WRKDIR}/passenger/build && ${RAKE} nginx:clean nginx +.endif + .if !empty(PKG_OPTIONS:Mperl) CONFIGURE_ARGS+= --with-http_perl_module CONFIGURE_ARGS+= --with-perl=${PERL5:Q} From d78a228034cffc0fd68a8e2c67af76611f3002be Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 7 Dec 2012 14:49:47 +0000 Subject: [PATCH 03/92] lang/gcc49: Apply our GCC changes. - Add ALTERNATIVES files. - Include the .o files in the -libs packages. - Prune unnecessary libraries from the -libs package. - Set local prefix to LOCALBASE (except tools build), and link against it by default. - Disable -fomit-frame-pointer, we like stack traces. - Disable __stack_chk_fail_local (fixes 32-bit) - DATASET-953 disable full gcc47 dependency - Implement -fstrict-calling-conventions, from richlowe. - Cleanup DEPENDS when using -libs - Fix check-shlibs in -libs - Fix joyent/pkgsrc-legacy#264 (avoid tls emulation) - Fix for building with newer GCC. --- lang/gcc49-libs/Makefile | 19 ++++++++-- lang/gcc49/ALTERNATIVES | 20 ++++++++++ lang/gcc49/Makefile | 24 ++++++++++++ lang/gcc49/buildlink3.mk | 2 +- lang/gcc49/distinfo | 15 ++++++-- lang/gcc49/patches/patch-gcc_caller-save.c | 15 ++++++++ lang/gcc49/patches/patch-gcc_common.opt | 19 ++++++++++ .../patches/patch-gcc_config_i386_i386.c | 37 +++++++++++++++++++ lang/gcc49/patches/patch-gcc_config_sol2-bi.h | 18 +++++++++ lang/gcc49/patches/patch-gcc_config_sol2.h | 18 +++++++++ lang/gcc49/patches/patch-gcc_configure | 10 +++++ lang/gcc49/patches/patch-gcc_dojump.c | 15 ++++++++ lang/gcc49/patches/patch-gcc_gengtype.c | 37 +++++++++++++++++++ lang/gcc49/patches/patch-gcc_ira.c | 24 ++++++++++++ lang/gcc49/patches/patch-gcc_read-md.c | 24 ++++++++++++ lang/gcc49/patches/patch-gcc_targhooks.c | 10 +++++ .../patches/patch-libiberty_sigsetmask.c | 14 +++++++ 17 files changed, 314 insertions(+), 7 deletions(-) create mode 100644 lang/gcc49/ALTERNATIVES create mode 100644 lang/gcc49/patches/patch-gcc_caller-save.c create mode 100644 lang/gcc49/patches/patch-gcc_common.opt create mode 100644 lang/gcc49/patches/patch-gcc_config_sol2-bi.h create mode 100644 lang/gcc49/patches/patch-gcc_config_sol2.h create mode 100644 lang/gcc49/patches/patch-gcc_dojump.c create mode 100644 lang/gcc49/patches/patch-gcc_gengtype.c create mode 100644 lang/gcc49/patches/patch-gcc_ira.c create mode 100644 lang/gcc49/patches/patch-gcc_read-md.c create mode 100644 lang/gcc49/patches/patch-libiberty_sigsetmask.c diff --git a/lang/gcc49-libs/Makefile b/lang/gcc49-libs/Makefile index 2f4e90bb157dc..ed0a358d3c74a 100644 --- a/lang/gcc49-libs/Makefile +++ b/lang/gcc49-libs/Makefile @@ -28,6 +28,9 @@ CHECK_SHLIBS= no ## Depend on exactly ${GCC49_DIST_VERSION}. BUILD_DEPENDS+= ${GCC_PKGNAME}-${GCC49_DIST_VERSION}{,nb[0-9]*}:../../lang/gcc49 +# Finds libs from gcc49 due to rpath +CHECK_SHLIBS= no + .include "../../mk/bsd.prefs.mk" LIBGCC_SUBPREFIX= ${GCC_PKGNAME} @@ -43,19 +46,26 @@ SHLIB_EXT= so .endif LIBRARY_FILES= ${WRKDIR}/lib_files +OBJECT_FILES= ${WRKDIR}/obj_files GENERATE_PLIST+= ${SED} -e 's,^,${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/,' \ - ${LIBRARY_FILES}; + -e 's,gcc/${MACHINE_GNU_PLATFORM}/${GCC49_DIST_VERSION}/,,' \ + ${LIBRARY_FILES} ${OBJECT_FILES}; GENERATE_PLIST+= ${GREP} -q 'lib/' ${LIBRARY_FILES} || \ ${ECHO} '@pkgdir ${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/lib' ; ${LIBRARY_FILES}: ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC49_DIST_VERSION}*' | \ ${SED} -n -e's,^${LIBGCC_PREFIX}/,,' -e'/libexec\//d' \ - -e'/libgij/d;/libgcj/d;/libjvm/d' \ + -e'/libgij/d;/libgcj/d;/libjvm/d;/libgo\./d' \ -e'/lib.*\.${SHLIB_EXT}/p' >${LIBRARY_FILES} -do-install: ${LIBRARY_FILES} +${OBJECT_FILES}: + ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC49_DIST_VERSION}*' | \ + ${SED} -n -e 's,^${LIBGCC_PREFIX}/,,' \ + -e '/\.o/p' -e '/libgcc\.a/p' -e '/libssp_nonshared\.a/p' >${OBJECT_FILES} + +do-install: ${LIBRARY_FILES} ${OBJECT_FILES} ${TEST} -d ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib || \ ${MKDIR} ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib cd ${LIBGCC_PREFIX} && \ @@ -66,6 +76,9 @@ do-install: ${LIBRARY_FILES} ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/$${lib}; \ done <${LIBRARY_FILES} .endif + cd ${LIBGCC_PREFIX} && \ + ${PAX} -r -s ',gcc/${MACHINE_GNU_PLATFORM}/${GCC49_DIST_VERSION}/,,' \ + -w ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE} <${OBJECT_FILES} .include "../../mk/dlopen.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" diff --git a/lang/gcc49/ALTERNATIVES b/lang/gcc49/ALTERNATIVES new file mode 100644 index 0000000000000..83d0c5c5637c4 --- /dev/null +++ b/lang/gcc49/ALTERNATIVES @@ -0,0 +1,20 @@ +bin/c++ @PREFIX@/gcc49/bin/c++ +bin/cc @PREFIX@/gcc49/bin/cc +bin/cpp @PREFIX@/gcc49/bin/cpp +bin/g++ @PREFIX@/gcc49/bin/g++ +bin/gcc @PREFIX@/gcc49/bin/gcc +bin/gcc-ar @PREFIX@/gcc49/bin/gcc-ar +bin/gcc-nm @PREFIX@/gcc49/bin/gcc-nm +bin/gcc-ranlib @PREFIX@/gcc49/bin/gcc-ranlib +bin/gccgo @PREFIX@/gcc49/bin/gccgo +bin/gcov @PREFIX@/gcc49/bin/gcov +bin/gfortran @PREFIX@/gcc49/bin/gfortran +bin/@MACHINE_GNU_PLATFORM@-c++ @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-c++ +bin/@MACHINE_GNU_PLATFORM@-g++ @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-g++ +bin/@MACHINE_GNU_PLATFORM@-gcc @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gcc +bin/@MACHINE_GNU_PLATFORM@-gcc-@GCC49_DIST_VERSION@ @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gcc-@GCC49_DIST_VERSION@ +bin/@MACHINE_GNU_PLATFORM@-gcc-ar @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gcc-ar +bin/@MACHINE_GNU_PLATFORM@-gcc-nm @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gcc-nm +bin/@MACHINE_GNU_PLATFORM@-gcc-ranlib @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gcc-ranlib +bin/@MACHINE_GNU_PLATFORM@-gccgo @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gccgo +bin/@MACHINE_GNU_PLATFORM@-gfortran @PREFIX@/gcc49/bin/@MACHINE_GNU_PLATFORM@-gfortran diff --git a/lang/gcc49/Makefile b/lang/gcc49/Makefile index 4954d5095fd23..a2f0c01ca70cf 100644 --- a/lang/gcc49/Makefile +++ b/lang/gcc49/Makefile @@ -44,6 +44,9 @@ CONFIGURE_ARGS+= --disable-libstdcxx-pch UNLIMIT_RESOURCES+= datasize UNLIMIT_RESOURCES+= stacksize +FILES_SUBST+= GCC49_DIST_VERSION=${GCC49_DIST_VERSION} +FILES_SUBST+= MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM} + SUBST_CLASSES+= vars SUBST_STAGE.vars= pre-configure SUBST_FILES.vars= gcc/Makefile.in @@ -51,6 +54,23 @@ SUBST_VARS.vars= GCC_TARGET_MACHINE .include "../../mk/bsd.prefs.mk" +# This includes some multiarch configuration but is left in the miscfix branch +# to ease merging. +SUBST_CLASSES+= rpaths +SUBST_STAGE.rpaths= pre-configure +SUBST_FILES.rpaths= gcc/config/sol2-bi.h gcc/config/sol2.h +SUBST_VARS.rpaths= PREFIX +.if !empty(MULTIARCH:M[Yy][Ee][Ss]) +SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,ARCH64_SUBDIR,g' +.else +SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,,g' +.endif +# For the tools build (i.e. when not using USE_GCC_LOCALBASE_PREFIX) we +# do not want the PREFIX rpaths added above to leak into final binaries. +.if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "no" +SUBST_SED.rpaths+= -e '/-R/d' +.endif + LANGS= c # In some cases LINKER_RPATH_FLAG needs a trailing space. @@ -88,7 +108,11 @@ CONFIGURE_ARGS+= --enable-libssp CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} CONFIGURE_ARGS+= --enable-shared CONFIGURE_ARGS+= --enable-long-long +.if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "yes" +CONFIGURE_ARGS+= --with-local-prefix=${LOCALBASE:Q} +.else CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} +.endif CONFIGURE_ARGS+= --enable-threads=posix CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} diff --git a/lang/gcc49/buildlink3.mk b/lang/gcc49/buildlink3.mk index 3d3fd0d721107..c707d07b4b224 100644 --- a/lang/gcc49/buildlink3.mk +++ b/lang/gcc49/buildlink3.mk @@ -16,7 +16,7 @@ BUILDLINK_FILES.gcc49= #empty BUILDLINK_AUTO_VARS.gcc49= no # Packages that link against shared libraries need a full dependency. -.if defined(_USE_GCC_SHLIB) +.if defined(_USE_GCC_SHLIB) && empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) DEPENDS+= {gcc49,gcc49-libs}>=4.9:../../lang/gcc49-libs .endif diff --git a/lang/gcc49/distinfo b/lang/gcc49/distinfo index 1e0770ee20d3e..df63c921ec79d 100644 --- a/lang/gcc49/distinfo +++ b/lang/gcc49/distinfo @@ -10,6 +10,8 @@ SHA512 (gcc-4.9.4.tar.bz2) = 93abb78e16277454f41a8e9810f41f66c0fdffdc539a762ff6b Size (gcc-4.9.4.tar.bz2) = 90097606 bytes SHA1 (patch-contrib_make__sunver.pl) = 49cbd1a83c9b65d07a373262fcf6f71069283d2e SHA1 (patch-gcc_Makefile.in) = 45c7a61cf22d02299d2308ba34f0ceb272ad5c5e +SHA1 (patch-gcc_caller-save.c) = 5d26b2ab0f0ea8292b63e0a43b3ac782c619deed +SHA1 (patch-gcc_common.opt) = d45228e1560e1cb087b07dc748196a6c17587a9c SHA1 (patch-gcc_config.gcc) = f8dc39c70aff31b1b9479895a14710ee9b168b3c SHA1 (patch-gcc_config.host) = 1b1e11cd199eb93f49443d51c0063b09b7327858 SHA1 (patch-gcc_config_dragonfly-stdint.h) = 249e78bf2171fcd29eae498e41a12bf747015a19 @@ -17,16 +19,22 @@ SHA1 (patch-gcc_config_dragonfly.h) = 5d671b7cdf8b8e3798dd7ec47f56708aa3548f38 SHA1 (patch-gcc_config_dragonfly.opt) = b01bee26978f7feb62fc2ec21186449ccaea0db7 SHA1 (patch-gcc_config_host-netbsd.c) = 765295f07edb8a68f1910e3a9b4dd2a7dcd491a5 SHA1 (patch-gcc_config_i386_dragonfly.h) = 5756b62791273f77866f06be1df0c267dc90a2ee -SHA1 (patch-gcc_config_i386_i386.c) = 61df9f4677f599f1ba3845849f334bbd568a479f +SHA1 (patch-gcc_config_i386_i386.c) = 247db3ee4e8083692558732ba54ae9148fc72a26 SHA1 (patch-gcc_config_netbsd-stdint.h) = fc430c80adda9d3f58eea47816338f697a659889 SHA1 (patch-gcc_config_netbsd.h) = 1d21dbe5082dd149d59dbc471d4148d0651df7d4 +SHA1 (patch-gcc_config_sol2-bi.h) = 8815540e87906a28ac2b727b470d59070d31f7fc +SHA1 (patch-gcc_config_sol2.h) = 4dc8562ef4a0dd7840474d01bee7f298f8302b9e SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 -SHA1 (patch-gcc_configure) = b925cb971ec547a9c25b518927493a168391d7da +SHA1 (patch-gcc_configure) = 302465f72ada3e3d3ec8acde70af9313e14053e1 +SHA1 (patch-gcc_dojump.c) = d9066b1d2ac6f7ddce876edf3cc61aca420d2686 SHA1 (patch-gcc_fortran_f95-lang.c) = 9dbac16c146821eed9b06e1e9f0da85ff5c4ee75 +SHA1 (patch-gcc_gengtype.c) = add0e5503c1759951a2e5ef34611a2f2a678d98a SHA1 (patch-gcc_ggc-common.c) = fa577bc25260d7e6304f166686ba51c0b677d7f6 SHA1 (patch-gcc_ginclude_stddef.h) = 8af3e4b4058fc623c61e91f5771699f0ce679957 +SHA1 (patch-gcc_ira.c) = 37bfd4118a9393d7d0fc142ee13379526fd733ee +SHA1 (patch-gcc_read-md.c) = 2302886f0a71002377379f976802a0fecb23a4c2 SHA1 (patch-gcc_system.h) = 4c959a6b1c4d524cbdf44cfb80f0e5758ec20783 -SHA1 (patch-gcc_targhooks.c) = ac5bf5f201389f5bb79866d9e0dc93ee28af51f2 +SHA1 (patch-gcc_targhooks.c) = a982fa02d2ce947481d78198586235a9c4eb5d65 SHA1 (patch-include_libiberty.h) = 5254c6a421ae16c71571820f6f07906367f042ba SHA1 (patch-libcilkrts_runtime_os-unix.c) = 165e736decbc6e0e3d905d418d71cf4873927925 SHA1 (patch-libcilkrts_runtime_signal_node.c) = e12fd7c9f109db568c46e915bd1bae28fae7b95a @@ -39,6 +47,7 @@ SHA1 (patch-libgfortran_configure) = 398088715086a0c7a0398590d2de3a8107e35a0d SHA1 (patch-libgo_Makefile.in) = dd3429a0a87f024f1709b8dda4758080e4525e71 SHA1 (patch-libgo_runtime_proc.c) = ba716b2772a83a0c3f0d77d67a40c5a3ac2a3d33 SHA1 (patch-libiberty_Makefile.in) = a5ab85457d69f7bc9fa637ab830c13920d6c4c7c +SHA1 (patch-libiberty_sigsetmask.c) = 4609d2b627a907da6f9e95d1825e473d26bd4cbc SHA1 (patch-libjava_Makefile.in) = a7bc03e3b01f12844106e831dc281a049ee6f906 SHA1 (patch-libjava_boehm.cc) = b18bc9d410a62543583c77e011f50b86f41ca18a SHA1 (patch-libjava_configure) = 449e54fd6fe4357bbd3e378cd6bae5a98fb47dac diff --git a/lang/gcc49/patches/patch-gcc_caller-save.c b/lang/gcc49/patches/patch-gcc_caller-save.c new file mode 100644 index 0000000000000..d63f4c03937bb --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_caller-save.c @@ -0,0 +1,15 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/caller-save.c.orig 2014-01-02 22:23:26.000000000 +0000 ++++ gcc/caller-save.c +@@ -378,7 +378,7 @@ saved_hard_reg_compare_func (const void + const struct saved_hard_reg *p1 = *(struct saved_hard_reg * const *) v1p; + const struct saved_hard_reg *p2 = *(struct saved_hard_reg * const *) v2p; + +- if (flag_omit_frame_pointer) ++ if (0) + { + if (p1->call_freq - p2->call_freq != 0) + return p1->call_freq - p2->call_freq; diff --git a/lang/gcc49/patches/patch-gcc_common.opt b/lang/gcc49/patches/patch-gcc_common.opt new file mode 100644 index 0000000000000..027979203517c --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_common.opt @@ -0,0 +1,19 @@ +$NetBSD$ + +Implement -fstrict-calling-conventions, from: + + https://github.com/richlowe/gcc/commit/c245a538375d071928782a1564cd7e55d70bd4a0 + +--- gcc/common.opt.orig 2015-02-26 02:43:52.000000000 +0000 ++++ gcc/common.opt +@@ -1991,6 +1991,10 @@ fstrict-aliasing + Common Report Var(flag_strict_aliasing) Optimization + Assume strict aliasing rules apply + ++fstrict-calling-conventions ++Common Report Var(flag_strict_calling_conventions) Init(1) ++Use strict ABI calling conventions even for static functions ++ + fstrict-overflow + Common Report Var(flag_strict_overflow) + Treat signed overflow as undefined diff --git a/lang/gcc49/patches/patch-gcc_config_i386_i386.c b/lang/gcc49/patches/patch-gcc_config_i386_i386.c index 3dc7c13e9ed19..8f97b06d4edc4 100644 --- a/lang/gcc49/patches/patch-gcc_config_i386_i386.c +++ b/lang/gcc49/patches/patch-gcc_config_i386_i386.c @@ -12,8 +12,45 @@ zero-extension with and. 2017-03-25 Uros Bizjak +Disable -fomit-frame-pointer. +Add support for -fstrict-calling-conventions. + --- gcc/config/i386/i386.c.orig 2016-08-01 16:03:41.000000000 +0000 +++ gcc/config/i386/i386.c +@@ -3857,7 +3857,7 @@ ix86_option_override_internal (bool main + } + + /* Keep nonleaf frame pointers. */ +- if (opts->x_flag_omit_frame_pointer) ++ if (0) + opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER; + else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags)) + opts->x_flag_omit_frame_pointer = 1; +@@ -5636,6 +5636,7 @@ ix86_function_regparm (const_tree type, + and callee not, or vice versa. Instead look at whether the callee + is optimized or not. */ + && opt_for_fn (decl, optimize) ++ && (TARGET_64BIT || !flag_strict_calling_conventions) + && !(profile_flag && !flag_fentry)) + { + /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */ +@@ -5713,6 +5714,7 @@ ix86_function_sseregparm (const_tree typ + /* For local functions, pass up to SSE_REGPARM_MAX SFmode + (and DFmode for SSE2) arguments in SSE registers. */ + if (decl && TARGET_SSE_MATH && optimize ++ && (TARGET_64BIT || !flag_strict_calling_conventions) + && !(profile_flag && !flag_fentry)) + { + /* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */ +@@ -10650,7 +10652,7 @@ ix86_finalize_stack_realign_flags (void) + if (stack_realign + && frame_pointer_needed + && crtl->is_leaf +- && flag_omit_frame_pointer ++ && 0 + && crtl->sp_is_unchanging + && !ix86_current_function_calls_tls_descriptor + && !crtl->accesses_prior_frames @@ -35540,9 +35540,6 @@ ix86_expand_builtin (tree exp, rtx targe mode0 = DImode; diff --git a/lang/gcc49/patches/patch-gcc_config_sol2-bi.h b/lang/gcc49/patches/patch-gcc_config_sol2-bi.h new file mode 100644 index 0000000000000..35620f92f354d --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_config_sol2-bi.h @@ -0,0 +1,18 @@ +$NetBSD$ + +Pull in ${PREFIX}/lib by default and handle for multiarch. + +--- gcc/config/sol2-bi.h.orig 2014-01-02 22:23:26.000000000 +0000 ++++ gcc/config/sol2-bi.h +@@ -74,8 +74,9 @@ + "%{G:-G} \ + %{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \ +- %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}" ++ -R@PREFIX@/lib/" @MARCH64_SUBDIR@ " \ ++ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ ++ %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "}}}" + + #undef LINK_ARCH64_SPEC + #ifndef USE_GLD diff --git a/lang/gcc49/patches/patch-gcc_config_sol2.h b/lang/gcc49/patches/patch-gcc_config_sol2.h new file mode 100644 index 0000000000000..ee94e685d1dd1 --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_config_sol2.h @@ -0,0 +1,18 @@ +$NetBSD$ + +Pull in ${PREFIX}/lib by default. + +--- gcc/config/sol2.h.orig 2014-05-28 11:37:50.000000000 +0000 ++++ gcc/config/sol2.h +@@ -154,8 +154,9 @@ along with GCC; see the file COPYING3. + "%{G:-G} \ + %{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib} \ +- %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib}}}" ++ -R@PREFIX@/lib \ ++ %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ ++ %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib:%R@PREFIX@/lib}}}" + + #undef LINK_ARCH32_SPEC + #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE diff --git a/lang/gcc49/patches/patch-gcc_configure b/lang/gcc49/patches/patch-gcc_configure index cb51da21444f1..11621729bdf2a 100644 --- a/lang/gcc49/patches/patch-gcc_configure +++ b/lang/gcc49/patches/patch-gcc_configure @@ -3,12 +3,22 @@ $NetBSD: patch-gcc_configure,v 1.2 2017/07/10 15:55:40 maya Exp $ Add dl_iterate_phdr detection for FreeBSD and DragonFly. Detection for NetBSD and OpenBSD is added but commented out in case this error handling mechanism is activated for these platforms later. +Fix detection of native TLS on SunOS, joyent/pkgsrc#264 netbsd provides ssp in libc and doesn't build libssp, adjust ssp spec fragment for it too --- gcc/configure.orig 2014-05-28 11:37:50.000000000 +0000 +++ gcc/configure +@@ -23330,7 +23330,7 @@ $as_echo "#define TLS_SECTION_ASM_FLAG ' + tls_first_major=2 + tls_first_minor=14 + tls_section_flag=T +- tls_as_opt="--fatal-warnings" ++ tls_as_opt="-32 --fatal-warnings" + fi + conftest_s="$conftest_s + foo: .long 25 @@ -27513,7 +27513,7 @@ fi # simply assert that glibc does provide this, which is true for all # realistically usable GNU/Hurd configurations. diff --git a/lang/gcc49/patches/patch-gcc_dojump.c b/lang/gcc49/patches/patch-gcc_dojump.c new file mode 100644 index 0000000000000..35c3a7112e761 --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_dojump.c @@ -0,0 +1,15 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/dojump.c.orig 2014-03-27 00:41:10.000000000 +0000 ++++ gcc/dojump.c +@@ -79,7 +79,7 @@ void + clear_pending_stack_adjust (void) + { + if (optimize > 0 +- && (! flag_omit_frame_pointer || cfun->calls_alloca) ++ && (! 0 || cfun->calls_alloca) + && EXIT_IGNORE_STACK) + discard_pending_stack_adjust (); + } diff --git a/lang/gcc49/patches/patch-gcc_gengtype.c b/lang/gcc49/patches/patch-gcc_gengtype.c new file mode 100644 index 0000000000000..2b7a5ec0ddc98 --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_gengtype.c @@ -0,0 +1,37 @@ +$NetBSD$ + +Fixes for building on SunOS in C99 mode. + +--- gcc/gengtype.c.orig 2014-01-02 22:23:26.000000000 +0000 ++++ gcc/gengtype.c +@@ -4951,7 +4951,7 @@ variable_size_p (const type_p s) + } + + enum alloc_quantity +-{ single, vector }; ++{ gsingle, vector }; + + /* Writes one typed allocator definition into output F for type + identifier TYPE_NAME with optional type specifier TYPE_SPECIFIER. +@@ -5035,8 +5035,8 @@ write_typed_alloc_defns (outf_p f, + if (nb_plugin_files > 0 + && ((s->u.s.line.file == NULL) || !s->u.s.line.file->inpisplugin)) + continue; +- write_typed_struct_alloc_def (f, s, "", single); +- write_typed_struct_alloc_def (f, s, "cleared_", single); ++ write_typed_struct_alloc_def (f, s, "", gsingle); ++ write_typed_struct_alloc_def (f, s, "cleared_", gsingle); + write_typed_struct_alloc_def (f, s, "vec_", vector); + write_typed_struct_alloc_def (f, s, "cleared_vec_", vector); + } +@@ -5055,8 +5055,8 @@ write_typed_alloc_defns (outf_p f, + if (!filoc || !filoc->file->inpisplugin) + continue; + }; +- write_typed_typedef_alloc_def (f, p, "", single); +- write_typed_typedef_alloc_def (f, p, "cleared_", single); ++ write_typed_typedef_alloc_def (f, p, "", gsingle); ++ write_typed_typedef_alloc_def (f, p, "cleared_", gsingle); + write_typed_typedef_alloc_def (f, p, "vec_", vector); + write_typed_typedef_alloc_def (f, p, "cleared_vec_", vector); + } diff --git a/lang/gcc49/patches/patch-gcc_ira.c b/lang/gcc49/patches/patch-gcc_ira.c new file mode 100644 index 0000000000000..1ab78c94be99c --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_ira.c @@ -0,0 +1,24 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/ira.c.orig 2016-03-31 13:21:43.000000000 +0000 ++++ gcc/ira.c +@@ -1707,7 +1707,7 @@ ira_init (void) + { + free_register_move_costs (); + setup_reg_mode_hard_regset (); +- setup_alloc_regs (flag_omit_frame_pointer != 0); ++ setup_alloc_regs (0 != 0); + setup_class_subset_and_memory_move_costs (); + setup_reg_class_nregs (); + setup_prohibited_class_mode_regs (); +@@ -2396,7 +2396,7 @@ ira_setup_eliminable_regset (void) + case. At some point, we should improve this by emitting the + sp-adjusting insns for this case. */ + frame_pointer_needed +- = (! flag_omit_frame_pointer ++ = (! 0 + || (cfun->calls_alloca && EXIT_IGNORE_STACK) + /* We need the frame pointer to catch stack overflow exceptions if + the stack pointer is moving (as for the alloca case just above). */ diff --git a/lang/gcc49/patches/patch-gcc_read-md.c b/lang/gcc49/patches/patch-gcc_read-md.c new file mode 100644 index 0000000000000..5fecbe62dc3a6 --- /dev/null +++ b/lang/gcc49/patches/patch-gcc_read-md.c @@ -0,0 +1,24 @@ +$NetBSD$ + +Backport upstream change to avoid decimal_string conflict on SunOS. + +--- gcc/read-md.c.orig 2014-01-02 22:23:26.000000000 +0000 ++++ gcc/read-md.c +@@ -780,7 +780,7 @@ traverse_md_constants (htab_trav callbac + /* Return a malloc()ed decimal string that represents number NUMBER. */ + + static char * +-decimal_string (int number) ++md_decimal_string (int number) + { + /* A safe overestimate. +1 for sign, +1 for null terminator. */ + char buffer[sizeof (int) * CHAR_BIT + 1 + 1]; +@@ -852,7 +852,7 @@ handle_enum (int lineno, bool md_p) + ev->name = value_name; + } + ev->def = add_constant (md_constants, value_name, +- decimal_string (def->num_values), def); ++ md_decimal_string (def->num_values), def); + + *def->tail_ptr = ev; + def->tail_ptr = &ev->next; diff --git a/lang/gcc49/patches/patch-gcc_targhooks.c b/lang/gcc49/patches/patch-gcc_targhooks.c index 6aa68f1cde347..77f09ea3ad46c 100644 --- a/lang/gcc49/patches/patch-gcc_targhooks.c +++ b/lang/gcc49/patches/patch-gcc_targhooks.c @@ -3,9 +3,19 @@ * Port from NetBSD src Fix __stack_chk_fail_local undefined reference error from "gcc test.c -fstack-protector-all -fPIE". +* Disable __stack_chk_fail_local 32-bit optimisation on SunOS. --- gcc/targhooks.c.orig 2014-03-03 21:51:58.000000000 +0000 +++ gcc/targhooks.c +@@ -716,7 +716,7 @@ default_external_stack_protect_fail (voi + tree + default_hidden_stack_protect_fail (void) + { +-#ifndef HAVE_GAS_HIDDEN ++#if !defined(HAVE_GAS_HIDDEN) || defined(__sun) + return default_external_stack_protect_fail (); + #else + tree t = stack_chk_fail_decl; @@ -738,7 +738,17 @@ default_hidden_stack_protect_fail (void) DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; diff --git a/lang/gcc49/patches/patch-libiberty_sigsetmask.c b/lang/gcc49/patches/patch-libiberty_sigsetmask.c new file mode 100644 index 0000000000000..5e4ea6c85a1d6 --- /dev/null +++ b/lang/gcc49/patches/patch-libiberty_sigsetmask.c @@ -0,0 +1,14 @@ +$NetBSD$ + +Fixes for building on SunOS in C99 mode. + +--- libiberty/sigsetmask.c.orig 2005-05-24 20:48:25.000000000 +0000 ++++ libiberty/sigsetmask.c +@@ -15,7 +15,6 @@ be the value @code{1}). + + */ + +-#define _POSIX_SOURCE + #include + /* Including seems to be needed by ISC. */ + #include From d0076d5c94a13d391fd44e2a344a7a74057cf04c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 3 Apr 2013 11:10:59 +0100 Subject: [PATCH 04/92] mk/pkginstall: make accounts NP by default --- mk/pkginstall/usergroupfuncs | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/pkginstall/usergroupfuncs b/mk/pkginstall/usergroupfuncs index 7b0cad29e33fb..3ffeb2dfdba72 100644 --- a/mk/pkginstall/usergroupfuncs +++ b/mk/pkginstall/usergroupfuncs @@ -124,6 +124,7 @@ adduser() -g $group -u $userid $user ;; esac + passwd -N $user fi return 0 } From 610d5247ce47abce982f5c0ed2d3e78b41ae8460 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 12 Jun 2013 16:19:53 +0100 Subject: [PATCH 05/92] mk/pkginstall: DATASET-780, permit existing users There should be an option with packages to re-use an existing user or group, even if a specific uid/gid is provided. This commit introduces a user variable to configure this: PKGINSTALL_IGNORE_UIDGID. When PKGINSTALL_IGNORE_UIDGID is true then pkg_install will not try to create the user/group as specified. If the user/group does not exist but the specified uid/gid is, then the uid/gid will be stripped so that the system can allocate one at random. --- mk/pkginstall/bsd.pkginstall.mk | 36 ++++++++++++++ mk/pkginstall/usergroup | 86 ++++++++++++++++++++++++++++----- mk/pkginstall/usergroupfuncs | 48 ++++++++++-------- 3 files changed, 138 insertions(+), 32 deletions(-) diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk index 1c08fdaca1b66..b515ec06baa09 100644 --- a/mk/pkginstall/bsd.pkginstall.mk +++ b/mk/pkginstall/bsd.pkginstall.mk @@ -15,11 +15,28 @@ # a message noting the actions taken. It is either YES or NO and # defaults to YES for PKG_DEVELOPERs, otherwise NO. # +# PKGINSTALL_IGNORE_UIDGID +# Whether or not to treat the specific uid/gid provided by the package as +# simply advisory. In the case where either the user/group already +# exists but the uid/gid does not match, or the uid/gid is already taken +# by a different user: +# +# * "yes" will add the user/group if necessary with an unspecified uid/gid +# * "no" will not add the user/group and fail the install. +# +# Default value: no +# +# PKGINSTALL_VERBOSE +# A list of scriptlets that will be verbose and output a message +# noting the actions taken. +# _VARGROUPS+= pkginstall _USER_VARS.pkginstall= \ FONTS_VERBOSE \ INFO_FILES_VERBOSE \ OCAML_FINDLIB_REGISTER_VERBOSE \ + PKGINSTALL_IGNORE_UIDGID \ + PKGINSTALL_VERBOSE \ PKG_CREATE_USERGROUP \ PKG_CONFIG PKG_CONFIG_PERMS \ PKG_RCD_SCRIPTS \ @@ -1078,6 +1095,25 @@ FILES_SUBST+= FONTS_VERBOSE=${FONTS_VERBOSE:Q} FILES_SUBST+= INFO_FILES_VERBOSE=${INFO_FILES_VERBOSE:Q} FILES_SUBST+= OCAML_FINDLIB_REGISTER_VERBOSE=${OCAML_FINDLIB_REGISTER_VERBOSE:Q} +PKGINSTALL_IGNORE_UIDGID?= no +FILES_SUBST+= PKGINSTALL_IGNORE_UIDGID=${PKGINSTALL_IGNORE_UIDGID:Q} + +.if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no" +PKGINSTALL_VERBOSE?= all +.else +PKGINSTALL_VERBOSE?= # empty +.endif +.if !empty(PKGINSTALL_VERBOSE:Mall) || !empty(PKGINSTALL_VERBOSE:Mfonts) +FILES_SUBST+= FONTS_VERBOSE=yes +.else +FILES_SUBST+= FONTS_VERBOSE=no +.endif +.if !empty(PKGINSTALL_VERBOSE:Mall) || !empty(PKGINSTALL_VERBOSE:Minfo-files) +FILES_SUBST+= INFO_FILES_VERBOSE=yes +.else +FILES_SUBST+= INFO_FILES_VERBOSE=no +.endif + # Substitute for various programs used in the DEINSTALL/INSTALL scripts and # in the rc.d scripts. # diff --git a/mk/pkginstall/usergroup b/mk/pkginstall/usergroup index 1b15dc321e384..9185b18e29fd5 100644 --- a/mk/pkginstall/usergroup +++ b/mk/pkginstall/usergroup @@ -74,6 +74,15 @@ PKG_METADATA_DIR="${2-${CURDIR}}" PKG_REFCOUNT_USERS_DBDIR="${PKG_REFCOUNT_DBDIR}/users" PKG_REFCOUNT_GROUPS_DBDIR="${PKG_REFCOUNT_DBDIR}/groups" +case "${PKGINSTALL_IGNORE_UIDGID:-@PKGINSTALL_IGNORE_UIDGID@}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + _PKGINSTALL_IGNORE_UIDGID=yes + ;; +[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) + _PKGINSTALL_IGNORE_UIDGID=no + ;; +esac + case "${PKG_CREATE_USERGROUP:-@PKG_CREATE_USERGROUP@}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) _PKG_CREATE_USERGROUP=yes @@ -126,8 +135,10 @@ ADD) token="$shadow_dir/${PKGNAME}" if ${TEST} ! -d "$shadow_dir"; then ${MKDIR} $shadow_dir - group_exists $group $groupid && - ${ECHO} "${PKGNAME}" > $preexist + group_exists $group $groupid + case $? in + 0|2) ${ECHO} "${PKGNAME}" > $preexist ;; + esac fi if ${TEST} -f "$token" && \ ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then @@ -139,8 +150,11 @@ ADD) yes) group_exists $group $groupid case $? in - 0) ;; 1) addgroup "$group" "$groupid" ;; + 3) case ${_PKGINSTALL_IGNORE_UIDGID} in + yes) addgroup "$group" "" ;; + esac + ;; esac ;; esac @@ -163,8 +177,10 @@ ADD) token="$shadow_dir/${PKGNAME}" if ${TEST} ! -d "$shadow_dir"; then ${MKDIR} $shadow_dir - user_exists $user $userid && - ${ECHO} "${PKGNAME}" > $preexist + user_exists $user $userid + case $? in + 0|2) ${ECHO} "${PKGNAME}" > $preexist ;; + esac fi if ${TEST} -f "$token" && \ ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then @@ -177,10 +193,16 @@ ADD) group_exists $group || continue user_exists $user $userid case $? in - 0) ;; 1) adduser "$user" "$group" "$userid" \ "$descr" "$home" "$shell" ;; + 3) case ${_PKGINSTALL_IGNORE_UIDGID} in + yes) + adduser "$user" "$group" "" \ + "$descr" "$home" "$shell" + ;; + esac + ;; esac ;; esac @@ -254,7 +276,15 @@ CHECK-ADD) IFS="$SAVEIFS" case $group in "") continue ;; - *) group_exists $group $groupid && continue ;; + *) group_exists $group $groupid + case $? in + 0) continue ;; + 2) case ${_PKGINSTALL_IGNORE_UIDGID} in + yes) continue ;; + esac + ;; + esac + ;; esac case "$printed_header" in yes) ;; @@ -266,7 +296,15 @@ CHECK-ADD) esac case $groupid in "") ${ECHO} " $group" ;; - *) ${ECHO} " $group (gid = $groupid)" ;; + *) ${ECHO} " $group (gid = $groupid)" + ${ECHO} "" + ${ECHO} "If you wish to ignore this check and either re-use an existing '$group' group" + ${ECHO} "or create a new one with a system-assigned gid then set" + ${ECHO} "" + ${ECHO} " PKGINSTALL_IGNORE_UIDGID=yes" + ${ECHO} "" + ${ECHO} "in the environment." + ;; esac done case "$printed_header" in @@ -285,7 +323,15 @@ CHECK-ADD) IFS="$SAVEIFS" case $user in "") continue ;; - *) user_exists $user $userid && continue ;; + *) user_exists $user $userid + case $? in + 0) continue ;; + 2) case ${_PKGINSTALL_IGNORE_UIDGID} in + yes) continue ;; + esac + ;; + esac + ;; esac case "$printed_header" in yes) ;; @@ -299,7 +345,15 @@ CHECK-ADD) : ${shell:="@PKG_USER_SHELL@"} case $userid in "") ${ECHO} " $user: $group, $home, $shell" ;; - *) ${ECHO} " $user (uid = $userid): $group, $home, $shell" ;; + *) ${ECHO} " $user (uid = $userid): $group, $home, $shell" + ${ECHO} "" + ${ECHO} "If you wish to ignore this check and either re-use an existing '$user' user" + ${ECHO} "or create a new one with a system-assigned uid then set" + ${ECHO} "" + ${ECHO} " PKGINSTALL_IGNORE_UIDGID=yes" + ${ECHO} "" + ${ECHO} "in the environment." + ;; esac done case "$printed_header" in @@ -321,7 +375,11 @@ CHECK-REMOVE) IFS="$SAVEIFS" case $user in "") continue ;; - *) user_exists $user $userid || continue ;; + *) user_exists $user $userid + case $? in + 0|2) continue ;; + esac + ;; esac shadow_dir="${PKG_REFCOUNT_USERS_DBDIR}/$user" ${TEST} ! -d "$shadow_dir" || continue # refcount isn't zero @@ -348,7 +406,11 @@ CHECK-REMOVE) IFS="$SAVEIFS" case $group in "") continue ;; - *) group_exists $group $groupid || continue ;; + *) group_exists $group $groupid + case $? in + 0|2) continue ;; + esac + ;; esac shadow_dir="${PKG_REFCOUNT_GROUPS_DBDIR}/$group" ${TEST} ! -d "$shadow_dir" || continue # refcount isn't zero diff --git a/mk/pkginstall/usergroupfuncs b/mk/pkginstall/usergroupfuncs index 3ffeb2dfdba72..7ff86e075b7d5 100644 --- a/mk/pkginstall/usergroupfuncs +++ b/mk/pkginstall/usergroupfuncs @@ -14,81 +14,89 @@ # group_exists group [groupid] # Returns 0 if $group exists and has gid $groupid # Returns 1 if neither $group nor $groupid exist -# Returns 2 if $group or $groupid exist but don't match -# Returns 3 for all errors +# Returns 2 if $group exists but $groupid does not match +# Returns 3 if $group does not exist but $groupid does +# Returns 4 for all errors # group_exists() { _group="$1"; _groupid="$2" - ${TEST} -n "$_group" || return 3 + ${TEST} -n "$_group" || return 4 # Check using chgrp to work properly in an NSS/NIS environment. _tmpdir="./.pkginstall.$$" - ${MKDIR} -p $_tmpdir 2>/dev/null || return 3 + ${MKDIR} -p $_tmpdir 2>/dev/null || return 4 ${CHMOD} 0700 $_tmpdir _testpath="$_tmpdir/group_exists" ${ECHO} > $_testpath if ${CHGRP} $_group $_testpath >/dev/null 2>&1; then # $_group exists _id=`${LS} -ln $_testpath 2>/dev/null | ${AWK} '{ print $4 }'` + ${RM} -fr $_tmpdir ${TEST} -n "$_groupid" || _groupid=$_id if ${TEST} "$_groupid" = "$_id"; then - ${RM} -fr $_tmpdir; return 0 + return 0 fi - ${RM} -fr $_tmpdir; return 2 + return 2 elif ${TEST} -z "$_groupid"; then + ${RM} -fr $_tmpdir # $_group doesn't exist and $_groupid is not set - ${RM} -fr $_tmpdir; return 1 + return 1 elif ${CHGRP} $_groupid $_testpath >/dev/null 2>&1; then _name=`${LS} -l $_testpath 2>/dev/null | ${AWK} '{ print $4 }'` + ${RM} -fr $_tmpdir if ${TEST} "$_name" != "$_groupid"; then # $_group doesn't exist, but $_groupid exists - ${RM} -fr $_tmpdir; return 2 + return 3 fi # neither $_group nor $_groupid exist - ${RM} -fr $_tmpdir; return 1 + return 1 fi - ${RM} -fr $_tmpdir; return 3 + ${RM} -fr $_tmpdir; return 4 } # user_exists user [userid] # Returns 0 if $user exists and has uid $userid # Returns 1 if neither $user nor $userid exist -# Returns 2 if $user or $userid exist but don't match -# Returns 3 for all errors +# Returns 2 if $user exists but $userid does not match +# Returns 3 if $user does not exist but $userid does +# Returns 4 for all errors # user_exists() { _user="$1"; _userid="$2" - ${TEST} -n "$_user" || return 3 + ${TEST} -n "$_user" || return 4 # Check using chown to work properly in an NSS/NIS environment. _tmpdir="./.pkginstall.$$" - ${MKDIR} -p $_tmpdir 2>/dev/null || return 3 + ${MKDIR} -p $_tmpdir 2>/dev/null || return 4 ${CHMOD} 0700 $_tmpdir _testpath="$_tmpdir/user_exists" ${ECHO} > $_testpath if ${CHOWN} $_user $_testpath >/dev/null 2>&1; then # $_user exists _id=`${LS} -ln $_testpath 2>/dev/null | ${AWK} '{ print $3 }'` + ${RM} -fr $_tmpdir ${TEST} -n "$_userid" || _userid=$_id if ${TEST} "$_userid" = "$_id"; then - ${RM} -fr $_tmpdir; return 0 + return 0 fi - ${RM} -fr $_tmpdir; return 2 + return 2 elif ${TEST} -z "$_userid"; then + ${RM} -fr $_tmpdir # $_user doesn't exist and $_userid is not set - ${RM} -fr $_tmpdir; return 1 + return 1 elif ${CHOWN} $_userid $_testpath >/dev/null 2>&1; then _name=`${LS} -l $_testpath 2>/dev/null | ${AWK} '{ print $3 }'` + ${RM} -fr $_tmpdir if ${TEST} "$_name" != "$_userid"; then # $_user doesn't exist, but $_userid exists - ${RM} -fr $_tmpdir; return 2 + return 3 fi # neither $_user nor $_userid exist - ${RM} -fr $_tmpdir; return 1 + return 1 fi - ${RM} -fr $_tmpdir; return 3 + ${RM} -fr $_tmpdir; return 4 } # adduser user group [userid] [descr] [home] [shell] From 636ba007f51c610506c78344e7d007abe55922c4 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 8 Jul 2013 14:36:56 +0100 Subject: [PATCH 06/92] mk/wrapper: add support for _WRAP_EXTRA_LIBS This allows specifying additional libraries in the output phase, and is a special case compared to _WRAP_EXTRA_ARGS as we need to ensure that these libaries are not applied when using Sun ld in -r mode. --- mk/wrapper/bsd.wrapper.mk | 2 ++ mk/wrapper/scan | 9 ++++++++- mk/wrapper/wrapper.sh | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index c51c40729a37c..c11bc1b8ac153 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -208,6 +208,7 @@ _UNWRAP_SED= -f ${_WRAP_UNTRANSFORM_SEDFILE} _WRAPPER_SH.${_wrappee_}= ${WRAPPER_SRCDIR}/wrapper.sh _WRAP_ENV.${_wrappee_}?= ${_WRAP_ENV} _WRAP_EXTRA_ARGS.${_wrappee_}?= # empty +_WRAP_EXTRA_LIBS.${_wrappee_}?= # empty _WRAP_ARG_PP.${_wrappee_}?= ${_WRAP_ARG_PP} _WRAP_ARG_PP_MAIN.${_wrappee_}?= ${_WRAP_ARG_PP_MAIN} _WRAP_ARG_SOURCE.${_wrappee_}?= ${_WRAP_ARG_SOURCE} @@ -400,6 +401,7 @@ _WRAP_SUBST_SED.${_wrappee_}= \ -e "s|@_WRAP_EMPTY_FILE@|${_WRAP_EMPTY_FILEQ}|g" \ -e "s|@_WRAP_ENV@|${_WRAP_ENV.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_EXTRA_ARGS@|${_WRAP_EXTRA_ARGS.${_wrappee_}:Q}|g" \ + -e "s|@_WRAP_EXTRA_LIBS@|${_WRAP_EXTRA_LIBS.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_ARG_PP@|${_WRAP_ARG_PP.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_ARG_PP_MAIN@|${_WRAP_ARG_PP_MAIN.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_ARG_SOURCE@|${_WRAP_ARG_SOURCE.${_wrappee_}:Q}|g" \ diff --git a/mk/wrapper/scan b/mk/wrapper/scan index f1ad1f82efe27..26c1734e802ed 100644 --- a/mk/wrapper/scan +++ b/mk/wrapper/scan @@ -31,6 +31,13 @@ # Optional argument processing. for arg do case $arg in - *) ;; + # Append extra libs to output objects, but not when using 'ld -r' or a + # compiler in pre-processor mode. + -o) append_extra_libs=yes ;; + -r) rflag=yes ;; + -E) preproc=yes ;; + -M*) preproc=yes ;; + c-header|c++-header) preproc=yes ;; + *) ;; esac done diff --git a/mk/wrapper/wrapper.sh b/mk/wrapper/wrapper.sh index 9ce505de2ccaf..965df78b26894 100644 --- a/mk/wrapper/wrapper.sh +++ b/mk/wrapper/wrapper.sh @@ -94,8 +94,24 @@ init_queue argbuf init_queue cmdbuf append_extra_args=yes +append_extra_libs=no +rflag=no +preproc=no . $scan +case $append_extra_libs in +yes) + # do not append libraries in preprocessor mode + if [ "$wrapper_type" = "CC" -o "$wrapper_type" = "CXX" ] && [ "$preproc" = "yes" ]; then + append_extra_libs=no + fi + # ld -r -o should not append extra libraries + if [ "$wrapper_type" = "LD" -a "$rflag" = "yes" ]; then + append_extra_libs=no + fi + ;; +esac + case $append_extra_args in yes) $debug_log $wrapperlog " (wrapper.sh) append args: @_WRAP_EXTRA_ARGS@" @@ -105,6 +121,15 @@ yes) ;; esac +case $append_extra_libs in +yes) + $debug_log $wrapperlog " (wrapper.sh) append libs: @_WRAP_EXTRA_LIBS@" + set -- "$@" @_WRAP_EXTRA_LIBS@ + ;; +*) + ;; +esac + . $arg_source . $logic . $cmd_sink From d10fb9c59322b5d880ba7c1c0ccc1b8d8fddeb25 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 18 Jul 2013 10:38:31 +0100 Subject: [PATCH 07/92] devel/binutils: avoid unwanted dependencies * Disable zlib so that we don't pull in platform libz. * Set OVERRIDE_DIRDEPTH.depcomp=1 to disable depcomp-override --- devel/binutils/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile index 6ac7733f4549d..798d7da2a0166 100644 --- a/devel/binutils/Makefile +++ b/devel/binutils/Makefile @@ -44,6 +44,10 @@ CONFIGURE_ARGS+= --with-lib-path=${LIB_PATH} CONFIGURE_ARGS+= --program-prefix=g BINUTILS_PREFIX= ${PREFIX}/${MACHINE_GNU_PLATFORM} +# Joyent changes to avoid pulling in unwanted dependencies. +CONFIGURE_ARGS+= --without-zlib +OVERRIDE_DIRDEPTH.depcomp= -1 + PLIST_SRC= ${PKGDIR}/PLIST.common PLIST_SRC+= ${WRKDIR}/PLIST_DYNAMIC From 6fd9280583cf934a7c73de9c46a6e4ef59d91db4 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Tue, 8 Oct 2013 12:47:02 +0000 Subject: [PATCH 08/92] www/varnish: add dependency on gcc (DATASET-877) --- www/varnish/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/varnish/Makefile b/www/varnish/Makefile index 3821650839582..204d39a0a501c 100644 --- a/www/varnish/Makefile +++ b/www/varnish/Makefile @@ -62,6 +62,11 @@ CONFIGURE_ENV+= VCC_CC="gcc ${_COMPILER_ABI_FLAG.${ABI}} -fpic -shared -o %o %s" . endif .endif +.include "../../mk/compiler.mk" +.if ${PKGSRC_COMPILER} == "gcc" +DEPENDS+= ${_GCC_DEPENDENCY} +.endif + .include "../../mk/curses.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" .include "../../mk/readline.buildlink3.mk" From a747b86d49e47af3fa68b8c33410c800884499a8 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Mon, 6 Jan 2014 15:02:59 +0000 Subject: [PATCH 09/92] math/R: Set R_LD_LIBRARY_PATH to fix GCC libs --- math/R/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/math/R/Makefile b/math/R/Makefile index b07c8c20fac19..4e65c49a82402 100644 --- a/math/R/Makefile +++ b/math/R/Makefile @@ -92,6 +92,9 @@ CONFIGURE_ENV+= ac_cv_path_PDFLATEX="" # We don't want "lib64" CONFIGURE_ENV+= LIBnn=lib +# Prepopulate R_LD_LIBRARY_PATH as the default one is useless +CONFIGURE_ENV+= R_LD_LIBRARY_PATH=${PREFIX}/lib:${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib${LIBABISUFFIX}:${LIBGCC_PREFIX}/lib${LIBABISUFFIX} + # Package assumes it can append to files (specifically DESCRIPTION) that have # been installed SHAREMODE SHAREMODE= 644 From 8820e9bbf597c33ea4b57efa3b8232ebcaa29729 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 6 Oct 2014 10:49:55 +0100 Subject: [PATCH 10/92] Add USE_GCC_RUNTIME as necessary. --- shells/mksh/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shells/mksh/Makefile b/shells/mksh/Makefile index a325d13bb31a5..ba0d2b581775d 100644 --- a/shells/mksh/Makefile +++ b/shells/mksh/Makefile @@ -14,6 +14,8 @@ HOMEPAGE= http://mirbsd.de/mksh COMMENT= MirBSD Korn Shell LICENSE= miros +USE_GCC_RUNTIME= yes + WRKSRC= ${WRKDIR}/mksh WRKBUILD?= ${WRKSRC} From 5bed3b9f47e61fcfcca939dca97b770974d00685 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 6 Oct 2014 10:50:17 +0100 Subject: [PATCH 11/92] multimedia/ffmpeg2: disable asm (-fno-omit-frame-pointer) --- multimedia/ffmpeg2/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multimedia/ffmpeg2/Makefile b/multimedia/ffmpeg2/Makefile index d553dc1f0babe..d0c41793258f9 100644 --- a/multimedia/ffmpeg2/Makefile +++ b/multimedia/ffmpeg2/Makefile @@ -41,6 +41,9 @@ post-install: .include "../../mk/compiler.mk" +# XXX: Incompatible with our disabling -fomit-frame-pointer +CONFIGURE_ARGS+= --disable-asm + # disable asm on i386 for non-gcc and gcc < 4.2 .if ${MACHINE_ARCH} == "i386" . if !empty(MACHINE_PLATFORM:MDarwin-*-i386) \ From cbc4b68f6c73fdde363668bd0d52211937438283 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 5 Feb 2015 13:55:13 +0000 Subject: [PATCH 12/92] pkgtools/cwrappers: support CWRAPPERS_LDADD. This allows arguments to be added when a wrapper is generating an object, and is useful for inserting a specific library into each, for example -lumem on SunOS. --- mk/cwrappers.mk | 3 ++ pkgtools/cwrappers/files/bin/Makefile | 6 +-- pkgtools/cwrappers/files/bin/base-wrapper.c | 7 +++ pkgtools/cwrappers/files/bin/common.c | 44 ++++++++++++++++++ pkgtools/cwrappers/files/bin/common.h | 6 +++ pkgtools/cwrappers/files/bin/ldadd-cc.c | 50 ++++++++++++++++++++ pkgtools/cwrappers/files/bin/ldadd-ld.c | 51 +++++++++++++++++++++ 7 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 pkgtools/cwrappers/files/bin/ldadd-cc.c create mode 100644 pkgtools/cwrappers/files/bin/ldadd-ld.c diff --git a/mk/cwrappers.mk b/mk/cwrappers.mk index 5d544548b3c32..9185c09dce9b1 100644 --- a/mk/cwrappers.mk +++ b/mk/cwrappers.mk @@ -82,6 +82,9 @@ generate-cwrappers: . for cmd in ${CWRAPPERS_PREPEND.${wrappee}:U} ${RUN}echo prepend=${cmd:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} . endfor +. for cmd in ${CWRAPPERS_LDADD.${wrappee}:U} + ${RUN}echo ldadd=${cmd:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} +. endfor . for cmd in ${_CWRAPPERS_UNWRAP} ${RUN}echo unwrap=${cmd:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} . endfor diff --git a/pkgtools/cwrappers/files/bin/Makefile b/pkgtools/cwrappers/files/bin/Makefile index 02e7fd4526b3a..603104a4c5caa 100644 --- a/pkgtools/cwrappers/files/bin/Makefile +++ b/pkgtools/cwrappers/files/bin/Makefile @@ -17,13 +17,13 @@ LDADD+= -lnbcompat CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c normalise-as.c -SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c -SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c +SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c ldadd-cc.c transform-cc.c +SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c ldadd-cc.c transform-cc.c SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \ - normalise-ld.c ld-wrapper.c + normalise-ld.c ldadd-ld.c ld-wrapper.c SRCS.libtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ normalise-cc.c libtool-wrapper.c fixup-libtool.c SRCS.shlibtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ diff --git a/pkgtools/cwrappers/files/bin/base-wrapper.c b/pkgtools/cwrappers/files/bin/base-wrapper.c index 8ec08379a45b2..21e60fa6c4b2c 100644 --- a/pkgtools/cwrappers/files/bin/base-wrapper.c +++ b/pkgtools/cwrappers/files/bin/base-wrapper.c @@ -120,6 +120,8 @@ main(int argc, char **argv) arglist_from_argc(&args, argc, argv); + arglist_register_globals(&args); + fp = worklog_open(); worklog_cmd(fp, "[*]", wrapper_name, &args); @@ -136,6 +138,11 @@ main(int argc, char **argv) operation_mode_cc(&args); #endif arglist_apply_config(&args); +#if defined(WRAPPER_LD) + ldadd_ld(&args); +#elif defined(WRAPPER_CC) || defined(WRAPPER_CXX) + ldadd_cc(&args); +#endif #if defined(WRAPPER_LD) normalise_ld(&args); #else diff --git a/pkgtools/cwrappers/files/bin/common.c b/pkgtools/cwrappers/files/bin/common.c index 3d2b8266e4cc9..cd864cf7d9166 100644 --- a/pkgtools/cwrappers/files/bin/common.c +++ b/pkgtools/cwrappers/files/bin/common.c @@ -51,6 +51,10 @@ char *wrksrc; int debug; enum operation_mode current_operation_mode = mode_unknown; +int rflag = 0; +int linking = 1; + +static struct arglist ldadd_args = TAILQ_HEAD_INITIALIZER(ldadd_args); static struct arglist prepend_args = TAILQ_HEAD_INITIALIZER(prepend_args); static struct arglist append_args = TAILQ_HEAD_INITIALIZER(append_args); static struct arglist prepend_executable_args = @@ -193,6 +197,41 @@ arglist_apply_config(struct arglist *args) } } +void +arglist_register_globals(struct arglist *args) +{ + struct argument *arg; + + TAILQ_FOREACH(arg, args, link) { + if (strcmp(arg->val, "-r") == 0) { + rflag = 1; + continue; + } + if ((strcmp(arg->val, "-c") == 0) || + (strcmp(arg->val, "-E") == 0) || + (strncmp(arg->val, "-M", 2) == 0) || + (strcmp(arg->val, "-S") == 0) || + (strcmp(arg->val, "-xc-header") == 0) || + (strcmp(arg->val, "-xc++-header") == 0) || + (strcmp(arg->val, "c-header") == 0) || + (strcmp(arg->val, "c++-header") == 0)) { + linking = 0; + continue; + } + } +} + +void +arglist_apply_ldadd(struct arglist *args) +{ + struct argument *arg, *arg2; + + TAILQ_FOREACH(arg, &ldadd_args, link) { + arg2 = argument_copy(arg->val); + TAILQ_INSERT_TAIL(args, arg2, link); + } +} + void argument_unlink(struct arglist *args, struct argument **argp) { @@ -251,6 +290,11 @@ parse_config(const char *wrapper) exec_name = xstrdup(line + 5); continue; } + if (strncmp(line, "ldadd=", 6) == 0) { + struct argument *arg; + arg = argument_copy(line + 6); + TAILQ_INSERT_TAIL(&ldadd_args, arg, link); + } if (strncmp(line, "reorder=", 8) == 0) { register_reorder(line + 8); continue; diff --git a/pkgtools/cwrappers/files/bin/common.h b/pkgtools/cwrappers/files/bin/common.h index a51267526400c..55a87bd5407b4 100644 --- a/pkgtools/cwrappers/files/bin/common.h +++ b/pkgtools/cwrappers/files/bin/common.h @@ -43,6 +43,8 @@ extern char *exec_path; extern char *exec_name; extern char *wrksrc; extern int debug; +extern int rflag; +extern int linking; enum operation_mode { mode_unknown, @@ -69,7 +71,9 @@ extern struct argument *prepend_after; char *concat(const char *, const char *); char *concat2(const char *, const char *, size_t); void arglist_from_argc(struct arglist *, int, char **); +void arglist_register_globals(struct arglist *); void arglist_apply_config(struct arglist *); +void arglist_apply_ldadd(struct arglist *); int command_exec(struct arglist *, int, char **); size_t wrapper_hash(const char *); size_t wrapper_hash2(const char *, size_t); @@ -99,6 +103,7 @@ char *xstrndup(const char *, size_t); void operation_mode_as(void); void operation_mode_cc(struct arglist *); +void ldadd_cc(struct arglist *); void normalise_cc(struct arglist *); void cleanup_cc(struct arglist *args); void transform_cc(struct arglist *args); @@ -111,6 +116,7 @@ void register_generic_transform(const char *); void generic_transform_cc(struct arglist *); void operation_mode_ld(struct arglist *); +void ldadd_ld(struct arglist *); void normalise_ld(struct arglist *); void generic_transform_ld(struct arglist *); diff --git a/pkgtools/cwrappers/files/bin/ldadd-cc.c b/pkgtools/cwrappers/files/bin/ldadd-cc.c new file mode 100644 index 0000000000000..82fa696cd0e43 --- /dev/null +++ b/pkgtools/cwrappers/files/bin/ldadd-cc.c @@ -0,0 +1,50 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2015 Jonathan Perkin . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include "common.h" + +void +ldadd_cc(struct arglist *args) +{ + struct argument *arg; + + if (linking) { + TAILQ_FOREACH(arg, args, link) { + if (strcmp(arg->val, "-o") == 0) { + arglist_apply_ldadd(args); + break; + } + } + } +} diff --git a/pkgtools/cwrappers/files/bin/ldadd-ld.c b/pkgtools/cwrappers/files/bin/ldadd-ld.c new file mode 100644 index 0000000000000..d88ba8180bec7 --- /dev/null +++ b/pkgtools/cwrappers/files/bin/ldadd-ld.c @@ -0,0 +1,51 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2015 Jonathan Perkin . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include "common.h" + +void +ldadd_ld(struct arglist *args) +{ + struct argument *arg; + + if (rflag) + return; + + TAILQ_FOREACH(arg, args, link) { + if (strcmp(arg->val, "-o") == 0) { + arglist_apply_ldadd(args); + break; + } + } +} From 3d5fb30f6bf933ed68b3efbc8a5fcf64bdbb265d Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Thu, 5 Feb 2015 20:20:24 +0000 Subject: [PATCH 13/92] databases/postgresql94: patch modules for joyent/postgresql-contrib --- databases/postgresql94/distinfo | 1 + .../patches/patch-contrib_postgres__fdw_Makefile | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 databases/postgresql94/patches/patch-contrib_postgres__fdw_Makefile diff --git a/databases/postgresql94/distinfo b/databases/postgresql94/distinfo index d58da519b249f..233f10a12474e 100644 --- a/databases/postgresql94/distinfo +++ b/databases/postgresql94/distinfo @@ -8,6 +8,7 @@ SHA1 (patch-config_missing) = c2d7d742922ba6861e7660c75b7b53f09e564813 SHA1 (patch-config_perl.m4) = 14c9564577d0df6f82ae0027aeada2f3a6a8f07c SHA1 (patch-configure) = 1c0fee3fb270863eb39118a65769ce170391cfec SHA1 (patch-contrib_dblink_dblink.c) = a6f87ab9f2c28a72608d70267b71bd77437b0921 +SHA1 (patch-contrib_postgres__fdw_Makefile) = b0dab35e7aa524227a4bb6c3866a698e9c3f2b7b SHA1 (patch-contrib_uuid-ossp_uuid-ossp.c) = b18da04850bc7c14f8fc80e0c86429ed1cc075c8 SHA1 (patch-src_Makefile.global.in) = 2ab3affedc77b202f6749964287438d6179ca23a SHA1 (patch-src_Makefile.shlib) = 62533bab4807033780732dfbea7e37d618807b37 diff --git a/databases/postgresql94/patches/patch-contrib_postgres__fdw_Makefile b/databases/postgresql94/patches/patch-contrib_postgres__fdw_Makefile new file mode 100644 index 0000000000000..7f661f5525c6b --- /dev/null +++ b/databases/postgresql94/patches/patch-contrib_postgres__fdw_Makefile @@ -0,0 +1,12 @@ +$NetBSD$ + +--- contrib/postgres_fdw/Makefile.orig 2014-12-16 01:07:34.000000000 +0000 ++++ contrib/postgres_fdw/Makefile +@@ -19,7 +19,6 @@ PG_CONFIG = pg_config + PGXS := $(shell $(PG_CONFIG) --pgxs) + include $(PGXS) + else +-SHLIB_PREREQS = submake-libpq + subdir = contrib/postgres_fdw + top_builddir = ../.. + include $(top_builddir)/src/Makefile.global From f46fa0959111eaae9c82dcb58bc99be7dff7c0ea Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Fri, 6 Feb 2015 14:23:18 +0000 Subject: [PATCH 14/92] mk: add support for projects linked to SMF --- mk/install/deinstall-smf | 38 ++++++++++++++++++++++++++++++++++++ mk/install/install-smf | 42 +++++++++++++++++++++++++++++++++++----- mk/smf.mk | 42 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 mk/install/deinstall-smf diff --git a/mk/install/deinstall-smf b/mk/install/deinstall-smf new file mode 100644 index 0000000000000..c7246b9e836e1 --- /dev/null +++ b/mk/install/deinstall-smf @@ -0,0 +1,38 @@ +# $NetBSD$ +# +# Print deinstall messages instructing the user how to handle the +# newly-installed SMF services. +# + +SMF_PROJECT="@SMF_PROJECT@" +SMF_PROJECT_ID="@SMF_PROJECT_ID@" +SMF_PROJECT_DESC="@SMF_PROJECT_DESC@" +SMF_PROJECT_USER="@SMF_PROJECT_USER@" +SMF_PROJECT_GROUP="@SMF_PROJECT_GROUP@" +SMF_PROJECT_ATTRS="@SMF_PROJECT_ATTRS@" + +case ${STAGE} in +DEINSTALL) + if svcprop -q "svc:/@SMF_PREFIX@/@SMF_NAME@"; then + cat </dev/null 2>&1; then + cat </dev/null 2>&1 + _SMF_IMPORT=$? + fi + if [ -n "${PKG_SKIP_SMF}" ] || [ "${_SMF_IMPORT:-0}" != 0 ]; then cat </dev/null 2>/dev/null; then + eval "/usr/sbin/projadd \ + ${SMF_PROJECT_ID:+-o -p '${SMF_PROJECT_ID}'} \ + ${SMF_PROJECT_DESC:+-c '${SMF_PROJECT_DESC}'} \ + ${SMF_PROJECT_USER:+-U '${SMF_PROJECT_USER}'} \ + ${SMF_PROJECT_GROUP:+-G '${SMF_PROJECT_GROUP}'} \ + ${SMF_PROJECT_ARGS} ${SMF_PROJECT}" + + # Check if SMF service has project attached, fix if not + if svcprop -q svc:/@SMF_PREFIX@/@SMF_NAME@ && \ + [ ! "$(svcprop -q -p method_context/project svc:/@SMF_PREFIX@/@SMF_NAME@)" == "${SMF_PROJECT}" ]; then + svccfg -s svc:/@SMF_PREFIX@/@SMF_NAME@ setprop method_context/project = "${SMF_PROJECT}" + svcadm refresh svc:/@SMF_PREFIX@/@SMF_NAME@ + fi + fi + fi + cat <= +# +# SMF_PROJECT_ID. +# Force set the project ID (normally assigned incrementally) +# +# SMF_PROJECT_DESC. +# Description of the project. +# +# SMF_PROJECT_USER. +# Username(s) the project should be bound to. +# +# SMF_PROJECT_GROUP. +# Groupname the project should be bound to. +# +# SMF_PROJECT_ATTRS. +# List of attributes to add to the project definition. Just the +# attribute argument should be passed, e.g. +# process.max-file-descriptor=(basic,10000,deny) .if !defined(SMF_MK) SMF_MK= # defined @@ -60,6 +82,15 @@ SMF_METHODS?= # empty SMF_METHOD_SHELL?= /sbin/sh SMF_SRCDIR?= ${FILESDIR}/smf +SMF_PROJECT?= ${SMF_PROJECT.${PKGBASE}} +.if !empty(SMF_PROJECT) +SMF_PROJECT_ID?= ${SMF_PROJECT_ID.${SMF_PROJECT}} +SMF_PROJECT_DESC?= ${SMF_PROJECT_DESC.${SMF_PROJECT}} +SMF_PROJECT_USER?= ${SMF_PROJECT_USER.${SMF_PROJECT}} +SMF_PROJECT_GROUP?= ${SMF_PROJECT_GROUP.${SMF_PROJECT}} +SMF_PROJECT_ATTRS?= ${SMF_PROJECT_ATTRS.${SMF_PROJECT}} +.endif + # Dynamically remove rc.d entries, primarily for pkgsrc-{joyent,wip} PLIST_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-smf.awk @@ -79,6 +110,12 @@ FILES_SUBST+= SMF_INSTANCES=${SMF_INSTANCES:Q} FILES_SUBST+= SMF_MANIFEST=${SMF_MANIFEST:Q} FILES_SUBST+= SMF_MANIFEST_FILE=${SMF_MANIFEST_FILE:Q} FILES_SUBST+= SMF_METHOD_SHELL=${SMF_METHOD_SHELL:Q} +FILES_SUBST+= SMF_PROJECT=${SMF_PROJECT:Q} +FILES_SUBST+= SMF_PROJECT_ID=${SMF_PROJECT_ID:Q} +FILES_SUBST+= SMF_PROJECT_DESC=${SMF_PROJECT_DESC:Q} +FILES_SUBST+= SMF_PROJECT_USER=${SMF_PROJECT_USER:Q} +FILES_SUBST+= SMF_PROJECT_GROUP=${SMF_PROJECT_GROUP:Q} +FILES_SUBST+= SMF_PROJECT_ATTRS=${SMF_PROJECT_ATTRS:Q} INSTALLATION_DIRS+= ${PKG_SMF_MANIFEST_DIR} MULTIARCH_SKIP_DIRS.lib+= ${PKG_SMF_DIR} @@ -101,7 +138,12 @@ PRINT_PLIST_AWK+= /^${SMF_MANIFEST_FILE:S|/|\\/|g}/ { next; } ${WRKDIR}/.smfinstall: ${PKGSRCDIR}/mk/install/install-smf @${CP} ${PKGSRCDIR}/mk/install/install-smf ${WRKDIR}/.smfinstall +# Target to add the DEINSTALL script to suggest removal of the SMF service +${WRKDIR}/.smfdeinstall: ${PKGSRCDIR}/mk/install/deinstall-smf + @${CP} ${PKGSRCDIR}/mk/install/deinstall-smf ${WRKDIR}/.smfdeinstall + INSTALL_TEMPLATES+= ${WRKDIR}/.smfinstall +DEINSTALL_TEMPLATES+= ${WRKDIR}/.smfdeinstall # Install optional SMF methods # From a785eebc1e68ad556e442c7a41ea897f81c7af41 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 19 Feb 2015 12:35:33 +0000 Subject: [PATCH 15/92] mk: record REQUIRES based on DT_NEEDED not ldd. --- mk/pkgformat/pkg/metadata.mk | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/mk/pkgformat/pkg/metadata.mk b/mk/pkgformat/pkg/metadata.mk index 371816761ebbc..0d918d25167bd 100644 --- a/mk/pkgformat/pkg/metadata.mk +++ b/mk/pkgformat/pkg/metadata.mk @@ -66,7 +66,25 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS} ELF) \ libs=`${AWK} '/\/lib.*\.so(\.[0-9]+)*$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \ if ${TEST} -n "$$bins" -o -n "$$libs"; then \ - requires=`(${PKGSRC_SETENV} ${LDD_ENV:U} $$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \ + requires=`(${PKGSRC_SETENV} elfdump -d $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} ' \ + /NEEDED/ { \ + dsolibs = dsolibs (dsolibs ? ":" : "") $$NF; \ + } \ + /RPATH/ { \ + nrpath = split($$NF ":${DESTDIR}${PREFIX}/lib${LIBARCHSUFFIX}:${SYSTEM_DEFAULT_RPATH}", rpath, ":"); \ + nlibs = split(dsolibs, libs, ":"); \ + for (l = 1; l <= nlibs; l++) { \ + for (r = 1; r <= nrpath; r++) { \ + sub(/\/$$/, "", rpath[r]); \ + if (system("test -f " rpath[r] "/" libs[l]) == 0) { \ + print rpath[r] "/" libs[l]; \ + break; \ + } \ + } \ + } \ + dsolibs = ""; \ + } \ + ' | ${SED} -e 's,^${DESTDIR},,' | ${SORT} -u`; \ fi; \ linklibs=`${AWK} '/.*\.so(\.[0-9]+)*$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \ for i in $$linklibs; do \ From aac32e0dfc29d63a9ee02823ed0c1a3f96a126a6 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 27 Mar 2015 10:20:48 +0000 Subject: [PATCH 16/92] lang/perl5: fix full_ar wrkdir references --- lang/perl5/Makefile | 1 + lang/perl5/files/Policy.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile index 589a4865ea43d..2255953f0bf03 100644 --- a/lang/perl5/Makefile +++ b/lang/perl5/Makefile @@ -183,6 +183,7 @@ CONFIGURE_ARGS+= -Duseshrplib # files, so make sure the paths to the ones in ${TOOLS_DIR} aren't used. # USE_TOOLS+= hostname ln rm sed test +SUBST_VARS.policysh+= AR SUBST_VARS.policysh+= TOOLS_HOSTNAME_CMD SUBST_VARS.policysh+= TOOLS_LN TOOLS_ALIASES.sed+= ${TOOLS_SED:T} diff --git a/lang/perl5/files/Policy.sh b/lang/perl5/files/Policy.sh index d203fe3386543..24a64b71a094f 100644 --- a/lang/perl5/files/Policy.sh +++ b/lang/perl5/files/Policy.sh @@ -15,6 +15,7 @@ installstyle='lib/perl5' # Perl embeds the full paths to the following tools in several installed # files, so make sure the paths to the ones in ${TOOLS_DIR} aren't used. +ar='@AR@' aphostname='@TOOLS_HOSTNAME_CMD@' ln='@TOOLS_LN@' lns='@TOOLS_LN@ -s' @@ -119,5 +120,6 @@ case "\$libswanted" in *gdbm*) esac # (re)Set sed here so that sed _and_ full_sed are correctly *both* set +ar='@AR@' sed='@TOOLS_SED@' EOCBU From 3d0d9ae029931eac1e9b838e3de6c4d9c99c3a04 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 29 Jul 2015 23:37:12 +0100 Subject: [PATCH 17/92] mk: pass ABI flag to the as(1) wrapper. --- mk/compiler.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/compiler.mk b/mk/compiler.mk index 19dc9cb26b69a..e1fc29f787d29 100644 --- a/mk/compiler.mk +++ b/mk/compiler.mk @@ -190,6 +190,7 @@ CWRAPPERS_PREPEND.cxx+= -std=${_CXX_VERSION_REQD} _WRAP_EXTRA_ARGS.CC+= ${_COMPILER_ABI_FLAG.${ABI}} _WRAP_EXTRA_ARGS.CXX+= ${_COMPILER_ABI_FLAG.${ABI}} _WRAP_EXTRA_ARGS.FC+= ${_COMPILER_ABI_FLAG.${ABI}} +CWRAPPERS_PREPEND.as+= --${ABI} CWRAPPERS_PREPEND.cc+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_PREPEND.cxx+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_PREPEND.f77+= ${_COMPILER_ABI_FLAG.${ABI}} From a38fc6b8f83cdae91eb1b6ff52a945ac7ff98423 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 3 Aug 2015 09:56:13 +0100 Subject: [PATCH 18/92] devel/libtool: apply our changes: - Remove TOOLS_BASEDIR references. - Set search path with COMPILER_LIB_DIRS. - Don't hardcode GCC library paths. - Can't use -nostdlib (due to the above change). mk/compiler/gcc.mk: remove libtool-base handling. We need this to ensure that sys_lib_search_path_spec is correct and prefers the runtime library. Without this we see failures where packages using libtool try to use both libstdc++.so's. Ensure we can use an external libtool for binutils. --- devel/libtool-base/Makefile | 1 + devel/libtool-fortran/Makefile | 1 + devel/libtool/Makefile.common | 19 ++++++++++++++++++ devel/libtool/distinfo | 2 +- devel/libtool/patches/patch-configure | 28 +++++++++++++++++++++++---- mk/bsd.pkg.use.mk | 3 ++- mk/compiler/gcc.mk | 2 +- 7 files changed, 49 insertions(+), 7 deletions(-) diff --git a/devel/libtool-base/Makefile b/devel/libtool-base/Makefile index 1bc4136a6f760..5e5d4ad44f8f5 100644 --- a/devel/libtool-base/Makefile +++ b/devel/libtool-base/Makefile @@ -67,6 +67,7 @@ fix-libtool: cd ${WRKSRC}; for f in libtool; do \ ${SED} -e "s,-L${BUILDLINK_DIR}/lib *,,g" \ -e "s,${BUILDLINK_DIR}/lib *,,g" \ + -e "s,${TOOLS_BASEDIR}/bin/,,g" \ $$f > $$f.new; \ if [ -x $$f ]; then ${CHMOD} +x $$f.new; fi; \ ${MV} -f $$f.new $$f; \ diff --git a/devel/libtool-fortran/Makefile b/devel/libtool-fortran/Makefile index 9a2c7d3afcfaf..ceeff77adb323 100644 --- a/devel/libtool-fortran/Makefile +++ b/devel/libtool-fortran/Makefile @@ -70,6 +70,7 @@ fix-libtool: cd ${WRKSRC}; for f in libtool; do \ ${SED} -e "s,-L${BUILDLINK_DIR}/lib *,,g" \ -e "s,${BUILDLINK_DIR}/lib *,,g" \ + -e "s,${TOOLS_BASEDIR}/bin/,,g" \ $$f > $$f.new; \ if [ -x $$f ]; then ${CHMOD} +x $$f.new; fi; \ ${MV} -f $$f.new $$f; \ diff --git a/devel/libtool/Makefile.common b/devel/libtool/Makefile.common index b80b3b8177619..3129204ee4235 100644 --- a/devel/libtool/Makefile.common +++ b/devel/libtool/Makefile.common @@ -77,3 +77,22 @@ CONFIGURE_ENV+= lt_cv_path_NM=${NM:Q} .endif CONFIGURE_ENV+= RANLIB=${RANLIB:Q} HELP2MAN=${TRUE:Q} + +# Use the correct library search path rather than hardcoding whatever random +# paths are printed out by GCC -print-search-dirs. +# +CONFIGURE_ENV+= lt_cv_sys_lib_search_path_spec=${COMPILER_LIB_DIRS:Q} + +# SunOS ships a /bin/print command which is picked up by libtool and used as +# the default $ECHO, however we use bash which does not have a 'print' builtin +# so we end up having to fork for each invocation. Avoid this by creating a +# broken wrapper. Unsuitable for upstream until it properly handles the ksh93 +# case which would be adversely affected by this right now. +# +.if ${OPSYS} == "SunOS" +.PHONY: create-print-wrapper +post-wrapper: create-print-wrapper +create-print-wrapper: + ${PRINTF} '#!/bin/sh\nfalse\n' > ${WRAPPER_DIR}/bin/print + ${CHMOD} +x ${WRAPPER_DIR}/bin/print +.endif diff --git a/devel/libtool/distinfo b/devel/libtool/distinfo index 29609cda29bf8..a23e3ee543e4b 100644 --- a/devel/libtool/distinfo +++ b/devel/libtool/distinfo @@ -7,5 +7,5 @@ Size (libtool-2.4.6.tar.gz) = 1806697 bytes SHA1 (patch-Makefile.in) = 0adb634335acd5fb280c99b5d43ae568018ca0af SHA1 (patch-build-aux_depcomp) = ae6f93ad4fac1df648cfcb62601c72f9ebb30233 SHA1 (patch-build-aux_ltmain.sh) = 110c3976ccdc2a69c34001923427e47e9c4b3b37 -SHA1 (patch-configure) = 30b05f8f258b3e16abf7daadb9d59cce9dbd9976 +SHA1 (patch-configure) = 454b03fb8f736db89a521a64f6668589d32d03b0 SHA1 (patch-libltdl_configure) = 73cc33d5ce0a91c7cd976d4a386e17d69d377c24 diff --git a/devel/libtool/patches/patch-configure b/devel/libtool/patches/patch-configure index 00f6f14831068..db2ed908ed3ad 100644 --- a/devel/libtool/patches/patch-configure +++ b/devel/libtool/patches/patch-configure @@ -436,16 +436,36 @@ DO NOT MODIFY THIS PATCH MANUALLY! YOUR CHANGES WILL BE LOST! ;; *nto* | *qnx*) -@@ -15966,7 +16086,7 @@ fi +@@ -15966,15 +16074,15 @@ fi # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then +- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + if true; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' ++ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' -@@ -16130,8 +16250,9 @@ if { { eval echo "\"\$as_me\":${as_linen +- $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. +- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ output_verbose_link_cmd=func_echo_all + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. +@@ -15985,7 +16093,7 @@ fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. +- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ output_verbose_link_cmd=func_echo_all + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' +@@ -16130,8 +16238,9 @@ if { { eval echo "\"\$as_me\":${as_linen -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. diff --git a/mk/bsd.pkg.use.mk b/mk/bsd.pkg.use.mk index cbaae33e46679..5e34d911607e0 100644 --- a/mk/bsd.pkg.use.mk +++ b/mk/bsd.pkg.use.mk @@ -99,7 +99,8 @@ SHLIBTOOL?= ${WRAPPER_BINDIR}/shlibtool LIBTOOL_REQD?= 2.4.2nb9 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) TOOL_DEPENDS+= cross-libtool-base-${MACHINE_ARCH}>=${_OPSYS_LIBTOOL_REQD:U${LIBTOOL_REQD}}:../../cross/cross-libtool-base -.else +# We use an external libtool for binutils. +.elif empty(PKGPATH:Mdevel/binutils) TOOL_DEPENDS+= libtool-base>=${_OPSYS_LIBTOOL_REQD:U${LIBTOOL_REQD}}:../../devel/libtool-base .endif CONFIGURE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index 7c22078204e22..41cb6cc8bb5fe 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -939,7 +939,7 @@ PREPEND_PATH+= ${_GCC_DIR}/bin # Add dependency on GCC libraries if requested. .if (defined(_USE_GCC_SHLIB) && !empty(_USE_GCC_SHLIB:M[Yy][Ee][Ss])) && !empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) # Special case packages which are themselves a dependency of gcc runtime. -. if empty(PKGPATH:Mdevel/libtool-base) && empty(PKGPATH:Mdevel/binutils) && \ +. if empty(PKGPATH:Mdevel/binutils) && \ empty(PKGPATH:Mlang/gcc4?) && empty(PKGPATH:Mlang/gcc[5-9]) . if !empty(_GCC_PKGBASE:Mgcc48) . include "../../lang/gcc48-libs/buildlink3.mk" From c39ab9ada413ea8088ad508c41eb9498eb37cc81 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 16 Dec 2015 18:04:53 +0000 Subject: [PATCH 19/92] pkg_install: explicitly disable lzma. Avoids accidentally picking up a broken/non-working one from the environment, or linking against one we don't have installed everywhere. --- pkgtools/pkg_install/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile index b20bc07bbd3af..97843a3361934 100644 --- a/pkgtools/pkg_install/Makefile +++ b/pkgtools/pkg_install/Makefile @@ -202,6 +202,7 @@ pre-configure: --disable-dependency-tracking --without-expat \ --disable-maintainer-mode \ --without-iconv --without-lzo2 --without-nettle \ + --without-lzmadec --without-lzma \ --without-xml2 --without-lz4 \ ${LIBARCHIVE_CONFIGURE_ARGS} cd ${WRKDIR}/libarchive && ${BUILD_MAKE_CMD} From f7bb03df392c61acde794f4fc71097a7d3012f25 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 24 Mar 2016 19:33:06 +0000 Subject: [PATCH 20/92] lang/python: CHECK_WRKREF+=buildlink fixes. --- lang/python27/Makefile | 4 ++++ lang/python34/Makefile | 4 ++++ lang/python35/Makefile | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lang/python27/Makefile b/lang/python27/Makefile index f3e87785a41c2..8a6bde0d7cad1 100644 --- a/lang/python27/Makefile +++ b/lang/python27/Makefile @@ -30,6 +30,10 @@ LDFLAGS+= -L${WRKSRC} # $RANDOM usage there is fine CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh +# Harmless PKG_CONFIG_LIBDIR references to BUILDLINK_DIR +CHECK_WRKREF_SKIP+= lib/python2.7/_sysconfigdata.py +CHECK_WRKREF_SKIP+= lib/python2.7/config/Makefile + PTHREAD_OPTS+= require PTHREAD_AUTO_VARS= yes .include "../../mk/pthread.buildlink3.mk" diff --git a/lang/python34/Makefile b/lang/python34/Makefile index cbe6e8e758c9a..2b1acdbcc7871 100644 --- a/lang/python34/Makefile +++ b/lang/python34/Makefile @@ -178,6 +178,10 @@ SUBST_VARS.sslbase= SSLBASE CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc +# Harmless PKG_CONFIG_LIBDIR references to BUILDLINK_DIR +CHECK_WRKREF_SKIP+= lib/python3.4/_sysconfigdata.py +CHECK_WRKREF_SKIP+= lib/python3.4/config-3.4/Makefile + .if ${OPSYS} == "HPUX" post-install: ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.4.sl \ diff --git a/lang/python35/Makefile b/lang/python35/Makefile index 001145fb13402..992add43e7a84 100644 --- a/lang/python35/Makefile +++ b/lang/python35/Makefile @@ -181,6 +181,10 @@ SUBST_VARS.sslbase= SSLBASE CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc +# Harmless PKG_CONFIG_LIBDIR references to BUILDLINK_DIR +CHECK_WRKREF_SKIP+= lib/python3.5/_sysconfigdata.py +CHECK_WRKREF_SKIP+= lib/python3.5/config-3.5/Makefile + # Avoid error: Cannot generate ./Include/opcode.h, python not found ! post-configure: touch ${WRKSRC}/Include/opcode.h From 051712adab8a5d1923c3b2757d32684675367f57 Mon Sep 17 00:00:00 2001 From: Filip Hajny Date: Mon, 25 Jun 2012 11:40:03 +0000 Subject: [PATCH 21/92] databases/php-oci8: build against joyent/instantclient --- databases/php-oci8/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/databases/php-oci8/Makefile b/databases/php-oci8/Makefile index a8656b2b7be53..c7b6f4f1c7db8 100644 --- a/databases/php-oci8/Makefile +++ b/databases/php-oci8/Makefile @@ -9,13 +9,17 @@ USE_PHP_EXT_PATCHES= yes .include "../../mk/bsd.prefs.mk" .if !defined(ORACLE_HOME) -PKG_FAIL_REASON+= "You must set ORACLE_HOME to the location of your Oracle installation" +# Joyent hack, user needs to fetch Instant Client themselves +.include "../../joyent/instantclient/buildlink3.mk" +CONFIGURE_ARGS+= --with-${MODNAME}=instantclient,${BUILDLINK_PREFIX.instantclient}/${ORACLE_IC_HOME} +MESSAGE_SRC+= ${.CURDIR}/../../joyent/instantclient/MESSAGE.instantclient .elif !exists(${ORACLE_HOME}) PKG_FAIL_REASON+= "The location of ORACLE_HOME does not exist" -.endif +.else BUILDLINK_PASSTHRU_DIRS+= ${ORACLE_HOME} CONFIGURE_ARGS+= --with-${MODNAME}=shared,${ORACLE_HOME} +.endif ONLY_FOR_PLATFORM= Linux-*-* SunOS-*-* From 2f50d9e2d2f4dc5c96b5b6c72333e672875a4f83 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 21 Jun 2016 17:44:01 +0100 Subject: [PATCH 22/92] mk: create .pkginfo file during 'package' phase. --- mk/pkgformat/pkg/package.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mk/pkgformat/pkg/package.mk b/mk/pkgformat/pkg/package.mk index 999b8c2e99cea..b79bfd128f98c 100644 --- a/mk/pkgformat/pkg/package.mk +++ b/mk/pkgformat/pkg/package.mk @@ -16,6 +16,8 @@ PKGFILE?= ${PKGREPOSITORY}/${FILEBASE}-${PKGVERSION}${PKG_SUFX} STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR} PKGREPOSITORYSUBDIR?= All +PKGINFOREPOSITORY?= ${PACKAGES}/pkginfo +PKGINFOFILE?= ${PKGINFOREPOSITORY}/${FILEBASE}-${PKGVERSION}.pkginfo ###################################################################### ### package-create (PRIVATE, pkgsrc/mk/package/package.mk) @@ -23,7 +25,7 @@ PKGREPOSITORYSUBDIR?= All ### package-create creates the binary package. ### .PHONY: package-create -package-create: ${PKGFILE} +package-create: ${PKGINFOFILE} ###################################################################### ### stage-package-create (PRIVATE, pkgsrc/mk/package/package.mk) @@ -67,6 +69,10 @@ ${PKGFILE}: ${STAGE_PKGFILE} ${RUN} ${MKDIR} ${.TARGET:H}; \ ${LN} -f ${STAGE_PKGFILE} ${PKGFILE} 2>/dev/null || \ ${CP} -pf ${STAGE_PKGFILE} ${PKGFILE} + +${PKGINFOFILE}: ${PKGFILE} + ${RUN} ${MKDIR} ${.TARGET:H}; \ + ${PKG_INFO} -X ${PKGFILE} >${.TARGET} .endif ###################################################################### From 153a01f6327f22776e3ea46adc2490fa1d2f8033 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 13 Oct 2016 18:29:38 +0100 Subject: [PATCH 23/92] pkg_install: compile openssl statically --- pkgtools/pkg_install/Makefile | 3 +-- pkgtools/pkg_install/files/add/Makefile.in | 2 +- pkgtools/pkg_install/files/admin/Makefile.in | 2 +- pkgtools/pkg_install/files/create/Makefile.in | 2 +- pkgtools/pkg_install/files/delete/Makefile.in | 2 +- pkgtools/pkg_install/files/info/Makefile.in | 2 +- pkgtools/pkg_install/options.mk | 14 +++++++++++++- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile index 97843a3361934..9dbc8a232917b 100644 --- a/pkgtools/pkg_install/Makefile +++ b/pkgtools/pkg_install/Makefile @@ -110,7 +110,6 @@ BUILDLINK_API_DEPENDS.libarchive+= libarchive>=3.3.1 .include "../../archivers/xz/builtin.mk" .include "../../archivers/libarchive/builtin.mk" .include "../../devel/zlib/builtin.mk" -.include "../../security/openssl/builtin.mk" .include "options.mk" @@ -212,7 +211,7 @@ pre-configure: ${MAKE_PROGRAM} ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \ -f ${MAKE_FILE} depend all cd ${WRKDIR}/netpgp && \ - ${SED} -e '/zlib/d' Makefile.lib.in >Makefile.in && \ + ${SED} -e '/zlib/d' -e 's/rsa\.o//' Makefile.lib.in >Makefile.in && \ ${RM} -f bzlib.h zlib.h && \ ${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} ./configure && \ ${SETENV} ${MAKE_ENV} ${BSD_MAKE_ENV} ${MAKE_PROGRAM} \ diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in index 524a18a2d048b..57c0c8040d118 100644 --- a/pkgtools/pkg_install/files/add/Makefile.in +++ b/pkgtools/pkg_install/files/add/Makefile.in @@ -24,7 +24,7 @@ SSL_SUPPORT= @ssl_support@ .if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch .if !empty(SSL_SUPPORT) -LIBS+= -lssl -lcrypto +LIBS+= -lssl -lcrypto -lssp CPPFLAGS+= -DHAVE_SSL .endif LIBS+= @LIBS@ diff --git a/pkgtools/pkg_install/files/admin/Makefile.in b/pkgtools/pkg_install/files/admin/Makefile.in index 9c50f82aad4cf..86f2941354fa8 100644 --- a/pkgtools/pkg_install/files/admin/Makefile.in +++ b/pkgtools/pkg_install/files/admin/Makefile.in @@ -32,7 +32,7 @@ CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib .if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch .if !empty(SSL_SUPPORT) -LIBS+= -lssl -lcrypto +LIBS+= -lssl -lcrypto -lssp CPPFLAGS+= -DHAVE_SSL .endif LIBS+= @LIBS@ diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in index da87b40e251b2..8d374f021485d 100644 --- a/pkgtools/pkg_install/files/create/Makefile.in +++ b/pkgtools/pkg_install/files/create/Makefile.in @@ -30,7 +30,7 @@ OBJS= main.o perform.o pl.o util.o build.o .if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch @LIBS@ .if !empty(SSL_SUPPORT) -LIBS+= -lssl -lcrypto +LIBS+= -lssl -lcrypto -lssp .endif .else LIBS= -linstall ${STATIC_LIBARCHIVE} @LIBS@ diff --git a/pkgtools/pkg_install/files/delete/Makefile.in b/pkgtools/pkg_install/files/delete/Makefile.in index 62e1f67c5284d..ea79f4a2fcdc4 100644 --- a/pkgtools/pkg_install/files/delete/Makefile.in +++ b/pkgtools/pkg_install/files/delete/Makefile.in @@ -18,7 +18,7 @@ CCLD= $(CC) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch @LIBS@ .if !empty(SSL_SUPPORT) -LIBS+= -lssl -lcrypto +LIBS+= -lssl -lcrypto -lssp .endif CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib -DBINDIR=\"$(sbindir)\" diff --git a/pkgtools/pkg_install/files/info/Makefile.in b/pkgtools/pkg_install/files/info/Makefile.in index 7187ce8d2b210..f4013669a908a 100644 --- a/pkgtools/pkg_install/files/info/Makefile.in +++ b/pkgtools/pkg_install/files/info/Makefile.in @@ -24,7 +24,7 @@ LDFLAGS= @LDFLAGS@ -L../lib .if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch @LIBS@ .if !empty(SSL_SUPPORT) -LIBS+= -lssl -lcrypto +LIBS+= -lssl -lcrypto -lssp .endif .else LIBS= -linstall @LIBS@ diff --git a/pkgtools/pkg_install/options.mk b/pkgtools/pkg_install/options.mk index 00657934b20ea..e56eab4dff90e 100644 --- a/pkgtools/pkg_install/options.mk +++ b/pkgtools/pkg_install/options.mk @@ -21,8 +21,20 @@ MAKE_ENV+= FETCH_WITH_INET6=no .if !empty(PKG_OPTIONS:Mopenssl) CONFIGURE_ARGS+= --with-ssl MAKE_ENV+= FETCH_WITH_OPENSSL=yes -LDFLAGS+= -lssl -lcrypto +CONFIGURE_ARGS+= --with-ssl + +# Ensure that openssl is linked statically to avoid bootstrap issues. +pre-configure: static-openssl +.PHONY: static-openssl +static-openssl: +.for lib in crypto ssl +. for ext in dylib so + ${RM} -f ${BUILDLINK_DIR:U/nonexistant}/lib/lib${lib}*.${ext}* +. endfor +.endfor + ${CP} `${CC} --print-file-name=libssp.a` ${WRKSRC}/lib || ${TRUE} +BUILDLINK_DEPMETHOD.openssl= build .include "../../security/openssl/buildlink3.mk" .else LIBARCHIVE_CONFIGURE_ARGS+= --without-openssl From 986f20f0e25819f9fffa72dcd313da691e5a15bc Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 19 Oct 2017 09:39:10 +0100 Subject: [PATCH 24/92] libfetch: fix proxy connections --- net/libfetch/files/http.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/net/libfetch/files/http.c b/net/libfetch/files/http.c index d0882e27308bc..f918d15b84325 100644 --- a/net/libfetch/files/http.c +++ b/net/libfetch/files/http.c @@ -493,6 +493,16 @@ http_match(const char *str, const char *hdr) return (hdr); } +/* Remove whitespace at the end of the buffer */ +static void +http_conn_trimright(conn_t *conn) +{ + while (conn->buflen && + isspace((unsigned char)conn->buf[conn->buflen - 1])) + conn->buflen--; + conn->buf[conn->buflen] = '\0'; +} + /* * Get the next header and return the appropriate symbolic code. */ @@ -501,13 +511,20 @@ http_next_header(conn_t *conn, const char **p) { int i; - if (fetch_getln(conn) == -1) - return (hdr_syserror); - while (conn->buflen && isspace((unsigned char)conn->buf[conn->buflen - 1])) - conn->buflen--; - conn->buf[conn->buflen] = '\0'; + /* + * Have to do the stripping here because of the first line. So + * it's done twice for the subsequent lines. No big deal + */ + http_conn_trimright(conn); + if (conn->buflen == 0) return (hdr_end); + + if (fetch_getln(conn) == -1) + return (hdr_syserror); + + http_conn_trimright(conn); + /* * We could check for malformed headers but we don't really care. * A valid header starts with a token immediately followed by a @@ -774,7 +791,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached) default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { From bd3eeafb7e5cca1046d30a19f2a628cd40817c27 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 20 Dec 2017 17:28:12 +0000 Subject: [PATCH 25/92] bootstrap: Do not save compiler flags to mk.conf. We already set them explicitly in pkgbuild and besides avoiding duplicates this also allows us to change them without having to rebuild bootstrap. --- bootstrap/bootstrap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index f1a82fc803ee8..a3719a02688fe 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -1305,6 +1305,7 @@ if test -n "$XARGS"; then echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} fi +if false; then if test -n "$CFLAGS"; then echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} @@ -1319,6 +1320,7 @@ fi if test -n "$LIBS"; then echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} fi +fi # opsys specific fiddling opsys_finish From a3b120bf4174159dba0ddc584c94217e718ae9e8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 4 Apr 2018 15:21:12 +0100 Subject: [PATCH 26/92] mk: Any errors creating .pkginfo should be ignored. Resolves issues when bootstrapping without a suitable pkg_info available, as the bootstrap pkg_info is unable to operate on binary packages. Fixes joyent/pkgsrc-legacy#564 --- mk/pkgformat/pkg/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/pkgformat/pkg/package.mk b/mk/pkgformat/pkg/package.mk index b79bfd128f98c..f869ab6f65024 100644 --- a/mk/pkgformat/pkg/package.mk +++ b/mk/pkgformat/pkg/package.mk @@ -72,7 +72,7 @@ ${PKGFILE}: ${STAGE_PKGFILE} ${PKGINFOFILE}: ${PKGFILE} ${RUN} ${MKDIR} ${.TARGET:H}; \ - ${PKG_INFO} -X ${PKGFILE} >${.TARGET} + ${PKG_INFO} -X ${PKGFILE} >${.TARGET} 2>/dev/null || ${TRUE} .endif ###################################################################### From cd5b00b4fab85a3a1cc614d6b1f5c5802fa49df1 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sat, 7 Apr 2018 09:42:04 +0100 Subject: [PATCH 27/92] openssl: Remove perl runtime dependency. It is only used for c_rehash and a couple of other example tools, and users can install perl manually if they require them. It bloats too much by default for something that is used so little, if at all. --- security/openssl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/openssl/Makefile b/security/openssl/Makefile index 656944eec6138..2bf5cf536c9c3 100644 --- a/security/openssl/Makefile +++ b/security/openssl/Makefile @@ -15,7 +15,7 @@ BUILD_DEPENDS+= p5-Perl4-CoreLibs-[0-9]*:../../devel/p5-Perl4-CoreLibs USE_GCC_RUNTIME= yes -USE_TOOLS+= fgrep gmake makedepend perl:run +USE_TOOLS+= fgrep gmake makedepend perl BUILD_TARGET= depend all TEST_TARGET= tests MAKE_JOBS_SAFE= no From ee7126cf3a9187f22f03f17263b54bf6a6198776 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 21 May 2018 23:03:29 +0100 Subject: [PATCH 28/92] lang/gcc7: Apply our GCC changes. - Add ALTERNATIVES files. - Include necessary object files in the -libs package. - Prune unnecessary libraries from the -libs package. - Set local prefix to LOCALBASE (except tools build), and link against it by default. - Disable -fomit-frame-pointer, we like stack traces. - Disable --as-needed to avoid libgcc_s dependency. - Disable __stack_chk_fail_local (fixes 32-bit) - Support -fclone-functions, -fstrict-calling-conventions, -msave-args - Fix check-shlibs in -libs - Fix joyent/pkgsrc-legacy#264 (avoid tls emulation) --- lang/gcc7-libs/Makefile | 20 +- lang/gcc7/ALTERNATIVES | 20 ++ lang/gcc7/Makefile | 28 ++ lang/gcc7/distinfo | 22 +- lang/gcc7/options.mk | 2 + lang/gcc7/patches/patch-gcc_caller-save.c | 15 + lang/gcc7/patches/patch-gcc_common.opt | 29 ++ .../gcc7/patches/patch-gcc_config_i386_i386.c | 293 ++++++++++++++++++ .../gcc7/patches/patch-gcc_config_i386_i386.h | 22 ++ .../patches/patch-gcc_config_i386_i386.opt | 22 ++ lang/gcc7/patches/patch-gcc_config_sol2-c.c | 56 ++++ lang/gcc7/patches/patch-gcc_config_sol2.h | 30 ++ lang/gcc7/patches/patch-gcc_configure | 15 +- lang/gcc7/patches/patch-gcc_dojump.c | 15 + lang/gcc7/patches/patch-gcc_dwarf2out.c | 18 ++ lang/gcc7/patches/patch-gcc_ira.c | 24 ++ lang/gcc7/patches/patch-gcc_symtab.c | 17 + ...e_gcc.dg_fno-clone-preserves-unused-args.c | 34 ++ ...atch-gcc_testsuite_gcc.target_i386_local.c | 14 + ...testsuite_gcc.target_i386_msave-args-mov.c | 33 ++ ...estsuite_gcc.target_i386_msave-args-push.c | 33 ++ ...-gcc_testsuite_gcc.target_i386_strict-cc.c | 31 ++ lang/gcc7/patches/patch-gcc_tree-inline.c | 14 + lang/gcc7/patches/patch-include_dwarf2.def | 15 + lang/gcc7/patches/patch-libgcc_config.host | 2 +- 25 files changed, 816 insertions(+), 8 deletions(-) create mode 100644 lang/gcc7/ALTERNATIVES create mode 100644 lang/gcc7/patches/patch-gcc_caller-save.c create mode 100644 lang/gcc7/patches/patch-gcc_common.opt create mode 100644 lang/gcc7/patches/patch-gcc_config_i386_i386.c create mode 100644 lang/gcc7/patches/patch-gcc_config_i386_i386.h create mode 100644 lang/gcc7/patches/patch-gcc_config_i386_i386.opt create mode 100644 lang/gcc7/patches/patch-gcc_config_sol2-c.c create mode 100644 lang/gcc7/patches/patch-gcc_config_sol2.h create mode 100644 lang/gcc7/patches/patch-gcc_dojump.c create mode 100644 lang/gcc7/patches/patch-gcc_dwarf2out.c create mode 100644 lang/gcc7/patches/patch-gcc_ira.c create mode 100644 lang/gcc7/patches/patch-gcc_symtab.c create mode 100644 lang/gcc7/patches/patch-gcc_testsuite_gcc.dg_fno-clone-preserves-unused-args.c create mode 100644 lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_local.c create mode 100644 lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-mov.c create mode 100644 lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-push.c create mode 100644 lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_strict-cc.c create mode 100644 lang/gcc7/patches/patch-gcc_tree-inline.c create mode 100644 lang/gcc7/patches/patch-include_dwarf2.def diff --git a/lang/gcc7-libs/Makefile b/lang/gcc7-libs/Makefile index 45a804a84612d..f0eee995d7bc4 100644 --- a/lang/gcc7-libs/Makefile +++ b/lang/gcc7-libs/Makefile @@ -28,6 +28,9 @@ CHECK_SHLIBS= no ## Depend on exactly ${GCC7_DIST_VERSION}. BUILD_DEPENDS+= ${GCC_PKGNAME}-${GCC7_DIST_VERSION}{,nb[0-9]*}:../../lang/gcc7 +# Finds libs from gcc7 due to rpath +CHECK_SHLIBS= no + .include "../../mk/bsd.prefs.mk" LIBGCC_SUBPREFIX= ${GCC_PKGNAME} @@ -42,23 +45,34 @@ SHLIB_EXT= so .endif LIBRARY_FILES= ${WRKDIR}/lib_files +OBJECT_FILES= ${WRKDIR}/obj_files GENERATE_PLIST+= ${SED} -e 's,^,${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/,' \ - ${LIBRARY_FILES}; + -e 's,gcc/${MACHINE_GNU_PLATFORM}/${GCC7_DIST_VERSION}/,,' \ + ${LIBRARY_FILES} ${OBJECT_FILES}; GENERATE_PLIST+= ${GREP} -q 'lib/' ${LIBRARY_FILES} || \ ${ECHO} '@pkgdir ${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/lib'; ${LIBRARY_FILES}: ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC7_DIST_VERSION}*' | \ ${SED} -n -e's,^${LIBGCC_PREFIX}/,,' -e'/libexec\//d' \ - -e'/libgij/d;/libgcj/d;/libjvm/d' \ + -e'/libgij/d;/libgcj/d;/libjvm/d;/libgo\./d' \ + -e'/libcc1plugin/d;/libcp1plugin/d;' \ -e'/lib.*\.${SHLIB_EXT}/p' >${LIBRARY_FILES} -do-install: ${LIBRARY_FILES} +${OBJECT_FILES}: + ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC7_DIST_VERSION}*' | \ + ${SED} -n -e 's,^${LIBGCC_PREFIX}/,,' \ + -e '/\.o/p' -e '/libgcc\.a/p' -e '/libssp_nonshared\.a/p' >${OBJECT_FILES} + +do-install: ${LIBRARY_FILES} ${OBJECT_FILES} ${TEST} -d ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib || \ ${MKDIR} ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib cd ${LIBGCC_PREFIX} && \ ${PAX} -rw ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE} <${LIBRARY_FILES} + cd ${LIBGCC_PREFIX} && \ + ${PAX} -r -s ',gcc/${MACHINE_GNU_PLATFORM}/${GCC7_DIST_VERSION}/,,' \ + -w ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE} <${OBJECT_FILES} .include "../../mk/dlopen.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" diff --git a/lang/gcc7/ALTERNATIVES b/lang/gcc7/ALTERNATIVES new file mode 100644 index 0000000000000..44c2b65d94c28 --- /dev/null +++ b/lang/gcc7/ALTERNATIVES @@ -0,0 +1,20 @@ +bin/c++ @PREFIX@/gcc7/bin/c++ +bin/cc @PREFIX@/gcc7/bin/cc +bin/cpp @PREFIX@/gcc7/bin/cpp +bin/g++ @PREFIX@/gcc7/bin/g++ +bin/gcc @PREFIX@/gcc7/bin/gcc +bin/gcc-ar @PREFIX@/gcc7/bin/gcc-ar +bin/gcc-nm @PREFIX@/gcc7/bin/gcc-nm +bin/gcc-ranlib @PREFIX@/gcc7/bin/gcc-ranlib +bin/gcov @PREFIX@/gcc7/bin/gcov +bin/gcov-dump @PREFIX@/gcc7/bin/gcov-dump +bin/gcov-tool @PREFIX@/gcc7/bin/gcov-tool +bin/gfortran @PREFIX@/gcc7/bin/gfortran +bin/@MACHINE_GNU_PLATFORM@-c++ @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-c++ +bin/@MACHINE_GNU_PLATFORM@-g++ @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-g++ +bin/@MACHINE_GNU_PLATFORM@-gcc @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gcc +bin/@MACHINE_GNU_PLATFORM@-gcc-@GCC7_DIST_VERSION@ @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gcc-@GCC7_DIST_VERSION@ +bin/@MACHINE_GNU_PLATFORM@-gcc-ar @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gcc-ar +bin/@MACHINE_GNU_PLATFORM@-gcc-nm @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gcc-nm +bin/@MACHINE_GNU_PLATFORM@-gcc-ranlib @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gcc-ranlib +bin/@MACHINE_GNU_PLATFORM@-gfortran @PREFIX@/gcc7/bin/@MACHINE_GNU_PLATFORM@-gfortran diff --git a/lang/gcc7/Makefile b/lang/gcc7/Makefile index c7478e6a8fb68..52f6826e13f1b 100644 --- a/lang/gcc7/Makefile +++ b/lang/gcc7/Makefile @@ -40,6 +40,9 @@ CONFIGURE_ARGS+= --disable-libstdcxx-pch UNLIMIT_RESOURCES+= datasize UNLIMIT_RESOURCES+= stacksize +FILES_SUBST+= GCC7_DIST_VERSION=${GCC7_DIST_VERSION} +FILES_SUBST+= MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM} + SUBST_CLASSES+= vars SUBST_MESSAGE.vars= Setting target machine name path in ${SUBST_FILES.vars} SUBST_STAGE.vars= pre-configure @@ -48,6 +51,23 @@ SUBST_VARS.vars= MACHINE_GNU_PLATFORM .include "../../mk/bsd.prefs.mk" +# This includes some multiarch configuration but is left in the miscfix branch +# to ease merging. +SUBST_CLASSES+= rpaths +SUBST_STAGE.rpaths= pre-configure +SUBST_FILES.rpaths= gcc/config/sol2-bi.h gcc/config/sol2.h +SUBST_VARS.rpaths= PREFIX +.if !empty(MULTIARCH:M[Yy][Ee][Ss]) +SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,ARCH64_SUBDIR,g' +.else +SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,,g' +.endif +# For the tools build (i.e. when not using USE_GCC_LOCALBASE_PREFIX) we +# do not want the PREFIX rpaths added above to leak into final binaries. +.if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "no" +SUBST_SED.rpaths+= -e '/-R/d' +.endif + LANGS= c # In some cases LINKER_RPATH_FLAG needs a trailing space. @@ -95,7 +115,11 @@ CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} CONFIGURE_ARGS+= --enable-shared CONFIGURE_ARGS+= --enable-long-long +.if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "yes" +CONFIGURE_ARGS+= --with-local-prefix=${LOCALBASE:Q} +.else CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} +.endif CONFIGURE_ARGS+= --enable-threads=posix CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} # multilib on Darwin requires fat-binaries @@ -134,6 +158,8 @@ MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} # Determine whether to use binutils .if ${OPSYS} == "SunOS" +# Disable --as-needed as it pulls in libgcc_s as a dependency. +MAKE_ENV+= gcc_cv_ld_as_needed=no . if exists(/usr/sfw/bin/gobjdump) CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump . endif @@ -191,6 +217,8 @@ GENERATE_PLIST+= \ cd ${DESTDIR}${PREFIX} && \ ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT}; +CTF_FILES_SKIP+= */gengtype + .include "../../mk/dlopen.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/lang/gcc7/distinfo b/lang/gcc7/distinfo index 4590a3c79ce3b..0a18d880dca26 100644 --- a/lang/gcc7/distinfo +++ b/lang/gcc7/distinfo @@ -10,6 +10,8 @@ SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c Size (isl-0.18.tar.bz2) = 1658291 bytes SHA1 (patch-contrib_download__prerequisites) = 86c6c16e0e3e3a0bcb38579a8b4004f603fac1ca SHA1 (patch-gcc_Makefile.in) = d96a57a098e49a2c5ea6478dd5d22aba584fc1bc +SHA1 (patch-gcc_caller-save.c) = 8b667a6d3129a912339c23a6ed64b10ccca7733f +SHA1 (patch-gcc_common.opt) = b7123b7119c524da1bc310429da9fd0338e17b55 SHA1 (patch-gcc_common_config_arm_arm-common.c) = 7c973cb9554a52f4b85f8fc98708f5e5cce8e8bd SHA1 (patch-gcc_config.gcc) = 20d1444cc2c031c8adc96289e1ccc6c1d29eb72f SHA1 (patch-gcc_config_aarch64_aarch64-builtins.c) = b10ef4b9ad39e605fc4e2a0c8dffdae677842e94 @@ -21,24 +23,40 @@ SHA1 (patch-gcc_config_alpha_linux.h) = fce1256bce232143ff6c1c1b8b9c855737adb23f SHA1 (patch-gcc_config_arm_arm.h) = 92c8bff1063e153fec4454e6dea5334a42b0dad6 SHA1 (patch-gcc_config_arm_netbsd-eabi.h) = 9c1d2148e306024e8de3bdc9802fb63b976e0e7a SHA1 (patch-gcc_config_arm_netbsd-elf.h) = 80a07645fab197969b4a6f518fdc81bda7376375 +SHA1 (patch-gcc_config_i386_i386.c) = cd11cff11c217eed3601da9cd209b5cb74fd0dad +SHA1 (patch-gcc_config_i386_i386.h) = b23863a9baf6d5aa20939e0d58ca343db15c8513 +SHA1 (patch-gcc_config_i386_i386.opt) = f0e325859409bd10a6fb60a85d659a23509f2f27 SHA1 (patch-gcc_config_netbsd-elf.h) = 5a9b5ef26c03bec3cd58e2f446224aa6e94a30d5 SHA1 (patch-gcc_config_netbsd-protos.h) = 6d28864b4ccc8c1a63fe28e43601b84b63a00633 SHA1 (patch-gcc_config_netbsd.h) = 662226f4491f94b641f78b1273a9047434d75aed +SHA1 (patch-gcc_config_sol2-c.c) = 7dac7d9a4111240fbff9099d7a9bcd08c898b07d +SHA1 (patch-gcc_config_sol2.h) = ce64522b655e47218a8fbb7dbe30ed3c69b79584 SHA1 (patch-gcc_config_t-netbsd) = 802ad5706aa7ca9629f8e237f08fbb1569d28846 SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 -SHA1 (patch-gcc_configure) = 15fb7af267b79965f83bc64ce8aad1279b0ea52d +SHA1 (patch-gcc_configure) = 1b66a9ac0af5e3be39410f82b1de84f217f5c2ef +SHA1 (patch-gcc_dojump.c) = 8b6f5263e7ce251aa0a00f24cc06daf84d290eec +SHA1 (patch-gcc_dwarf2out.c) = 1cd7645095205b340305094fd31ed475fa1cc927 SHA1 (patch-gcc_ggc-common.c) = a5d2dba635859f5d680c3f80d7c30b42461c752b SHA1 (patch-gcc_ginclude_stddef.h) = 583b7931aad14058be75569b0138efad8ac74113 +SHA1 (patch-gcc_ira.c) = aa4b8d35356201f307f568238817e870a0527542 SHA1 (patch-gcc_lto_lto.c) = 825b632e2a7ff5777d4fbfdcf6f0ea3f64c4742b +SHA1 (patch-gcc_symtab.c) = a84091f6892e421081546ce3ea381e771f0041db SHA1 (patch-gcc_system.h) = 4c959a6b1c4d524cbdf44cfb80f0e5758ec20783 SHA1 (patch-gcc_targhooks.c) = 6268d548058b6325ead1115f78c2c17c6d786296 +SHA1 (patch-gcc_testsuite_gcc.dg_fno-clone-preserves-unused-args.c) = e3b58e623df14d01fdcdb7ae1978b1876cedf657 +SHA1 (patch-gcc_testsuite_gcc.target_i386_local.c) = a6f2f056cb742f8723d775746e0394b7ada02c37 +SHA1 (patch-gcc_testsuite_gcc.target_i386_msave-args-mov.c) = 1b48c98ea87a6e2370e6379e63f6f318bfe019d0 +SHA1 (patch-gcc_testsuite_gcc.target_i386_msave-args-push.c) = 65afdee3521d29cbcd9a06d602bed34a53465d7e +SHA1 (patch-gcc_testsuite_gcc.target_i386_strict-cc.c) = f99944d55366c609def436f997c24e90664ec859 +SHA1 (patch-gcc_tree-inline.c) = f646054b34b4dd953c1d372c8f42f82055b092f4 +SHA1 (patch-include_dwarf2.def) = 52e6977b842ca3257ed2ef9f7ff9d0c914a06505 SHA1 (patch-isl_configure) = 36b37778ee13c0b364fb24d5864d6a9e65b29b7d SHA1 (patch-libcilkrts_configure) = ec76313d8103e0c525ebd26e9013ee3ca9e93391 SHA1 (patch-libcilkrts_runtime_os-unix.c) = b25632587d9fbe8ff38377fe34cb16225355b521 SHA1 (patch-libdecnumber_decNumber.c) = cec90e49c829bfc6ba1ec605d2fac7daaad62762 SHA1 (patch-libffi_configure) = bcfbfe8abddc378e2de4a39ad0669583b37e0292 SHA1 (patch-libffi_testsuite_libffi.call_float2.c) = 6321dde308579448c27c2b6e1e30633699dd145f -SHA1 (patch-libgcc_config.host) = 4fa15e83a446e026507ac4f16c4f7ef686544c43 +SHA1 (patch-libgcc_config.host) = a6cc52ef4e4529d7bf77f1c7cf892a7a2d0b6e00 SHA1 (patch-libgcc_config_arm_t-netbsd) = fe986b09ccbfc253aaaca263e8e38f06da4891cc SHA1 (patch-libgcc_config_arm_t-netbsd-eabi) = 1e818e92fe79f57d305ff42ce3449dddf87c3179 SHA1 (patch-libgcc_config_i386_cpuinfo.h) = d217e3c65178c96c7314cb88c740b9586d4e8fed diff --git a/lang/gcc7/options.mk b/lang/gcc7/options.mk index c41b70a9e8e88..a18d7ce035d8b 100644 --- a/lang/gcc7/options.mk +++ b/lang/gcc7/options.mk @@ -115,7 +115,9 @@ LANGS+= fortran .if !empty(PKG_OPTIONS:Mgcc-c++) LANGS+= c++ +.if ${OPSYS} != "SunOS" CONFIGURE_ARGS+= --enable-__cxa_atexit +.endif CONFIGURE_ARGS+= --with-gxx-include-dir=${GCC_PREFIX}/include/c++/ .else CONFIGURE_ARGS+= --disable-build-with-cxx diff --git a/lang/gcc7/patches/patch-gcc_caller-save.c b/lang/gcc7/patches/patch-gcc_caller-save.c new file mode 100644 index 0000000000000..c61499cc7796d --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_caller-save.c @@ -0,0 +1,15 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/caller-save.c.orig 2017-01-01 12:07:43.905435000 +0000 ++++ gcc/caller-save.c +@@ -378,7 +378,7 @@ saved_hard_reg_compare_func (const void + const struct saved_hard_reg *p1 = *(struct saved_hard_reg * const *) v1p; + const struct saved_hard_reg *p2 = *(struct saved_hard_reg * const *) v2p; + +- if (flag_omit_frame_pointer) ++ if (0) + { + if (p1->call_freq - p2->call_freq != 0) + return p1->call_freq - p2->call_freq; diff --git a/lang/gcc7/patches/patch-gcc_common.opt b/lang/gcc7/patches/patch-gcc_common.opt new file mode 100644 index 0000000000000..18a2e34f161b5 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_common.opt @@ -0,0 +1,29 @@ +$NetBSD$ + +Support -fclone-functions and -fstrict-calling-conventions. + +--- gcc/common.opt.orig 2017-06-22 11:38:22.113724000 +0000 ++++ gcc/common.opt +@@ -1076,6 +1076,11 @@ fcode-hoisting + Common Report Var(flag_code_hoisting) Optimization + Enable code hoisting. + ++fclone-functions ++Common Report Var(flag_clone_functions) Init(1) ++Allow the compiler to clone functions to facilitate certain optimizations. ++Enabled by default. ++ + fcombine-stack-adjustments + Common Report Var(flag_combine_stack_adjustments) Optimization + Looks for opportunities to reduce stack adjustments and stack references. +@@ -2341,6 +2346,10 @@ fstrict-aliasing + Common Report Var(flag_strict_aliasing) Optimization + Assume strict aliasing rules apply. + ++fstrict-calling-conventions ++Common Report Var(flag_strict_calling_conventions) Init(1) ++Use strict ABI calling conventions even for static functions ++ + fstrict-overflow + Common Report Var(flag_strict_overflow) Optimization + Treat signed overflow as undefined. diff --git a/lang/gcc7/patches/patch-gcc_config_i386_i386.c b/lang/gcc7/patches/patch-gcc_config_i386_i386.c new file mode 100644 index 0000000000000..19470da25f82d --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_config_i386_i386.c @@ -0,0 +1,293 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. +Support -fstrict-calling-conventions and -msave-args. + +--- gcc/config/i386/i386.c.orig 2018-01-16 12:49:29.534125000 +0000 ++++ gcc/config/i386/i386.c +@@ -2572,6 +2572,9 @@ static unsigned int ix86_minimum_incomin + + static enum calling_abi ix86_function_abi (const_tree); + ++static int ix86_nsaved_args (void); ++static void pro_epilogue_adjust_stack (rtx, rtx, rtx, int, bool); ++ + + #ifndef SUBTARGET32_DEFAULT_CPU + #define SUBTARGET32_DEFAULT_CPU "i386" +@@ -5847,7 +5850,7 @@ ix86_option_override_internal (bool main + } + + /* Keep nonleaf frame pointers. */ +- if (opts->x_flag_omit_frame_pointer) ++ if (0) + opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER; + else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags)) + opts->x_flag_omit_frame_pointer = 1; +@@ -5896,6 +5899,9 @@ ix86_option_override_internal (bool main + &= ~((OPTION_MASK_ISA_BMI | OPTION_MASK_ISA_BMI2 | OPTION_MASK_ISA_TBM) + & ~opts->x_ix86_isa_flags_explicit); + ++ if (!TARGET_64BIT && TARGET_SAVE_ARGS) ++ warning (0, "-msave-args is ignored in 32-bit mode"); ++ + /* Validate -mpreferred-stack-boundary= value or default it to + PREFERRED_STACK_BOUNDARY_DEFAULT. */ + ix86_preferred_stack_boundary = PREFERRED_STACK_BOUNDARY_DEFAULT; +@@ -8015,6 +8021,7 @@ ix86_function_regparm (const_tree type, + and callee not, or vice versa. Instead look at whether the callee + is optimized or not. */ + if (target && opt_for_fn (target->decl, optimize) ++ && !flag_strict_calling_conventions + && !(profile_flag && !flag_fentry)) + { + cgraph_local_info *i = &target->local; +@@ -8112,6 +8119,7 @@ ix86_function_sseregparm (const_tree typ + /* TARGET_SSE_MATH */ + && (target_opts_for_fn (target->decl)->x_ix86_fpmath & FPMATH_SSE) + && opt_for_fn (target->decl, optimize) ++ && !flag_strict_calling_conventions + && !(profile_flag && !flag_fentry)) + { + cgraph_local_info *i = &target->local; +@@ -11964,7 +11972,7 @@ ix86_can_use_return_insn_p (void) + ix86_compute_frame_layout (); + struct ix86_frame &frame = cfun->machine->frame; + return (frame.stack_pointer_offset == UNITS_PER_WORD +- && (frame.nregs + frame.nsseregs) == 0); ++ && (frame.nmsave_args + frame.nregs + frame.nsseregs) == 0); + } + + /* Value should be nonzero if functions must have frame pointers. +@@ -11988,6 +11996,9 @@ ix86_frame_pointer_required (void) + if (TARGET_32BIT_MS_ABI && cfun->calls_setjmp) + return true; + ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) ++ return true; ++ + /* Win64 SEH, very large frames need a frame-pointer as maximum stack + allocation is 4GB. */ + if (TARGET_64BIT_MS_ABI && get_frame_size () > SEH_MAX_FRAME_SIZE) +@@ -12781,6 +12792,7 @@ ix86_compute_frame_layout (void) + + frame->nregs = ix86_nsaved_regs (); + frame->nsseregs = ix86_nsaved_sseregs (); ++ frame->nmsave_args = ix86_nsaved_args (); + + /* 64-bit MS ABI seem to require stack alignment to be always 16, + except for function prologues, leaf functions and when the defult +@@ -12843,7 +12855,8 @@ ix86_compute_frame_layout (void) + } + + frame->save_regs_using_mov +- = (TARGET_PROLOGUE_USING_MOVE && cfun->machine->use_fast_prologue_epilogue ++ = ((TARGET_FORCE_SAVE_REGS_USING_MOV || ++ (TARGET_PROLOGUE_USING_MOVE && cfun->machine->use_fast_prologue_epilogue)) + /* If static stack checking is enabled and done with probes, + the registers need to be saved before allocating the frame. */ + && flag_stack_check != STATIC_BUILTIN_STACK_CHECK); +@@ -12863,6 +12876,13 @@ ix86_compute_frame_layout (void) + /* The traditional frame pointer location is at the top of the frame. */ + frame->hard_frame_pointer_offset = offset; + ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) ++ { ++ offset += frame->nmsave_args * UNITS_PER_WORD; ++ offset += (frame->nmsave_args % 2) * UNITS_PER_WORD; ++ } ++ frame->arg_save_offset = offset; ++ + /* Register save area */ + offset += frame->nregs * UNITS_PER_WORD; + frame->reg_save_offset = offset; +@@ -12945,7 +12965,7 @@ ix86_compute_frame_layout (void) + /* Size prologue needs to allocate. */ + to_allocate = offset - frame->sse_reg_save_offset; + +- if ((!to_allocate && frame->nregs <= 1) ++ if ((!TARGET_SAVE_ARGS && !to_allocate && frame->nregs <= 1) + || (TARGET_64BIT && to_allocate >= HOST_WIDE_INT_C (0x80000000))) + frame->save_regs_using_mov = false; + +@@ -12957,7 +12977,11 @@ ix86_compute_frame_layout (void) + { + frame->red_zone_size = to_allocate; + if (frame->save_regs_using_mov) +- frame->red_zone_size += frame->nregs * UNITS_PER_WORD; ++ { ++ frame->red_zone_size += frame->nregs * UNITS_PER_WORD; ++ frame->red_zone_size += frame->nmsave_args * UNITS_PER_WORD; ++ frame->red_zone_size += (frame->nmsave_args % 2) * UNITS_PER_WORD; ++ } + if (frame->red_zone_size > RED_ZONE_SIZE - RED_ZONE_RESERVE) + frame->red_zone_size = RED_ZONE_SIZE - RED_ZONE_RESERVE; + } +@@ -12988,6 +13012,20 @@ ix86_compute_frame_layout (void) + frame->hard_frame_pointer_offset = frame->stack_pointer_offset - 128; + } + } ++ if (getenv("DEBUG_FRAME_STUFF") != NULL) ++ { ++ printf("nmsave_args: %d\n", frame->nmsave_args); ++ printf("nsseregs: %d\n", frame->nsseregs); ++ printf("nregs: %d\n", frame->nregs); ++ ++ printf("frame_pointer_offset: %llx\n", frame->frame_pointer_offset); ++ printf("hard_frame_pointer_offset: %llx\n", frame->hard_frame_pointer_offset); ++ printf("stack_pointer_offset: %llx\n", frame->stack_pointer_offset); ++ printf("hfp_save_offset: %llx\n", frame->hfp_save_offset); ++ printf("arg_save_offset: %llx\n", frame->arg_save_offset); ++ printf("reg_save_offset: %llx\n", frame->reg_save_offset); ++ printf("sse_reg_save_offset: %llx\n", frame->sse_reg_save_offset); ++ } + } + + /* This is semi-inlined memory_address_length, but simplified +@@ -13096,6 +13134,23 @@ ix86_emit_save_regs (void) + unsigned int regno; + rtx_insn *insn; + ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) ++ { ++ int i; ++ int nsaved = ix86_nsaved_args (); ++ int start = cfun->returns_struct; ++ ++ for (i = start; i < start + nsaved; i++) ++ { ++ regno = x86_64_int_parameter_registers[i]; ++ insn = emit_insn (gen_push (gen_rtx_REG (word_mode, regno))); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ if (nsaved % 2 != 0) ++ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, ++ GEN_INT (-UNITS_PER_WORD), -1, false); ++ } ++ + for (regno = FIRST_PSEUDO_REGISTER - 1; regno-- > 0; ) + if (GENERAL_REGNO_P (regno) && ix86_save_reg (regno, true)) + { +@@ -13174,9 +13229,30 @@ ix86_emit_save_reg_using_mov (machine_mo + /* Emit code to save registers using MOV insns. + First register is stored at CFA - CFA_OFFSET. */ + static void +-ix86_emit_save_regs_using_mov (HOST_WIDE_INT cfa_offset) ++ix86_emit_save_regs_using_mov (const struct ix86_frame *frame) + { + unsigned int regno; ++ HOST_WIDE_INT cfa_offset = frame->arg_save_offset; ++ ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) ++ { ++ int i; ++ int nsaved = ix86_nsaved_args (); ++ int start = cfun->returns_struct; ++ ++ /* We deal with this twice? */ ++ if (nsaved % 2 != 0) ++ cfa_offset -= UNITS_PER_WORD; ++ ++ for (i = start + nsaved - 1; i >= start; i--) ++ { ++ regno = x86_64_int_parameter_registers[i]; ++ ix86_emit_save_reg_using_mov(word_mode, regno, cfa_offset); ++ cfa_offset -= UNITS_PER_WORD; ++ } ++ } ++ ++ cfa_offset = frame->reg_save_offset; + + for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) + if (GENERAL_REGNO_P (regno) && ix86_save_reg (regno, true)) +@@ -13960,7 +14036,7 @@ ix86_finalize_stack_realign_flags (void) + if (stack_realign + && frame_pointer_needed + && crtl->is_leaf +- && flag_omit_frame_pointer ++ && 0 + && crtl->sp_is_unchanging + && !ix86_current_function_calls_tls_descriptor + && !crtl->accesses_prior_frames +@@ -14235,7 +14311,7 @@ ix86_expand_prologue (void) + } + } + +- int_registers_saved = (frame.nregs == 0); ++ int_registers_saved = (frame.nregs == 0 && frame.nmsave_args == 0); + sse_registers_saved = (frame.nsseregs == 0); + + if (frame_pointer_needed && !m->fs.fp_valid) +@@ -14286,7 +14362,7 @@ ix86_expand_prologue (void) + && (! TARGET_STACK_PROBE + || frame.stack_pointer_offset < CHECK_STACK_LIMIT)) + { +- ix86_emit_save_regs_using_mov (frame.reg_save_offset); ++ ix86_emit_save_regs_using_mov (&frame); + int_registers_saved = true; + } + } +@@ -14529,7 +14605,7 @@ ix86_expand_prologue (void) + } + + if (!int_registers_saved) +- ix86_emit_save_regs_using_mov (frame.reg_save_offset); ++ ix86_emit_save_regs_using_mov (&frame); + if (!sse_registers_saved) + ix86_emit_save_sse_regs_using_mov (frame.sse_reg_save_offset); + +@@ -14968,6 +15044,35 @@ ix86_expand_epilogue (int style) + ix86_emit_restore_regs_using_pop (); + } + ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) { ++ /* ++ * For each saved argument, emit a restore note, to make sure it happens ++ * correctly within the shrink wrapping (I think). ++ * ++ * Note that 'restore' in this case merely means the rule is the same as ++ * it was on function entry, not that we have actually done a register ++ * restore (which of course, we haven't). ++ * ++ * If we do not do this, the DWARF code will emit sufficient restores to ++ * provide balance on its own initiative, which in the presence of ++ * -fshrink-wrap may actually _introduce_ unbalance (whereby we only ++ * .cfi_offset a register sometimes, but will always .cfi_restore it. ++ * This will trip an assert.) ++ */ ++ int start = cfun->returns_struct; ++ int nsaved = ix86_nsaved_args(); ++ int i; ++ ++ for (i = start + nsaved - 1; i >= start; i--) ++ queued_cfa_restores ++ = alloc_reg_note (REG_CFA_RESTORE, ++ gen_rtx_REG(Pmode, ++ x86_64_int_parameter_registers[i]), ++ queued_cfa_restores); ++ ++ gcc_assert(m->fs.fp_valid); ++ } ++ + /* If we used a stack pointer and haven't already got rid of it, + then do so now. */ + if (m->fs.fp_valid) +@@ -15979,6 +16084,18 @@ ix86_cannot_force_const_mem (machine_mod + return !ix86_legitimate_constant_p (mode, x); + } + ++/* Return number of arguments to be saved on the stack with ++ -msave-args. */ ++ ++static int ++ix86_nsaved_args (void) ++{ ++ if (TARGET_64BIT && TARGET_SAVE_ARGS) ++ return crtl->args.info.regno - cfun->returns_struct; ++ else ++ return 0; ++} ++ + /* Nonzero if the symbol is marked as dllimport, or as stub-variable, + otherwise zero. */ + diff --git a/lang/gcc7/patches/patch-gcc_config_i386_i386.h b/lang/gcc7/patches/patch-gcc_config_i386_i386.h new file mode 100644 index 0000000000000..6328a3aafd31f --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_config_i386_i386.h @@ -0,0 +1,22 @@ +$NetBSD$ + +Support -msave-args. + +--- gcc/config/i386/i386.h.orig 2018-01-16 11:10:44.253204000 +0000 ++++ gcc/config/i386/i386.h +@@ -2480,6 +2480,7 @@ enum avx_u128_state + */ + struct GTY(()) ix86_frame + { ++ int nmsave_args; + int nsseregs; + int nregs; + int va_arg_size; +@@ -2491,6 +2492,7 @@ struct GTY(()) ix86_frame + HOST_WIDE_INT hard_frame_pointer_offset; + HOST_WIDE_INT stack_pointer_offset; + HOST_WIDE_INT hfp_save_offset; ++ HOST_WIDE_INT arg_save_offset; + HOST_WIDE_INT reg_save_offset; + HOST_WIDE_INT sse_reg_save_offset; + diff --git a/lang/gcc7/patches/patch-gcc_config_i386_i386.opt b/lang/gcc7/patches/patch-gcc_config_i386_i386.opt new file mode 100644 index 0000000000000..16aa2178adab3 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_config_i386_i386.opt @@ -0,0 +1,22 @@ +$NetBSD$ + +Support -msave-args. + +--- gcc/config/i386/i386.opt.orig 2018-01-16 11:17:49.509247000 +0000 ++++ gcc/config/i386/i386.opt +@@ -505,6 +505,15 @@ mtls-direct-seg-refs + Target Report Mask(TLS_DIRECT_SEG_REFS) + Use direct references against %gs when accessing tls data. + ++msave-args ++Target Report Mask(SAVE_ARGS) ++Save integer arguments on the stack at function entry ++ ++mforce-save-regs-using-mov ++Target Report Mask(FORCE_SAVE_REGS_USING_MOV) ++Save registers using push in function prologues. This is intentionally ++undocumented and used for msave-args testing. ++ + mtune= + Target RejectNegative Joined Var(ix86_tune_string) + Schedule code for given CPU. diff --git a/lang/gcc7/patches/patch-gcc_config_sol2-c.c b/lang/gcc7/patches/patch-gcc_config_sol2-c.c new file mode 100644 index 0000000000000..a9fd6b0ff4ee1 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_config_sol2-c.c @@ -0,0 +1,56 @@ +$NetBSD$ + +Update cmn_err format specifier. + +--- gcc/config/sol2-c.c.orig 2017-01-01 12:07:43.905435000 +0000 ++++ gcc/config/sol2-c.c +@@ -40,7 +40,10 @@ static const format_length_info cmn_err_ + + static const format_flag_spec cmn_err_flag_specs[] = + { ++ { '0', 0, 0, N_("'0' flag"), N_("the '0' flag"), STD_C89 }, ++ { '-', 0, 0, N_("'-' flag"), N_("the '-' flag"), STD_C89 }, + { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, ++ { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, + { 0, 0, 0, NULL, NULL, STD_C89 } + }; +@@ -48,6 +51,7 @@ static const format_flag_spec cmn_err_fl + + static const format_flag_pair cmn_err_flag_pairs[] = + { ++ { '0', '-', 1, 0 }, + { 0, 0, 0, 0 } + }; + +@@ -57,21 +61,21 @@ static const format_char_info bitfield_s + static const format_char_info cmn_err_char_table[] = + { + /* C89 conversion specifiers. */ +- { "dD", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, +- { "oOxX",0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, +- { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, +- { "c", 0, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, +- { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "c", NULL }, +- { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "cR", NULL }, +- { "b", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", &bitfield_string_type }, ++ { "dD", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL }, ++ { "oOxX",0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL }, ++ { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL }, ++ { "c", 0, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, ++ { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c", NULL }, ++ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL }, ++ { "b", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w0", "", &bitfield_string_type }, + { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } + }; + + EXPORTED_CONST format_kind_info solaris_format_types[] = { +- { "cmn_err", cmn_err_length_specs, cmn_err_char_table, "", NULL, ++ { "cmn_err", cmn_err_length_specs, cmn_err_char_table, "0-", NULL, + cmn_err_flag_specs, cmn_err_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, +- 'w', 0, 0, 0, 'L', 0, ++ 'w', 0, 'p', 0, 'L', 0, + &integer_type_node, &integer_type_node + } + }; diff --git a/lang/gcc7/patches/patch-gcc_config_sol2.h b/lang/gcc7/patches/patch-gcc_config_sol2.h new file mode 100644 index 0000000000000..37c45ef7c9e17 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_config_sol2.h @@ -0,0 +1,30 @@ +$NetBSD$ + +Pull in ${PREFIX}/lib by default and handle for multiarch. + +--- gcc/config/sol2.h.orig 2017-11-21 09:31:12.000000000 +0000 ++++ gcc/config/sol2.h +@@ -241,8 +241,9 @@ along with GCC; see the file COPYING3. + "%{G:-G} \ + %{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \ +- %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}" ++ -R@PREFIX@/lib \ ++ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp:%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ ++ %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib:%R@PREFIX@/lib}}}" + + #undef LINK_ARCH32_SPEC + #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE +@@ -254,8 +255,9 @@ along with GCC; see the file COPYING3. + "%{G:-G} \ + %{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \ +- %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}" ++ -R@PREFIX@/lib/" @MARCH64_SUBDIR@ " \ ++ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ ++ %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "}}}" + + #undef LINK_ARCH64_SPEC + #ifndef USE_GLD diff --git a/lang/gcc7/patches/patch-gcc_configure b/lang/gcc7/patches/patch-gcc_configure index 4d1ded0e9b77a..d28e259b08fe7 100644 --- a/lang/gcc7/patches/patch-gcc_configure +++ b/lang/gcc7/patches/patch-gcc_configure @@ -1,8 +1,19 @@ $NetBSD: patch-gcc_configure,v 1.1 2017/05/03 00:21:03 maya Exp $ ---- gcc/configure.orig 2015-09-30 23:06:11.000000000 +0000 +Fix detection of native TLS on SunOS, joyent/pkgsrc#264 + +--- gcc/configure.orig 2017-11-21 09:31:12.135035000 +0000 +++ gcc/configure -@@ -28321,7 +28321,7 @@ case "$target" in +@@ -23957,7 +23958,7 @@ $as_echo "#define TLS_SECTION_ASM_FLAG ' + tls_first_major=2 + tls_first_minor=14 + tls_section_flag=T +- tls_as_opt="--fatal-warnings" ++ tls_as_opt="-32 --fatal-warnings" + fi + case "$target" in + i[34567]86-*-*) +@@ -29111,7 +29114,7 @@ case "$target" in gcc_cv_target_dl_iterate_phdr=no fi ;; diff --git a/lang/gcc7/patches/patch-gcc_dojump.c b/lang/gcc7/patches/patch-gcc_dojump.c new file mode 100644 index 0000000000000..dfa43523ead6a --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_dojump.c @@ -0,0 +1,15 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/dojump.c.orig 2017-01-01 12:07:43.905435000 +0000 ++++ gcc/dojump.c +@@ -82,7 +82,7 @@ void + clear_pending_stack_adjust (void) + { + if (optimize > 0 +- && (! flag_omit_frame_pointer || cfun->calls_alloca) ++ && (! 0 || cfun->calls_alloca) + && EXIT_IGNORE_STACK) + discard_pending_stack_adjust (); + } diff --git a/lang/gcc7/patches/patch-gcc_dwarf2out.c b/lang/gcc7/patches/patch-gcc_dwarf2out.c new file mode 100644 index 0000000000000..2c05799f944c3 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_dwarf2out.c @@ -0,0 +1,18 @@ +$NetBSD$ + +Support -msave-args. + +--- gcc/dwarf2out.c.orig 2017-11-15 11:54:11.986064000 +0000 ++++ gcc/dwarf2out.c +@@ -22432,6 +22432,11 @@ gen_subprogram_die (tree decl, dw_die_re + /* Add the calling convention attribute if requested. */ + add_calling_convention_attribute (subr_die, decl); + ++#ifdef TARGET_SAVE_ARGS ++ if (TARGET_SAVE_ARGS) ++ add_AT_flag (subr_die, DW_AT_SUN_amd64_parmdump, 1); ++#endif ++ + /* Output Dwarf info for all of the stuff within the body of the function + (if it has one - it may be just a declaration). + diff --git a/lang/gcc7/patches/patch-gcc_ira.c b/lang/gcc7/patches/patch-gcc_ira.c new file mode 100644 index 0000000000000..7ef3f90e12585 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_ira.c @@ -0,0 +1,24 @@ +$NetBSD$ + +Disable -fomit-frame-pointer. + +--- gcc/ira.c.orig 2017-10-18 21:13:16.833810000 +0000 ++++ gcc/ira.c +@@ -1720,7 +1720,7 @@ ira_init (void) + { + this_target_ira_int->free_register_move_costs (); + setup_reg_mode_hard_regset (); +- setup_alloc_regs (flag_omit_frame_pointer != 0); ++ setup_alloc_regs (0 != 0); + setup_class_subset_and_memory_move_costs (); + setup_reg_class_nregs (); + setup_prohibited_class_mode_regs (); +@@ -2275,7 +2275,7 @@ ira_setup_eliminable_regset (void) + case. At some point, we should improve this by emitting the + sp-adjusting insns for this case. */ + frame_pointer_needed +- = (! flag_omit_frame_pointer ++ = (! 0 + || (cfun->calls_alloca && EXIT_IGNORE_STACK) + /* We need the frame pointer to catch stack overflow exceptions if + the stack pointer is moving (as for the alloca case just above). */ diff --git a/lang/gcc7/patches/patch-gcc_symtab.c b/lang/gcc7/patches/patch-gcc_symtab.c new file mode 100644 index 0000000000000..9635f4fe1b596 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_symtab.c @@ -0,0 +1,17 @@ +$NetBSD$ + +Support -fclone-functions. + +--- gcc/symtab.c.orig 2017-04-28 11:42:14.556427000 +0000 ++++ gcc/symtab.c +@@ -1744,6 +1744,10 @@ symtab_node::noninterposable_alias (void + tree new_decl; + symtab_node *new_node = NULL; + ++ /* Do not allow a clone to be created if function-cloning is disabled */ ++ if (!flag_clone_functions) ++ return NULL; ++ + /* First try to look up existing alias or base object + (if that is already non-overwritable). */ + symtab_node *node = ultimate_alias_target (); diff --git a/lang/gcc7/patches/patch-gcc_testsuite_gcc.dg_fno-clone-preserves-unused-args.c b/lang/gcc7/patches/patch-gcc_testsuite_gcc.dg_fno-clone-preserves-unused-args.c new file mode 100644 index 0000000000000..c9d2190ee5da5 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_testsuite_gcc.dg_fno-clone-preserves-unused-args.c @@ -0,0 +1,34 @@ +$NetBSD$ + +Test -fclone-functions. + +--- /dev/null 2018-05-21 12:23:16.000000000 +0000 ++++ gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c 2018-05-21 12:14:37.563084208 +0000 +@@ -0,0 +1,27 @@ ++/* { dg-do compile { target { ilp32 } } } */ ++/* { dg-options "-O2 -funit-at-a-time -fipa-sra -fno-clone-functions" } */ ++/* { dg-final { scan-assembler "pushl.*\\\$1" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$2" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$3" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$4" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$5" } } */ ++ ++#include ++ ++/* ++ * Verify that preventing function cloning prevents constant prop/scalar ++ * reduction removing parameters ++ */ ++static void ++t(int, int, int, int, int) __attribute__ ((noinline)); ++ ++int void() ++{ ++ t(1, 2, 3, 4, 5); ++} ++ ++/* Only use 3 params, bait constprop/sra into deleting the other two */ ++static void(int a, int b, int c, int d, int e) ++{ ++ printf("%d %d\n", a, b, c); ++} diff --git a/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_local.c b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_local.c new file mode 100644 index 0000000000000..67dce519ea2e4 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_local.c @@ -0,0 +1,14 @@ +$NetBSD$ + +Test -fstrict-calling-conventions. + +--- gcc/testsuite/gcc.target/i386/local.c.orig 2015-12-29 10:32:21.184118000 +0000 ++++ gcc/testsuite/gcc.target/i386/local.c +@@ -1,5 +1,6 @@ + /* { dg-do compile } */ +-/* { dg-options "-O2 -funit-at-a-time" } */ ++/* { dg-options "-O2 -funit-at-a-time -fno-strict-calling-conventions" { target ia32 } } */ ++/* { dg-options "-O2 -funit-at-a-time" { target lp64 } } */ + /* { dg-final { scan-assembler "magic\[^\\n\]*eax" { target ia32 } } } */ + /* { dg-final { scan-assembler "magic\[^\\n\]*(edi|ecx)" { target { ! ia32 } } } } */ + diff --git a/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-mov.c b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-mov.c new file mode 100644 index 0000000000000..bfd20a89906cc --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-mov.c @@ -0,0 +1,33 @@ +$NetBSD$ + +Test -msave-args. + +--- /dev/null 2018-05-21 12:23:16.000000000 +0000 ++++ gcc/testsuite/gcc.target/i386/msave-args-mov.c 2018-05-21 12:31:14.365772073 +0000 +@@ -0,0 +1,26 @@ ++/* { dg-do run { target { { i?86-*-solaris2.* } && lp64 } } } */ ++/* { dg-options "-msave-args -mforce-save-regs-using-mov -save-temps" } */ ++ ++#include ++ ++void t(int, int, int, int, int) __attribute__ ((noinline)); ++ ++int ++main(int argc, char **argv) ++{ ++ t(1, 2, 3, 4, 5); ++ return (0); ++} ++ ++void ++t(int a, int b, int c, int d, int e) ++{ ++ printf("%d %d %d %d %d", a, b, c, d, e); ++} ++ ++/* { dg-final { scan-assembler "movq\t%rdi, -8\\(%rbp\\)" } } */ ++/* { dg-final { scan-assembler "movq\t%rsi, -16\\(%rbp\\)" } } */ ++/* { dg-final { scan-assembler "movq\t%rdx, -24\\(%rbp\\)" } } */ ++/* { dg-final { scan-assembler "movq\t%rcx, -32\\(%rbp\\)" } } */ ++/* { dg-final { scan-assembler "movq\t%r8, -40\\(%rbp\\)" } } */ ++/* { dg-final { cleanup-saved-temps } } */ diff --git a/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-push.c b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-push.c new file mode 100644 index 0000000000000..a4cd80d3cfdf6 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_msave-args-push.c @@ -0,0 +1,33 @@ +$NetBSD$ + +Test -msave-args. + +--- /dev/null 2018-05-21 12:23:16.000000000 +0000 ++++ gcc/testsuite/gcc.target/i386/msave-args-push.c 2018-05-21 12:31:39.048591314 +0000 +@@ -0,0 +1,26 @@ ++/* { dg-do run { target { { i?86-*-solaris2.* } && lp64 } } } */ ++/* { dg-options "-msave-args -save-temps " } */ ++ ++#include ++ ++void t(int, int, int, int, int) __attribute__ ((noinline)); ++ ++int ++main(int argc, char **argv) ++{ ++ t(1, 2, 3, 4, 5); ++ return (0); ++} ++ ++void ++t(int a, int b, int c, int d, int e) ++{ ++ printf("%d %d %d %d %d", a, b, c, d, e); ++} ++ ++/* { dg-final { scan-assembler "pushq\t%rdi" } } */ ++/* { dg-final { scan-assembler "pushq\t%rsi" } } */ ++/* { dg-final { scan-assembler "pushq\t%rdx" } } */ ++/* { dg-final { scan-assembler "pushq\t%rcx" } } */ ++/* { dg-final { scan-assembler "pushq\t%r8" } } */ ++/* { dg-final { cleanup-saved-temps } } */ diff --git a/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_strict-cc.c b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_strict-cc.c new file mode 100644 index 0000000000000..1c721430ed580 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_testsuite_gcc.target_i386_strict-cc.c @@ -0,0 +1,31 @@ +$NetBSD$ + +Test -fstrict-calling-conventions. + +--- /dev/null 2018-05-21 12:23:16.000000000 +0000 ++++ gcc/testsuite/gcc.target/i386/strict-cc.c 2018-05-21 12:11:48.087972286 +0000 +@@ -0,0 +1,24 @@ ++/* { dg-do compile { target { ilp32 } } } */ ++/* { dg-options "-O2 -funit-at-a-time -fstrict-calling-conventions" } */ ++/* { dg-final { scan-assembler "pushl.*\\\$1" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$2" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$3" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$4" } } */ ++/* { dg-final { scan-assembler "pushl.*\\\$5" } } */ ++ ++#include ++ ++/* Verify that local calling convention is not used if strict conventions. */ ++static int t(int, int, int, int, int) __attribute__ ((noinline)); ++ ++int ++m() ++{ ++ t(1, 2, 3, 4, 5); ++} ++ ++static int ++t(int a, int b, int c, int d, int e) ++{ ++ printf("%d\n", a, b, c, d, e); ++} diff --git a/lang/gcc7/patches/patch-gcc_tree-inline.c b/lang/gcc7/patches/patch-gcc_tree-inline.c new file mode 100644 index 0000000000000..fa34b1489d228 --- /dev/null +++ b/lang/gcc7/patches/patch-gcc_tree-inline.c @@ -0,0 +1,14 @@ +$NetBSD$ + +Support -fclone-functions. + +--- gcc/tree-inline.c.orig 2017-10-27 20:33:35.593168000 +0000 ++++ gcc/tree-inline.c +@@ -5714,6 +5714,7 @@ bool + tree_versionable_function_p (tree fndecl) + { + return (!lookup_attribute ("noclone", DECL_ATTRIBUTES (fndecl)) ++ && flag_clone_functions + && copy_forbidden (DECL_STRUCT_FUNCTION (fndecl)) == NULL); + } + diff --git a/lang/gcc7/patches/patch-include_dwarf2.def b/lang/gcc7/patches/patch-include_dwarf2.def new file mode 100644 index 0000000000000..c6178a7cd2dc4 --- /dev/null +++ b/lang/gcc7/patches/patch-include_dwarf2.def @@ -0,0 +1,15 @@ +$NetBSD$ + +Support -msave-args. + +--- include/dwarf2.def.orig 2017-02-25 08:18:24.431993000 +0000 ++++ include/dwarf2.def +@@ -457,6 +457,8 @@ DW_TAG (DW_AT_GNU_denominator, 0x2304) + /* Biased integer extension. + See https://gcc.gnu.org/wiki/DW_AT_GNU_bias . */ + DW_TAG (DW_AT_GNU_bias, 0x2305) ++/* Sun extension. */ ++DW_AT (DW_AT_SUN_amd64_parmdump, 0x2224) + /* UPC extension. */ + DW_AT (DW_AT_upc_threads_scaled, 0x3210) + /* PGI (STMicroelectronics) extensions. */ diff --git a/lang/gcc7/patches/patch-libgcc_config.host b/lang/gcc7/patches/patch-libgcc_config.host index 1f9b281367a5b..7aaeb44cdc514 100644 --- a/lang/gcc7/patches/patch-libgcc_config.host +++ b/lang/gcc7/patches/patch-libgcc_config.host @@ -19,7 +19,7 @@ arm64 support aarch64*-*-linux*) extra_parts="$extra_parts crtfastmath.o" md_unwind_header=aarch64/linux-unwind.h -@@ -396,7 +402,16 @@ +@@ -396,7 +396,16 @@ arm*-*-freebsd*) # ARM Fr tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" ;; arm*-*-netbsdelf*) From 2ce469e8cec444b4cbafcd7f1be3ed948dc75732 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 20 Dec 2017 16:20:01 +0000 Subject: [PATCH 29/92] mk: Enable CTF logging (Joyent specific) --- mk/install/install.mk | 19 ++++++++++++++++++- mk/pkgformat/pkg/package.mk | 24 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/mk/install/install.mk b/mk/install/install.mk index a1c5590587c59..ec373b261d94c 100644 --- a/mk/install/install.mk +++ b/mk/install/install.mk @@ -347,20 +347,37 @@ post-install: .PHONY: install-ctf install-ctf: plist @${STEP_MSG} "Generating CTF data" + @${RM} -f ${WRKDIR}/.ctfdata ${WRKDIR}/.ctffail ${WRKDIR}/.ctfnox ${RUN}cd ${DESTDIR:Q}${PREFIX:Q}; \ ${CAT} ${_PLIST_NOKEYWORDS} | while read f; do \ [ ! -h "$${f}" ] || continue; \ + /bin/file -b "$${f}" | grep ^ELF >/dev/null || continue; \ + if /bin/elfdump "$${f}" | grep SUNW_ctf >/dev/null; then \ + continue; \ + fi; \ case "$${f}" in \ ${CTF_FILES_SKIP:@p@${p}) continue ;;@} \ *) ;; \ esac; \ tmp_f="$${f}.XXX"; \ - if ${CTFCONVERT} -o "$${tmp_f}" "$${f}" 2>/dev/null; then \ + if err=`${CTFCONVERT} -o "$${tmp_f}" "$${f}" 2>&1`; then \ if [ -f "$${tmp_f}" -a -f "$${f}" ]; then \ ${MV} "$${tmp_f}" "$${f}"; \ fi; \ fi; \ ${RM} -f "$${tmp_f}"; \ + if /bin/elfdump "$${f}" | grep SUNW_ctf >/dev/null; then \ + ${ECHO} $${f} \ + | ${SED} -e 's|^${DESTDIR}||' \ + >>${WRKDIR}/.ctfdata; \ + [ -x "$${f}" ] || ${ECHO} $${f} \ + | ${SED} -e 's|^${DESTDIR}||' \ + >>${WRKDIR}/.ctfnox; \ + else \ + ${ECHO} "$${f}: $${err}" \ + | ${SED} -e 's|^${DESTDIR}||' \ + >>${WRKDIR}/.ctffail; \ + fi; \ done ###################################################################### diff --git a/mk/pkgformat/pkg/package.mk b/mk/pkgformat/pkg/package.mk index 999b8c2e99cea..3f3613be140a6 100644 --- a/mk/pkgformat/pkg/package.mk +++ b/mk/pkgformat/pkg/package.mk @@ -60,6 +60,30 @@ ${STAGE_PKGFILE}: ${_CONTENTS_TARGETS} ${RUN} tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \ ${MV} -f "$$tmpname" ${.TARGET} .endif + @${RUN}${MKDIR} ${PACKAGES}/ctfdata 2>/dev/null || ${TRUE}; \ + ${RM} -f ${PACKAGES}/ctfdata/${PKGNAME}; \ + if [ -f ${WRKDIR}/.ctfdata -a -d ${PACKAGES}/ctfdata ]; then \ + ${STEP_MSG} "Copying CTF data"; \ + ${MKDIR} ${PACKAGES}/ctfdata; \ + ${MV} ${WRKDIR}/.ctfdata \ + ${PACKAGES}/ctfdata/${PKGNAME}; \ + fi; \ + ${MKDIR} ${PACKAGES}/ctffail 2>/dev/null || ${TRUE}; \ + ${RM} -f ${PACKAGES}/ctffail/${PKGNAME}; \ + if [ -f ${WRKDIR}/.ctffail -a -d ${PACKAGES}/ctffail ]; then \ + ${STEP_MSG} "Copying CTF failures"; \ + ${MKDIR} ${PACKAGES}/ctffail; \ + ${MV} ${WRKDIR}/.ctffail \ + ${PACKAGES}/ctffail/${PKGNAME}; \ + fi; \ + ${MKDIR} ${PACKAGES}/ctfnox 2>/dev/null || ${TRUE}; \ + ${RM} -f ${PACKAGES}/ctfnox/${PKGNAME}; \ + if [ -f ${WRKDIR}/.ctfnox -a -d ${PACKAGES}/ctfnox ]; then \ + ${STEP_MSG} "Copying CTF non-executables"; \ + ${MKDIR} ${PACKAGES}/ctfnox; \ + ${MV} ${WRKDIR}/.ctfnox \ + ${PACKAGES}/ctfnox/${PKGNAME}; \ + fi .if ${PKGFILE} != ${STAGE_PKGFILE} ${PKGFILE}: ${STAGE_PKGFILE} From 0e10902b8e36c8159eeb5c590abe945b3ae5dab8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 14:01:21 +0100 Subject: [PATCH 30/92] Ignore files under PKGBUILD_BASEDIR for scanning. These update a lot but not in a way that will affect the scan results, and if that is the case then we remove old bulklogs anyway. --- mk/pbulk/pbulk-index.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/pbulk/pbulk-index.mk b/mk/pbulk/pbulk-index.mk index 6288fd53c4139..4d14bd5127a0d 100644 --- a/mk/pbulk/pbulk-index.mk +++ b/mk/pbulk/pbulk-index.mk @@ -117,7 +117,7 @@ pbulk-index-item: @echo "USE_DESTDIR="${_USE_DESTDIR:Q} @echo "BOOTSTRAP_PKG="${BOOTSTRAP_PKG} @echo "USERGROUP_PHASE="${USERGROUP_PHASE:Q} - @echo "SCAN_DEPENDS="${_PBULK_SCAN_DEPENDS:Q} + @echo "SCAN_DEPENDS="${_PBULK_SCAN_DEPENDS:N${PKGBUILD_BASEDIR:U/nonexistent}/*:Q} .if defined(_PBULK_MULTI_NEEDED) @printf "MULTI_VERSION=" .for _t in ${_PBULK_MULTI_NEEDED} From e3019a4c5b7a25b7dc7d4da249da11df53a5c03f Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 14:18:53 +0100 Subject: [PATCH 31/92] Support chrooted builds. This adds a chroot handling script and a few additional variables to pbulk.conf: - $chroot_create and $chroot_delete point to scripts which create and delete a sandbox respectively, each taking a path argument of the chroot location. - $chroot_dir is the base directory where chroots are created. - $build_chroots and $scan_chroots specify the number of build and scan chroots to create respectively. If the number of chroots is 1, they are named: ${chroot_dir}-build ${chroot_dir}-scan otherwise they are named i=1..N: ${chroot_dir}-build-${i} ${chroot_dir}-scan-${i} The chroot_dir variable isn't brilliantly named, but at this point is baked into too many of our pbulk branches to change. Currently users of this need to provide their own create/delete scripts, though hopefully at some point I'll provide sysutils/mksandbox wrappers as examples for getting started. --- pkgtools/pbulk/Makefile | 2 +- pkgtools/pbulk/PLIST | 1 + pkgtools/pbulk/files/pbulk/pbulk.conf | 18 ++++ pkgtools/pbulk/files/pbulk/scripts/Makefile | 2 +- pkgtools/pbulk/files/pbulk/scripts/build | 2 + .../files/pbulk/scripts/build-client-start | 8 +- pkgtools/pbulk/files/pbulk/scripts/chroot | 90 +++++++++++++++++++ .../pbulk/files/pbulk/scripts/client-prepare | 8 +- pkgtools/pbulk/files/pbulk/scripts/scan | 4 + .../files/pbulk/scripts/scan-client-start | 8 +- 10 files changed, 138 insertions(+), 5 deletions(-) create mode 100755 pkgtools/pbulk/files/pbulk/scripts/chroot diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index b5e35c7295da0..627f0788f154a 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -25,7 +25,7 @@ SUBST_STAGE.tools= pre-configure SUBST_MESSAGE.tools= Fixing references to tools SUBST_FILES.tools= pbulk.conf scripts/build scripts/build-client-start \ scripts/bulkbuild scripts/bulkbuild-rebuild scripts/bulkbuild-restart \ - scripts/client-clean scripts/client-prepare \ + scripts/chroot scripts/client-clean scripts/client-prepare \ scripts/pkg-build scripts/pkg-up-to-date scripts/pre-build \ scripts/report scripts/scan scripts/scan-client-start scripts/upload \ scripts/compute-packages.awk scripts/create-broken-graph.awk \ diff --git a/pkgtools/pbulk/PLIST b/pkgtools/pbulk/PLIST index 664954455847b..c4097b0f1a6ee 100644 --- a/pkgtools/pbulk/PLIST +++ b/pkgtools/pbulk/PLIST @@ -4,6 +4,7 @@ bin/bulkbuild-rebuild bin/bulkbuild-restart libexec/pbulk/build libexec/pbulk/build-client-start +libexec/pbulk/chroot libexec/pbulk/client-clean libexec/pbulk/client-prepare libexec/pbulk/compute-packages diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index ae4a4ce24fb5f..b9ce924878c20 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -26,6 +26,23 @@ build_clients="192.168.75.21 192.168.75.22 192.168.75.23 192.168.75.24" master_port_scan=${master_ip}:2001 master_port_build=${master_ip}:2002 +# Create chroots for each phase. This allows concurrent build/scan on the +# same host. chroot_create/chroot_delete are scripts which take a single +# argument which is the chroot directory to create/delete, and chroot_dir is +# used as the prefix for the name of the chroot directory. +# +# To use chroots on a single host, set master_mode=yes and leave both +# build_clients and scan_clients unset or empty. +# +#chroot_create=/path/to/mksandbox +#chroot_delete=/path/to/rmsandbox +#chroot_dir=/chroot/pkgsrc + +# To enable concurrent chroots, set build_chroots/scan_chroots > 1. +# +#build_chroots=4 +#scan_chroots=8 + # Some flags for the programs that publish the binary packages and the # build report. If you want to disable the publishing at all, see below. # @@ -118,6 +135,7 @@ keep_prefix=no client_prepare=@PREFIX@/libexec/pbulk/client-prepare client_prepare_action=@PREFIX@/libexec/pbulk/client-clean client_prepare_chroot=: +chroot_script=@PREFIX@/libexec/pbulk/chroot pkg_up_to_date_script=@PREFIX@/libexec/pbulk/pkg-up-to-date pbuild_script=@PREFIX@/libexec/pbulk/pkg-build pbuild_start_script=@PREFIX@/libexec/pbulk/build-client-start diff --git a/pkgtools/pbulk/files/pbulk/scripts/Makefile b/pkgtools/pbulk/files/pbulk/scripts/Makefile index 057e5b9455ec1..d904a6b9fb3ba 100644 --- a/pkgtools/pbulk/files/pbulk/scripts/Makefile +++ b/pkgtools/pbulk/files/pbulk/scripts/Makefile @@ -2,7 +2,7 @@ SCRIPTS= build build-client-start bulkbuild bulkbuild-rebuild \ bulkbuild-restart \ - client-clean client-prepare \ + chroot client-clean client-prepare \ pkg-build pkg-up-to-date pre-build report \ scan scan-client-start upload \ compute-packages.awk create-broken-graph.awk \ diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 1ed9a70cb7222..94ad223740295 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -46,7 +46,9 @@ case "${master_mode}" in ${pbuild} -r ${loc}/pbuild -v -b ${pbuild_script} ${loc}/presolve ${loc}/success ${loc}/error ;; [yY][eE][sS]) + [ -n "${chroot_dir}" ] && ${chroot_script} build create ${chroot_dir} ${pbuild} -r ${loc}/pbuild -I ${pbuild_start_script} -m ${master_port_build} -v ${loc}/presolve ${loc}/success ${loc}/error + [ -n "${chroot_dir}" ] && ${chroot_script} build delete ${chroot_dir} ;; *) echo "master_mode must be either yes or no." diff --git a/pkgtools/pbulk/files/pbulk/scripts/build-client-start b/pkgtools/pbulk/files/pbulk/scripts/build-client-start index 770569482477b..c557044e95075 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/build-client-start @@ -29,7 +29,13 @@ for client in ${build_clients}; do ;; esac if [ -z "$path" ]; then - ssh $port $client "${pbuild} -c ${master_port_build} -b ${pbuild_script}" & + if [ -n "${chroot_create}" -a "${chroot_dir}" ]; then + ssh $port $client "for dir in ${chroot_dir}-build*; do + PBULK_CONF=${PBULK_CONF} chroot \${dir} @SH@ -c \"${pbuild} -c ${master_port_build} -b ${pbuild_script}\" & + done" & + else + ssh $port $client "${pbuild} -c ${master_port_build} -b ${pbuild_script}" & + fi else chroot "$path" ${pbuild} -c ${master_port_build} -b ${pbuild_script} & fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/chroot b/pkgtools/pbulk/files/pbulk/scripts/chroot new file mode 100755 index 0000000000000..8e1bbc7239838 --- /dev/null +++ b/pkgtools/pbulk/files/pbulk/scripts/chroot @@ -0,0 +1,90 @@ +#!@SH@ +# $NetBSD$ +# +# Script to manage creating/deleting chroots during the pbulk process +# +# Usage: chroot +# + +. ${PBULK_CONF:-@PBULK_CONFIG@} + +set -e + +if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then + echo "Your configuration has version ${config_version}." + echo "This version of pbulk expects version @PBULK_CONFIG_VERSION@." + exit 1 +fi + +phase=$1; shift +operation=$1; shift +chroot_dir=$1; shift + +case "${phase}" in +build) + clients=${build_clients} + numchroots=${build_chroots} + ;; +scan) + clients=${scan_clients} + numchroots=${scan_chroots} + ;; +*) + echo "$0: Unexpected phase '${phase}'" >&2 + exit 1 + ;; +esac + +case "${operation}" in +create) + chroot_script=${chroot_create} + ;; +delete) + chroot_script=${chroot_delete} + ;; +*) + echo "$0: Unexpected operation '${operation}'" >&2 + exit 1 + ;; +esac + +if [ -z "${chroot_script}" ] || [ ! -x "${chroot_script}" ]; then + echo "$0: chroot_${operation} unset or not found/executable" >&2 + exit 1 +fi + +# Create chroots on remote clients +if [ -n "${clients}" ]; then + for client in ${clients}; do + if [ -n "${numchroots}" -a ${numchroots} -gt 1 ]; then + ssh $client " + i=1 + while true; do + ${chroot_script} ${chroot_dir}-${phase}-\${i} & + i=\`expr \$i + 1\` + if [ \$i -gt ${numchroots} ]; then + break + fi + done" & + else + ssh $client "${chroot_script} ${chroot_dir}-${phase}" & + fi + done +# Create local chroots +else + if [ -n "${numchroots}" -a ${numchroots} -gt 1 ]; then + i=1 + while true; do + ${chroot_script} ${chroot_dir}-${phase}-${i} & + i=`expr $i + 1` + if [ $i -gt ${numchroots} ]; then + break + fi + done + else + ${chroot_script} ${chroot_dir}-${phase} + fi +fi + +# Ensure all chroot operations are complete before continuing. +wait diff --git a/pkgtools/pbulk/files/pbulk/scripts/client-prepare b/pkgtools/pbulk/files/pbulk/scripts/client-prepare index 3123969969d15..af24ec30e52ba 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-prepare +++ b/pkgtools/pbulk/files/pbulk/scripts/client-prepare @@ -44,7 +44,13 @@ for client in ${unique_clients}; do ;; esac if [ -z "$path" ]; then - ssh $port $client "${client_prepare_action}" & + if [ -n "${chroot_create}" -a "${chroot_dir}" ]; then + ssh $port $client "for dir in ${chroot_dir}-scan*; do + PBULK_CONF=${PBULK_CONF} chroot \${dir} @SH@ -c \"${client_prepare_action}\" & + done" & + else + ssh $port $client "${client_prepare_action}" & + fi else clients_prepare_chroot "$path" & fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/scan b/pkgtools/pbulk/files/pbulk/scripts/scan index 26c0109274754..6da566742bd61 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan +++ b/pkgtools/pbulk/files/pbulk/scripts/scan @@ -54,7 +54,9 @@ if [ -z "${limited_list}" ]; then ${pscan} -v -M ${make} ${extra_pscan_args} ${pkgsrc} ${loc}/pscan 2>> ${loc}/pscan.stderr ;; [yY][eE][sS]) + [ -n "${chroot_dir}" ] && ${chroot_script} scan create ${chroot_dir} ${pscan} -v -I ${pscan_start_script} -m ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc} ${loc}/pscan 2>> ${loc}/pscan.stderr + [ -n "${chroot_dir}" ] && ${chroot_script} scan delete ${chroot_dir} ;; *) echo "master_mode must be either yes or no." @@ -89,7 +91,9 @@ else ${pscan} -v -l -M ${make} ${pkgsrc} ${loc}/pscan < ${loc}/missing.s ;; [yY][eE][sS]) + [ -n "${chroot_dir}" ] && ${chroot_script} scan create ${chroot_dir} ${pscan} -v -l -I ${pscan_start_script} -m ${master_port_scan} -M ${make} ${pkgsrc} ${loc}/pscan < ${loc}/missing.s + [ -n "${chroot_dir}" ] && ${chroot_script} scan delete ${chroot_dir} ;; *) echo "master_mode must be either yes or no." diff --git a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start index 158e71f31f582..bcf58077b986c 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start @@ -37,7 +37,13 @@ for client in ${scan_clients}; do ;; esac if [ -z "$path" ]; then - ssh $port $client "${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" & + if [ -n "${chroot_create}" -a "${chroot_dir}" ]; then + ssh $port $client "for dir in ${chroot_dir}-scan*; do + PBULK_CONF=${PBULK_CONF} chroot \${dir} @SH@ -c \"${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}\" & + done" & + else + ssh $port $client "PBULK_CONF=${PBULK_CONF} ${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" & + fi else chroot "$path" ${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc} & fi From 90ca6403c9aa61ea371759f74c747a439b0a362b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 14:39:10 +0100 Subject: [PATCH 32/92] Support specifying pbulk.conf on the command line. This allows a single pbulk install to handle multiple builds easily without having to switch out the main pbulk.conf each time. --- pkgtools/pbulk/files/pbulk/scripts/build | 2 +- .../files/pbulk/scripts/build-client-start | 2 +- pkgtools/pbulk/files/pbulk/scripts/bulkbuild | 16 +++++++++++++++- .../files/pbulk/scripts/bulkbuild-rebuild | 18 ++++++++++++++++-- .../files/pbulk/scripts/bulkbuild-restart | 16 +++++++++++++++- .../pbulk/files/pbulk/scripts/client-clean | 2 +- .../pbulk/files/pbulk/scripts/client-prepare | 2 +- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 2 +- .../pbulk/files/pbulk/scripts/pkg-up-to-date | 2 +- pkgtools/pbulk/files/pbulk/scripts/pre-build | 2 +- pkgtools/pbulk/files/pbulk/scripts/report | 2 +- pkgtools/pbulk/files/pbulk/scripts/scan | 2 +- .../files/pbulk/scripts/scan-client-start | 2 +- pkgtools/pbulk/files/pbulk/scripts/upload | 2 +- 14 files changed, 57 insertions(+), 15 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 94ad223740295..ff43ac777a3e1 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/build-client-start b/pkgtools/pbulk/files/pbulk/scripts/build-client-start index c557044e95075..493fc09abe427 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/build-client-start @@ -1,7 +1,7 @@ #!@SH@ # $NetBSD: build-client-start,v 1.5 2016/12/18 22:59:35 joerg Exp $ -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild index 4b0c233b76baa..b4ada70aab865 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild +++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild @@ -1,7 +1,21 @@ #!@SH@ # $NetBSD: bulkbuild,v 1.1.1.1 2007/06/19 19:49:59 joerg Exp $ -. @PBULK_CONFIG@ +if [ "$1" = "-h" ]; then + echo "usage: $0 [-h] []" + exit 2 +elif [ -f "$1" ]; then + case "$1" in + /*) + export PBULK_CONF="$1"; shift + ;; + *) + export PBULK_CONF="$(pwd)/$1"; shift + ;; + esac +fi + +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild index 33ac0f39eb149..cbfb18a972056 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild +++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild @@ -1,7 +1,21 @@ #!@SH@ # $NetBSD: bulkbuild-rebuild,v 1.3 2008/09/16 18:21:30 joerg Exp $ -. @PBULK_CONFIG@ +if [ "$1" = "-h" ]; then + echo "Usage: $0 [-h] [] package ..." + exit 2 +elif [ -f "$1" ]; then + case "$1" in + /*) + export PBULK_CONF="$1"; shift + ;; + *) + export PBULK_CONF="$(pwd)/$1"; shift + ;; + esac +fi + +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e @@ -33,7 +47,7 @@ build_pkg() { } if [ $# = 0 ]; then - echo "Usage: $0 package ..." + echo "Usage: $0 [-h] [] package ..." fi while [ $# != 0 ]; do diff --git a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart index 85424890db0b0..beb470502bb47 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart +++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart @@ -1,7 +1,21 @@ #!@SH@ # $NetBSD: bulkbuild-restart,v 1.4 2016/12/18 22:38:16 joerg Exp $ -. @PBULK_CONFIG@ +if [ "$1" = "-h" ]; then + echo "usage: $0 [-h] []" + exit 2 +elif [ -f "$1" ]; then + case "$1" in + /*) + export PBULK_CONF="$1"; shift + ;; + *) + export PBULK_CONF="$(pwd)/$1"; shift + ;; + esac +fi + +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/client-clean b/pkgtools/pbulk/files/pbulk/scripts/client-clean index e94312dc3be08..90048fc9eff4a 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-clean +++ b/pkgtools/pbulk/files/pbulk/scripts/client-clean @@ -1,7 +1,7 @@ #!@SH@ # $NetBSD: client-clean,v 1.9 2008/09/16 18:21:30 joerg Exp $ -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/client-prepare b/pkgtools/pbulk/files/pbulk/scripts/client-prepare index af24ec30e52ba..e376a318f2a41 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-prepare +++ b/pkgtools/pbulk/files/pbulk/scripts/client-prepare @@ -1,7 +1,7 @@ #!@SH@ # $NetBSD: client-prepare,v 1.3 2016/12/18 22:59:35 joerg Exp $ -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index f11d4c2e5da25..f64f77083fd87 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then echo "Your configuration has version ${config_version}." diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date index efbedaac766eb..c31110c9788cd 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/pre-build b/pkgtools/pbulk/files/pbulk/scripts/pre-build index a11f0fcb76b3a..ce46337c3942a 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pre-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pre-build @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/report b/pkgtools/pbulk/files/pbulk/scripts/report index e207018ae89f7..30ea3f0d40198 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/report +++ b/pkgtools/pbulk/files/pbulk/scripts/report @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/scan b/pkgtools/pbulk/files/pbulk/scripts/scan index 6da566742bd61..fe813d314f1f2 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan +++ b/pkgtools/pbulk/files/pbulk/scripts/scan @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start index bcf58077b986c..9b6acf75c43d5 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start @@ -1,7 +1,7 @@ #!@SH@ # $NetBSD: scan-client-start,v 1.7 2016/12/18 22:59:35 joerg Exp $ -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 2a17168f83b14..7dbc8028c0dce 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -30,7 +30,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -. @PBULK_CONFIG@ +. ${PBULK_CONF:-@PBULK_CONFIG@} set -e From d5b4fcfcd7fa301e36d76cd4475a170661699abd Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:06:56 +0100 Subject: [PATCH 33/92] Support USER_ADDITIONAL_PKGS. These are passed in as SUBDIR entries by the top-level Makefile. --- pkgtools/pbulk/files/pbulk/pscan/client.c | 24 +++++++++++++++++++++++ pkgtools/pbulk/files/pbulk/pscan/jobs.c | 10 ++++++++++ pkgtools/pbulk/files/pbulk/pscan/pscan.c | 11 +++++++++++ pkgtools/pbulk/files/pbulk/pscan/pscan.h | 1 + 4 files changed, 46 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/pscan/client.c b/pkgtools/pbulk/files/pbulk/pscan/client.c index 9f28c9cff5729..96e1af7e448c1 100644 --- a/pkgtools/pbulk/files/pbulk/pscan/client.c +++ b/pkgtools/pbulk/files/pbulk/pscan/client.c @@ -80,6 +80,30 @@ find_full_tree_client(int fd, const char *bmake_path) if (cat_len == 0) break; + /* + * Check for SUBDIR including a '/', if so then it has been + * passed via USER_ADDITIONAL_PKGS from the top-level Makefile, + * and should be added as a package path directly. + */ + if (memchr(cat, '/', cat_len) != NULL) { + if (len_pkgs == allocated_pkgs) { + if (allocated_pkgs == 0) { + allocated_pkgs = 1024; + pkgs = xmalloc(sizeof(*pkgs) * + allocated_pkgs); + } else { + allocated_pkgs *= 2; + pkgs = xrealloc(pkgs, + sizeof(*pkgs) * allocated_pkgs); + } + } + pkgs[len_pkgs] = xasprintf("%.*s", (int)cat_len, cat); + len_pkgs_data += strlen(pkgs[len_pkgs]) + 1; + ++len_pkgs; + cat += cat_len; + continue; + } + cat_path = xasprintf("%s/%.*s", pkgsrc_tree, (int)cat_len, cat); buf_orig = buf = read_from_child(cat_path, bmake_path, extract_subdir); free(cat_path); diff --git a/pkgtools/pbulk/files/pbulk/pscan/jobs.c b/pkgtools/pbulk/files/pbulk/pscan/jobs.c index fa6284e6ead43..fabce61034d75 100644 --- a/pkgtools/pbulk/files/pbulk/pscan/jobs.c +++ b/pkgtools/pbulk/files/pbulk/pscan/jobs.c @@ -278,6 +278,16 @@ add_job(const char *cat, size_t cat_len, const char *dir, size_t dir_len) free(location); } +void +add_job_pkgpath(const char *pkgpath, size_t pkgpath_len) +{ + char *location; + + location = xasprintf("%.*s", (int)pkgpath_len, pkgpath); + add_job_full(location); + free(location); +} + void add_job_full(const char *location) { diff --git a/pkgtools/pbulk/files/pbulk/pscan/pscan.c b/pkgtools/pbulk/files/pbulk/pscan/pscan.c index 191fb637e9409..52e3baddab932 100644 --- a/pkgtools/pbulk/files/pbulk/pscan/pscan.c +++ b/pkgtools/pbulk/files/pbulk/pscan/pscan.c @@ -225,6 +225,17 @@ find_full_tree(void) if (cat_len == 0) break; + /* + * Check for SUBDIR including a '/', if so then it has been + * passed via USER_ADDITIONAL_PKGS from the top-level Makefile, + * and should be added as a package path directly. + */ + if (memchr(cat, '/', cat_len) != NULL) { + add_job_pkgpath(cat, cat_len); + cat += cat_len; + continue; + } + cat_path = xasprintf("%s/%.*s", pkgsrc_tree, (int)cat_len, cat); buf_orig = buf = read_from_child(cat_path, bmake_path, extract_subdir); free(cat_path); diff --git a/pkgtools/pbulk/files/pbulk/pscan/pscan.h b/pkgtools/pbulk/files/pbulk/pscan/pscan.h index dd6f2156da28f..da4f7e50f458b 100644 --- a/pkgtools/pbulk/files/pbulk/pscan/pscan.h +++ b/pkgtools/pbulk/files/pbulk/pscan/pscan.h @@ -56,6 +56,7 @@ void client_mode(const char *, const char *); void master_mode(const char *, const char *); void add_job(const char *, size_t, const char *, size_t); +void add_job_pkgpath(const char *, size_t); void add_job_full(const char *); struct scan_job *get_job(void); void process_job(struct scan_job *, enum job_state); From 7812cbe8c92a664683c5d5f8423eea22c812f277 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:31:12 +0100 Subject: [PATCH 34/92] Support optional $client_clean_local script. This allows local customisations to the client-clean script, for example our OSX /tmp ramdisk cleanup: https://github.com/joyent/pkgbuild/blob/master/scripts/client-clean-osx which is necessary to keep the ramdisk usage pruned. --- pkgtools/pbulk/files/pbulk/pbulk.conf | 4 ++++ pkgtools/pbulk/files/pbulk/scripts/client-clean | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index b9ce924878c20..445c0b02d7fbf 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -159,3 +159,7 @@ sync_buildlog=: sync_package=default_sync_package # PKG_SUFX as set in mk.conf pkg_sufx=.tgz + +# Optional local override scripts. +# +#client_clean_local=/client_clean_local diff --git a/pkgtools/pbulk/files/pbulk/scripts/client-clean b/pkgtools/pbulk/files/pbulk/scripts/client-clean index 90048fc9eff4a..235c205c63cb8 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-clean +++ b/pkgtools/pbulk/files/pbulk/scripts/client-clean @@ -23,6 +23,11 @@ rm -rf ${cur_destdir}${varbase}/qmail 2> /dev/null || true # Note: It is not an error if ${prefix} still exists at this point, # because it might be a mount point. +# Source optional cleanup script +if [ -f "${client_clean_local}" ]; then + . ${client_clean_local} +fi + # Install fresh bootstrap state if [ -f "${bootstrapkit}" ]; then ${tar} -xzf ${bootstrapkit} -C ${cur_destdir}/ From 4623b4d475a8fb065e65df5f0e82f7480f0df480 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:34:27 +0100 Subject: [PATCH 35/92] Don't recursively mark packages as restricted. This is useful when e.g. using Oracle Java which cannot be redistributed. It should still be possible to install packages which depend upon it after the user has installed the restricted package manually first. --- pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk index d9de4becb89c8..63bf9dfe812cf 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk @@ -59,7 +59,7 @@ BEGIN { status[cur] = substr($0, 14) if ($0 ~ "^NO_BIN_ON_FTP=.") - initial_restricted[cur] = 1 + restricted[cur] = 1 if ($0 ~ "^DEPENDS=") depends[cur] = substr($0, 9) From 43d2e8cc1851a91d5abaf5de045feb6b165f11a2 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:40:46 +0100 Subject: [PATCH 36/92] Increase maximum top broken package count to 25. --- pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk | 2 +- pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk index 460b140ce8d5e..62fe863b3d03c 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk @@ -310,7 +310,7 @@ BEGIN { print " " > html_report print " " > html_report - for (i = 0; i < 10 && sorted_top_count[i] != ""; ++i) { + for (i = 0; i < 25 && sorted_top_count[i] != ""; ++i) { pkg = top_count[sorted_top_count[i]] print_failed(pkg) } diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk index fccc1b20ca093..465ccb12b0bea 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk @@ -153,7 +153,7 @@ BEGIN { print "" > txt_report print "Package Breaks Maintainer" > txt_report print "-------------------------------------------------------------------------" > txt_report - for (i = 0; i < 10 && sorted_top_count[i] != ""; ++i) { + for (i = 0; i < 25 && sorted_top_count[i] != ""; ++i) { loc = top_count[sorted_top_count[i]] printf "%- 37s % 6d %s\n", loc, broken_location[loc], maintainer[pkg_location[loc]] > txt_report From 468aee6a9ca753e45ab5e6b87acb30b24cbad7c4 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:42:57 +0100 Subject: [PATCH 37/92] Replace hardcoded ".tgz" with $pkg_sufx --- pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk | 3 ++- pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date | 4 ++-- pkgtools/pbulk/files/pbulk/scripts/upload | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk index 63bf9dfe812cf..deb5dba744cef 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk @@ -43,6 +43,7 @@ function mark_restricted(PKG, dep, depend_list) { BEGIN { meta_dir = ARGV[1] + pkg_sufx = ARGV[2] success_file = meta_dir "/success" presolve_file = meta_dir "/presolve" @@ -90,7 +91,7 @@ BEGIN { print "+ " cat "/" printed_cats[cat] = cat } - print "+ " cat "/" pkg ".tgz" + print "+ " cat "/" pkg pkg_sufx } } close(success_file) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date index c31110c9788cd..33aa81ea4789f 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date @@ -40,7 +40,7 @@ if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then exit 1 fi -pkg="${packages}/All/$1.tgz" +pkg="${packages}/All/${1}${pkg_sufx}" [ -f ${pkg} ] ${pkg_info} -qb ${pkg} | sed 's/:/ /' | while read file file_id; do @@ -71,7 +71,7 @@ ${pkg_info} -qN ${pkg} | while read dep; do [Yy][Ee][Ss]) ;; *) - [ "${packages}/All/${dep}.tgz" -ot "${pkg}" ] + [ "${packages}/All/${dep}${pkg_sufx}" -ot "${pkg}" ] ;; esac done diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 7dbc8028c0dce..5131a9d386aa3 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -48,6 +48,6 @@ cd ${packages} echo "+ SHA512.bz2" echo "+ All/pkg_summary.bz2" echo "+ All/pkg_summary.gz" - ${packages_script} ${loc} + ${packages_script} ${loc} ${pkg_sufx} echo "- *" } | LC_ALL=C sort | ${rsync} --exclude-from=- ${pkg_rsync_args} . ${pkg_rsync_target} From 6c02493563bebb38689c1fbeff6b31f7db312a90 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:49:58 +0100 Subject: [PATCH 38/92] Move OS variable generation to the first build. There's no guarantee that the pbulk master is running the same OS version that the pbulk clients are. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 32 +++++++++++++++++++ pkgtools/pbulk/files/pbulk/scripts/pre-build | 33 ++------------------ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index f64f77083fd87..dddf132c2812e 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -135,6 +135,38 @@ if [ `@ID@ -u` -ne 0 ]; then run_install=run_direct fi +# Attempt to move the pre-build status file into place. If we're successful +# we are the first build and we can now log the remaining details. +ret=`mv ${loc}/status.pre-build ${loc}/status 2>/dev/null; echo $?` +if [ ${ret} -eq 0 ]; then + @PREFIX@/libexec/pbulk/client-clean + opsys=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OPSYS` + opver=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OS_VERSION` + # Check if it is an OS with variants where we would rather use the + # variant name and version rather than common name and version + case "$opsys" in + SunOS | Cygwin | SCO_SV) + opvar=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OS_VARIANT` + case "$opsys" in + Cygwin | SCO_SV) + opsys=$opvar + ;; + SunOS) + if [ -n "$opvar" ]; then + opsys=$opvar + opver=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=LOWER_VARIANT_VERSION` + fi + ;; + esac + ;; + esac + platform=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=MACHINE_ARCH` + compiler=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=PKGSRC_COMPILER` + + echo "COMPILER=${compiler}" >> ${loc}/status + echo "PLATFORM=${opsys} ${opver}/${platform}" >> ${loc}/status +fi + ${pkg_up_to_date_script} ${pkgname} ${dependencies} && exit 0 set -e diff --git a/pkgtools/pbulk/files/pbulk/scripts/pre-build b/pkgtools/pbulk/files/pbulk/scripts/pre-build index ce46337c3942a..1113676e8fce0 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pre-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pre-build @@ -86,34 +86,7 @@ mkdir -p "${bulklog}" "${loc}" @PREFIX@/libexec/pbulk/client-clean -# Log common settings... -opsys=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OPSYS` -opver=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OS_VERSION` -# Check if it is an OS with variants where we would rather use the -# variant name and version rather than common name and version -case "$opsys" in - SunOS | Cygwin | SCO_SV) - opvar=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=OS_VARIANT` - case "$opsys" in - Cygwin | SCO_SV) - opsys=$opvar - ;; - SunOS) - if [ -n "$opvar" ]; then - opsys=$opvar - opver=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=LOWER_VARIANT_VERSION` - fi - ;; - esac - ;; -esac - -platform=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=MACHINE_ARCH` -compiler=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=PKGSRC_COMPILER` - -echo "PLATFORM=${opsys} ${opver}/${platform}" > ${loc}/status -echo "COMPILER=${compiler}" >> ${loc}/status - +# Start status file, it will be moved into place by the first build. date '+%Y-%m-%d %H:%M|%Y%m%d.%H%M' | sed 's/^\(.*\)|\(.*\)$/BUILD_START_ISO=\1\ -BUILD_START_DIR=\2/' >> ${loc}/status -echo "BASE_URL=${base_url}" >> ${loc}/status +BUILD_START_DIR=\2/' > ${loc}/status.pre-build +echo "BASE_URL=${base_url}" >> ${loc}/status.pre-build From d4ef771d5b666a30323e2258d16742444f70d3d0 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:54:31 +0100 Subject: [PATCH 39/92] Ensure each build starts with clean passwd files. Skipped on Darwin as it has a centralised OpenDirectory database, however finding a way to do this on Darwin would be greatly beneficial. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index dddf132c2812e..1aa8af2630248 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -169,6 +169,17 @@ fi ${pkg_up_to_date_script} ${pkgname} ${dependencies} && exit 0 +# Ensure we start with a clean passwd/group. +if [ `uname` != "Darwin" ]; then + for file in group passwd shadow user_attr; do + if [ -f ${loc}/${file} ]; then + cp -p ${loc}/${file} /etc/${file} + elif [ -f /etc/${file} ]; then + cp -p /etc/${file} ${loc}/${file} + fi + done +fi + set -e @PREFIX@/libexec/pbulk/client-clean From 68a6fc9b34883066e424ee3be816accf98bc6789 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 16:56:17 +0100 Subject: [PATCH 40/92] Support uploading reports to Manta. Assumes pbulk.conf is populated with the appropriate variables and that nodejs and the 'manta' npm package is installed under $MANTA_PATH. --- pkgtools/pbulk/files/pbulk/scripts/report | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/report b/pkgtools/pbulk/files/pbulk/scripts/report index 30ea3f0d40198..9061b0a253a8e 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/report +++ b/pkgtools/pbulk/files/pbulk/scripts/report @@ -107,4 +107,19 @@ echo "Uploading report..." [ -f "$file" ] && echo "+ $file" done echo "- *" -} | ${rsync} --exclude-from=- ${report_rsync_args} . ${report_rsync_target}/${build_start_dir} +} | { + if [ -n "${report_manta_target}" ]; then + # Variables sourced from pbulk.conf + export MANTA_USER MANTA_KEY_ID MANTA_URL MANTA_SUBUSER + PATH=${MANTA_PATH}:${PATH} + # Output directory only needs to not exist or be empty. + tmpdir="${bulklog}/pbulk-rsync-dir" + tmptar="${bulklog}/pbulk-rsync.tar" + rm -rf ${tmpdir} ${tmptar} + ${rsync} -rn --exclude-from=- --out-format='%n' . ${tmpdir} \ + | grep -v '/$' | @TAR@ -cf ${tmptar} -T - + muntar -f ${tmptar} ${report_manta_target}/${build_start_dir} + else + ${rsync} --exclude-from=- ${report_rsync_args} . ${report_rsync_target}/${build_start_dir} + fi +} From 894e5664bcff8689b78a2d8f8f0729b0159a95bb Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 17:00:23 +0100 Subject: [PATCH 41/92] Generate checksum and pkginfo at package build time. This saves a decent amount of time at the end of a pbulk run (around 20 minutes) by avoiding a single-threaded operation to generate them. XXX: not currently handled by custom $sync_package scripts --- pkgtools/pbulk/files/pbulk/scripts/build | 10 +++++----- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index ff43ac777a3e1..48048236b4863 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -60,7 +60,7 @@ date '+BUILD_END_ISO=%Y-%m-%d %H:%M' >> ${loc}/status echo "Building pkg_summary..." cd ${packages}/All -sed 's/$/.tgz/' < ${loc}/success | sort | xargs ${pkg_info} -X | ${gzip} -c > pkg_summary.gz +sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_summary.gz ${gzip} -dc < pkg_summary.gz | ${bzip2} -c > pkg_summary.bz2 if [ "${checksum_packages}" != "no" ] && \ @@ -68,8 +68,8 @@ if [ "${checksum_packages}" != "no" ] && \ echo "Building SHA512..." cd ${packages} { - echo "All/pkg_summary.bz2" - echo "All/pkg_summary.gz" - sed 's|^\(.*\)$|All/\1.tgz|' < ${loc}/success - } | sort | xargs ${digest} SHA512 | ${bzip2} -c > SHA512.bz2 + ${digest} SHA512 All/pkg_summary.bz2 + ${digest} SHA512 All/pkg_summary.gz + sed -e 's,^,checksums/,' -e 's/$/.sha512/' < ${loc}/success | xargs cat 2>/dev/null + } | sort | ${bzip2} -c > SHA512.bz2 fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 1aa8af2630248..43720cfd06196 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -113,6 +113,10 @@ while read build_info_line; do ;; USERGROUP_PHASE=*) usergroup_phase=${build_info_line#USERGROUP_PHASE=} + ;; + NO_BIN_ON_FTP=*) + restricted=${build_info_line#NO_BIN_ON_FTP=} + ;; esac done @@ -262,5 +266,19 @@ ${sync_package} ${pkgfile} ${pkgname} "${categories}" || cleanup # Clean build area ${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1 || true +# Save a SHA512 sum of the package (if not restricted), saves doing all of +# them single-threaded at the end of a bulk build and avoids re-computing for +# packages we have already built. +if [ -z "${restricted}" ]; then + mkdir -p ${packages}/checksums ${packages}/pkginfo + ( + cd ${packages} + ${digest} SHA512 All/${pkgname}${pkg_sufx} \ + > ${packages}/checksums/${pkgname}.sha512 || cleanup + ${pkg_info} -X All/${pkgname}${pkg_sufx} \ + > ${packages}/pkginfo/${pkgname}.pkginfo || cleanup + ) +fi + # Cleanup build logs on success rm -R ${bulklog}/${pkgname} From cc094389e58a9c3db7d222d0d5dbd38eaf67185c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 17:10:12 +0100 Subject: [PATCH 42/92] Save package build time for performance analysis. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 43720cfd06196..2032a971049c3 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -43,7 +43,15 @@ default_sync_package() { cp "$1" "${packages}/All/${pkgname}${pkg_sufx}" } +logpkgtime() { + stop_time=`date '+%s'` + build_time=`expr ${stop_time} - ${start_time}` + mkdir -p ${packages}/pkgtimes + echo "${build_time}" >${packages}/pkgtimes/${pkgname}.pkgtime +} + cleanup() { + logpkgtime if [ "$keep_wrkdir" = yes ]; then ${make} pbulk-save-wrkdir INTO=${bulklog}/${pkgname}/wrkdir.tar.gz TAR="${tar}" fi @@ -220,6 +228,9 @@ else cur_pkgdb="${pkgdb}" fi +# Save package start time +start_time=`date '+%s'` + # Go to target directory cd ${pkgsrc}/${pkgdir} # Clean build area, just in case @@ -266,6 +277,9 @@ ${sync_package} ${pkgfile} ${pkgname} "${categories}" || cleanup # Clean build area ${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1 || true +# Save build runtime +logpkgtime + # Save a SHA512 sum of the package (if not restricted), saves doing all of # them single-threaded at the end of a bulk build and avoids re-computing for # packages we have already built. From 7d163251c4d126a492af57f1c56fb169f68d2c86 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 17:12:22 +0100 Subject: [PATCH 43/92] Add support for $local_bulklog This is a directory where the bulklog files are written to temporarily before either being moved to $bulklog at the end of a failed build or removed. This avoids failures when writing to an NFS-backed $bulklog (seen most commonly with 'gmake: write error'), and also improves performance. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 52 +++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 2032a971049c3..7208dccd9be24 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -52,6 +52,10 @@ logpkgtime() { cleanup() { logpkgtime + if [ -n "${local_bulklog}" ]; then + mkdir -p ${bulklog} + mv ${logpkgdir} ${bulklog}/${pkgname} + fi if [ "$keep_wrkdir" = yes ]; then ${make} pbulk-save-wrkdir INTO=${bulklog}/${pkgname}/wrkdir.tar.gz TAR="${tar}" fi @@ -79,7 +83,7 @@ run_make() { BATCH=1 \ DEPENDS_TARGET=/nonexistent \ ${MAKE_FLAGS} \ - WRKLOG=${bulklog}/${pkgname}/work.log + WRKLOG=${logpkgdir}/work.log } run_usergroup() { @@ -133,6 +137,15 @@ if [ "$use_unprivileged_checksum" != "no" ]; then else run_checksum=run_direct fi + +# Sometimes writing logs to NFS can cause issues, support writing to a local +# bulklog directory before moving to NFS at the end. +if [ -n "${local_bulklog}" ]; then + logpkgdir="${local_bulklog}/${pkgname}" +else + logpkgdir="${bulklog}/${pkgname}" +fi + if [ "$use_destdir" = user-destdir ]; then run_build=run_su run_install=run_su @@ -197,11 +210,12 @@ set -e @PREFIX@/libexec/pbulk/client-clean # Create the output directory and clean it up -mkdir -p ${bulklog}/${pkgname} -rm -f ${bulklog}/${pkgname}/* +rm -rf ${bulklog}/${pkgname} +mkdir -p ${logpkgdir} +rm -f ${logpkgdir}/* -touch ${bulklog}/${pkgname}/work.log -@CHOWN@ ${unprivileged_user} ${bulklog}/${pkgname}/work.log +touch ${logpkgdir}/work.log +@CHOWN@ ${unprivileged_user} ${logpkgdir}/work.log pkg_add_normal() { PKG_PATH=${packages}/All ${pkg_add} -K ${cur_pkgdb} "$@" @@ -234,20 +248,20 @@ start_time=`date '+%s'` # Go to target directory cd ${pkgsrc}/${pkgdir} # Clean build area, just in case -${make} clean > ${bulklog}/${pkgname}/pre-clean.log 2>&1 +${make} clean > ${logpkgdir}/pre-clean.log 2>&1 || cleanup # Install all dependencies the package said it would need if [ ! -z "$dependencies" ]; then - ${pkg_add_cmd} $dependencies > ${bulklog}/${pkgname}/depends.log 2>&1 || cleanup + ${pkg_add_cmd} $dependencies > ${logpkgdir}/depends.log 2>&1 || cleanup fi # Build package, create a separate log file for each major phase -run_make ${run_checksum} checksum > ${bulklog}/${pkgname}/checksum.log 2>&1 || cleanup -run_usergroup configure > ${bulklog}/${pkgname}/configure.log 2>&1 || cleanup -run_make ${run_build} configure >> ${bulklog}/${pkgname}/configure.log 2>&1 || cleanup -run_usergroup build> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup -run_make ${run_build} all >> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup -run_usergroup install > ${bulklog}/${pkgname}/install.log 2>&1 || cleanup -run_make ${run_install} stage-install >> ${bulklog}/${pkgname}/install.log 2>&1 || cleanup -run_make run_direct stage-package-create > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup +run_make ${run_checksum} checksum > ${logpkgdir}/checksum.log 2>&1 || cleanup +run_usergroup configure > ${logpkgdir}/configure.log 2>&1 || cleanup +run_make ${run_build} configure >> ${logpkgdir}/configure.log 2>&1 || cleanup +run_usergroup build> ${logpkgdir}/build.log 2>&1 || cleanup +run_make ${run_build} all >> ${logpkgdir}/build.log 2>&1 || cleanup +run_usergroup install > ${logpkgdir}/install.log 2>&1 || cleanup +run_make ${run_install} stage-install >> ${logpkgdir}/install.log 2>&1 || cleanup +run_make run_direct stage-package-create > ${logpkgdir}/package.log 2>&1 || cleanup pkgfile=$(run_make run_direct show-var VARNAME=STAGE_PKGFILE) @@ -255,7 +269,7 @@ pkgfile=$(run_make run_direct show-var VARNAME=STAGE_PKGFILE) # potential bootstrap packages as they might already be installed. if [ -z "${is_bootstrap}" ]; then if ! ${pkg_add_cmd} ${pkgfile} \ - >> ${bulklog}/${pkgname}/package.log 2>&1; then + >> ${logpkgdir}/package.log 2>&1; then cleanup fi fi @@ -265,7 +279,7 @@ fi # part of the bootstrap, those have the preserve flag set. if [ "$cross_compile" = "no" ] && \ [ -z "${is_bootstrap}" ]; then - ${pkg_delete} -K ${cur_pkgdb} ${pkgname} > ${bulklog}/${pkgname}/deinstall.log 2>&1 || cleanup + ${pkg_delete} -K ${cur_pkgdb} ${pkgname} > ${logpkgdir}/deinstall.log 2>&1 || cleanup fi # Comment the following out if you want to test all deinstall scripts. @@ -275,7 +289,7 @@ fi ${sync_package} ${pkgfile} ${pkgname} "${categories}" || cleanup # Clean build area -${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1 || true +${make} clean > ${logpkgdir}/clean.log 2>&1 || cleanup # Save build runtime logpkgtime @@ -295,4 +309,4 @@ if [ -z "${restricted}" ]; then fi # Cleanup build logs on success -rm -R ${bulklog}/${pkgname} +rm -R ${logpkgdir} From 82a3dd92a54b8e2d27fd646131ef7c052c5fdcb9 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 17:14:31 +0100 Subject: [PATCH 44/92] Enable pkg-build script logging. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 7208dccd9be24..efa9ad4d1e360 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -214,6 +214,11 @@ rm -rf ${bulklog}/${pkgname} mkdir -p ${logpkgdir} rm -f ${logpkgdir}/* +# Ensure we log any failures from this script itself, otherwise it is very +# difficult to debug. +exec >${logpkgdir}/pkg-build.log 2>&1 +set -x + touch ${logpkgdir}/work.log @CHOWN@ ${unprivileged_user} ${logpkgdir}/work.log From d7a29a222a21a65b481340cf7563a9653a24933a Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 16 Oct 2015 18:04:58 +0100 Subject: [PATCH 45/92] Pull in xz for pkg_summary and the machine report. --- pkgtools/pbulk/Makefile | 4 ++-- pkgtools/pbulk/files/pbulk/pbulk.conf | 1 + pkgtools/pbulk/files/pbulk/scripts/build | 2 ++ pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk | 2 +- pkgtools/pbulk/files/pbulk/scripts/report | 4 ++-- pkgtools/pbulk/files/pbulk/scripts/upload | 1 + 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index 627f0788f154a..b0b4062517326 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -6,7 +6,7 @@ COMMENT= Modular bulk build framework .include "../../pkgtools/pbulk/Makefile.common" USE_TOOLS+= awk:run bzip2:run digest:run gzip:run make:run \ - mail:run sed:run tar:run + mail:run sed:run tar:run xz:run DEPENDS+= rsync-[0-9]*:../../net/rsync DEPENDS+= pbulk-base>=0.38:../../pkgtools/pbulk-base @@ -34,7 +34,7 @@ SUBST_FILES.tools= pbulk.conf scripts/build scripts/build-client-start \ SUBST_VARS.tools= AWK BZIP2 CHOWN DIGEST GZIP_CMD ID MAIL_CMD NEATO \ PBULK_CONFIG PBULK_CONFIG_VERSION PKG_ADD_CMD \ PKG_DELETE_CMD PKG_INFO_CMD PREFIX SED SH TAR \ - TARGET_MAKE + TARGET_MAKE XZ CONF_FILES+= share/examples/pbulk/pbulk.conf ${PKG_SYSCONFDIR}/pbulk.conf diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index 445c0b02d7fbf..d35d0b1da5aeb 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -118,6 +118,7 @@ neato=@NEATO@ rsync=@PREFIX@/bin/rsync sed=@SED@ tar=@TAR@ +xz=@XZ@ loc=${bulklog}/meta diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 48048236b4863..165299e15ba7c 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -62,6 +62,7 @@ echo "Building pkg_summary..." cd ${packages}/All sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_summary.gz ${gzip} -dc < pkg_summary.gz | ${bzip2} -c > pkg_summary.bz2 +${gzip} -dc < pkg_summary.gz | ${xz} -zc > pkg_summary.xz if [ "${checksum_packages}" != "no" ] && \ [ "${checksum_packages}" != "NO" ]; then @@ -70,6 +71,7 @@ if [ "${checksum_packages}" != "no" ] && \ { ${digest} SHA512 All/pkg_summary.bz2 ${digest} SHA512 All/pkg_summary.gz + ${digest} SHA512 All/pkg_summary.xz sed -e 's,^,checksums/,' -e 's/$/.sha512/' < ${loc}/success | xargs cat 2>/dev/null } | sort | ${bzip2} -c > SHA512.bz2 fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk index 465ccb12b0bea..5e2e48775aab6 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk @@ -129,7 +129,7 @@ BEGIN { print "" > txt_report report_base_url = pkgsrc_base_url "/" pkgsrc_build_start_dir print "Full report: " report_base_url "/meta/report.html" > txt_report - print "Machine readable version: " report_base_url "/meta/report.bz2" > txt_report + print "Machine readable version: " report_base_url "/meta/report.xz" > txt_report print "" > txt_report all_pkgs = pkgs_done + pkgs_failed + pkgs_prefailed + pkgs_indirect_failed + pkgs_indirect_prefailed printf "Total number of packages: %5d\n", all_pkgs > txt_report diff --git a/pkgtools/pbulk/files/pbulk/scripts/report b/pkgtools/pbulk/files/pbulk/scripts/report index 9061b0a253a8e..498c3135a9201 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/report +++ b/pkgtools/pbulk/files/pbulk/scripts/report @@ -42,7 +42,7 @@ fi echo "Build reports..." ${report_script} ${loc} -${bzip2} -zc ${loc}/report > ${loc}/report.bz2 +${xz} -zc ${loc}/report > ${loc}/report.xz ${report_html_script} ${loc} ${bulklog} ${report_txt_script} ${loc} @@ -79,11 +79,11 @@ cat ${loc}/report.txt | ${mail} -s "${report_subject_prefix} ${platform} ${build cd ${bulklog} echo "Uploading report..." { - echo "meta/report.bz2" echo "meta/report.txt" echo "meta/report.html" echo "meta/report.dot" echo "meta/report.svg" + echo "meta/report.xz" echo "meta/status" while read pkg; do echo "${pkg}/pre-clean.log" diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 5131a9d386aa3..9a433214392be 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -48,6 +48,7 @@ cd ${packages} echo "+ SHA512.bz2" echo "+ All/pkg_summary.bz2" echo "+ All/pkg_summary.gz" + echo "+ All/pkg_summary.xz" ${packages_script} ${loc} ${pkg_sufx} echo "- *" } | LC_ALL=C sort | ${rsync} --exclude-from=- ${pkg_rsync_args} . ${pkg_rsync_target} From 55d812ddc8cc070cf4b22ff459243052491d7ba9 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 12 Nov 2015 15:28:35 +0000 Subject: [PATCH 46/92] Add support for $script_phase_pre_upload. This is set to a script that is executed by the upload script prior to starting the actual upload, and is useful for performing any sanity checks on what is about to be uploaded. Add variables used by Joyent to ensure a certain number of packages built ($pkg_rsync_min) and that a list of core packages all built successfully ($pkg_rsync_required_pkgs) to the example config. --- pkgtools/pbulk/files/pbulk/pbulk.conf | 11 +++++++++++ pkgtools/pbulk/files/pbulk/scripts/upload | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index d35d0b1da5aeb..b500af26a6225 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -53,6 +53,15 @@ report_rsync_target="pkgsrc@192.168.75.1:/public/reports/current/DragonFly-1.8" report_subject_prefix="pkgsrc" report_recipients="pkgsrc-bulk@netbsd.org" +# Example variables used by an optional pre-upload script to ensure certain +# criteria are met before publishing. +# +# Set a minimum number of successful packages. +#pkg_rsync_min=10000 +# +# Ensure all packages listed in the file built successfully. +#pkg_rsync_required_pkgs=/required_pkgs + # An archive containing the pkgsrc binary tree after bootstrapping. # bootstrapkit=/usr/pkgsrc/bootstrap/bootstrap.tar.gz @@ -151,6 +160,8 @@ script_phase_pre_build=@PREFIX@/libexec/pbulk/pre-build script_phase_build=@PREFIX@/libexec/pbulk/build script_phase_report=@PREFIX@/libexec/pbulk/report script_phase_scan=@PREFIX@/libexec/pbulk/scan +# Optional pre-upload script called from upload. +#script_phase_pre_upload=/pre-upload script_phase_upload=@PREFIX@/libexec/pbulk/upload # Arguments are buildlog and pkgname diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 9a433214392be..ad030a7d31818 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -40,6 +40,17 @@ if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then exit 1 fi +# +# Run optional check script. This allows ensuring certain criteria are met +# before continuing with the upload process, for example to avoid publishing +# a new package set with critical packages missing. PBULK_CONF is passed in +# the environment so that the script can source it for useful variables. +# +if [ -x "${script_phase_pre_upload}" ]; then + echo "Running pre-upload check script..." + PBULK_CONF=${PBULK_CONF:-@PBULK_CONFIG@} ${script_phase_pre_upload} +fi + echo "Uploading packages..." cd ${packages} { From f86a72c656fda24fce1027a6f87e57c42d30c0fe Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 1 Feb 2016 10:41:33 +0000 Subject: [PATCH 47/92] Exit pool loop when we've seen all returned events. Avoids issues seen on SunOS and Darwin where LIST_NEXT would return garbage. Use event_del() while here. --- pkgtools/pbulk/files/pbulk/lib/event.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/lib/event.c b/pkgtools/pbulk/files/pbulk/lib/event.c index 32e563828f8c0..f88932b18739f 100644 --- a/pkgtools/pbulk/files/pbulk/lib/event.c +++ b/pkgtools/pbulk/files/pbulk/lib/event.c @@ -345,13 +345,11 @@ event_dispatch(void) if (ret > 0) { iter = poll_list; for (ev = LIST_FIRST(&all_events); - iter < last_iter && ev && (next = LIST_NEXT(ev, ev_link), 1); + ret && iter < last_iter && ev && (next = LIST_NEXT(ev, ev_link), 1); ev = next, ++iter) { if (iter->revents) { - if (!ev->ev_persistent) { - --active_events; - LIST_REMOVE(ev, ev_link); - } + if (!ev->ev_persistent) + event_del(ev); (*ev->ev_handler)(ev->ev_fd, ev->ev_arg); --ret; } From 2aaec8693723c1c2a19cf08b28fad5696fab8432 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 9 Feb 2016 10:06:46 +0000 Subject: [PATCH 48/92] Add support for README.push --- pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk | 4 ++++ pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk | 6 ++++++ pkgtools/pbulk/files/pbulk/scripts/pkg-build | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk index 62fe863b3d03c..0a76f4cc5ad47 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk @@ -229,6 +229,8 @@ BEGIN { pkgsrc_build_start_iso = substr($0, 17) else if ($0 ~ "^BUILD_END_ISO=") pkgsrc_build_end_iso = substr($0, 15) + else if ($0 ~ "^DESCRIPTION=") + pkgsrc_description = substr($0, 13) } close(status_file) @@ -271,6 +273,8 @@ BEGIN { print " " > html_report print " " > html_report printf("

pkgsrc bulk build for %s

\n", pkgsrc_platform) > html_report + if (pkgsrc_description) + printf("

Description: %s

\n", pkgsrc_description) > html_report printf("

Build start: %s

\n", pkgsrc_build_start_iso) > html_report printf("

Build end: %s

\n", pkgsrc_build_end_iso) > html_report print "
" > html_report diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk index 5e2e48775aab6..b32db85d9410d 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-txt.awk @@ -72,6 +72,8 @@ BEGIN { pkgsrc_build_end_iso = substr($0, 15) else if ($0 ~ "^BASE_URL=") pkgsrc_base_url = substr($0, 10) + else if ($0 ~ "^DESCRIPTION=") + pkgsrc_description = substr($0, 13) } close(status_file) @@ -121,6 +123,10 @@ BEGIN { print "pkgsrc bulk build report" > txt_report print "========================" > txt_report print "" > txt_report + if (pkgsrc_description) { + print "Description: " pkgsrc_description > txt_report + print "" > txt_report + } print pkgsrc_platform > txt_report print "Compiler: " pkgsrc_compiler > txt_report print "" > txt_report diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index efa9ad4d1e360..ca51c3eeca67a 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -190,6 +190,10 @@ if [ ${ret} -eq 0 ]; then echo "COMPILER=${compiler}" >> ${loc}/status echo "PLATFORM=${opsys} ${opver}/${platform}" >> ${loc}/status + + if [ -s ${pkgsrc}/README.push ]; then + echo "DESCRIPTION=`head -1 ${pkgsrc}/README.push`" >> ${loc}/status + fi fi ${pkg_up_to_date_script} ${pkgname} ${dependencies} && exit 0 From 9c824017397176ae64dc98bfe13e0a46cff39012 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 21 Mar 2016 14:25:33 +0000 Subject: [PATCH 49/92] Add support for --link-dest atomic updates. --- pkgtools/pbulk/files/pbulk/scripts/upload | 39 ++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index ad030a7d31818..3cbd0484bae95 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -62,4 +62,41 @@ cd ${packages} echo "+ All/pkg_summary.xz" ${packages_script} ${loc} ${pkg_sufx} echo "- *" -} | LC_ALL=C sort | ${rsync} --exclude-from=- ${pkg_rsync_args} . ${pkg_rsync_target} +} | LC_ALL=C sort >/tmp/rsync-exclude-$$ + +# Joyent specific. Additional pbulk.conf variables provide host + directory so +# that we can insert the rsync --link-dest argument and ensure atomic directory +# updates. Requires pkg_rsync_target_linkdest and pkg_rsync_target_tmpdest to +# reside on the same file system for hardlinks. +if [ -z "${pkg_rsync_target_host}" -o \ + -z "${pkg_rsync_target_linkdest}" -o \ + -z "${pkg_rsync_target_tmpdest}" ]; then + # Legacy sync, just performed in-place directly to target. + ${rsync} --exclude-from=/tmp/rsync-exclude-$$ ${pkg_rsync_args} \ + . ${pkg_rsync_target} +else + # Use link-dest to create/update to a shadow directory. The tmpdest + # argument requires the usual parent directories to exist first. If + # link-dest doesn't exist (e.g. an initial sync) it is not an error. + ${rsync} --exclude-from=/tmp/rsync-exclude-$$ ${pkg_rsync_args} \ + --link-dest=${pkg_rsync_target_linkdest} \ + . ${pkg_rsync_target_host}:${pkg_rsync_target_tmpdest} + + # Move any existing linkdest out of the way, promote the new tmpdest, + # and remove the previous linkdest. We move it to a directory based + # on tmpdest as that is usually a hidden directory, avoiding directory + # listings showing the old directory while it is being deleted. + ssh ${pkg_rsync_target_host} " + if [ -f ${pkg_rsync_target_tmpdest}/All/pkg_summary.gz ]; then + if [ -d ${pkg_rsync_target_linkdest} ]; then + mv ${pkg_rsync_target_linkdest} ${pkg_rsync_target_tmpdest}-old + else + mkdir -p $(dirname ${pkg_rsync_target_linkdest}) + fi + mv ${pkg_rsync_target_tmpdest} ${pkg_rsync_target_linkdest} + rm -rf ${pkg_rsync_target_tmpdest}-old + fi + " +fi + +rm -f /tmp/rsync-exclude-$$ From 529ee5e45b2fb8238d9003dc21e8935a8bbc7b65 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 13 Oct 2016 09:56:05 +0100 Subject: [PATCH 50/92] Support $report_platform. --- pkgtools/pbulk/files/pbulk/scripts/pkg-build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index ca51c3eeca67a..1c5a2cffdc7e2 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -189,7 +189,11 @@ if [ ${ret} -eq 0 ]; then compiler=`cd ${pkgsrc}/pkgtools/pkg_install && ${make} show-var VARNAME=PKGSRC_COMPILER` echo "COMPILER=${compiler}" >> ${loc}/status - echo "PLATFORM=${opsys} ${opver}/${platform}" >> ${loc}/status + if [ -n "${report_platform}" ]; then + echo "PLATFORM=${report_platform}" >> ${loc}/status + else + echo "PLATFORM=${opsys} ${opver}/${platform}" >> ${loc}/status + fi if [ -s ${pkgsrc}/README.push ]; then echo "DESCRIPTION=`head -1 ${pkgsrc}/README.push`" >> ${loc}/status From 5bc816246cece1d28cb508cc6f95e5cf80cc2be2 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 13 Oct 2016 09:56:30 +0100 Subject: [PATCH 51/92] Generate pkg_files archives. --- pkgtools/pbulk/files/pbulk/scripts/build | 6 ++++++ pkgtools/pbulk/files/pbulk/scripts/pkg-build | 2 ++ pkgtools/pbulk/files/pbulk/scripts/upload | 3 +++ 3 files changed, 11 insertions(+) diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 165299e15ba7c..aae813b3e93f6 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -60,6 +60,9 @@ date '+BUILD_END_ISO=%Y-%m-%d %H:%M' >> ${loc}/status echo "Building pkg_summary..." cd ${packages}/All +sed -e 's,^,../pkginfo/,' -e 's/$/.pkglist/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_files.gz +${gzip} -dc < pkg_files.gz | ${bzip2} -c > pkg_files.bz2 +${gzip} -dc < pkg_files.gz | ${xz} -zc > pkg_files.xz sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_summary.gz ${gzip} -dc < pkg_summary.gz | ${bzip2} -c > pkg_summary.bz2 ${gzip} -dc < pkg_summary.gz | ${xz} -zc > pkg_summary.xz @@ -69,6 +72,9 @@ if [ "${checksum_packages}" != "no" ] && \ echo "Building SHA512..." cd ${packages} { + ${digest} SHA512 All/pkg_files.bz2 + ${digest} SHA512 All/pkg_files.gz + ${digest} SHA512 All/pkg_files.xz ${digest} SHA512 All/pkg_summary.bz2 ${digest} SHA512 All/pkg_summary.gz ${digest} SHA512 All/pkg_summary.xz diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 1c5a2cffdc7e2..30da8c9eb2dd2 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build @@ -318,6 +318,8 @@ if [ -z "${restricted}" ]; then > ${packages}/checksums/${pkgname}.sha512 || cleanup ${pkg_info} -X All/${pkgname}${pkg_sufx} \ > ${packages}/pkginfo/${pkgname}.pkginfo || cleanup + ${pkg_info} -L All/${pkgname}${pkg_sufx} \ + > ${packages}/pkginfo/${pkgname}.pkglist || cleanup ) fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 3cbd0484bae95..425c44894a2e2 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -57,6 +57,9 @@ cd ${packages} [ "${checksum_packages}" != "no" ] && \ [ "${checksum_packages}" != "NO" ] && \ echo "+ SHA512.bz2" + echo "+ All/pkg_files.bz2" + echo "+ All/pkg_files.gz" + echo "+ All/pkg_files.xz" echo "+ All/pkg_summary.bz2" echo "+ All/pkg_summary.gz" echo "+ All/pkg_summary.xz" From e324d548fe0fbb4673ffbb7a2f0e94ba09950053 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 18 Jan 2017 11:38:04 +0000 Subject: [PATCH 52/92] Category links are no more, remove support for them. --- .../files/pbulk/scripts/compute-packages.awk | 15 +-------------- pkgtools/pbulk/files/pbulk/scripts/upload | 1 + 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk index deb5dba744cef..4c4240ed6db5f 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/compute-packages.awk @@ -53,9 +53,6 @@ BEGIN { pkgs[cur] = cur } - if ($0 ~ "^CATEGORIES=") - categories[cur] = substr($0, 12) - if ($0 ~ "^BUILD_STATUS=") status[cur] = substr($0, 14) @@ -82,17 +79,7 @@ BEGIN { # skip restricted packages if (pkg in restricted) continue; - # build category/file list - split(categories[pkg], cats, "[ \t]+") - cats[0] = "All" - for (cat_idx in cats) { - cat = cats[cat_idx] - if (!(cat in printed_cats)) { - print "+ " cat "/" - printed_cats[cat] = cat - } - print "+ " cat "/" pkg pkg_sufx - } + print "+ All/" pkg pkg_sufx } close(success_file) } diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 425c44894a2e2..8614063a872a3 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -57,6 +57,7 @@ cd ${packages} [ "${checksum_packages}" != "no" ] && \ [ "${checksum_packages}" != "NO" ] && \ echo "+ SHA512.bz2" + echo "+ All/" echo "+ All/pkg_files.bz2" echo "+ All/pkg_files.gz" echo "+ All/pkg_files.xz" From d672f0672c05c1a88969b439dcba3ff560c0f5a8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 19 Jan 2017 16:29:56 +0000 Subject: [PATCH 53/92] Ensure the options cache directory is created. --- pkgtools/pbulk/files/pbulk/scripts/pre-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/pre-build b/pkgtools/pbulk/files/pbulk/scripts/pre-build index 1113676e8fce0..63ad099ab3e4c 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pre-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pre-build @@ -82,7 +82,7 @@ else rm -rf "${bulklog}"/* || true fi -mkdir -p "${bulklog}" "${loc}" +mkdir -p "${bulklog}" "${bulklog}/cache" "${loc}" @PREFIX@/libexec/pbulk/client-clean From fdf643e45dccb52b963557fe8239a510f87ae003 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 19 Jan 2017 16:33:09 +0000 Subject: [PATCH 54/92] Use --partial-dir to avoid rsync mirror failures. --- pkgtools/pbulk/files/pbulk/scripts/upload | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/upload b/pkgtools/pbulk/files/pbulk/scripts/upload index 8614063a872a3..1949e0f9a3c21 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/upload +++ b/pkgtools/pbulk/files/pbulk/scripts/upload @@ -77,13 +77,13 @@ if [ -z "${pkg_rsync_target_host}" -o \ -z "${pkg_rsync_target_tmpdest}" ]; then # Legacy sync, just performed in-place directly to target. ${rsync} --exclude-from=/tmp/rsync-exclude-$$ ${pkg_rsync_args} \ - . ${pkg_rsync_target} + --partial-dir=.rsync-partial . ${pkg_rsync_target} else # Use link-dest to create/update to a shadow directory. The tmpdest # argument requires the usual parent directories to exist first. If # link-dest doesn't exist (e.g. an initial sync) it is not an error. - ${rsync} --exclude-from=/tmp/rsync-exclude-$$ ${pkg_rsync_args} \ - --link-dest=${pkg_rsync_target_linkdest} \ + ${rsync} --exclude-from=/tmp/rsync-exclude-$$ ${pkg_rsync_args} \ + --partial-dir=.rsync-partial --link-dest=${pkg_rsync_target_linkdest} \ . ${pkg_rsync_target_host}:${pkg_rsync_target_tmpdest} # Move any existing linkdest out of the way, promote the new tmpdest, From c2286ba87df65634bb3b2ab4f17287ff5900deca Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 25 May 2017 12:03:35 +0100 Subject: [PATCH 55/92] Add parallelism to pkg_{files,summary} creation. --- pkgtools/pbulk/files/pbulk/scripts/build | 25 ++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index aae813b3e93f6..8ec998b415b13 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -60,12 +60,25 @@ date '+BUILD_END_ISO=%Y-%m-%d %H:%M' >> ${loc}/status echo "Building pkg_summary..." cd ${packages}/All -sed -e 's,^,../pkginfo/,' -e 's/$/.pkglist/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_files.gz -${gzip} -dc < pkg_files.gz | ${bzip2} -c > pkg_files.bz2 -${gzip} -dc < pkg_files.gz | ${xz} -zc > pkg_files.xz -sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success | sort | xargs cat 2>/dev/null | ${gzip} -c > pkg_summary.gz -${gzip} -dc < pkg_summary.gz | ${bzip2} -c > pkg_summary.bz2 -${gzip} -dc < pkg_summary.gz | ${xz} -zc > pkg_summary.xz +{ + sed -e 's,^,../pkginfo/,' -e 's/$/.pkglist/' < ${loc}/success \ + | sort | xargs cat 2>/dev/null > pkg_files + cat pkg_files | ${gzip} -c > pkg_files.gz & + cat pkg_files | ${bzip2} -c > pkg_files.bz2 & + cat pkg_files | ${xz} -zc > pkg_files.xz & + wait + rm -f pkg_files +} & +{ + sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success \ + | sort | xargs cat 2>/dev/null > pkg_summary + cat pkg_summary | ${gzip} -c > pkg_summary.gz & + cat pkg_summary | ${bzip2} -c > pkg_summary.bz2 & + cat pkg_summary | ${xz} -zc > pkg_summary.xz & + wait + rm -f pkg_summary +} & +wait if [ "${checksum_packages}" != "no" ] && \ [ "${checksum_packages}" != "NO" ]; then From fae6b037791329c26804d212bf681ff2e3a371ae Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 3 Jul 2017 14:09:35 +0100 Subject: [PATCH 56/92] Send report mail after finishing report upload. --- pkgtools/pbulk/files/pbulk/scripts/report | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/report b/pkgtools/pbulk/files/pbulk/scripts/report index 498c3135a9201..ce5c1ff7836df 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/report +++ b/pkgtools/pbulk/files/pbulk/scripts/report @@ -73,9 +73,6 @@ if [ -z "${build_start_iso}" ] || [ -z "${build_start_dir}" ]; then exit 1 fi -echo "Sending report mail..." -cat ${loc}/report.txt | ${mail} -s "${report_subject_prefix} ${platform} ${build_start_iso}" ${report_recipients} - cd ${bulklog} echo "Uploading report..." { @@ -123,3 +120,6 @@ echo "Uploading report..." ${rsync} --exclude-from=- ${report_rsync_args} . ${report_rsync_target}/${build_start_dir} fi } + +echo "Sending report mail..." +cat ${loc}/report.txt | ${mail} -s "${report_subject_prefix} ${platform} ${build_start_iso}" ${report_recipients} From 1aa2f216d1a66c5fdc3884f9738333c2f225a079 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 Jul 2017 16:12:14 +0100 Subject: [PATCH 57/92] fix "set -e" failure in new pkg_summary generation. --- pkgtools/pbulk/files/pbulk/scripts/build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 8ec998b415b13..931ab078f5858 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -62,7 +62,7 @@ echo "Building pkg_summary..." cd ${packages}/All { sed -e 's,^,../pkginfo/,' -e 's/$/.pkglist/' < ${loc}/success \ - | sort | xargs cat 2>/dev/null > pkg_files + | sort | xargs cat 2>/dev/null > pkg_files || true cat pkg_files | ${gzip} -c > pkg_files.gz & cat pkg_files | ${bzip2} -c > pkg_files.bz2 & cat pkg_files | ${xz} -zc > pkg_files.xz & @@ -71,7 +71,7 @@ cd ${packages}/All } & { sed -e 's,^,../pkginfo/,' -e 's/$/.pkginfo/' < ${loc}/success \ - | sort | xargs cat 2>/dev/null > pkg_summary + | sort | xargs cat 2>/dev/null > pkg_summary || true cat pkg_summary | ${gzip} -c > pkg_summary.gz & cat pkg_summary | ${bzip2} -c > pkg_summary.bz2 & cat pkg_summary | ${xz} -zc > pkg_summary.xz & From ae25f42bec1230a2dd8d01385809c89fa73d2946 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 16 Jul 2013 11:58:55 +0100 Subject: [PATCH 58/92] Apply pbulk support for MySQL/Percona. This updates the mysql.buildlink3.mk file to support multiple versions, and adds some support for building multiple p5-DBD-mysql and py-mysqldb packages. --- audio/amarok/Makefile | 8 +- audio/squeezeboxserver/Makefile | 6 +- databases/innotop/Makefile | 2 +- databases/mytop/Makefile | 2 +- databases/p5-DBD-mysql/Makefile | 2 +- .../p5-DBIx-Class-Schema-Loader/options.mk | 2 +- databases/percona-toolkit/Makefile | 2 +- databases/py-mysqldb/Makefile | 2 +- devel/bugzilla/options.mk | 2 +- devel/bugzilla3/options.mk | 2 +- devel/py-trytond/options.mk | 2 +- devel/rt-mysql/Makefile.common | 2 +- devel/rt3/Makefile | 2 +- devel/rt4/options.mk | 2 +- mail/akonadi/options.mk | 8 +- mail/opendmarc/Makefile | 2 +- mail/sympa/Makefile | 2 +- meta-pkgs/bulk-medium/Makefile | 2 +- mk/mysql.buildlink3.mk | 230 ++++++++++-------- net/dnscheck/Makefile | 2 +- net/proftpd-mysql/Makefile | 2 +- net/proftpd/Makefile.common | 5 + net/proftpd/distinfo | 1 + net/proftpd/patches/patch-configure | 15 ++ security/zoneminder/Makefile | 5 +- www/py-django14/options.mk | 2 +- 26 files changed, 189 insertions(+), 125 deletions(-) create mode 100644 net/proftpd/patches/patch-configure diff --git a/audio/amarok/Makefile b/audio/amarok/Makefile index 4443547d8fbd0..5b540e0d57a95 100644 --- a/audio/amarok/Makefile +++ b/audio/amarok/Makefile @@ -40,17 +40,17 @@ SUBST_SED.mysql= -e s:/opt/mysqle/:${BUILDLINK_PREFIX.mysql-server}: .include "options.mk" .include "../../mk/mysql.buildlink3.mk" -.if ${_MYSQL_VERSION} == "56" +.if ${MYSQL_VERSION} == "56" .include "../../databases/mysql56-server/buildlink3.mk" SUBST_SED.mysql+= -e s:@@WLR@@:${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.mysql-server}/lib: -.elif ${_MYSQL_VERSION} == "55" +.elif ${MYSQL_VERSION} == "55" .include "../../databases/mysql55-server/buildlink3.mk" SUBST_SED.mysql+= -e s:@@WLR@@:${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.mysql-server}/lib: -.elif ${_MYSQL_VERSION} == "51" +.elif ${MYSQL_VERSION} == "51" .include "../../databases/mysql51-server/buildlink3.mk" SUBST_SED.mysql+= -e s:@@WLR@@:${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.mysql-server}/lib/mysql: .else -PKG_FAIL_REASON+= "Unknown mysql version: ${_MYSQL_VERSION}" +PKG_FAIL_REASON+= "Unknown mysql version: ${MYSQL_VERSION}" .endif .include "../../audio/liblastfm/buildlink3.mk" diff --git a/audio/squeezeboxserver/Makefile b/audio/squeezeboxserver/Makefile index 613aea2ea1f4d..21be481913940 100644 --- a/audio/squeezeboxserver/Makefile +++ b/audio/squeezeboxserver/Makefile @@ -67,7 +67,9 @@ LICENSE= squeezeboxserver-license # Database server MYSQL_VERSIONS_ACCEPTED= 55 .include "../../mk/mysql.buildlink3.mk" -.include "${MYSQL_PKGSRCDIR:S/-client$/-server/}/buildlink3.mk" + +# Make sure p5-DBD-{mysql,percona}* matches the mysql.bl3 above +BUILD_DEPENDS+= p5-DBD-${MYSQL_PKG_PREFIX}-[0-9]*:../../databases/p5-DBD-mysql # Audio converters DEPENDS+= wavpack-[0-9]*:../../audio/wavpack @@ -79,7 +81,7 @@ DEPENDS+= faad2-[0-9]*:../../audio/faad2 DEPENDS+= p5-Audio-Scan>=0.84:../../audio/p5-Audio-Scan DEPENDS+= p5-Class-XSAccessor>=1.05:../../devel/p5-Class-XSAccessor #DEPENDS+= {perl>=5.10.0,p5-Compress-Raw-Zlib-[0-9]*}:../../devel/p5-Compress-Raw-Zlib -DEPENDS+= p5-DBD-mysql>=3.0002:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql DEPENDS+= p5-DBI>=1.608:../../databases/p5-DBI DEPENDS+= p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1 DEPENDS+= p5-EV>=3.8:../../devel/p5-EV diff --git a/databases/innotop/Makefile b/databases/innotop/Makefile index 5f98711dfaf7c..9445e30099eaa 100644 --- a/databases/innotop/Makefile +++ b/databases/innotop/Makefile @@ -13,7 +13,7 @@ LICENSE= gnu-gpl-v2 DEPENDS+= p5-Term-ReadKey>=2.10:../../devel/p5-Term-ReadKey DEPENDS+= p5-DBI>=1.13:../../databases/p5-DBI -DEPENDS+= p5-DBD-mysql>=1.0:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql PERL5_PACKLIST= auto/innotop/.packlist REPLACE_PERL= innotop diff --git a/databases/mytop/Makefile b/databases/mytop/Makefile index bfd4a46b10dd3..c1c65564ec7a9 100644 --- a/databases/mytop/Makefile +++ b/databases/mytop/Makefile @@ -13,7 +13,7 @@ LICENSE= gnu-gpl-v2 DEPENDS+= p5-DBI-[0-9]*:../../databases/p5-DBI #DEPENDS+= p5-Term-ANSIColor-[0-9]*:../../devel/p5-Term-ANSIColor DEPENDS+= p5-Term-ReadKey-[0-9]*:../../devel/p5-Term-ReadKey -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql PERL5_PACKLIST= auto/mytop/.packlist REPLACE_PERL= mytop diff --git a/databases/p5-DBD-mysql/Makefile b/databases/p5-DBD-mysql/Makefile index 45c840e16fc7d..450090eb979c2 100644 --- a/databases/p5-DBD-mysql/Makefile +++ b/databases/p5-DBD-mysql/Makefile @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.76 2019/01/06 09:09:16 markd Exp $ DISTNAME= DBD-mysql-4.049 -PKGNAME= p5-${DISTNAME} +PKGNAME= p5-${DISTNAME:S/mysql/${MYSQL_PKG_PREFIX}/} PKGREVISION= 1 CATEGORIES= databases perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=DBD/} diff --git a/databases/p5-DBIx-Class-Schema-Loader/options.mk b/databases/p5-DBIx-Class-Schema-Loader/options.mk index 4d6f0e05f3a14..82ed4ff1ecce8 100644 --- a/databases/p5-DBIx-Class-Schema-Loader/options.mk +++ b/databases/p5-DBIx-Class-Schema-Loader/options.mk @@ -13,7 +13,7 @@ BUILDLINK_DEPMETHOD.p5-DBI?= full .endif .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=4.004:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql BUILDLINK_DEPMETHOD.p5-DBI?= full .endif diff --git a/databases/percona-toolkit/Makefile b/databases/percona-toolkit/Makefile index 2e380a0b79e90..f049a922426a8 100644 --- a/databases/percona-toolkit/Makefile +++ b/databases/percona-toolkit/Makefile @@ -32,7 +32,7 @@ SUBST_FILES.sh+= blib/script/pt-mysql-summary SUBST_FILES.sh+= blib/script/pt-summary SUBST_SED.sh+= -e 's|^\#!.*|\#!${TOOLS_PATH.sh}|' -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql #DEPENDS+= {perl>=5.7.3,p5-Time-HiRes-[0-9]*}:../../time/p5-Time-HiRes PERL5_PACKLIST= auto/percona-toolkit/.packlist diff --git a/databases/py-mysqldb/Makefile b/databases/py-mysqldb/Makefile index 99dfae7157450..95bdda7aaf053 100644 --- a/databases/py-mysqldb/Makefile +++ b/databases/py-mysqldb/Makefile @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.46 2018/07/03 05:03:07 adam Exp $ DISTNAME= MySQL-python-1.2.5 -PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/MySQL-python/mysqldb/} +PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/MySQL-python/${MYSQL_PKG_PREFIX}db/} CATEGORIES= databases python MASTER_SITES= ${MASTER_SITE_PYPI:=M/MySQL-python/} EXTRACT_SUFX= .zip diff --git a/devel/bugzilla/options.mk b/devel/bugzilla/options.mk index ac127e60aba6f..9f9bac84e5939 100644 --- a/devel/bugzilla/options.mk +++ b/devel/bugzilla/options.mk @@ -19,7 +19,7 @@ PKG_SUGGESTED_OPTIONS= sqlite ### Use mysql or postgresql backend ### .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=4.000:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql DBDRIVER= mysql .elif !empty(PKG_OPTIONS:Msqlite) DEPENDS+= p5-DBD-SQLite>=1.54:../../databases/p5-DBD-SQLite diff --git a/devel/bugzilla3/options.mk b/devel/bugzilla3/options.mk index aaed3f2d68adc..2ba0c3d843389 100644 --- a/devel/bugzilla3/options.mk +++ b/devel/bugzilla3/options.mk @@ -19,7 +19,7 @@ PKG_SUGGESTED_OPTIONS= mysql ### Use mysql or postgresql backend ### .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=4.000:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql DBDRIVER= mysql .elif !empty(PKG_OPTIONS:Mpgsql) DEPENDS+= p5-DBD-postgresql>=1.45:../../databases/p5-DBD-postgresql diff --git a/devel/py-trytond/options.mk b/devel/py-trytond/options.mk index 2f8dd8a21fbdb..e240106916787 100644 --- a/devel/py-trytond/options.mk +++ b/devel/py-trytond/options.mk @@ -16,7 +16,7 @@ DEPENDS+= ${PYPKGPREFIX}-cdecimal-[0-9]*:../../math/py-cdecimal .if !empty(PKG_OPTIONS:Mmysql) PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 37 # py-mysqldb -DEPENDS+= ${PYPKGPREFIX}-mysqldb-[0-9]*:../../databases/py-mysqldb +DEPENDS+= ${PYPKGPREFIX}-${MYSQL_PKG_PREFIX}db-[0-9]*:../../databases/py-mysqldb .endif .if !empty(PKG_OPTIONS:Mpydot) diff --git a/devel/rt-mysql/Makefile.common b/devel/rt-mysql/Makefile.common index e27f6f7878764..96b913cdef7a2 100644 --- a/devel/rt-mysql/Makefile.common +++ b/devel/rt-mysql/Makefile.common @@ -55,7 +55,7 @@ REPLACE_PERL+= tools/insertdata \ .if (${RT_DB_TYPE} == "mysql") PKGNAME= ${DISTNAME:S/-/./g:S/./-mysql-/} -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql RT_DB_HOST?= localhost RT_DB_PORT?= RT_DB_PATH?= ${PREFIX}/lib/mysql diff --git a/devel/rt3/Makefile b/devel/rt3/Makefile index 25cb1eb17893d..b74054d7eca10 100644 --- a/devel/rt3/Makefile +++ b/devel/rt3/Makefile @@ -105,7 +105,7 @@ rm-speedycgi: # Back-end dependencies .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=2.1018:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql _RT_DB_TYPE= mysql .elif !empty(PKG_OPTIONS:Mpgsql) DEPENDS+= p5-DBD-postgresql>=1.43:../../databases/p5-DBD-postgresql diff --git a/devel/rt4/options.mk b/devel/rt4/options.mk index 3909eaef085e0..64458947fe141 100644 --- a/devel/rt4/options.mk +++ b/devel/rt4/options.mk @@ -23,7 +23,7 @@ DEPENDS+= p5-HTML-Mason>=1.36:../../www/p5-HTML-Mason # Backend database dependencies .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=2.1018:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql RT_DB_TYPE= mysql .elif !empty(PKG_OPTIONS:Mpgsql) DEPENDS+= p5-DBD-postgresql>=1.43:../../databases/p5-DBD-postgresql diff --git a/mail/akonadi/options.mk b/mail/akonadi/options.mk index 20e3eea2d6a26..7d9555e9b186a 100644 --- a/mail/akonadi/options.mk +++ b/mail/akonadi/options.mk @@ -17,14 +17,14 @@ PKG_SUGGESTED_OPTIONS= sqlite .include "../../mk/mysql.buildlink3.mk" DEPENDS+= qt4-mysql-[0-9]*:../../x11/qt4-mysql CMAKE_ARGS+= -DAKONADI_BUILD_QSQLITE=off -. if ${_MYSQL_VERSION} == "56" +. if ${MYSQL_VERSION} == "56" . include "../../databases/mysql56-server/buildlink3.mk" -. elif ${_MYSQL_VERSION} == "55" +. elif ${MYSQL_VERSION} == "55" . include "../../databases/mysql55-server/buildlink3.mk" -. elif ${_MYSQL_VERSION} == "51" +. elif ${MYSQL_VERSION} == "51" . include "../../databases/mysql51-server/buildlink3.mk" . else -PKG_FAIL_RESASON+= "Unknown MySQL version: ${_MYSQL_VERSION}" +PKG_FAIL_RESASON+= "Unknown MySQL version: ${MYSQL_VERSION}" . endif SUBST_CLASSES+= mysql SUBST_STAGE.mysql= pre-configure diff --git a/mail/opendmarc/Makefile b/mail/opendmarc/Makefile index e686917cfc349..9ccb0f21797c6 100644 --- a/mail/opendmarc/Makefile +++ b/mail/opendmarc/Makefile @@ -11,7 +11,7 @@ COMMENT= Open source DMARC library, MTA filter implementation and tools LICENSE= modified-bsd DEPENDS+= p5-DBI-[0-9]*:../../databases/p5-DBI -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql #DEPENDS+= {perl>=5.6.1,p5-File-Temp-[0-9]*}:../../devel/p5-File-Temp DEPENDS+= p5-Switch-[0-9]*:../../lang/p5-Switch diff --git a/mail/sympa/Makefile b/mail/sympa/Makefile index afed121c1caa3..97becd3cdf23b 100644 --- a/mail/sympa/Makefile +++ b/mail/sympa/Makefile @@ -96,7 +96,7 @@ RCD_SCRIPTS= archived bounced bulk sympa task_manager .include "../../mk/bsd.options.mk" .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= p5-DBD-mysql>=2.0407:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql .endif .if !empty(PKG_OPTIONS:Mpgsql) diff --git a/meta-pkgs/bulk-medium/Makefile b/meta-pkgs/bulk-medium/Makefile index 57edb493c7843..8271682b2cee0 100644 --- a/meta-pkgs/bulk-medium/Makefile +++ b/meta-pkgs/bulk-medium/Makefile @@ -141,7 +141,7 @@ BUILD_DEPENDS+= libvorbis-[0-9]*:../../audio/libvorbis BUILD_DEPENDS+= gdbm-[0-9]*:../../databases/gdbm BUILD_DEPENDS+= p5-BDB-[0-9]*:../../databases/p5-BDB BUILD_DEPENDS+= p5-BerkeleyDB-[0-9]*:../../databases/p5-BerkeleyDB -BUILD_DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +BUILD_DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql BUILD_DEPENDS+= p5-DBD-postgresql-[0-9]*:../../databases/p5-DBD-postgresql BUILD_DEPENDS+= p5-DBI-[0-9]*:../../databases/p5-DBI BUILD_DEPENDS+= ${PYPKGPREFIX}-bsddb3-[0-9]*:../../databases/py-bsddb3 diff --git a/mk/mysql.buildlink3.mk b/mk/mysql.buildlink3.mk index c56e43808b97c..0230738da8ee4 100644 --- a/mk/mysql.buildlink3.mk +++ b/mk/mysql.buildlink3.mk @@ -8,7 +8,9 @@ # MYSQL_VERSION_DEFAULT # The preferred MySQL version. # -# Possible: 57 56 55 51 MARIADB55 +# Possible: 57 56 55 51 mariadb55 mariadb100 +# 73-cluster percona57 percona56 percona55 +# percona57-cluster percona56-cluster percona55-cluster # Default: 57 # # === Package-settable variables === @@ -19,6 +21,20 @@ # Possible: (see MYSQL_VERSION_DEFAULT) # Default: (all) # +# === Variables defined by this file === +# +# MYSQL_VERSION +# The MySQL version that is actually used. +# +# Possible: (see MYSQL_VERSION_DEFAULT) +# +# MYSQL_PKG_PREFIX +# The package name prefix for the selected version. +# +# Possible: mysql73-cluster mysql57 mysql56 mysql55 mysql51 mysql5 +# percona57 percona56 percona55 +# percona55-cluster percona56-cluster percona57-cluster +# .if !defined(MYSQL_VERSION_MK) MYSQL_VERSION_MK= # defined @@ -26,122 +42,144 @@ MYSQL_VERSION_MK= # defined _VARGROUPS+= mysql _USER_VARS.mysql= MYSQL_VERSION_DEFAULT _PKG_VARS.mysql= MYSQL_VERSIONS_ACCEPTED -_SYS_VARS.mysql= MYSQL_PKGSRCDIR +_SYS_VARS.mysql= MYSQL_VERSION MYSQL_PKG_PREFIX .include "../../mk/bsd.prefs.mk" MYSQL_VERSION_DEFAULT?= 57 -MYSQL_VERSIONS_ACCEPTED?= 57 56 55 51 MARIADB55 +BUILD_DEFS+= MYSQL_VERSION_DEFAULT +BUILD_DEFS_EFFECTS+= MYSQL_VERSION MYSQL_PKG_PREFIX -# transform the list into individual variables -.for mv in ${MYSQL_VERSIONS_ACCEPTED} -_MYSQL_VERSION_${mv}_OK= yes -.endfor +# Package-settable variables +MYSQL_VERSIONS_ACCEPTED?= ${_PKG_MYSQLS} -# check what is installed -.if ${OPSYS} == "Darwin" -. if exists(${LOCALBASE}/lib/libmysqlclient.20.dylib) -_MYSQL_VERSION_57_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 57 -. endif -. if exists(${LOCALBASE}/lib/libmysqlclient.18.dylib) -. if exists(${LOCALBASE}/include/mysql/mysql/client_authentication.h) -_MYSQL_VERSION_56_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 56 -. else -_MYSQL_VERSION_55_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 55 -. endif -. endif -. if exists(${LOCALBASE}/lib/mysql/libmysqlclient.16.dylib) -_MYSQL_VERSION_51_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 51 -. endif -.else -. if exists(${LOCALBASE}/lib/libmysqlclient.so.20) -_MYSQL_VERSION_57_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 57 -. endif -. if exists(${LOCALBASE}/lib/libmysqlclient.so.18) -. if exists(${LOCALBASE}/include/mysql/mysql/client_authentication.h) -_MYSQL_VERSION_56_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 56 -. elif exists(${LOCALBASE}/share/mariadb) -_MYSQL_VERSION_MARIADB55_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= MARIADB55 -. else -_MYSQL_VERSION_55_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 55 -. endif -. endif -. if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.16) -_MYSQL_VERSION_51_INSTALLED= yes -_MYSQL_VERSION_INSTALLED= 51 -. endif -.endif +# The available MySQL packages: +_PKG_MYSQLS= 57 56 55 51 mariadb55 mariadb100 +_PKG_MYSQLS+= 57-cluster +_PKG_MYSQLS+= percona57 percona56 percona55 +_PKG_MYSQLS+= percona55-cluster percona56-cluster percona57-cluster +_MYSQL_PKGBASE.57-cluster= mysql-cluster-7.3.* +_MYSQL_PKGSRCDIR.57-cluster= ../../joyent/mysql73-cluster +_MYSQL_PKG_PREFIX.57-cluster= mysql73-cluster -# if a version is explicitely required, take it -.if defined(MYSQL_VERSION_REQD) -_MYSQL_VERSION= ${MYSQL_VERSION_REQD} +_MYSQL_PKGBASE.57= mysql-client-5.7.* +_MYSQL_PKGSRCDIR.57= ../../databases/mysql57-client +_MYSQL_PKG_PREFIX.57= mysql57 + +_MYSQL_PKGBASE.56= mysql-client-5.6.* +_MYSQL_PKGSRCDIR.56= ../../databases/mysql56-client +_MYSQL_PKG_PREFIX.56= mysql56 + +_MYSQL_PKGBASE.55= mysql-client-5.5.* +_MYSQL_PKGSRCDIR.55= ../../databases/mysql55-client +_MYSQL_PKG_PREFIX.55= mysql55 + +_MYSQL_PKGBASE.51= mysql-client-5.1.* +_MYSQL_PKGSRCDIR.51= ../../databases/mysql51-client +_MYSQL_PKG_PREFIX.51= mysql51 + +_MYSQL_PKGBASE.mariadb55= mariadb-client-5.5.* +_MYSQL_PKGSRCDIR.mariadb55= ../../databases/mariadb55-client +_MYSQL_PKG_PREFIX.mariadb55= mariadb55 + +_MYSQL_PKGBASE.mariadb100= mariadb-client-10.0.* +_MYSQL_PKGSRCDIR.mariadb100= ../../joyent/mariadb100-client +_MYSQL_PKG_PREFIX.mariadb100= mariadb100 + +_MYSQL_PKGBASE.percona57= percona-client-5.7.* +_MYSQL_PKGSRCDIR.percona57= ../../joyent/percona57-client +_MYSQL_PKG_PREFIX.percona57= percona57 + +_MYSQL_PKGBASE.percona56= percona-client-5.6.* +_MYSQL_PKGSRCDIR.percona56= ../../joyent/percona56-client +_MYSQL_PKG_PREFIX.percona56= percona56 + +_MYSQL_PKGBASE.percona55= percona-client-5.5.* +_MYSQL_PKGSRCDIR.percona55= ../../joyent/percona55-client +_MYSQL_PKG_PREFIX.percona55= percona55 + +_MYSQL_PKGBASE.percona55-cluster= percona-cluster-5.5.* +_MYSQL_PKGSRCDIR.percona55-cluster= ../../joyent/percona55-cluster +_MYSQL_PKG_PREFIX.percona55-cluster= percona55-cluster + +_MYSQL_PKGBASE.percona56-cluster= percona-cluster-5.6.* +_MYSQL_PKGSRCDIR.percona56-cluster= ../../joyent/percona56-cluster +_MYSQL_PKG_PREFIX.percona56-cluster= percona56-cluster + +_MYSQL_PKGBASE.percona57-cluster= percona-cluster-5.7.* +_MYSQL_PKGSRCDIR.percona57-cluster= ../../joyent/percona57-cluster +_MYSQL_PKG_PREFIX.percona57-cluster= percona57-cluster + +# +# Sanity checks +# +.if empty(_PKG_MYSQLS:M${MYSQL_VERSION_DEFAULT}) +PKG_FAIL_REASON+= "[mysql.buildlink3.mk] Invalid mysql package \""${MYSQL_VERSION_DEFAULT:Q}"\" in MYSQL_VERSION_DEFAULT." .endif -# if the default is already installed, it is first choice -.if !defined(_MYSQL_VERSION) -. if defined(_MYSQL_VERSION_${MYSQL_VERSION_DEFAULT}_OK) -. if defined(_MYSQL_VERSION_${MYSQL_VERSION_DEFAULT}_INSTALLED) -_MYSQL_VERSION= ${MYSQL_VERSION_DEFAULT} -. endif + +.for _myver_ in ${MYSQL_VERSIONS_ACCEPTED} +. if empty(_PKG_MYSQLS:M${_myver_}) +PKG_FAIL_REASON+= "[mysql.buildlink3.mk] Invalid mysql package \""${_myver_:Q}"\" in MYSQL_VERSIONS_ACCEPTED." +MYSQL_VERSIONS_ACCEPTED= # none . endif +.endfor + +# +# Mark the acceptable versions and check which packages are installed. +# +.for _myver_ in ${MYSQL_VERSIONS_ACCEPTED} +_MYSQL_OK.${_myver_}= yes +_MYSQL_INSTALLED.${_myver_}!= \ + if ${PKG_INFO} -qe ${_MYSQL_PKGBASE.${_myver_}:Q}; then \ + ${ECHO} yes; \ + else \ + ${ECHO} no; \ + fi +.endfor +.for _myver_ in ${_PKG_MYSQLS} +_MYSQL_OK.${_myver_}?= no +.endfor + +# If a version is explicitely required, take it... +.if defined(MYSQL_VERSION_REQD) +MYSQL_VERSION= ${MYSQL_VERSION_REQD} .endif -# prefer an already installed version, in order of "accepted" -.if !defined(_MYSQL_VERSION) -. for mv in ${MYSQL_VERSIONS_ACCEPTED} -. if defined(_MYSQL_VERSION_${mv}_INSTALLED) -_MYSQL_VERSION?= ${mv} -. else -# keep information as last resort - see below -_MYSQL_VERSION_FIRSTACCEPTED?= ${mv} + +# ...otherwise use one of the installed MySQL packages... +.if !defined(MYSQL_VERSION) +. for _myver_ in ${MYSQL_VERSIONS_ACCEPTED} +. if ${_MYSQL_INSTALLED.${_myver_}} == "yes" +MYSQL_VERSION?= ${_myver_} . endif . endfor .endif -# if the default is OK for the addon pkg, take this -.if !defined(_MYSQL_VERSION) -. if defined(_MYSQL_VERSION_${MYSQL_VERSION_DEFAULT}_OK) -_MYSQL_VERSION= ${MYSQL_VERSION_DEFAULT} + +# ...otherwise prefer the default one if it is accepted... +.if !defined(MYSQL_VERSION) +. if defined(_MYSQL_OK.${MYSQL_VERSION_DEFAULT}) && \ + ${_MYSQL_OK.${MYSQL_VERSION_DEFAULT}} == "yes" +MYSQL_VERSION?= ${MYSQL_VERSION_DEFAULT} . endif .endif -# take the first one accepted by the package -.if !defined(_MYSQL_VERSION) -_MYSQL_VERSION= ${_MYSQL_VERSION_FIRSTACCEPTED} + +# ...otherwise just use the first default accepted. +.if !defined(MYSQL_VERSION) +. for _myver_ in ${MYSQL_VERSIONS_ACCEPTED} +MYSQL_VERSION?= ${_myver_} +. endfor .endif -# -# set variables for the version we decided to use: -# -.if ${_MYSQL_VERSION} == "57" -MYSQL_PKGSRCDIR= ../../databases/mysql57-client -.elif ${_MYSQL_VERSION} == "56" -MYSQL_PKGSRCDIR= ../../databases/mysql56-client -.elif ${_MYSQL_VERSION} == "MARIADB55" -MYSQL_PKGSRCDIR= ../../databases/mariadb55-client -.elif ${_MYSQL_VERSION} == "55" -MYSQL_PKGSRCDIR= ../../databases/mysql55-client -.elif ${_MYSQL_VERSION} == "51" -MYSQL_PKGSRCDIR= ../../databases/mysql51-client +.if defined(MYSQL_VERSION) +. include "${_MYSQL_PKGSRCDIR.${MYSQL_VERSION}}/buildlink3.mk" .else -# force an error -PKG_FAIL_REASON+= "[mysql.buildlink3.mk] ${_MYSQL_VERSION} is not a valid mysql package." +PKG_FAIL_REASON+= "[mysql.buildlink3.mk] No acceptable mysql version found." +MYSQL_VERSION= none .endif -# -# check installed version aginst required: -# -.if defined(_MYSQL_VERSION_INSTALLED) -. if ${_MYSQL_VERSION} != ${_MYSQL_VERSION_INSTALLED} -PKG_FAIL_REASON+= "${PKGBASE} requires mysql-${_MYSQL_VERSION}, but mysql-${_MYSQL_VERSION_INSTALLED} is already installed." -. endif -.endif +MYSQL_PKG_PREFIX= ${_MYSQL_PKG_PREFIX.${MYSQL_VERSION}} -.include "${MYSQL_PKGSRCDIR}/buildlink3.mk" +# Variable assignment for multi-mysql packages +MULTI+= MYSQL_VERSION=${MYSQL_VERSION} .endif # MYSQL_VERSION_MK diff --git a/net/dnscheck/Makefile b/net/dnscheck/Makefile index d47512e5ed101..0b848c17e9d92 100644 --- a/net/dnscheck/Makefile +++ b/net/dnscheck/Makefile @@ -23,7 +23,7 @@ DEPENDS+= p5-Socket6>=0.19:../../net/p5-Socket6 DEPENDS+= p5-IO-Socket-INET6>=2.51:../../net/p5-IO-Socket-INET6 DEPENDS+= p5-Mail-RFC822-Address-[0-9]*:../../mail/p5-Mail-RFC822-Address DEPENDS+= p5-DBI-[0-9]*:../../databases/p5-DBI -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql DEPENDS+= p5-Config-Any-[0-9]*:../../devel/p5-Config-Any DEPENDS+= p5-File-ShareDir-[0-9]*:../../devel/p5-File-ShareDir DEPENDS+= p5-File-ShareDir-Install-[0-9]*:../../devel/p5-File-ShareDir-Install diff --git a/net/proftpd-mysql/Makefile b/net/proftpd-mysql/Makefile index 84a7236a94ecd..2204682550b96 100644 --- a/net/proftpd-mysql/Makefile +++ b/net/proftpd-mysql/Makefile @@ -3,7 +3,7 @@ .include "../../net/proftpd/Makefile.module" PROFTPD_MOD= mysql -PKGNAME= ${DISTNAME:S/proftpd/proftpd-${PROFTPD_MOD}/} +PKGNAME= ${DISTNAME:S/proftpd/proftpd-${MYSQL_PKG_PREFIX}/} COMMENT= MySQL module for proftpd CONFIGURE_ARGS+= --with-shared=mod_sql_mysql diff --git a/net/proftpd/Makefile.common b/net/proftpd/Makefile.common index 6902ab63d5997..b82421b83b917 100644 --- a/net/proftpd/Makefile.common +++ b/net/proftpd/Makefile.common @@ -40,6 +40,11 @@ BUILD_DEFS+= VARBASE CHECK_SHLIBS_SKIP= libexec/proftpd/*.a CHECK_SSP_SKIP= ${CHECK_SHLIBS_SKIP} +SUBST_CLASSES+= libs +SUBST_STAGE.libs= pre-build +SUBST_FILES.libs= modules/mod_sql_mysql.c +SUBST_SED.libs= -e 's|^\(.\*\ \$$Libraries:\ \).* \$$|\1'"`mysql_config --libs`"'\ \$$|' + .include "options.mk" .include "../../devel/gettext-lib/buildlink3.mk" diff --git a/net/proftpd/distinfo b/net/proftpd/distinfo index 073f13b4d211e..0738cca7b54b1 100644 --- a/net/proftpd/distinfo +++ b/net/proftpd/distinfo @@ -9,5 +9,6 @@ RMD160 (proftpd-1.3.5d.tar.gz) = 2052a7c41824c8ce9558fd11c78843b1b07ab6e7 SHA512 (proftpd-1.3.5d.tar.gz) = 3297ddd1f11d46123bbe46488d75fa7a6dcdf2c2d6e7e880a78a427f9f1e9901878dab179e41092e0b9864a615d8ba0b0bf444d4f829870e993e3169c7141c37 Size (proftpd-1.3.5d.tar.gz) = 29966560 bytes SHA1 (patch-Makefile.in) = 332dcd9d773770c10d876dc9da1dc7f6b1c15421 +SHA1 (patch-configure) = 5b1ba2c106217a394443b84ac418b56dab30fe28 SHA1 (patch-contrib_mod__sftp_Makefile.in) = 8a805d777597b4fb06a45b484373880e535a0cee SHA1 (patch-contrib_mod_tls.c) = e36dfa9427804b41eb2ad49378b62890325d50ed diff --git a/net/proftpd/patches/patch-configure b/net/proftpd/patches/patch-configure new file mode 100644 index 0000000000000..d595deb910a03 --- /dev/null +++ b/net/proftpd/patches/patch-configure @@ -0,0 +1,15 @@ +$NetBSD$ + +Help linker find -lperconaserverclient for percona + +--- configure.orig 2015-05-28 00:25:54.000000000 +0000 ++++ configure +@@ -37370,7 +37370,7 @@ if test x"$pr_use_mysql" = xyes; then + LDFLAGS="$LDFLAGS $ac_build_addl_libdirs" + + LIBS=`echo "$LIBS" | sed -e 's/-lsupp//g'`; +- LIBS="$LIBS -lm -lmysqlclient -lz" ++ LIBS="$LIBS $(mysql_config --libs)" + + + { echo "$as_me:$LINENO: checking for MySQL's make_scrambled_password" >&5 diff --git a/security/zoneminder/Makefile b/security/zoneminder/Makefile index 45f47f1259ea9..c60cfd1aef567 100644 --- a/security/zoneminder/Makefile +++ b/security/zoneminder/Makefile @@ -31,12 +31,15 @@ GNU_CONFIGURE= yes USE_LANGUAGES= c c++ USE_TOOLS+= aclocal autoconf autoheader automake gmake perl pkg-config +# Make sure p5-DBD-{mysql,percona}* matches the mysql.bl3 above +BUILD_DEPENDS+= p5-DBD-${MYSQL_PKG_PREFIX}-[0-9]*:../../databases/p5-DBD-mysql + # MIME::Entity is needed from p5-MIME-tools # LWP::UserAgent is needed from p5-libwww DEPENDS+= p5-Archive-Zip-[0-9]*:../../archivers/p5-Archive-Zip DEPENDS+= p5-Date-Manip-[0-9]*:../../devel/p5-Date-Manip DEPENDS+= p5-Device-SerialPort-[0-9]*:../../comms/p5-Device-SerialPort -DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql +DEPENDS+= p5-DBD-{mysql,percona}*-[0-9]*:../../databases/p5-DBD-mysql DEPENDS+= p5-MIME-Lite-[0-9]*:../../mail/p5-MIME-Lite DEPENDS+= p5-MIME-tools-[0-9]*:../../mail/p5-MIME-tools DEPENDS+= p5-PHP-Serialization-[0-9]*:../../devel/p5-PHP-Serialization diff --git a/www/py-django14/options.mk b/www/py-django14/options.mk index 0e25d929d5ed1..e55ac4151b834 100644 --- a/www/py-django14/options.mk +++ b/www/py-django14/options.mk @@ -9,7 +9,7 @@ PKG_SUGGESTED_OPTIONS= pgsql PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS} .if !empty(PKG_OPTIONS:Mmysql) -DEPENDS+= ${PYPKGPREFIX}-mysqldb-[0-9]*:../../databases/py-mysqldb +DEPENDS+= ${PYPKGPREFIX}-${MYSQL_PKG_PREFIX}db-[0-9]*:../../databases/py-mysqldb PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 37 # py-mysqldb PLIST.mysql= yes .endif From e4ddd07ce28a7d9d55f4e3220972c1953ad7618c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 10 Aug 2018 11:58:48 +0100 Subject: [PATCH 59/92] Add pbulkmulti support for php pgsql. --- databases/pear-MDB2_Driver_pgsql/Makefile | 2 +- databases/php-pdo_pgsql/Makefile | 1 + databases/php-pgsql/Makefile | 1 + databases/phppgadmin/Makefile | 2 +- devel/mantis/options.mk | 2 +- mail/roundcube/options.mk | 2 +- meta-pkgs/php56-extensions/Makefile | 4 ++-- meta-pkgs/php71-extensions/Makefile | 4 ++-- meta-pkgs/php72-extensions/Makefile | 4 ++-- meta-pkgs/php73-extensions/Makefile | 4 ++-- sysutils/zabbix-frontend/Makefile | 2 +- time/php-mrbs/options.mk | 2 +- www/davical/Makefile | 4 ++-- www/drupal7/options.mk | 2 +- www/drupal8/options.mk | 2 +- www/horde/options.mk | 2 +- www/mediawiki/options.mk | 2 +- www/moodle/options.mk | 2 +- www/php-basercms/options.mk | 2 +- www/php-nextcloud/options.mk | 2 +- www/php-owncloud/options.mk | 4 ++-- www/php-tt-rss/options.mk | 2 +- 22 files changed, 28 insertions(+), 26 deletions(-) diff --git a/databases/pear-MDB2_Driver_pgsql/Makefile b/databases/pear-MDB2_Driver_pgsql/Makefile index ea1c5fd094a37..1f67584583ff5 100644 --- a/databases/pear-MDB2_Driver_pgsql/Makefile +++ b/databases/pear-MDB2_Driver_pgsql/Makefile @@ -8,7 +8,7 @@ HOMEPAGE= http://pear.php.net/package/MDB2_Driver_pgsql COMMENT= Pgsql MDB2 driver LICENSE= modified-bsd -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql-[0-9]*:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-pear-MDB2>=2.5:../../databases/pear-MDB2 PEAR_DIRRM_EXCLUDE= lib/php/MDB2 diff --git a/databases/php-pdo_pgsql/Makefile b/databases/php-pdo_pgsql/Makefile index edc14c7adfdb5..bd5dd4960353e 100644 --- a/databases/php-pdo_pgsql/Makefile +++ b/databases/php-pdo_pgsql/Makefile @@ -1,6 +1,7 @@ # $NetBSD: Makefile,v 1.19 2016/11/12 15:42:51 taca Exp $ MODNAME= pdo_pgsql +PKGNAME= ${PHP_PKG_PREFIX}-${MODNAME}${PGSQL_VERSION}-${PHP_VERSION} CATEGORIES+= databases COMMENT= PHP extension for PHP Data Objects (PostgreSQL) diff --git a/databases/php-pgsql/Makefile b/databases/php-pgsql/Makefile index f29b565a51dff..131a89da5d456 100644 --- a/databases/php-pgsql/Makefile +++ b/databases/php-pgsql/Makefile @@ -1,6 +1,7 @@ # $NetBSD: Makefile,v 1.19 2016/11/12 15:42:51 taca Exp $ MODNAME= pgsql +PKGNAME= ${PHP_PKG_PREFIX}-${MODNAME}${PGSQL_VERSION}-${PHP_VERSION} CATEGORIES+= databases COMMENT= PHP extension for PostgreSQL databases diff --git a/databases/phppgadmin/Makefile b/databases/phppgadmin/Makefile index aeacbe18432eb..9436117c6c642 100644 --- a/databases/phppgadmin/Makefile +++ b/databases/phppgadmin/Makefile @@ -11,7 +11,7 @@ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://phppgadmin.sourceforge.net/ COMMENT= Set of PHP-scripts to administer PostgreSQL over the WWW -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=4.2.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql MESSAGE_SUBST+= EGDIR=${EGDIR} diff --git a/devel/mantis/options.mk b/devel/mantis/options.mk index ba1bf49f7bc84..9ed9861081be4 100644 --- a/devel/mantis/options.mk +++ b/devel/mantis/options.mk @@ -19,5 +19,5 @@ DEPENDS+= ${PHP_PKG_PREFIX}-jpgraph-[0-9]*:../../graphics/php-jpgraph .if !empty(PKG_OPTIONS:Mmysql) DEPENDS+= ${PHP_PKG_PREFIX}-mysqli-[0-9]*:../../databases/php-mysqli .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql-[0-9]*:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif diff --git a/mail/roundcube/options.mk b/mail/roundcube/options.mk index d07ab223fbeb7..3b22bc9db75b6 100644 --- a/mail/roundcube/options.mk +++ b/mail/roundcube/options.mk @@ -24,7 +24,7 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql-[0-9]*:../../databases/php-pdo_mysql ### Use postgresql backend. ### .if !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql-[0-9]*:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql .endif ### diff --git a/meta-pkgs/php56-extensions/Makefile b/meta-pkgs/php56-extensions/Makefile index 18825c72afb3a..511b7bf8331de 100644 --- a/meta-pkgs/php56-extensions/Makefile +++ b/meta-pkgs/php56-extensions/Makefile @@ -43,9 +43,9 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pcntl>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-p DEPENDS+= ${PHP_PKG_PREFIX}-pdo>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo DEPENDS+= ${PHP_PKG_PREFIX}-pdo_dblib>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_dblib DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_mysql -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_sqlite -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-sqlite3>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-sqlite3 DEPENDS+= ${PHP_PKG_PREFIX}-posix>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-posix DEPENDS+= ${PHP_PKG_PREFIX}-pspell>=${PHP_VERSION}<${NEXT_VERS}:../../textproc/php-pspell diff --git a/meta-pkgs/php71-extensions/Makefile b/meta-pkgs/php71-extensions/Makefile index b3b3cec97f294..e0d355d0ae2f7 100644 --- a/meta-pkgs/php71-extensions/Makefile +++ b/meta-pkgs/php71-extensions/Makefile @@ -40,9 +40,9 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pcntl>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-p DEPENDS+= ${PHP_PKG_PREFIX}-pdo>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo DEPENDS+= ${PHP_PKG_PREFIX}-pdo_dblib>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_dblib DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_mysql -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_sqlite -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-sqlite3>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-sqlite3 DEPENDS+= ${PHP_PKG_PREFIX}-posix>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-posix DEPENDS+= ${PHP_PKG_PREFIX}-pspell>=${PHP_VERSION}<${NEXT_VERS}:../../textproc/php-pspell diff --git a/meta-pkgs/php72-extensions/Makefile b/meta-pkgs/php72-extensions/Makefile index c1f88357e1ce7..e91b19db6141b 100644 --- a/meta-pkgs/php72-extensions/Makefile +++ b/meta-pkgs/php72-extensions/Makefile @@ -41,9 +41,9 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php DEPENDS+= ${PHP_PKG_PREFIX}-pdo_dblib>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_dblib DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_mysql DEPENDS+= ${PHP_PKG_PREFIX}-sqlite3>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-sqlite3 -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_sqlite -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-posix>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-posix DEPENDS+= ${PHP_PKG_PREFIX}-pspell>=${PHP_VERSION}<${NEXT_VERS}:../../textproc/php-pspell DEPENDS+= ${PHP_PKG_PREFIX}-shmop>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-shmop diff --git a/meta-pkgs/php73-extensions/Makefile b/meta-pkgs/php73-extensions/Makefile index 949983651daf2..c5bcecfc2dc1a 100644 --- a/meta-pkgs/php73-extensions/Makefile +++ b/meta-pkgs/php73-extensions/Makefile @@ -40,9 +40,9 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php DEPENDS+= ${PHP_PKG_PREFIX}-pdo_dblib>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_dblib DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_mysql DEPENDS+= ${PHP_PKG_PREFIX}-sqlite3>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-sqlite3 -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_pgsql DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pdo_sqlite -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql{11,10,96,95,94,93}>=${PHP_VERSION}<${NEXT_VERS}:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-posix>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-posix DEPENDS+= ${PHP_PKG_PREFIX}-pspell>=${PHP_VERSION}<${NEXT_VERS}:../../textproc/php-pspell DEPENDS+= ${PHP_PKG_PREFIX}-shmop>=${PHP_VERSION}<${NEXT_VERS}:../../devel/php-shmop diff --git a/sysutils/zabbix-frontend/Makefile b/sysutils/zabbix-frontend/Makefile index 9548b1e633873..f62c0f4ff1ca7 100644 --- a/sysutils/zabbix-frontend/Makefile +++ b/sysutils/zabbix-frontend/Makefile @@ -26,7 +26,7 @@ DEPENDS+= ${PHP_PKG_PREFIX}-json>=5.4.0:../../textproc/php-json DEPENDS+= ${PHP_PKG_PREFIX}-ldap>=5.4.0:../../databases/php-ldap DEPENDS+= ${PHP_PKG_PREFIX}-mbstring>=5.4.0:../../converters/php-mbstring DEPENDS+= ${PHP_PKG_PREFIX}-mysqli>=5.4.0:../../databases/php-mysqli -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=5.4.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql DEPENDS+= ${PHP_PKG_PREFIX}-sockets>=5.4.0:../../net/php-sockets DEPENDS+= ${PHP_PKG_PREFIX}-sysvsem>=5.4.0:../../devel/php-sysvsem diff --git a/time/php-mrbs/options.mk b/time/php-mrbs/options.mk index dd470a2a84ac2..e8cf79523a743 100644 --- a/time/php-mrbs/options.mk +++ b/time/php-mrbs/options.mk @@ -16,7 +16,7 @@ PKG_SUGGESTED_OPTIONS= mysql DEPENDS+= ${PHP_PKG_PREFIX}-mysql>=5.2.0:../../databases/php-mysql PHP_VERSIONS_ACCEPTED= 56 .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=5.2.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .else PKG_FAIL_REASON+= ${PKGNAME} needs either mysql or pgsql .endif diff --git a/www/davical/Makefile b/www/davical/Makefile index c702686c21e7d..de4aa807a0056 100644 --- a/www/davical/Makefile +++ b/www/davical/Makefile @@ -34,8 +34,8 @@ INSTALLATION_DIRS= ${DOCDIR} ${EGDIR}/config .include "../../lang/php/phpversion.mk" DEPENDS+= ${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}>=5.2:../../www/ap-php -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=4.3.1:../../databases/php-pgsql -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=${PHP_BASE_VERS}:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql DEPENDS+= ${PHP_PKG_PREFIX}-libawl>=0.56:../../devel/php-libawl DEPENDS+= ${PHP_PKG_PREFIX}-calendar>=5.3.18:../../time/php-calendar DEPENDS+= ${PHP_PKG_PREFIX}-curl>=5.3.18:../../www/php-curl diff --git a/www/drupal7/options.mk b/www/drupal7/options.mk index 166d129166cc2..3f4e7e3e72a42 100644 --- a/www/drupal7/options.mk +++ b/www/drupal7/options.mk @@ -14,7 +14,7 @@ PKG_SUGGESTED_OPTIONS= mysql apache ### Use PostgreSQL for storing Drupal data ### .if !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=5.2.7:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql .elif !empty(PKG_OPTIONS:Mmysql) ### ### Use MySQL for storing Drupal data diff --git a/www/drupal8/options.mk b/www/drupal8/options.mk index 14edd2a13435f..a634cc29d30f3 100644 --- a/www/drupal8/options.mk +++ b/www/drupal8/options.mk @@ -14,7 +14,7 @@ PKG_SUGGESTED_OPTIONS= mysql apache ### Use PostgreSQL for storing Drupal data ### .if !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=5.2.7:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql .elif !empty(PKG_OPTIONS:Mmysql) ### ### Use MySQL for storing Drupal data diff --git a/www/horde/options.mk b/www/horde/options.mk index 8bb06f91ec8d3..664c663259844 100644 --- a/www/horde/options.mk +++ b/www/horde/options.mk @@ -17,7 +17,7 @@ DEPENDS+= ${PHP_PKG_PREFIX}-ldap>=4.3.3:../../databases/php-ldap ### Use PostgreSQL for storing user details ### .if !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=4.3.3:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif ### diff --git a/www/mediawiki/options.mk b/www/mediawiki/options.mk index 4f5091dd782c1..280d6498e0e3c 100644 --- a/www/mediawiki/options.mk +++ b/www/mediawiki/options.mk @@ -16,7 +16,7 @@ PKG_SUGGESTED_OPTIONS= apache mysql .if !empty(PKG_OPTIONS:Mmysql) DEPENDS+= ${PHP_PKG_PREFIX}-mysqli>=5.5.9:../../databases/php-mysqli .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=5:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif .if !empty(PKG_OPTIONS:Mapache) diff --git a/www/moodle/options.mk b/www/moodle/options.mk index 6843a10cc0284..a226aa260844e 100644 --- a/www/moodle/options.mk +++ b/www/moodle/options.mk @@ -14,5 +14,5 @@ PKG_SUGGESTED_OPTIONS= mysql .if !empty(PKG_OPTIONS:Mmysql) DEPENDS+= ${PHP_PKG_PREFIX}-mysqli>=7.0.0:../../databases/php-mysqli .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=7.0.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif diff --git a/www/php-basercms/options.mk b/www/php-basercms/options.mk index 993667852ea34..20e7b59564bdd 100644 --- a/www/php-basercms/options.mk +++ b/www/php-basercms/options.mk @@ -21,7 +21,7 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=5.2.0:../../databases/php-pdo_mysql # complained/failed that PDO was not present. DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=5.2.0:../../databases/php-pdo_sqlite .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=5.2.0:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql .elif !!empty(PKG_OPTIONS:Mcsv) # no DEPENDS .endif diff --git a/www/php-nextcloud/options.mk b/www/php-nextcloud/options.mk index 277e6ba820f36..9cacea0bd75cc 100644 --- a/www/php-nextcloud/options.mk +++ b/www/php-nextcloud/options.mk @@ -17,5 +17,5 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=5.2.0:../../databases/php-pdo_mysql .elif !empty(PKG_OPTIONS:Msqlite3) DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=5.4.0:../../databases/php-pdo_sqlite .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=5.4.0:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql .endif diff --git a/www/php-owncloud/options.mk b/www/php-owncloud/options.mk index 65fdfd89ee1ab..9f3c78ac634f9 100644 --- a/www/php-owncloud/options.mk +++ b/www/php-owncloud/options.mk @@ -21,6 +21,6 @@ DEPENDS+= ${PHP_PKG_PREFIX}-pdo_mysql>=5.2.0:../../databases/php-pdo_mysql # complained/failed that PDO was not present. DEPENDS+= ${PHP_PKG_PREFIX}-pdo_sqlite>=5.4.0:../../databases/php-pdo_sqlite .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql>=5.4.0:../../databases/php-pdo_pgsql -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=5.4.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pdo_pgsql*-[0-9]*:../../databases/php-pdo_pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif diff --git a/www/php-tt-rss/options.mk b/www/php-tt-rss/options.mk index 9af98dbfccbb0..9c2a243c4dcf9 100644 --- a/www/php-tt-rss/options.mk +++ b/www/php-tt-rss/options.mk @@ -16,5 +16,5 @@ PKG_SUGGESTED_OPTIONS= pgsql DEPENDS+= ${PHP_PKG_PREFIX}-mysql>=5.2.0:../../databases/php-mysql PHP_VERSIONS_ACCEPTED= 56 .elif !empty(PKG_OPTIONS:Mpgsql) -DEPENDS+= ${PHP_PKG_PREFIX}-pgsql>=5.2.0:../../databases/php-pgsql +DEPENDS+= ${PHP_PKG_PREFIX}-pgsql*-[0-9]*:../../databases/php-pgsql .endif From 14232490f958d76f5db6885c1d19ac71cb999e88 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 17 Dec 2018 10:04:35 +0000 Subject: [PATCH 60/92] myodbc: Test multi-mysql version. --- databases/myodbc/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/databases/myodbc/Makefile b/databases/myodbc/Makefile index fff022e0c855d..3f451e364e52e 100644 --- a/databases/myodbc/Makefile +++ b/databases/myodbc/Makefile @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.41 2017/09/03 08:53:05 wiz Exp $ DISTNAME= mysql-connector-odbc-5.3.2-src -PKGNAME= ${DISTNAME:S/mysql-connector-odbc/myodbc/:S/-src$//} +PKGNAME= ${DISTNAME:S/mysql-connector-odbc/${MYSQL_PKG_PREFIX}-odbc/:S/-src$//} PKGREVISION= 2 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_MYSQL:=Connector-ODBC/5.3/} @@ -14,7 +14,7 @@ LICENSE= gnu-gpl-v2 USE_CMAKE= yes CMAKE_ARGS= -Wno-dev #CMAKE_ARGS+= -DMYSQL_DIR=${BUILDLINK_PREFIX.mysql-client} -CMAKE_ARGS+= -DMYSQL_INCLUDE_DIR=${BUILDLINK_PREFIX.mysql-client}/include/mysql +CMAKE_ARGS+= -DMYSQL_INCLUDE_DIR=${BUILDLINK_PREFIX.mysql-client}/${BUILDLINK_INCDIRS.mysql-client} USE_LANGUAGES= c c++ INSTALLATION_DIRS= share/doc/mysql-connector-odbc @@ -22,7 +22,7 @@ INSTALLATION_DIRS+= share/mysql-connector-odbc/test .include "options.mk" -MYSQL_VERSIONS_ACCEPTED= 56 55 51 +#MYSQL_VERSIONS_ACCEPTED= 56 55 51 .include "../../devel/libltdl/buildlink3.mk" .include "../../devel/zlib/buildlink3.mk" From d6f3eb6dfaf73de06f25410a7640d5d4efb52399 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 15 Jan 2019 13:43:50 +0000 Subject: [PATCH 61/92] Add 'joyent' and 'wip' submodules. --- .gitmodules | 6 ++++++ joyent | 1 + wip | 1 + 3 files changed, 8 insertions(+) create mode 100644 .gitmodules create mode 160000 joyent create mode 160000 wip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000..77ed738a50a96 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "joyent"] + path = joyent + url = git://github.com/joyent/pkgsrc-joyent.git +[submodule "wip"] + path = wip + url = git://github.com/joyent/pkgsrc-wip.git diff --git a/joyent b/joyent new file mode 160000 index 0000000000000..2391135284ce8 --- /dev/null +++ b/joyent @@ -0,0 +1 @@ +Subproject commit 2391135284ce860fb7c1a6f3ba6d7b1b16faf966 diff --git a/wip b/wip new file mode 160000 index 0000000000000..15de871bb7746 --- /dev/null +++ b/wip @@ -0,0 +1 @@ +Subproject commit 15de871bb77465aace5aba16c98bda7d160793d2 From e6ae314ca723aca0bc9127fb89ac249e87ed1c32 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 15 Jan 2019 15:06:47 +0000 Subject: [PATCH 62/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 2391135284ce8..03a063feacdc6 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 2391135284ce860fb7c1a6f3ba6d7b1b16faf966 +Subproject commit 03a063feacdc69847061c775e2cc7be0d30a43f9 From 698114be2f7caf9b384710c84cbcb092a5bb1bc1 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 15 Jan 2019 20:25:17 +0000 Subject: [PATCH 63/92] gcc{49,7}: Test tools path fixes from miscfix --- lang/gcc49/Makefile | 7 +++++-- lang/gcc49/distinfo | 4 ++-- lang/gcc49/patches/patch-gcc_config_sol2-bi.h | 2 +- lang/gcc49/patches/patch-gcc_config_sol2.h | 4 ++-- lang/gcc7/Makefile | 9 ++++++--- lang/gcc7/distinfo | 2 +- lang/gcc7/patches/patch-gcc_config_sol2.h | 4 ++-- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lang/gcc49/Makefile b/lang/gcc49/Makefile index a2f0c01ca70cf..25f18c30877b6 100644 --- a/lang/gcc49/Makefile +++ b/lang/gcc49/Makefile @@ -66,9 +66,12 @@ SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,ARCH64_SUBDIR,g' SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,,g' .endif # For the tools build (i.e. when not using USE_GCC_LOCALBASE_PREFIX) we -# do not want the PREFIX rpaths added above to leak into final binaries. +# do not want to include any of the PREFIX library paths added by +# patch-gcc_config_sol2*.h, otherwise they would leak into the non-tools +# builds. The SUBST used here relies on SUBST_VARS coming after SUBST_SED. .if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "no" -SUBST_SED.rpaths+= -e '/-R/d' +SUBST_SED.rpaths+= -e '/-R@PREFIX@/d' +SUBST_SED.rpaths+= -e 's/:%R@PREFIX@[^}]*//' .endif LANGS= c diff --git a/lang/gcc49/distinfo b/lang/gcc49/distinfo index df63c921ec79d..90e8115c8e851 100644 --- a/lang/gcc49/distinfo +++ b/lang/gcc49/distinfo @@ -22,8 +22,8 @@ SHA1 (patch-gcc_config_i386_dragonfly.h) = 5756b62791273f77866f06be1df0c267dc90a SHA1 (patch-gcc_config_i386_i386.c) = 247db3ee4e8083692558732ba54ae9148fc72a26 SHA1 (patch-gcc_config_netbsd-stdint.h) = fc430c80adda9d3f58eea47816338f697a659889 SHA1 (patch-gcc_config_netbsd.h) = 1d21dbe5082dd149d59dbc471d4148d0651df7d4 -SHA1 (patch-gcc_config_sol2-bi.h) = 8815540e87906a28ac2b727b470d59070d31f7fc -SHA1 (patch-gcc_config_sol2.h) = 4dc8562ef4a0dd7840474d01bee7f298f8302b9e +SHA1 (patch-gcc_config_sol2-bi.h) = 74f21e7f7ec84ce2ca1b42e9f51ac0e90565fcdf +SHA1 (patch-gcc_config_sol2.h) = f57281071f1fbc4a9115cbb517031ba57c88f360 SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 SHA1 (patch-gcc_configure) = 302465f72ada3e3d3ec8acde70af9313e14053e1 SHA1 (patch-gcc_dojump.c) = d9066b1d2ac6f7ddce876edf3cc61aca420d2686 diff --git a/lang/gcc49/patches/patch-gcc_config_sol2-bi.h b/lang/gcc49/patches/patch-gcc_config_sol2-bi.h index 35620f92f354d..a91e4ad3e7e2c 100644 --- a/lang/gcc49/patches/patch-gcc_config_sol2-bi.h +++ b/lang/gcc49/patches/patch-gcc_config_sol2-bi.h @@ -11,7 +11,7 @@ Pull in ${PREFIX}/lib by default and handle for multiarch. - %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \ - %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}" + -R@PREFIX@/lib/" @MARCH64_SUBDIR@ " \ -+ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ ++ %{!YP,*:%{p|pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ + %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "}}}" #undef LINK_ARCH64_SPEC diff --git a/lang/gcc49/patches/patch-gcc_config_sol2.h b/lang/gcc49/patches/patch-gcc_config_sol2.h index ee94e685d1dd1..5b7541209eba2 100644 --- a/lang/gcc49/patches/patch-gcc_config_sol2.h +++ b/lang/gcc49/patches/patch-gcc_config_sol2.h @@ -11,8 +11,8 @@ Pull in ${PREFIX}/lib by default. - %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib} \ - %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib}}}" + -R@PREFIX@/lib \ -+ %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ -+ %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib:%R@PREFIX@/lib}}}" ++ %{!YP,*:%{p|pg:-Y P,%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ ++ %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib:%R@PREFIX@/lib}}}" #undef LINK_ARCH32_SPEC #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE diff --git a/lang/gcc7/Makefile b/lang/gcc7/Makefile index 52f6826e13f1b..15b0c4f0a7a5c 100644 --- a/lang/gcc7/Makefile +++ b/lang/gcc7/Makefile @@ -55,7 +55,7 @@ SUBST_VARS.vars= MACHINE_GNU_PLATFORM # to ease merging. SUBST_CLASSES+= rpaths SUBST_STAGE.rpaths= pre-configure -SUBST_FILES.rpaths= gcc/config/sol2-bi.h gcc/config/sol2.h +SUBST_FILES.rpaths= gcc/config/sol2.h SUBST_VARS.rpaths= PREFIX .if !empty(MULTIARCH:M[Yy][Ee][Ss]) SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,ARCH64_SUBDIR,g' @@ -63,9 +63,12 @@ SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,ARCH64_SUBDIR,g' SUBST_SED.rpaths= -e 's,@MARCH64_SUBDIR@,,g' .endif # For the tools build (i.e. when not using USE_GCC_LOCALBASE_PREFIX) we -# do not want the PREFIX rpaths added above to leak into final binaries. +# do not want to include any of the PREFIX library paths added by +# patch-gcc_config_sol2.h, otherwise they would leak into the non-tools +# builds. The SUBST used here relies on SUBST_VARS coming after SUBST_SED. .if ${USE_GCC_LOCALBASE_PREFIX:Uno:tl} == "no" -SUBST_SED.rpaths+= -e '/-R/d' +SUBST_SED.rpaths+= -e '/-R@PREFIX@/d' +SUBST_SED.rpaths+= -e 's/:%R@PREFIX@[^}]*//' .endif LANGS= c diff --git a/lang/gcc7/distinfo b/lang/gcc7/distinfo index 0a18d880dca26..ebf3af111d40d 100644 --- a/lang/gcc7/distinfo +++ b/lang/gcc7/distinfo @@ -30,7 +30,7 @@ SHA1 (patch-gcc_config_netbsd-elf.h) = 5a9b5ef26c03bec3cd58e2f446224aa6e94a30d5 SHA1 (patch-gcc_config_netbsd-protos.h) = 6d28864b4ccc8c1a63fe28e43601b84b63a00633 SHA1 (patch-gcc_config_netbsd.h) = 662226f4491f94b641f78b1273a9047434d75aed SHA1 (patch-gcc_config_sol2-c.c) = 7dac7d9a4111240fbff9099d7a9bcd08c898b07d -SHA1 (patch-gcc_config_sol2.h) = ce64522b655e47218a8fbb7dbe30ed3c69b79584 +SHA1 (patch-gcc_config_sol2.h) = 33c8fe322bc36e0933777ae0118759f41476dba4 SHA1 (patch-gcc_config_t-netbsd) = 802ad5706aa7ca9629f8e237f08fbb1569d28846 SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 SHA1 (patch-gcc_configure) = 1b66a9ac0af5e3be39410f82b1de84f217f5c2ef diff --git a/lang/gcc7/patches/patch-gcc_config_sol2.h b/lang/gcc7/patches/patch-gcc_config_sol2.h index 37c45ef7c9e17..58fb9aa4a4d09 100644 --- a/lang/gcc7/patches/patch-gcc_config_sol2.h +++ b/lang/gcc7/patches/patch-gcc_config_sol2.h @@ -11,7 +11,7 @@ Pull in ${PREFIX}/lib by default and handle for multiarch. - %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \ - %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}" + -R@PREFIX@/lib \ -+ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp:%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ ++ %{!YP,*:%{p|pg:-Y P,%R/lib:%R/usr/lib:%R@PREFIX@/lib} \ + %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib:%R@PREFIX@/lib}}}" #undef LINK_ARCH32_SPEC @@ -23,7 +23,7 @@ Pull in ${PREFIX}/lib by default and handle for multiarch. - %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \ - %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}" + -R@PREFIX@/lib/" @MARCH64_SUBDIR@ " \ -+ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ ++ %{!YP,*:%{p|pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "} \ + %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR ":%R@PREFIX@/lib/" @MARCH64_SUBDIR@ "}}}" #undef LINK_ARCH64_SPEC From c06307da512fc1db4a9932189065777e5ba66ee9 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sun, 27 Jan 2019 10:39:07 +0000 Subject: [PATCH 64/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 03a063feacdc6..9dac87b557b0a 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 03a063feacdc69847061c775e2cc7be0d30a43f9 +Subproject commit 9dac87b557b0a96fcbc11bed579e442ef72ccccc From e34a7574aa59a2e2a42f5cd78530230ce1ea1d64 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 7 Feb 2019 16:54:54 +0000 Subject: [PATCH 65/92] rust: Test jbk patches. --- lang/rust/distinfo | 2 ++ ...tch-src_librustc__target_spec_solaris__base.rs | 14 ++++++++++++++ ...librustc__target_spec_x86__64__sun__solaris.rs | 15 +++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 lang/rust/patches/patch-src_librustc__target_spec_solaris__base.rs create mode 100644 lang/rust/patches/patch-src_librustc__target_spec_x86__64__sun__solaris.rs diff --git a/lang/rust/distinfo b/lang/rust/distinfo index 519ecf6eee5b0..328d6de2f68b7 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -103,6 +103,8 @@ SHA1 (patch-src_bootstrap_lib.rs) = bc23743f1b9c4ad3d7557b4fdf8a55976ca7f417 SHA1 (patch-src_libbacktrace_configure) = b2c1e9b93a99408aad42ab9f1af27704cc81bdd8 SHA1 (patch-src_liblibc_src_unix_solaris_mod.rs) = aeb7c22995e33c700ce3ea4336368a1fd08120e1 SHA1 (patch-src_librustc__llvm_build.rs) = a56bf5435e40bb012641ada6b20256901a1073fb +SHA1 (patch-src_librustc__target_spec_solaris__base.rs) = 3334957856f9a969a94fdd85260f1ef31cbac941 +SHA1 (patch-src_librustc__target_spec_x86__64__sun__solaris.rs) = 563d81a7de2fbe0248f3f5fd3014d84be4f9c9bd SHA1 (patch-src_libstd_build.rs) = 2334879e4b730014de08bb2dfff1a643292a630e SHA1 (patch-src_libstd_sys_unix_thread.rs) = 46ef46365658e2f895bd3dde9c74f352890e9ccc SHA1 (patch-src_libsyntax__pos_span__encoding.rs) = c891cffab8ae47b13b3b391ddd1a6c62ee2b38f3 diff --git a/lang/rust/patches/patch-src_librustc__target_spec_solaris__base.rs b/lang/rust/patches/patch-src_librustc__target_spec_solaris__base.rs new file mode 100644 index 0000000000000..7e6cab4defda0 --- /dev/null +++ b/lang/rust/patches/patch-src_librustc__target_spec_solaris__base.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Test jbk patch. + +--- src/librustc_target/spec/solaris_base.rs.orig 2019-01-16 09:30:27.000000000 +0000 ++++ src/librustc_target/spec/solaris_base.rs +@@ -18,6 +18,7 @@ pub fn opts() -> TargetOptions { + has_rpath: true, + target_family: Some("unix".to_string()), + is_like_solaris: true, ++ eliminate_frame_pointer: false, + + .. Default::default() + } diff --git a/lang/rust/patches/patch-src_librustc__target_spec_x86__64__sun__solaris.rs b/lang/rust/patches/patch-src_librustc__target_spec_x86__64__sun__solaris.rs new file mode 100644 index 0000000000000..58c229fc84bc3 --- /dev/null +++ b/lang/rust/patches/patch-src_librustc__target_spec_x86__64__sun__solaris.rs @@ -0,0 +1,15 @@ +$NetBSD$ + +Test jbk patch. + +--- src/librustc_target/spec/x86_64_sun_solaris.rs.orig 2019-01-16 09:30:27.000000000 +0000 ++++ src/librustc_target/spec/x86_64_sun_solaris.rs +@@ -15,7 +15,7 @@ pub fn target() -> TargetResult { + base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]); + base.cpu = "x86-64".to_string(); + base.max_atomic_width = Some(64); +- base.stack_probes = true; ++ base.stack_probes = false; + + Ok(Target { + llvm_target: "x86_64-pc-solaris".to_string(), From d3ce743b81440fa2466f13db5c24b40fd3ff81d8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sun, 10 Feb 2019 12:51:42 +0000 Subject: [PATCH 66/92] gcc7: Ensure the correct values objects are used. Based on a patch from richlowe, expanded to handle all current possible -std= variants except e.g. "-std=iso9899:1999" as it's not clear how to handle the embedded colon in the startfile syntax. --- lang/gcc7/distinfo | 2 +- lang/gcc7/patches/patch-gcc_config_sol2.h | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lang/gcc7/distinfo b/lang/gcc7/distinfo index ebf3af111d40d..b6116a754241c 100644 --- a/lang/gcc7/distinfo +++ b/lang/gcc7/distinfo @@ -30,7 +30,7 @@ SHA1 (patch-gcc_config_netbsd-elf.h) = 5a9b5ef26c03bec3cd58e2f446224aa6e94a30d5 SHA1 (patch-gcc_config_netbsd-protos.h) = 6d28864b4ccc8c1a63fe28e43601b84b63a00633 SHA1 (patch-gcc_config_netbsd.h) = 662226f4491f94b641f78b1273a9047434d75aed SHA1 (patch-gcc_config_sol2-c.c) = 7dac7d9a4111240fbff9099d7a9bcd08c898b07d -SHA1 (patch-gcc_config_sol2.h) = 33c8fe322bc36e0933777ae0118759f41476dba4 +SHA1 (patch-gcc_config_sol2.h) = c2b3566a956efaa2f94c101e6fc06784369d2d40 SHA1 (patch-gcc_config_t-netbsd) = 802ad5706aa7ca9629f8e237f08fbb1569d28846 SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 SHA1 (patch-gcc_configure) = 1b66a9ac0af5e3be39410f82b1de84f217f5c2ef diff --git a/lang/gcc7/patches/patch-gcc_config_sol2.h b/lang/gcc7/patches/patch-gcc_config_sol2.h index 58fb9aa4a4d09..67510be429fe9 100644 --- a/lang/gcc7/patches/patch-gcc_config_sol2.h +++ b/lang/gcc7/patches/patch-gcc_config_sol2.h @@ -4,7 +4,25 @@ Pull in ${PREFIX}/lib by default and handle for multiarch. --- gcc/config/sol2.h.orig 2017-11-21 09:31:12.000000000 +0000 +++ gcc/config/sol2.h -@@ -241,8 +241,9 @@ along with GCC; see the file COPYING3. +@@ -170,8 +170,15 @@ along with GCC; see the file COPYING3. + #define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT + + #undef STARTFILE_ARCH_SPEC +-#define STARTFILE_ARCH_SPEC "%{ansi:values-Xc.o%s} \ +- %{!ansi:values-Xa.o%s}" ++#define STARTFILE_ARCH_SPEC \ ++ "%{std=c17|std=c18|std=gnu17|std=gnu18:values-Xc.o%s values-xpg6.o%s; \ ++ std=c11|std=c1x|std=gnu11|std=gnu1x:values-Xc.o%s values-xpg6.o%s; \ ++ std=c99|std=c9x|std=gnu99|std=gnu9x:values-Xc.o%s values-xpg6.o%s; \ ++ std=c++17|std=c++1z|std=gnu++17|std=gnu++1z:values-Xc.o%s; \ ++ std=c++14|std=c++1y|std=gnu++14|std=gnu++1y:values-Xc.o%s; \ ++ std=c++11|std=c++0x|std=gnu++11|std=gnu++0x:values-Xc.o%s; \ ++ std=c++98|std=c++03|std=gnu++98|std=gnu++03:values-Xc.o%s; \ ++ :values-Xa.o%s}" + + #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS) + #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \ +@@ -241,8 +248,9 @@ along with GCC; see the file COPYING3. "%{G:-G} \ %{YP,*} \ %{R*} \ @@ -16,7 +34,7 @@ Pull in ${PREFIX}/lib by default and handle for multiarch. #undef LINK_ARCH32_SPEC #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE -@@ -254,8 +255,9 @@ along with GCC; see the file COPYING3. +@@ -254,8 +262,9 @@ along with GCC; see the file COPYING3. "%{G:-G} \ %{YP,*} \ %{R*} \ From f69658dda7d979739b01de7d858beb1d5e1364c8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 28 Feb 2019 13:12:26 +0000 Subject: [PATCH 67/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index 15de871bb7746..c63082b1e0242 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit 15de871bb77465aace5aba16c98bda7d160793d2 +Subproject commit c63082b1e0242ede6ce68b3fb948c941fedeedf1 From 7dbd055c93dbd4b195f264f65985ada1483ca234 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 6 Mar 2019 21:51:15 +0000 Subject: [PATCH 68/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index c63082b1e0242..9ae5e3e90407a 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit c63082b1e0242ede6ce68b3fb948c941fedeedf1 +Subproject commit 9ae5e3e90407a7c0d8a71454f02c4a3571229dec From c8fc78f375f0981ad11db48e65ff740f9cb8d82a Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 7 Mar 2019 22:27:34 +0000 Subject: [PATCH 69/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 9dac87b557b0a..6c81fcc92ee20 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 9dac87b557b0a96fcbc11bed579e442ef72ccccc +Subproject commit 6c81fcc92ee2016d88318cc8a1818e2b073f830f From 157ff525f9e5c28a06941f489bcaa1bc9eb6d613 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sat, 9 Mar 2019 10:26:56 +0000 Subject: [PATCH 70/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 6c81fcc92ee20..be2555677085b 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 6c81fcc92ee2016d88318cc8a1818e2b073f830f +Subproject commit be2555677085b31c485cb577eeb16af7ee990cfd From 44dde0216f24ebcadb597fb8511e2de2f3a0f01f Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sun, 10 Mar 2019 19:57:06 +0000 Subject: [PATCH 71/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index be2555677085b..baa027a664605 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit be2555677085b31c485cb577eeb16af7ee990cfd +Subproject commit baa027a664605e8a7bc24445f7a3cb1783e37336 From 9efab5ccfb9a6f90d9226d4a2665bf0eac23ffb6 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 26 Mar 2019 10:45:00 +0000 Subject: [PATCH 72/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index 9ae5e3e90407a..18dd3e0e593ac 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit 9ae5e3e90407a7c0d8a71454f02c4a3571229dec +Subproject commit 18dd3e0e593ac2eacac47f3e5ab6a12f6463bf5a From ed192e68436d768432a82672e32c4fa35651382d Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 28 Mar 2019 20:08:33 +0000 Subject: [PATCH 73/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index 18dd3e0e593ac..dc2c039e2c08e 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit 18dd3e0e593ac2eacac47f3e5ab6a12f6463bf5a +Subproject commit dc2c039e2c08ecfd321ffa55b9925bb0c23a1b2a From dbbe179c6c38e412fb62d220fcf5a5125793a0f8 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sat, 20 Apr 2019 23:22:49 +0100 Subject: [PATCH 74/92] fix rust checksum --- lang/rust/distinfo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/rust/distinfo b/lang/rust/distinfo index ab9d1756cd3a3..c92fd0d8147dc 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -20,10 +20,10 @@ SHA1 (rust-1.33.0-x86_64-apple-darwin.tar.gz) = a1ca5de2eb62f346437d70a2eafc4d49 RMD160 (rust-1.33.0-x86_64-apple-darwin.tar.gz) = 389aa9da93a874c9bdac5e931bfcc0d76bac5660 SHA512 (rust-1.33.0-x86_64-apple-darwin.tar.gz) = a7b669ca7563e5e4e9a74fc2ca1ace150c8f62e53cc687b58570e97f7850d66970308ed4d84304fbc30f94cc9d615bafad49657ff94307fb198880e715a87d39 Size (rust-1.33.0-x86_64-apple-darwin.tar.gz) = 245799023 bytes -SHA1 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = dc455032fdcf8057473f2d736e17739be5524257 -RMD160 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = a8de825ed0e77c290d93009d45a0a5425bd32c48 -SHA512 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = d3be6347f4714a82f1d4fe70eb40e5dc5f1ec8620becca24179a608c33f6fde37f4afd8514e080b5459767df67d6ee836c537a1617bbc2bea3d6fc51a7dfd538 -Size (rust-1.33.0-x86_64-sun-solaris.tar.gz) = 215768353 bytes +SHA1 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = e848c844b7836316a2bcbf8d37eaf24a7c76c073 +RMD160 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = acd310b0a638c501cc5bc2363000a8ce53c85cd1 +SHA512 (rust-1.33.0-x86_64-sun-solaris.tar.gz) = 8ccbf01892cbf011276593e6ecdbe75d3adda390a2611a0761afa7b7fbf1cadcebf67c4e04548773c1d03411b3dc7c91d95b849894bc4fe7fcbaa21b402cb989 +Size (rust-1.33.0-x86_64-sun-solaris.tar.gz) = 215760962 bytes SHA1 (rust-1.33.0-x86_64-unknown-freebsd.tar.gz) = 6cba12148bebd2dbd08daab5e49490eefb4e987f RMD160 (rust-1.33.0-x86_64-unknown-freebsd.tar.gz) = fd6564223b374633cf3cd15bc5cba36d9fe56004 SHA512 (rust-1.33.0-x86_64-unknown-freebsd.tar.gz) = c73e3a2b73520f9ba762d8d67dea94812ac2e99d7e8e9eecf72555a546f8304ca4cb375f1d0a0f8dd40392772af29db74327682df646111de5233cad9cd19741 From 7ab3de896a040da997efaf8d7e0dc2a9164e2a80 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 10 May 2019 12:13:48 +0100 Subject: [PATCH 75/92] Update 'joyent' and 'wip' submodules. --- joyent | 2 +- wip | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/joyent b/joyent index baa027a664605..d51a8d3a24e1d 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit baa027a664605e8a7bc24445f7a3cb1783e37336 +Subproject commit d51a8d3a24e1d763c26c029767aa1af0472005da diff --git a/wip b/wip index dc2c039e2c08e..79f2dc01fa92c 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit dc2c039e2c08ecfd321ffa55b9925bb0c23a1b2a +Subproject commit 79f2dc01fa92c6324dce468889a135435af37207 From 4b00ddf3599e265acae0a7ad68c66c2828d4c121 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 15 May 2019 16:53:35 +0100 Subject: [PATCH 76/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index d51a8d3a24e1d..402487aac3324 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit d51a8d3a24e1d763c26c029767aa1af0472005da +Subproject commit 402487aac3324ea0a6b93e5b089293d798a3115a From 6fba734febfa377f99a76215419be9129ce943e4 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sun, 2 Jun 2019 17:26:31 +0100 Subject: [PATCH 77/92] llvm fix --- lang/llvm/distinfo | 1 + .../patches/patch-utils_FileCheck_FileCheck.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 lang/llvm/patches/patch-utils_FileCheck_FileCheck.cpp diff --git a/lang/llvm/distinfo b/lang/llvm/distinfo index 990ea789f010b..cd1f2f487b63a 100644 --- a/lang/llvm/distinfo +++ b/lang/llvm/distinfo @@ -12,3 +12,4 @@ SHA1 (patch-cmake_modules_HandleLLVMOptions.cmake) = e6cb9bed8bc3e3793824b65291f SHA1 (patch-include_llvm-c_DataTypes.h) = 025c035e0e10871727391bd58936bd67b3e58244 SHA1 (patch-include_llvm_Analysis_ConstantFolding.h) = 56b9374da236c346565897977040255b9766cab8 SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 6c74713de3f953cbe323b3a83ca8e8d66f76f6e8 +SHA1 (patch-utils_FileCheck_FileCheck.cpp) = 2c33fea936abac98662b7ba2d10bce2c293bb588 diff --git a/lang/llvm/patches/patch-utils_FileCheck_FileCheck.cpp b/lang/llvm/patches/patch-utils_FileCheck_FileCheck.cpp new file mode 100644 index 0000000000000..2bcff648234cf --- /dev/null +++ b/lang/llvm/patches/patch-utils_FileCheck_FileCheck.cpp @@ -0,0 +1,15 @@ +$NetBSD$ + +Avoid ambiguous function call. + +--- utils/FileCheck/FileCheck.cpp.orig 2019-02-12 15:22:48.000000000 +0000 ++++ utils/FileCheck/FileCheck.cpp +@@ -403,7 +403,7 @@ static void DumpAnnotatedInput(raw_ostre + unsigned LineCount = InputFileText.count('\n'); + if (InputFileEnd[-1] != '\n') + ++LineCount; +- unsigned LineNoWidth = log10(LineCount) + 1; ++ unsigned LineNoWidth = log10((float)LineCount) + 1; + // +3 below adds spaces (1) to the left of the (right-aligned) line numbers + // on input lines and (2) to the right of the (left-aligned) labels on + // annotation lines so that input lines and annotation lines are more From c9a64b0050ba4d60703536f5e85f88fa493c5a3e Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 4 Jun 2019 12:50:21 +0100 Subject: [PATCH 78/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index 79f2dc01fa92c..ecf8869f7beeb 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit 79f2dc01fa92c6324dce468889a135435af37207 +Subproject commit ecf8869f7beeb52569fa45b7d3df1dad5ba2f428 From 077033d1a2fd6135aac9893d458a0c4fd5751f31 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 Jun 2019 19:40:03 +0100 Subject: [PATCH 79/92] gettext-lib: Test automatic -lintl fix. --- devel/gettext-lib/buildlink3.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk index 850c34d965c88..a9eaaaf2c5cd8 100644 --- a/devel/gettext-lib/buildlink3.mk +++ b/devel/gettext-lib/buildlink3.mk @@ -22,7 +22,7 @@ BUILDLINK_LDADD.gettext+= ${BUILDLINK_LDADD.iconv} # to LIBS to workaround this brokenness. # BROKEN_GETTEXT_DETECTION?= no -.if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS]) +.if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS]) || ${OPSYS} == "SunOS" BUILDLINK_LIBS.gettext+= ${BUILDLINK_LDADD.gettext} CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}" .endif From 728ed973b6a39b981061aa221cba6caa747db02c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 7 Jun 2019 11:31:20 +0100 Subject: [PATCH 80/92] gettext-lib: Try BUILDLINK_LDFLAGS instead. --- devel/gettext-lib/buildlink3.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk index a9eaaaf2c5cd8..1110c122b1bb1 100644 --- a/devel/gettext-lib/buildlink3.mk +++ b/devel/gettext-lib/buildlink3.mk @@ -23,7 +23,7 @@ BUILDLINK_LDADD.gettext+= ${BUILDLINK_LDADD.iconv} # BROKEN_GETTEXT_DETECTION?= no .if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS]) || ${OPSYS} == "SunOS" -BUILDLINK_LIBS.gettext+= ${BUILDLINK_LDADD.gettext} +BUILDLINK_LDFLAGS.gettext+= ${BUILDLINK_LDADD.gettext} CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}" .endif From 95dc31b9b5ca3a824bf319551adea1f8d29de944 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 18 Jun 2019 15:47:40 +0100 Subject: [PATCH 81/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 402487aac3324..68e20b9ff8df8 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 402487aac3324ea0a6b93e5b089293d798a3115a +Subproject commit 68e20b9ff8df885197046e4eb2d5c990ed2827ea From 80e56ef6339859c2071751b62e06d4fb1de15a63 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 21 Jun 2019 19:08:41 +0100 Subject: [PATCH 82/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 68e20b9ff8df8..f691da48cc7f1 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 68e20b9ff8df885197046e4eb2d5c990ed2827ea +Subproject commit f691da48cc7f10451472ca85243673859488be5b From 47fdbfd90c3ed9be2633dcb36932a4341b9edeaf Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 27 Jun 2019 21:24:45 +0100 Subject: [PATCH 83/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index f691da48cc7f1..4beeaeccb4ece 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit f691da48cc7f10451472ca85243673859488be5b +Subproject commit 4beeaeccb4ece17590490bfb17aadaeb7d07f951 From 425efe8b5e0b5dd341162500f21713262f19819c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 28 Jun 2019 19:05:10 +0100 Subject: [PATCH 84/92] mk: Improve +BUILD_INFO generation time. Cache REQUIRES entries so that we don't need to continue forking for every one. Reduces time for net/samba4 from 10 minutes to 6 seconds. --- mk/pkgformat/pkg/metadata.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mk/pkgformat/pkg/metadata.mk b/mk/pkgformat/pkg/metadata.mk index 8de6c91f3f6a1..7e821d50e80c8 100644 --- a/mk/pkgformat/pkg/metadata.mk +++ b/mk/pkgformat/pkg/metadata.mk @@ -76,8 +76,12 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS} for (l = 1; l <= nlibs; l++) { \ for (r = 1; r <= nrpath; r++) { \ sub(/\/$$/, "", rpath[r]); \ - if (system("test -f " rpath[r] "/" libs[l]) == 0) { \ - print rpath[r] "/" libs[l]; \ + libfile = rpath[r] "/" libs[l]; \ + if (!(libfile in libcache)) { \ + libcache[libfile] = system("test -f " libfile); \ + } \ + if (libcache[libfile] == 0) { \ + print libfile; \ break; \ } \ } \ From 42ec76305756981a6b61639dcf1cc70801c9a1d7 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sat, 13 Jul 2019 14:04:54 +0100 Subject: [PATCH 85/92] Update 'wip' submodule. --- wip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wip b/wip index ecf8869f7beeb..5ca5be41a5143 160000 --- a/wip +++ b/wip @@ -1 +1 @@ -Subproject commit ecf8869f7beeb52569fa45b7d3df1dad5ba2f428 +Subproject commit 5ca5be41a5143fb582798979d63957e1e696dce0 From 6f99c5c8a8bdd56bf2355bcb449672a72238a90c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 23 Jul 2019 15:32:19 +0100 Subject: [PATCH 86/92] mk/mysql: Add support for mysql80 and percona80. --- mk/mysql.buildlink3.mk | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mk/mysql.buildlink3.mk b/mk/mysql.buildlink3.mk index 0230738da8ee4..27d24ad118f54 100644 --- a/mk/mysql.buildlink3.mk +++ b/mk/mysql.buildlink3.mk @@ -8,8 +8,9 @@ # MYSQL_VERSION_DEFAULT # The preferred MySQL version. # -# Possible: 57 56 55 51 mariadb55 mariadb100 -# 73-cluster percona57 percona56 percona55 +# Possible: 80 57 56 55 51 73-cluster +# mariadb55 mariadb100 +# percona80 percona57 percona56 percona55 # percona57-cluster percona56-cluster percona55-cluster # Default: 57 # @@ -31,9 +32,9 @@ # MYSQL_PKG_PREFIX # The package name prefix for the selected version. # -# Possible: mysql73-cluster mysql57 mysql56 mysql55 mysql51 mysql5 -# percona57 percona56 percona55 -# percona55-cluster percona56-cluster percona57-cluster +# Possible: mysql80 mysql57 mysql56 mysql55 mysql51 mysql5 mysql73-cluster +# percona80 percona57 percona56 percona55 +# percona57-cluster percona56-cluster percona55-cluster # .if !defined(MYSQL_VERSION_MK) @@ -54,15 +55,19 @@ BUILD_DEFS_EFFECTS+= MYSQL_VERSION MYSQL_PKG_PREFIX MYSQL_VERSIONS_ACCEPTED?= ${_PKG_MYSQLS} # The available MySQL packages: -_PKG_MYSQLS= 57 56 55 51 mariadb55 mariadb100 +_PKG_MYSQLS= 80 57 56 55 51 mariadb55 mariadb100 _PKG_MYSQLS+= 57-cluster -_PKG_MYSQLS+= percona57 percona56 percona55 -_PKG_MYSQLS+= percona55-cluster percona56-cluster percona57-cluster +_PKG_MYSQLS+= percona80 percona57 percona56 percona55 +_PKG_MYSQLS+= percona57-cluster percona56-cluster percona55-cluster _MYSQL_PKGBASE.57-cluster= mysql-cluster-7.3.* _MYSQL_PKGSRCDIR.57-cluster= ../../joyent/mysql73-cluster _MYSQL_PKG_PREFIX.57-cluster= mysql73-cluster +_MYSQL_PKGBASE.80= mysql-client-8.0.* +_MYSQL_PKGSRCDIR.80= ../../databases/mysql80-client +_MYSQL_PKG_PREFIX.80= mysql80 + _MYSQL_PKGBASE.57= mysql-client-5.7.* _MYSQL_PKGSRCDIR.57= ../../databases/mysql57-client _MYSQL_PKG_PREFIX.57= mysql57 @@ -87,6 +92,10 @@ _MYSQL_PKGBASE.mariadb100= mariadb-client-10.0.* _MYSQL_PKGSRCDIR.mariadb100= ../../joyent/mariadb100-client _MYSQL_PKG_PREFIX.mariadb100= mariadb100 +_MYSQL_PKGBASE.percona80= percona-client-8.0.* +_MYSQL_PKGSRCDIR.percona80= ../../joyent/percona80-client +_MYSQL_PKG_PREFIX.percona80= percona80 + _MYSQL_PKGBASE.percona57= percona-client-5.7.* _MYSQL_PKGSRCDIR.percona57= ../../joyent/percona57-client _MYSQL_PKG_PREFIX.percona57= percona57 From c091985b838515d07f7c2380bbdb7bc05f188648 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 23 Jul 2019 15:33:59 +0100 Subject: [PATCH 87/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 4beeaeccb4ece..53e5b20fd4c6e 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 4beeaeccb4ece17590490bfb17aadaeb7d07f951 +Subproject commit 53e5b20fd4c6e9aba5b801744a69df9948484053 From e62de07cd568f19ce0b34f4aeed59aead8d20c01 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 4 Jul 2019 18:35:53 +0100 Subject: [PATCH 88/92] Add mysql80-{client,server} packages for testing. --- databases/Makefile | 2 + databases/mysql80-client/DESCR | 14 ++ databases/mysql80-client/Makefile | 15 ++ databases/mysql80-client/Makefile.common | 145 ++++++++++++ databases/mysql80-client/PLIST | 63 ++++++ databases/mysql80-client/buildlink3.mk | 19 ++ databases/mysql80-client/distinfo | 18 ++ databases/mysql80-client/options.mk | 24 ++ .../patches/patch-CMakeLists.txt | 21 ++ .../patches/patch-client_CMakeLists.txt | 57 +++++ .../patches/patch-cmake_boost.cmake | 24 ++ ...ld__configurations_compiler__options.cmake | 13 ++ .../patches/patch-include_CMakeLists.txt | 17 ++ .../patches/patch-libmysql_CMakeLists.txt | 62 ++++++ .../patches/patch-router_CMakeLists.txt | 15 ++ .../patches/patch-scripts_CMakeLists.txt | 39 ++++ ...ps_platform_thread__attrs__api__solaris.cc | 63 ++++++ .../patch-storage_myisam_mi__dynrec.cc | 18 ++ .../patches/patch-storage_myisam_mi__extra.cc | 18 ++ ..._frontend_dojo_dojox_mobile_build_build.sh | 24 ++ databases/mysql80-server/DEINSTALL | 16 ++ databases/mysql80-server/DESCR | 15 ++ databases/mysql80-server/MESSAGE | 21 ++ databases/mysql80-server/MESSAGE.sphinx | 14 ++ databases/mysql80-server/Makefile | 70 ++++++ databases/mysql80-server/PLIST | 207 ++++++++++++++++++ databases/mysql80-server/PLIST.SunOS | 2 + databases/mysql80-server/buildlink3.mk | 15 ++ databases/mysql80-server/files/mysqld.sh | 108 +++++++++ .../mysql80-server/files/smf/manifest.xml | 32 +++ databases/mysql80-server/files/smf/mysqld.sh | 31 +++ 31 files changed, 1202 insertions(+) create mode 100644 databases/mysql80-client/DESCR create mode 100644 databases/mysql80-client/Makefile create mode 100644 databases/mysql80-client/Makefile.common create mode 100644 databases/mysql80-client/PLIST create mode 100644 databases/mysql80-client/buildlink3.mk create mode 100644 databases/mysql80-client/distinfo create mode 100644 databases/mysql80-client/options.mk create mode 100644 databases/mysql80-client/patches/patch-CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-client_CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-cmake_boost.cmake create mode 100644 databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake create mode 100644 databases/mysql80-client/patches/patch-include_CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-libmysql_CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-router_CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-scripts_CMakeLists.txt create mode 100644 databases/mysql80-client/patches/patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc create mode 100644 databases/mysql80-client/patches/patch-storage_myisam_mi__dynrec.cc create mode 100644 databases/mysql80-client/patches/patch-storage_myisam_mi__extra.cc create mode 100644 databases/mysql80-client/patches/patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh create mode 100644 databases/mysql80-server/DEINSTALL create mode 100644 databases/mysql80-server/DESCR create mode 100644 databases/mysql80-server/MESSAGE create mode 100644 databases/mysql80-server/MESSAGE.sphinx create mode 100644 databases/mysql80-server/Makefile create mode 100644 databases/mysql80-server/PLIST create mode 100644 databases/mysql80-server/PLIST.SunOS create mode 100644 databases/mysql80-server/buildlink3.mk create mode 100644 databases/mysql80-server/files/mysqld.sh create mode 100644 databases/mysql80-server/files/smf/manifest.xml create mode 100644 databases/mysql80-server/files/smf/mysqld.sh diff --git a/databases/Makefile b/databases/Makefile index a9eca9c866883..9269a470e8379 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -108,6 +108,8 @@ SUBDIR+= mysql56-client SUBDIR+= mysql56-server SUBDIR+= mysql57-client SUBDIR+= mysql57-server +SUBDIR+= mysql80-client +SUBDIR+= mysql80-server SUBDIR+= mysqltuner SUBDIR+= mytop SUBDIR+= nss-pgsql diff --git a/databases/mysql80-client/DESCR b/databases/mysql80-client/DESCR new file mode 100644 index 0000000000000..a3ace9ed8013a --- /dev/null +++ b/databases/mysql80-client/DESCR @@ -0,0 +1,14 @@ +MySQL is a SQL (Structured Query Language) database server. SQL is the most +popular database language in the world. MySQL is a client-server implementation +that consists of a server daemon `mysqld' and many different client +programs/libraries. + +The main goals of MySQL are speed and robustness. + +The base upon which MySQL is built is a set of routines that have been used in +a highly demanding production environment for many years. While MySQL is still +in development it already offers a rich and highly useful function set. + +The official way to pronounce 'MySQL' is 'My Ess Que Ell' (Not MY-SEQUEL). + +This package contains the MySQL client programs and libraries. diff --git a/databases/mysql80-client/Makefile b/databases/mysql80-client/Makefile new file mode 100644 index 0000000000000..fdeaa1d9ec9cd --- /dev/null +++ b/databases/mysql80-client/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.20 2019/02/05 20:19:55 adam Exp $ + +PKGNAME= ${DISTNAME:S/-/-client-/} +COMMENT= Popular open source database (client) + +.include "Makefile.common" + +CMAKE_ARGS+= -DWITHOUT_SERVER=ON +UNWRAP_FILES+= scripts/mysql_config +INFO_FILES= yes +.for dir in client include libmysql man scripts testclients +INSTALL_DIRS+= ${WRKDIR}/build/${dir} +.endfor + +.include "../../mk/bsd.pkg.mk" diff --git a/databases/mysql80-client/Makefile.common b/databases/mysql80-client/Makefile.common new file mode 100644 index 0000000000000..7e36a95b92509 --- /dev/null +++ b/databases/mysql80-client/Makefile.common @@ -0,0 +1,145 @@ +# $NetBSD: Makefile.common,v 1.15 2019/02/05 20:19:55 adam Exp $ +# +# used by databases/mysql80-client/Makefile +# used by databases/mysql80-server/Makefile + +DISTNAME= mysql-8.0.16 +CATEGORIES= databases +MASTER_SITES= ${MASTER_SITE_MYSQL:=MySQL-8.0/} + +MAINTAINER?= pkgsrc-users@NetBSD.org +HOMEPAGE= https://www.mysql.com/ +LICENSE= gnu-gpl-v2 + +DISTINFO_FILE?= ${.CURDIR}/../../databases/mysql80-client/distinfo +PATCHDIR?= ${.CURDIR}/../../databases/mysql80-client/patches + +USE_CMAKE= yes +USE_LANGUAGES= c c++14 +USE_TOOLS+= bash bison gmake perl:run + +.include "../../mk/bsd.prefs.mk" + +.include "options.mk" + +# MYSQL_USER username of the database administrator +# MYSQL_GROUP group of the database administrator +# MYSQL_DATADIR home directory (location of the databases) +# MYSQL_PIDFILE process ID file +# MYSQL_CHARSET default character set +# MYSQL_EXTRA_CHARSET additional character set to be compiled in +MYSQL_USER?= mysql +MYSQL_GROUP?= mysql +MYSQL_DATADIR?= ${VARBASE}/mysql +MYSQL_PIDFILE?= ${MYSQL_DATADIR}/${HOST}.pid +#MYSQL_CHARSET?= latin1 +#MYSQL_COLLATION?= latin1_swedish_ci +#MYSQL_EXTRA_CHARSET?= all + +PKG_USERS_VARS+= MYSQL_USER +PKG_GROUPS_VARS+= MYSQL_GROUP + +CONFIG_SHELL= ${TOOLS_PATH.bash} + +#CFLAGS.IRIX+= -DIRIX5 -DNEEDS_BSTRING_H + +BUILD_DEFS+= VARBASE + +CONFIGURE_DIRS= ${WRKDIR}/build +CMAKE_ARG_PATH= ${WRKSRC} + +post-extract: + ${MKDIR} ${WRKDIR}/build + +# paths +CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql" +CMAKE_ARGS+= -DINSTALL_DOCREADMEDIR="share/doc/mysql" +CMAKE_ARGS+= -DINSTALL_INCLUDEDIR="include/mysql" +CMAKE_ARGS+= -DINSTALL_INFODIR="info" +CMAKE_ARGS+= -DINSTALL_MANDIR="${PKGMANDIR}" +CMAKE_ARGS+= -DINSTALL_MYSQLSHAREDIR="share/mysql" +CMAKE_ARGS+= -DINSTALL_MYSQLTESTDIR="" +CMAKE_ARGS+= -DINSTALL_PLUGINDIR="lib/mysql/plugin" +CMAKE_ARGS+= -DINSTALL_SBINDIR="sbin" +CMAKE_ARGS+= -DINSTALL_SCRIPTDIR="bin" +CMAKE_ARGS+= -DINSTALL_SQLBENCHDIR="share/mysql/sql-bench" +CMAKE_ARGS+= -DINSTALL_SUPPORTFILESDIR="share/mysql" +CMAKE_ARGS+= -DMYSQL_DATADIR=${MYSQL_DATADIR} + +CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release + +CMAKE_ARGS+= -DWITH_BOOST="system" +CMAKE_ARGS+= -DWITH_LZ4="system" +CMAKE_ARGS+= -DWITH_SSL="system" +CMAKE_ARGS+= -DWITH_ZLIB="system" +#CMAKE_ARGS+= -DDEFAULT_CHARSET=${MYSQL_CHARSET} +#CMAKE_ARGS+= -DDEFAULT_COLLATION=${MYSQL_COLLATION} +#CMAKE_ARGS+= -DWITH_EXTRA_CHARSETS=${MYSQL_EXTRA_CHARSET} + +# we need atomic builtins +#.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "i386" +#GNU_ARCH.i386= i586 +#CFLAGS+= -march=i586 +#.endif + +#CPPFLAGS+= -Dunix +#CFLAGS+= -DUSE_OLD_FUNCTIONS # 3.23.x compat +#CFLAGS+= -D__STDC_FORMAT_MACROS=1 # always defined too late + +#.if ${OPSYS} != "Interix" +#CFLAGS+= -fPIC -DPIC +#CXXFLAGS+= -fPIC -DPIC +#.endif + +CMAKE_ARGS.SunOS+= -DFORCE_UNSUPPORTED_COMPILER=YES + +# Force HAVE_CURSES_H on Solaris since the configure script is broken +# and does not properly detect this, breaking the build later on. Also +# explicitly disable epoll support as it is Linux-specific. +CMAKE_ARGS.SunOS+= -DHAVE_SYS_EPOLL_H=NO +CMAKE_ARGS.SunOS+= -DHAVE_EPOLL=NO +CMAKE_ARGS.SunOS+= -DEVENT__HAVE_SYS_EPOLL_H=NO +CMAKE_ARGS.SunOS+= -DEVENT__HAVE_EPOLL=NO + + +#CFLAGS.SunOS+= -DHAVE_CURSES_H +#CXXFLAGS.SunOS+= -DHAVE_CURSES_H + +#.include "../../mk/pthread.buildlink3.mk" + +#.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth") +#CFLAGS+= -DSIGNALS_DONT_BREAK_READ +#CXXFLAGS+= -DSIGNALS_DONT_BREAK_READ +#.endif + +LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/lib/mysql +LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/lib/mysqlrouter + +SUBST_CLASSES+= scr +SUBST_STAGE.scr= pre-configure +SUBST_FILES.scr= scripts/mysqld_safe.sh +SUBST_FILES.scr+= support-files/mysql.server.sh +SUBST_SED.scr= -e "s,chown,${CHOWN},g" +SUBST_SED.scr+= -e "s,/bin/sh,${RCD_SCRIPTS_SHELL},g" +SUBST_SED.scr+= -e "s,@SHELL_PATH@,${RCD_SCRIPTS_SHELL},g" +SUBST_MESSAGE.scr= Fixing scripts. + +# Don't use the base system "libedit" under NetBSD because MySQL expects +# an incompatible prototype for "rl_completion_entry_function". +#.if ${OPSYS} == "NetBSD" +#USE_BUILTIN.editline= no +#.endif + +.include "../../mk/readline.buildlink3.mk" +.if ${READLINE_TYPE} == "readline" +CMAKE_ARGS+= -DWITH_READLINE="system" +.else +CMAKE_ARGS+= -DWITH_EDITLINE="system" +.endif + +.include "../../mk/curses.buildlink3.mk" +.include "../../archivers/lz4/buildlink3.mk" +.include "../../devel/boost-libs/buildlink3.mk" +.include "../../devel/libevent/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../security/openssl/buildlink3.mk" diff --git a/databases/mysql80-client/PLIST b/databases/mysql80-client/PLIST new file mode 100644 index 0000000000000..5459733e3323c --- /dev/null +++ b/databases/mysql80-client/PLIST @@ -0,0 +1,63 @@ +@comment $NetBSD$ +bin/mysql +bin/mysql_client_test +bin/mysql_config +bin/mysql_config_editor +bin/mysqladmin +bin/mysqlbinlog +bin/mysqlcheck +bin/mysqldump +bin/mysqlimport +bin/mysqlpump +bin/mysqlshow +bin/mysqlslap +bin/mysqltest +include/mysql/errmsg.h +include/mysql/field_types.h +include/mysql/my_command.h +include/mysql/my_list.h +include/mysql/mysql.h +include/mysql/mysql/client_plugin.h +include/mysql/mysql/plugin_auth_common.h +include/mysql/mysql/udf_registration_types.h +include/mysql/mysql_com.h +include/mysql/mysql_time.h +include/mysql/mysql_version.h +include/mysql/mysqld_error.h +lib/libmysqlclient.a +lib/libmysqlclient.so +lib/libmysqlclient.so.21 +lib/libmysqlclient.so.21.0.16 +lib/pkgconfig/mysqlclient.pc +man/man1/comp_err.1 +man/man1/ibd2sdi.1 +man/man1/innochecksum.1 +man/man1/lz4_decompress.1 +man/man1/my_print_defaults.1 +man/man1/myisam_ftdump.1 +man/man1/myisamchk.1 +man/man1/myisamlog.1 +man/man1/myisampack.1 +man/man1/mysql.1 +man/man1/mysql.server.1 +man/man1/mysql_config.1 +man/man1/mysql_config_editor.1 +man/man1/mysql_secure_installation.1 +man/man1/mysql_ssl_rsa_setup.1 +man/man1/mysql_tzinfo_to_sql.1 +man/man1/mysql_upgrade.1 +man/man1/mysqladmin.1 +man/man1/mysqlbinlog.1 +man/man1/mysqlcheck.1 +man/man1/mysqld_multi.1 +man/man1/mysqld_safe.1 +man/man1/mysqldump.1 +man/man1/mysqldumpslow.1 +man/man1/mysqlimport.1 +man/man1/mysqlman.1 +man/man1/mysqlpump.1 +man/man1/mysqlshow.1 +man/man1/mysqlslap.1 +man/man1/perror.1 +man/man1/zlib_decompress.1 +man/man8/mysqld.8 diff --git a/databases/mysql80-client/buildlink3.mk b/databases/mysql80-client/buildlink3.mk new file mode 100644 index 0000000000000..db79e83dc401d --- /dev/null +++ b/databases/mysql80-client/buildlink3.mk @@ -0,0 +1,19 @@ +# $NetBSD: buildlink3.mk,v 1.3 2019/02/05 20:19:55 adam Exp $ + +BUILDLINK_TREE+= mysql-client + +.if !defined(MYSQL_CLIENT_BUILDLINK3_MK) +MYSQL_CLIENT_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.mysql-client+= mysql-client>=8.0<8.1 +BUILDLINK_ABI_DEPENDS.mysql-client+= mysql-client>=8.0<8.1 +BUILDLINK_PKGSRCDIR.mysql-client?= ../../databases/mysql80-client +BUILDLINK_INCDIRS.mysql-client?= include/mysql +BUILDLINK_LIBDIRS.mysql-client?= lib + +.include "../../devel/libevent/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../security/openssl/buildlink3.mk" +.endif # MYSQL_CLIENT_BUILDLINK3_MK + +BUILDLINK_TREE+= -mysql-client diff --git a/databases/mysql80-client/distinfo b/databases/mysql80-client/distinfo new file mode 100644 index 0000000000000..5aa54c6ae2658 --- /dev/null +++ b/databases/mysql80-client/distinfo @@ -0,0 +1,18 @@ +$NetBSD: distinfo,v 1.28 2019/02/05 20:19:55 adam Exp $ + +SHA1 (mysql-8.0.16.tar.gz) = 0282645e6167f658962277d870123f9c88a5519f +RMD160 (mysql-8.0.16.tar.gz) = 2e0d3326331b74fec8ab3e147f330d2d4f75382e +SHA512 (mysql-8.0.16.tar.gz) = a6936473bf3a64ead4e70dd9a126c857fdb305f231c1e3915719a170c4a82e115d433ff96cb35f55855a9bca9085c2b4a8a88d672cdeee78e5c3f423ac266565 +Size (mysql-8.0.16.tar.gz) = 146811037 bytes +SHA1 (patch-CMakeLists.txt) = e94533a9b7d7b0c07b73811030762352249568b8 +SHA1 (patch-client_CMakeLists.txt) = 98a2739a2769f906db8b559a25f601cd99cd45ca +SHA1 (patch-cmake_boost.cmake) = ab788a9a2fa89845a497d38fede8b7796977de27 +SHA1 (patch-cmake_build__configurations_compiler__options.cmake) = 35be3c51e6bf33ca18c4c65eddbbdcb083789ddf +SHA1 (patch-include_CMakeLists.txt) = 71c9d658ad4ab3c6cc542aeaf2d2801da9e4168a +SHA1 (patch-libmysql_CMakeLists.txt) = e79cf661e478d6634761da79196eeca43a6608d5 +SHA1 (patch-router_CMakeLists.txt) = 38093f5d156f5d94da65c95b003b66b8913ffa12 +SHA1 (patch-scripts_CMakeLists.txt) = 48184c5b2c98a2ba724d0b29fdd2a3253cab4846 +SHA1 (patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc) = 10039638c4fff9347f53466118f94466ebf12e5c +SHA1 (patch-storage_myisam_mi__dynrec.cc) = 18ba2c806cb4c1deebd5988e46a5d0b81cf7dcd4 +SHA1 (patch-storage_myisam_mi__extra.cc) = 55443b27ded1156a3dd60bb66101ff95833650f2 +SHA1 (patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh) = cf9b8b609bb75c9a92e2c90bb3194b6b5541a8cb diff --git a/databases/mysql80-client/options.mk b/databases/mysql80-client/options.mk new file mode 100644 index 0000000000000..46cc4a266eb35 --- /dev/null +++ b/databases/mysql80-client/options.mk @@ -0,0 +1,24 @@ +# $NetBSD: options.mk,v 1.3 2019/02/05 20:19:55 adam Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.mysql80 + +PKG_SUPPORTED_OPTIONS+= dtrace memcached + +.include "../../mk/bsd.options.mk" + +# Enable DTrace support +.if !empty(PKG_OPTIONS:Mdtrace) +CMAKE_ARGS+= -DENABLE_DTRACE=ON +.else +CMAKE_ARGS+= -DENABLE_DTRACE=OFF +.endif + +# Enable InnoDB Memcached support +PLIST_VARS+= memcached +.if !empty(PKG_OPTIONS:Mmemcached) +PLIST.memcached= yes +CMAKE_ARGS+= -DWITH_INNODB_MEMCACHED=ON +CMAKE_ARGS+= -DWITH_BUNDLED_MEMCACHED=ON +.else +CMAKE_ARGS+= -DWITH_INNODB_MEMCACHED=OFF +.endif diff --git a/databases/mysql80-client/patches/patch-CMakeLists.txt b/databases/mysql80-client/patches/patch-CMakeLists.txt new file mode 100644 index 0000000000000..bd97515018501 --- /dev/null +++ b/databases/mysql80-client/patches/patch-CMakeLists.txt @@ -0,0 +1,21 @@ +$NetBSD$ + +Split configuration between -client and -server. + +--- CMakeLists.txt.orig 2019-01-25 22:33:03.000000000 +0000 ++++ CMakeLists.txt +@@ -1040,12 +1040,10 @@ ADD_SUBDIRECTORY(utilities) + ADD_SUBDIRECTORY(share) + ADD_SUBDIRECTORY(libservices) + +-IF(UNIX) ++IF(WITHOUT_SERVER) + ADD_SUBDIRECTORY(man) +-ENDIF() +- +-IF(NOT WITHOUT_SERVER) + ADD_SUBDIRECTORY(testclients) ++ELSE() + ADD_SUBDIRECTORY(sql) + ENDIF() + diff --git a/databases/mysql80-client/patches/patch-client_CMakeLists.txt b/databases/mysql80-client/patches/patch-client_CMakeLists.txt new file mode 100644 index 0000000000000..529162c449d46 --- /dev/null +++ b/databases/mysql80-client/patches/patch-client_CMakeLists.txt @@ -0,0 +1,57 @@ +$NetBSD$ + +Split configuration between -client and -server. + +--- client/CMakeLists.txt.orig 2019-04-13 11:46:31.000000000 +0000 ++++ client/CMakeLists.txt +@@ -27,13 +27,17 @@ INCLUDE_DIRECTORIES( + ## Subdirectory with common client code. + ADD_SUBDIRECTORY(base) + ## Subdirectory for mysqlpump code. ++IF(WITHOUT_SERVER) + ADD_SUBDIRECTORY(dump) ++ENDIF() + ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc ../sql-common/sql_string.cc pattern_matcher.cc ${CMAKE_SOURCE_DIR}/sql/net_ns.cc) + TARGET_LINK_LIBRARIES(mysql mysqlclient) + IF(UNIX) + TARGET_LINK_LIBRARIES(mysql ${EDITLINE_LIBRARY}) + ENDIF(UNIX) ++ENDIF() + + IF(NOT WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysql_upgrade upgrade/program.cc) +@@ -48,13 +52,16 @@ SET(MYSQLTEST_SRC + mysqltest/utils.cc + ) + ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc ${MYSQLTEST_SRC} COMPONENT Test) + TARGET_LINK_LIBRARIES(mysqltest mysqlclient) + ADD_DEPENDENCIES(mysqltest GenError GenClientError) ++ENDIF() + + ADD_CONVENIENCE_LIBRARY(mysqlcheck_core check/mysqlcheck_core.cc) + TARGET_LINK_LIBRARIES(mysqlcheck_core mysqlclient) + ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysqlcheck check/mysqlcheck.cc) + TARGET_LINK_LIBRARIES(mysqlcheck mysqlcheck_core) + +@@ -107,12 +114,15 @@ TARGET_LINK_LIBRARIES(mysqlslap mysqlcli + + MYSQL_ADD_EXECUTABLE(mysql_config_editor mysql_config_editor.cc) + TARGET_LINK_LIBRARIES(mysql_config_editor mysqlclient) ++ENDIF() + ++IF(NOT WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysql_secure_installation mysql_secure_installation.cc) + TARGET_LINK_LIBRARIES(mysql_secure_installation mysqlclient) + + MYSQL_ADD_EXECUTABLE(mysql_ssl_rsa_setup mysql_ssl_rsa_setup.cc path.cc logger.cc) + TARGET_LINK_LIBRARIES(mysql_ssl_rsa_setup mysys mysys_ssl) ++ENDIF() + + # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/". + IF(WIN32) diff --git a/databases/mysql80-client/patches/patch-cmake_boost.cmake b/databases/mysql80-client/patches/patch-cmake_boost.cmake new file mode 100644 index 0000000000000..ea9bd51fa4e70 --- /dev/null +++ b/databases/mysql80-client/patches/patch-cmake_boost.cmake @@ -0,0 +1,24 @@ +$NetBSD$ + +Support pkgsrc boost. + +--- cmake/boost.cmake.orig 2019-04-13 11:46:31.000000000 +0000 ++++ cmake/boost.cmake +@@ -280,17 +280,6 @@ STRING(REGEX REPLACE + + MESSAGE(STATUS "BOOST_VERSION_NUMBER is ${BOOST_VERSION_NUMBER}") + +-IF(NOT BOOST_MAJOR_VERSION EQUAL 10) +- COULD_NOT_FIND_BOOST() +-ENDIF() +- +-IF(NOT BOOST_MINOR_VERSION EQUAL 69) +- MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} " +- "we need 69" +- ) +- COULD_NOT_FIND_BOOST() +-ENDIF() +- + MESSAGE(STATUS "BOOST_INCLUDE_DIR ${BOOST_INCLUDE_DIR}") + + # We have a limited set of patches/bugfixes here: diff --git a/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake b/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake new file mode 100644 index 0000000000000..dbfddfa957e97 --- /dev/null +++ b/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake @@ -0,0 +1,13 @@ +$NetBSD$ + +--- cmake/build_configurations/compiler_options.cmake.orig 2019-04-13 11:46:31.000000000 +0000 ++++ cmake/build_configurations/compiler_options.cmake +@@ -88,7 +88,7 @@ IF(UNIX) + # Solaris flags + IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + # Link mysqld with mtmalloc on Solaris 10 and later +- SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "") ++ #SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "") + + IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + SET(SUNPRO_FLAGS "") diff --git a/databases/mysql80-client/patches/patch-include_CMakeLists.txt b/databases/mysql80-client/patches/patch-include_CMakeLists.txt new file mode 100644 index 0000000000000..47f0f15bef183 --- /dev/null +++ b/databases/mysql80-client/patches/patch-include_CMakeLists.txt @@ -0,0 +1,17 @@ +$NetBSD$ + +Split configuration between -client and -server. + +--- include/CMakeLists.txt.orig 2019-01-25 22:33:03.000000000 +0000 ++++ include/CMakeLists.txt +@@ -43,8 +43,10 @@ SET(HEADERS_MYSQL_DIR + mysql/udf_registration_types.h + ) + ++IF(WITHOUT_SERVER) + INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development) + INSTALL(FILES ${HEADERS_MYSQL_DIR} DESTINATION ${INSTALL_INCLUDEDIR}/mysql COMPONENT Development) ++ENDIF() + + # openssl/applink.c must be built into applications linking with libmysql.dll + IF (WIN32 AND OPENSSL_APPLINK_C) diff --git a/databases/mysql80-client/patches/patch-libmysql_CMakeLists.txt b/databases/mysql80-client/patches/patch-libmysql_CMakeLists.txt new file mode 100644 index 0000000000000..9fa1a90ed610f --- /dev/null +++ b/databases/mysql80-client/patches/patch-libmysql_CMakeLists.txt @@ -0,0 +1,62 @@ +$NetBSD$ + +Split configuration between -client and -server. +Do not run libmysql_api_test, requires LD_LIBRARY_PATH. + +--- libmysql/CMakeLists.txt.orig 2019-04-13 11:46:31.000000000 +0000 ++++ libmysql/CMakeLists.txt +@@ -241,11 +241,17 @@ IF(WIN32) + ENDIF() + + # LDAP authentication SASL client plugin ++IF(NOT WITHOUT_SERVER) + MESSAGE(STATUS "Creating LDAP authentication SASL client library.") + ADD_SUBDIRECTORY(authentication_ldap) ++ENDIF() + + # Merge several convenience libraries into one big mysqlclient ++IF(WITHOUT_SERVER) + MERGE_CONVENIENCE_LIBRARIES(mysqlclient ${LIBS_TO_MERGE} COMPONENT Development) ++ELSE() ++MERGE_CONVENIENCE_LIBRARIES(mysqlclient SKIP_INSTALL ${LIBS_TO_MERGE} COMPONENT Development) ++ENDIF() + TARGET_LINK_LIBRARIES(mysqlclient PRIVATE ${LIBS_TO_LINK}) + + # Visual Studio users need debug static library for debug projects +@@ -284,9 +290,15 @@ ENDIF() + IF(NOT DISABLE_SHARED) + # Merge several convenience libraries into one big mysqlclient + # and link them together into shared library. ++ IF(WITHOUT_SERVER) + MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE} + EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED} + COMPONENT SharedLibraries) ++ ELSE() ++ MERGE_LIBRARIES_SHARED(libmysql SKIP_INSTALL ${LIBS_TO_MERGE} ++ EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED} ++ COMPONENT SharedLibraries) ++ ENDIF() + TARGET_LINK_LIBRARIES(libmysql PRIVATE ${LIBS_TO_LINK}) + + IF(WIN32) +@@ -359,6 +371,7 @@ CONFIGURE_FILE(api_test.c.in ${CMAKE_CUR + # from @CLIENT_API_FUNCTIONS@ are declared by . It will fail + # to run if not all of these symbols are exported by the library. + # ++IF(NOT WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(libmysql_api_test + ${CMAKE_CURRENT_BINARY_DIR}/api_test.c SKIP_INSTALL) + # Clang/UBSAN needs this on some platforms. +@@ -380,9 +393,12 @@ IF(DISABLE_SHARED) + ELSE() + TARGET_LINK_LIBRARIES(libmysql_api_test libmysql) + ENDIF() ++ENDIF() + + # Verify that libmysql_api_test runs OK ++IF(0) + ADD_CUSTOM_COMMAND(TARGET libmysql_api_test POST_BUILD + COMMAND $ + > ${CMAKE_CURRENT_BINARY_DIR}/libmysql_api_test.out + ) ++ENDIF() diff --git a/databases/mysql80-client/patches/patch-router_CMakeLists.txt b/databases/mysql80-client/patches/patch-router_CMakeLists.txt new file mode 100644 index 0000000000000..446fee8e66f62 --- /dev/null +++ b/databases/mysql80-client/patches/patch-router_CMakeLists.txt @@ -0,0 +1,15 @@ +$NetBSD$ + +Disable section specific to Solaris Studio. + +--- router/CMakeLists.txt.orig 2019-04-13 11:46:31.000000000 +0000 ++++ router/CMakeLists.txt +@@ -56,7 +56,7 @@ IF(POLICY CMP0075) + CMAKE_POLICY(SET CMP0075 OLD) + ENDIF() + +-IF(SOLARIS) ++IF(notSOLARIS) + # disable rapidjson optimisation on Solaris as it breaks + # shared objects that build with -fPIC + ADD_DEFINITIONS(-DRAPIDJSON_48BITPOINTER_OPTIMIZATION=0) diff --git a/databases/mysql80-client/patches/patch-scripts_CMakeLists.txt b/databases/mysql80-client/patches/patch-scripts_CMakeLists.txt new file mode 100644 index 0000000000000..949e7eb0be908 --- /dev/null +++ b/databases/mysql80-client/patches/patch-scripts_CMakeLists.txt @@ -0,0 +1,39 @@ +$NetBSD$ + +Split configuration between -client and -server. + +--- scripts/CMakeLists.txt.orig 2019-01-25 22:33:03.000000000 +0000 ++++ scripts/CMakeLists.txt +@@ -456,19 +456,21 @@ ELSE() + # On Unix, most of the files end up in the bin directory + SET(mysql_config_COMPONENT Development) + ++ IF(WITHOUT_SERVER) ++ SET(BIN_SCRIPTS mysql_config) ++ ELSE() + IF(WITH_SYSTEMD) + SET(BIN_SCRIPTS +- mysql_config + mysqldumpslow + ) + ELSE() + SET(BIN_SCRIPTS +- mysql_config + mysqldumpslow + mysqld_multi + mysqld_safe + ) + ENDIF() ++ ENDIF() + + SET(PKGCONFIG_FILE ${LIBMYSQL_OS_OUTPUT_NAME}.pc) + STRING(REGEX REPLACE "/mysql$" "" PKGCONFIG_DIR "${INSTALL_LIBDIR}") +@@ -484,7 +486,7 @@ ELSE() + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE} + ESCAPE_QUOTES @ONLY) + +- IF(INSTALL_PKGCONFIGDIR) ++ IF(INSTALL_PKGCONFIGDIR AND WITHOUT_SERVER) + MESSAGE(STATUS "INSTALL ${PKGCONFIG_FILE} ${INSTALL_PKGCONFIGDIR}") + INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE} diff --git a/databases/mysql80-client/patches/patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc b/databases/mysql80-client/patches/patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc new file mode 100644 index 0000000000000..e376ff08e4564 --- /dev/null +++ b/databases/mysql80-client/patches/patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc @@ -0,0 +1,63 @@ +$NetBSD$ + +Fix build on illumos. + +--- sql/resourcegroups/platform/thread_attrs_api_solaris.cc.orig 2019-01-25 22:33:03.000000000 +0000 ++++ sql/resourcegroups/platform/thread_attrs_api_solaris.cc +@@ -60,6 +60,7 @@ bool bind_to_cpu(cpu_id_t cpu_id, my_thr + } + + bool bind_to_cpus(const std::vector &cpu_ids) { ++#if 0 + if (cpu_ids.empty()) return false; + + procset_t ps; +@@ -76,10 +77,13 @@ bool bind_to_cpus(const std::vector &cpu_ids, + my_thread_os_id_t thread_id) { ++#if 0 + procset_t ps; + uint_t nids = cpu_ids.size(); + id_t *ids = reinterpret_cast(const_cast(cpu_ids.data())); +@@ -96,9 +100,12 @@ bool bind_to_cpus(const std::vectors->file_map, size, MADV_RANDOM); ++# else + madvise((char *)info->s->file_map, size, MADV_RANDOM); ++# endif + #endif + info->s->mmaped_length = size; + info->s->file_read = mi_mmap_pread; diff --git a/databases/mysql80-client/patches/patch-storage_myisam_mi__extra.cc b/databases/mysql80-client/patches/patch-storage_myisam_mi__extra.cc new file mode 100644 index 0000000000000..029b20da2ce03 --- /dev/null +++ b/databases/mysql80-client/patches/patch-storage_myisam_mi__extra.cc @@ -0,0 +1,18 @@ +$NetBSD$ + +Fix build on SunOS. + +--- storage/myisam/mi_extra.cc.orig 2019-01-25 22:33:03.000000000 +0000 ++++ storage/myisam/mi_extra.cc +@@ -251,7 +251,11 @@ int mi_reset(MI_INFO *info) { + if (share->base.blobs) mi_alloc_rec_buff(info, -1, &info->rec_buff); + #if defined(HAVE_MADVISE) + if (info->opt_flag & MEMMAP_USED) ++# ifdef __sun ++ posix_madvise((char *)share->file_map, share->state.state.data_file_length, ++# else + madvise((char *)share->file_map, share->state.state.data_file_length, ++# endif + MADV_RANDOM); + #endif + info->opt_flag &= ~(KEY_READ_USED | REMEMBER_OLD_POS); diff --git a/databases/mysql80-client/patches/patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh b/databases/mysql80-client/patches/patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh new file mode 100644 index 0000000000000..191118efa24fe --- /dev/null +++ b/databases/mysql80-client/patches/patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh @@ -0,0 +1,24 @@ +$NetBSD: patch-storage_ndb_mcc_frontend_dojo_dojox_mobile_build_build.sh,v 1.1 2016/09/16 06:49:11 adam Exp $ + +Shell portability. + +--- storage/ndb/mcc/frontend/dojo/dojox/mobile/build/build.sh.orig 2016-03-28 18:06:12.000000000 +0000 ++++ storage/ndb/mcc/frontend/dojo/dojox/mobile/build/build.sh +@@ -16,14 +16,14 @@ profile=mobile + dir=release-mobile-separate + webkit= + #standalone=standaloneScrollable=true +-if [ "$1" == "single" ]; then ++if [ "$1" = "single" ]; then + profile=mobile-all + fi +-if [ "$1" == "single" ]; then ++if [ "$1" = "single" ]; then + dir=release-mobile-single + fi + shift 1 +-if [ "$1" == "webkit" ]; then ++if [ "$1" = "webkit" ]; then + webkit=webkitMobile=true + shift 1 + fi diff --git a/databases/mysql80-server/DEINSTALL b/databases/mysql80-server/DEINSTALL new file mode 100644 index 0000000000000..1a06da193be21 --- /dev/null +++ b/databases/mysql80-server/DEINSTALL @@ -0,0 +1,16 @@ +# $NetBSD: DEINSTALL,v 1.1 2016/09/16 06:49:12 adam Exp $ + +case ${STAGE} in +POST-DEINSTALL) + if [ -d @MYSQL_DATADIR@ ]; then + ${CAT} << EOF +=========================================================================== +If you won't be using ${PKGNAME} any longer, and you don't +wish to preserve your existing databases, then you may remove the +following directory: + + @MYSQL_DATADIR@ +=========================================================================== +EOF + fi +esac diff --git a/databases/mysql80-server/DESCR b/databases/mysql80-server/DESCR new file mode 100644 index 0000000000000..15226a0a0bea5 --- /dev/null +++ b/databases/mysql80-server/DESCR @@ -0,0 +1,15 @@ +MySQL is a SQL (Structured Query Language) database server. SQL is the most +popular database language in the world. MySQL is a client-server implementation +that consists of a server daemon `mysqld' and many different client +programs/libraries. + +The main goals of MySQL are speed and robustness. + +The base upon which MySQL is built is a set of routines that have been used in +a highly demanding production environment for many years. While MySQL is still +in development it already offers a rich and highly useful function set. + +The official way to pronounce 'MySQL' is 'My Ess Que Ell' (Not MY-SEQUEL). + +This package contains the MySQL server programs and libraries including +embedded server (by PKG_OPTION). diff --git a/databases/mysql80-server/MESSAGE b/databases/mysql80-server/MESSAGE new file mode 100644 index 0000000000000..94012d3d3e227 --- /dev/null +++ b/databases/mysql80-server/MESSAGE @@ -0,0 +1,21 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1 2016/09/16 06:49:12 adam Exp $ + +After the tables are set up and the MySQL server is running, +please remember to set a password for the MySQL root user! +This is done by running both: + + ${PREFIX}/bin/mysqladmin -u root -p password 'new-password' + ${PREFIX}/bin/mysqladmin -h `hostname` -u root -p password 'new-password' + +The "Enter password:" prompt is asking for the existing password. +As there is no existing password, just press the Return key. + +There is a script distributed with MySQL that can help you lock down +an installation. This script has been installed to + + ${PREFIX}/bin/mysql_secure_installation. + +Please see the manual and the MySQL web site for more instructions. + +=========================================================================== diff --git a/databases/mysql80-server/MESSAGE.sphinx b/databases/mysql80-server/MESSAGE.sphinx new file mode 100644 index 0000000000000..6b373550a8685 --- /dev/null +++ b/databases/mysql80-server/MESSAGE.sphinx @@ -0,0 +1,14 @@ +=========================================================================== +$NetBSD: MESSAGE.sphinx,v 1.1 2016/09/16 06:49:12 adam Exp $ + +To install the SphinxSE MySQL plugin, log into your MySQL console +and issue the following query: + + INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so'; + +You can verify it has been loaded properly by checking whether +it shows up in the list when list your engines: + + SHOW ENGINES; + +=========================================================================== diff --git a/databases/mysql80-server/Makefile b/databases/mysql80-server/Makefile new file mode 100644 index 0000000000000..da74ca18b91fd --- /dev/null +++ b/databases/mysql80-server/Makefile @@ -0,0 +1,70 @@ +# $NetBSD: Makefile,v 1.20 2019/02/05 20:19:55 adam Exp $ + +PKGNAME= ${DISTNAME:S/-/-server-/} +COMMENT= A free SQL database (server) + +CONFLICTS= mysql3-server-[0-9]* + +.include "../../databases/mysql80-client/Makefile.common" + +CMAKE_ARGS+= -DINSTALL_INFODIR=${PKGINFODIR} +CMAKE_ARGS+= -DINSTALL_MYSQLTESTDIR="" +CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER=ON + +PTHREAD_OPTS+= require + +PKG_GROUPS= ${MYSQL_GROUP} +PKG_USERS= ${MYSQL_USER}:${MYSQL_GROUP} + +PKG_GECOS.${MYSQL_USER}= MySQL database administrator +PKG_HOME.${MYSQL_USER}= ${MYSQL_DATADIR} +PKG_SHELL.${MYSQL_USER}= ${SH} + +RCD_SCRIPTS= mysqld +SMF_NAME= mysql +SMF_METHODS= ${RCD_SCRIPTS} + +FILES_SUBST+= HOSTNAME_CMD=${HOSTNAME_CMD:Q} +FILES_SUBST+= MYSQL_DATADIR=${MYSQL_DATADIR} +FILES_SUBST+= MYSQL_USER=${MYSQL_USER} MYSQL_GROUP=${MYSQL_GROUP} +FILES_SUBST+= MYSQL_PIDFILE=${MYSQL_PIDFILE} +MESSAGE_SUBST+= MYSQL_DATADIR=${MYSQL_DATADIR} +MESSAGE_SUBST+= MYSQL_USER=${MYSQL_USER} MYSQL_GROUP=${MYSQL_GROUP} +BUILD_DEFS+= MYSQL_DATADIR + +#REPLACE_PERL+= mysql-test/lib/v1/mysql-test-run.pl +#REPLACE_PERL+= mysql-test/mysql-stress-test.pl +#REPLACE_PERL+= mysql-test/mysql-test-run.pl +#REPLACE_PERL+= mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl +#REPLACE_PERL+= mysql-test/suite/funcs_1/lib/DataGen_local.pl +#REPLACE_PERL+= mysql-test/suite/funcs_1/lib/DataGen_modify.pl +#REPLACE_PERL+= mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl +#REPLACE_PERL+= mysql-test/suite/opt_trace/validate_json.pl +#REPLACE_PERL+= mysql-test/suite/rpl/extension/bhs.pl +#REPLACE_PERL+= mysql-test/suite/rpl/extension/checksum.pl + +#REPLACE_SH+= mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh +#REPLACE_SH+= mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh +#REPLACE_SH+= mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh +#REPLACE_SH+= mysql-test/t/long_tmpdir-master.sh +#REPLACE_SH+= mysql-test/t/lowercase_mixed_tmpdir-master.sh +#REPLACE_SH+= mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh + +#CHECK_INTERPRETER_SKIP+= share/mysql/test/std_data/dtrace.d + +SUBST_CLASSES+= perlpath +SUBST_STAGE.perlpath= pre-configure +SUBST_MESSAGE.perlpath= Fixing Perl paths. +SUBST_FILES.perlpath= scripts/mysql_config.pl.in +SUBST_FILES.perlpath+= scripts/mysqld_multi.sh +SUBST_FILES.perlpath+= scripts/mysqldumpslow.sh +SUBST_SED.perlpath= -e 's,@PERL_PATH@,${PERL5},g' + +INSTALLATION_DIRS+= bin +TEST_TARGET= test + +.include "../../archivers/lz4/buildlink3.mk" +BUILDLINK_AUTO_DIRS.mysql-client= no +.include "../../databases/mysql80-client/buildlink3.mk" +.include "../../security/tcp_wrappers/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/databases/mysql80-server/PLIST b/databases/mysql80-server/PLIST new file mode 100644 index 0000000000000..d6a97ad8761a8 --- /dev/null +++ b/databases/mysql80-server/PLIST @@ -0,0 +1,207 @@ +@comment $NetBSD$ +LICENSE.router +README.router +bin/ibd2sdi +bin/innochecksum +bin/my_print_defaults +bin/myisam_ftdump +bin/myisamchk +bin/myisamlog +bin/myisampack +bin/mysql_secure_installation +bin/mysql_ssl_rsa_setup +bin/mysql_tzinfo_to_sql +bin/mysql_upgrade +bin/mysqld_multi +bin/mysqld_safe +bin/mysqldumpslow +bin/mysqlrouter +bin/mysqlrouter_passwd +bin/mysqlrouter_plugin_info +bin/mysqltest_safe_process +bin/mysqlxtest +bin/perror +bin/zlib_decompress +include/mysql/mysqlx_ername.h +include/mysql/mysqlx_error.h +include/mysql/mysqlx_version.h +lib/libmysqlharness.a +lib/libmysqlharness.so +lib/libmysqlharness.so.1 +lib/libmysqlrouter.so +lib/libmysqlrouter.so.1 +lib/libmysqlrouter_http.so +lib/libmysqlrouter_http.so.1 +lib/libmysqlservices.a +lib/mysql/plugin/adt_null.so +lib/mysql/plugin/auth.so +lib/mysql/plugin/auth_test_plugin.so +lib/mysql/plugin/authentication_ldap_sasl_client.so +lib/mysql/plugin/component_audit_api_message_emit.so +lib/mysql/plugin/component_example_component1.so +lib/mysql/plugin/component_example_component2.so +lib/mysql/plugin/component_example_component3.so +lib/mysql/plugin/component_log_filter_dragnet.so +lib/mysql/plugin/component_log_sink_json.so +lib/mysql/plugin/component_log_sink_syseventlog.so +lib/mysql/plugin/component_log_sink_test.so +lib/mysql/plugin/component_mysqlx_global_reset.so +lib/mysql/plugin/component_pfs_example.so +lib/mysql/plugin/component_pfs_example_component_population.so +lib/mysql/plugin/component_test_audit_api_message.so +lib/mysql/plugin/component_test_backup_lock_service.so +lib/mysql/plugin/component_test_host_application_signal.so +lib/mysql/plugin/component_test_mysql_runtime_error.so +lib/mysql/plugin/component_test_pfs_notification.so +lib/mysql/plugin/component_test_pfs_resource_group.so +lib/mysql/plugin/component_test_status_var_service.so +lib/mysql/plugin/component_test_status_var_service_int.so +lib/mysql/plugin/component_test_status_var_service_reg_only.so +lib/mysql/plugin/component_test_status_var_service_str.so +lib/mysql/plugin/component_test_status_var_service_unreg_only.so +lib/mysql/plugin/component_test_string_service.so +lib/mysql/plugin/component_test_string_service_charset.so +lib/mysql/plugin/component_test_string_service_long.so +lib/mysql/plugin/component_test_sys_var_service.so +lib/mysql/plugin/component_test_sys_var_service_int.so +lib/mysql/plugin/component_test_sys_var_service_same.so +lib/mysql/plugin/component_test_sys_var_service_str.so +lib/mysql/plugin/component_test_system_variable_source.so +lib/mysql/plugin/component_test_udf_registration.so +lib/mysql/plugin/component_udf_reg_3_func.so +lib/mysql/plugin/component_udf_reg_avg_func.so +lib/mysql/plugin/component_udf_reg_int_func.so +lib/mysql/plugin/component_udf_reg_int_same_func.so +lib/mysql/plugin/component_udf_reg_only_3_func.so +lib/mysql/plugin/component_udf_reg_real_func.so +lib/mysql/plugin/component_udf_unreg_3_func.so +lib/mysql/plugin/component_udf_unreg_int_func.so +lib/mysql/plugin/component_udf_unreg_real_func.so +lib/mysql/plugin/component_validate_password.so +lib/mysql/plugin/connection_control.so +lib/mysql/plugin/daemon_example.ini +lib/mysql/plugin/ddl_rewriter.so +lib/mysql/plugin/group_replication.so +lib/mysql/plugin/ha_example.so +lib/mysql/plugin/ha_mock.so +lib/mysql/plugin/innodb_engine.so +lib/mysql/plugin/keyring_file.so +lib/mysql/plugin/keyring_udf.so +lib/mysql/plugin/libdaemon_example.so +lib/mysql/plugin/libmemcached.so +lib/mysql/plugin/libtest_framework.so +lib/mysql/plugin/libtest_services.so +lib/mysql/plugin/libtest_services_threaded.so +lib/mysql/plugin/libtest_session_attach.so +lib/mysql/plugin/libtest_session_detach.so +lib/mysql/plugin/libtest_session_in_thd.so +lib/mysql/plugin/libtest_session_info.so +lib/mysql/plugin/libtest_sql_2_sessions.so +lib/mysql/plugin/libtest_sql_all_col_types.so +lib/mysql/plugin/libtest_sql_cmds_1.so +lib/mysql/plugin/libtest_sql_commit.so +lib/mysql/plugin/libtest_sql_complex.so +lib/mysql/plugin/libtest_sql_errors.so +lib/mysql/plugin/libtest_sql_lock.so +lib/mysql/plugin/libtest_sql_processlist.so +lib/mysql/plugin/libtest_sql_replication.so +lib/mysql/plugin/libtest_sql_reset_connection.so +lib/mysql/plugin/libtest_sql_shutdown.so +lib/mysql/plugin/libtest_sql_sqlmode.so +lib/mysql/plugin/libtest_sql_stmt.so +lib/mysql/plugin/libtest_sql_stored_procedures_functions.so +lib/mysql/plugin/libtest_sql_views_triggers.so +lib/mysql/plugin/libtest_x_sessions_deinit.so +lib/mysql/plugin/libtest_x_sessions_init.so +lib/mysql/plugin/locking_service.so +lib/mysql/plugin/mypluglib.so +lib/mysql/plugin/mysql_no_login.so +lib/mysql/plugin/pfs_example_plugin_employee.so +lib/mysql/plugin/qa_auth_client.so +lib/mysql/plugin/qa_auth_interface.so +lib/mysql/plugin/qa_auth_server.so +lib/mysql/plugin/replication_observers_example_plugin.so +lib/mysql/plugin/rewrite_example.so +lib/mysql/plugin/rewriter.so +lib/mysql/plugin/semisync_master.so +lib/mysql/plugin/semisync_slave.so +lib/mysql/plugin/test_security_context.so +lib/mysql/plugin/test_services_host_application_signal.so +lib/mysql/plugin/test_services_plugin_registry.so +lib/mysql/plugin/test_udf_services.so +lib/mysql/plugin/udf_example.so +lib/mysql/plugin/validate_password.so +lib/mysql/plugin/version_token.so +lib/mysqlrouter/http_auth_backend.so +lib/mysqlrouter/http_auth_realm.so +lib/mysqlrouter/http_server.so +lib/mysqlrouter/keepalive.so +lib/mysqlrouter/metadata_cache.so +lib/mysqlrouter/mysql_protocol.so +lib/mysqlrouter/routing.so +sbin/mysqld +share/aclocal/mysql.m4 +share/doc/mysql/ChangeLog +share/doc/mysql/INFO_BIN +share/doc/mysql/INFO_SRC +share/doc/mysql/LICENSE +share/doc/mysql/README +share/doc/mysql/sample_mysqlrouter.conf +share/mysql/bulgarian/errmsg.sys +share/mysql/charsets/Index.xml +share/mysql/charsets/README +share/mysql/charsets/armscii8.xml +share/mysql/charsets/ascii.xml +share/mysql/charsets/cp1250.xml +share/mysql/charsets/cp1251.xml +share/mysql/charsets/cp1256.xml +share/mysql/charsets/cp1257.xml +share/mysql/charsets/cp850.xml +share/mysql/charsets/cp852.xml +share/mysql/charsets/cp866.xml +share/mysql/charsets/dec8.xml +share/mysql/charsets/geostd8.xml +share/mysql/charsets/greek.xml +share/mysql/charsets/hebrew.xml +share/mysql/charsets/hp8.xml +share/mysql/charsets/keybcs2.xml +share/mysql/charsets/koi8r.xml +share/mysql/charsets/koi8u.xml +share/mysql/charsets/latin1.xml +share/mysql/charsets/latin2.xml +share/mysql/charsets/latin5.xml +share/mysql/charsets/latin7.xml +share/mysql/charsets/macce.xml +share/mysql/charsets/macroman.xml +share/mysql/charsets/swe7.xml +share/mysql/czech/errmsg.sys +share/mysql/danish/errmsg.sys +share/mysql/dictionary.txt +share/mysql/dutch/errmsg.sys +share/mysql/english/errmsg.sys +share/mysql/errmsg-utf8.txt +share/mysql/estonian/errmsg.sys +share/mysql/french/errmsg.sys +share/mysql/german/errmsg.sys +share/mysql/greek/errmsg.sys +share/mysql/hungarian/errmsg.sys +share/mysql/innodb_memcached_config.sql +share/mysql/install_rewriter.sql +share/mysql/italian/errmsg.sys +share/mysql/japanese/errmsg.sys +share/mysql/korean/errmsg.sys +share/mysql/mysql-log-rotate +share/mysql/mysql.server +share/mysql/mysqld_multi.server +share/mysql/norwegian-ny/errmsg.sys +share/mysql/norwegian/errmsg.sys +share/mysql/polish/errmsg.sys +share/mysql/portuguese/errmsg.sys +share/mysql/romanian/errmsg.sys +share/mysql/russian/errmsg.sys +share/mysql/serbian/errmsg.sys +share/mysql/slovak/errmsg.sys +share/mysql/spanish/errmsg.sys +share/mysql/swedish/errmsg.sys +share/mysql/ukrainian/errmsg.sys +share/mysql/uninstall_rewriter.sql diff --git a/databases/mysql80-server/PLIST.SunOS b/databases/mysql80-server/PLIST.SunOS new file mode 100644 index 0000000000000..d1f598401f45f --- /dev/null +++ b/databases/mysql80-server/PLIST.SunOS @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST.SunOS,v 1.1 2016/09/16 06:49:12 adam Exp $ +share/mysql/solaris/postinstall-solaris diff --git a/databases/mysql80-server/buildlink3.mk b/databases/mysql80-server/buildlink3.mk new file mode 100644 index 0000000000000..ed24b344e66fb --- /dev/null +++ b/databases/mysql80-server/buildlink3.mk @@ -0,0 +1,15 @@ +# $NetBSD: buildlink3.mk,v 1.1 2016/09/16 06:49:12 adam Exp $ + +BUILDLINK_TREE+= mysql-server + +.if !defined(MYSQL_SERVER_BUILDLINK3_MK) +MYSQL_SERVER_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.mysql-server+= mysql-server>=5.7.12 +BUILDLINK_ABI_DEPENDS.mysql-server?= mysql-server>=5.7.12 +BUILDLINK_PKGSRCDIR.mysql-server?= ../../databases/mysql57-server +BUILDLINK_LIBDIRS.mysql-server?= lib + +.endif # MYSQL_SERVER_BUILDLINK3_MK + +BUILDLINK_TREE+= -mysql-server diff --git a/databases/mysql80-server/files/mysqld.sh b/databases/mysql80-server/files/mysqld.sh new file mode 100644 index 0000000000000..7a9e44e1406b2 --- /dev/null +++ b/databases/mysql80-server/files/mysqld.sh @@ -0,0 +1,108 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: mysqld.sh,v 1.2 2017/06/24 15:18:42 schmonz Exp $ +# +# PROVIDE: mysqld +# REQUIRE: DAEMON LOGIN mountall +# KEYWORD: shutdown +# +# You will need to set some variables in /etc/rc.conf to start MySQL: +# +# mysqld=YES +# +# The following variables are optional: +# +# mysqld_user="mysql" # user to run mysqld as +# mysqld_datadir="/path/to/home" # path to MySQL database directory +# mysqld_pidfile="/path/to/p.pid" # path to MySQL PID file + +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="mysqld" +rcvar=${name} +command="@PREFIX@/bin/mysqld_safe" +procname="@PREFIX@/sbin/${name}" +: ${mysqld_user:=@MYSQL_USER@} +: ${mysqld_group:=@MYSQL_GROUP@} +: ${mysqld_datadir:=@MYSQL_DATADIR@} +: ${mysqld_pidfile:=@MYSQL_PIDFILE@} + +extra_commands="initdb" +initdb_cmd="mysqld_initdb" +start_precmd="mysqld_precmd" +start_cmd="mysqld_start" + +mysqld_precmd() +{ + if [ ! -d ${mysqld_datadir}/mysql ]; then + ${initdb_cmd} + fi +} + +mysqld_initdb() +{ + initdb="@PREFIX@/sbin/mysqld" + if [ ! -x ${initdb} ]; then + return 1 + fi + if [ -f ${mysqld_datadir}/mysql/host.frm ]; then + @ECHO@ "The MySQL database has already been initialized." + @ECHO@ "Skipping database initialization." + else + @ECHO@ "Initializing MySQL database system tables." + ${initdb} --initialize --user=${mysqld_user} \ + --datadir=${mysqld_datadir} || return 1 + if [ -d ${mysqld_datadir} ]; then + @CHOWN@ -R ${mysqld_user}:${mysqld_group} \ + ${mysqld_datadir} + fi + fi +} + +mysqld_start() +{ + for f in $required_files; do + if [ ! -r "$f" ]; then + @ECHO@ 1>&2 "$0: WARNING: $f is not readable" + if [ -z $rc_force ]; then + return 1 + fi + fi + done + @ECHO@ "Starting ${name}." + ulimit -n 4096 + cd @PREFIX@ + @PERL5@ -e 'use POSIX qw(setsid); setsid(); { exec (@ARGV) }' ${command} --user=${mysqld_user} --datadir=${mysqld_datadir} \ + --pid-file=${mysqld_pidfile} ${mysqld_flags} \ + ${thread_flags} \ + 2>&1 | @PERL5@ -e 'use POSIX qw(setsid); setsid(); { exec (@ARGV) }' @SU@ -m ${mysqld_user} -c 'logger -t nbmysqld_safe' \ + & +} + +if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then + load_rc_config $name + pidfile="${mysqld_pidfile}" + run_rc_command "$1" +else + if [ -f /etc/rc.conf ]; then + . /etc/rc.conf + fi + pidfile="${mysqld_pidfile}" + case "$1" in + initdb) + eval ${initdb_cmd} + ;; + stop) + if [ -r "${pidfile}" ]; then + @ECHO@ "Stopping ${name}." + kill `@CAT@ ${pidfile}` + fi + ;; + *) + eval ${start_precmd} + eval ${start_cmd} + ;; + esac +fi diff --git a/databases/mysql80-server/files/smf/manifest.xml b/databases/mysql80-server/files/smf/manifest.xml new file mode 100644 index 0000000000000..d558639bf321c --- /dev/null +++ b/databases/mysql80-server/files/smf/manifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/databases/mysql80-server/files/smf/mysqld.sh b/databases/mysql80-server/files/smf/mysqld.sh new file mode 100644 index 0000000000000..ee2de4fdb8e1a --- /dev/null +++ b/databases/mysql80-server/files/smf/mysqld.sh @@ -0,0 +1,31 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: mysqld.sh,v 1.1 2016/09/16 06:49:12 adam Exp $ +# +# Init script for mysqld. +# + +. /lib/svc/share/smf_include.sh + +PIDFILE="@MYSQL_DATADIR@/mysql.pid" + +ulimit -n 10240 + +case "$1" in +start) + @LOCALBASE@/sbin/mysqld --user=mysql \ + --basedir=@LOCALBASE@ \ + --datadir=@MYSQL_DATADIR@ \ + --pid-file=${PIDFILE} \ + --log-error=@VARBASE@/log/mysql/error.log & + ;; +stop) + [ -f ${PIDFILE} ] && kill `@HEAD@ -1 ${PIDFILE}` + ;; +*) + echo "Usage: $0 {start|stop}" >&2 + exit 1 + ;; +esac + +exit $SMF_EXIT_OK From 44ea19f4e516708988afd09557486c83f4040950 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 5 Jul 2019 11:52:33 +0100 Subject: [PATCH 89/92] mysql80*: Some fixes. --- databases/mysql80-client/Makefile | 2 +- databases/mysql80-client/distinfo | 2 +- ..._build__configurations_compiler__options.cmake | 13 ------------- ...in_group__replication_libmysqlgcs_rpcgen.cmake | 15 +++++++++++++++ databases/mysql80-server/Makefile | 10 +++++++++- 5 files changed, 26 insertions(+), 16 deletions(-) delete mode 100644 databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake create mode 100644 databases/mysql80-client/patches/patch-plugin_group__replication_libmysqlgcs_rpcgen.cmake diff --git a/databases/mysql80-client/Makefile b/databases/mysql80-client/Makefile index fdeaa1d9ec9cd..d50ee0089b25d 100644 --- a/databases/mysql80-client/Makefile +++ b/databases/mysql80-client/Makefile @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.20 2019/02/05 20:19:55 adam Exp $ PKGNAME= ${DISTNAME:S/-/-client-/} -COMMENT= Popular open source database (client) +COMMENT= MySQL database client and libraries .include "Makefile.common" diff --git a/databases/mysql80-client/distinfo b/databases/mysql80-client/distinfo index 5aa54c6ae2658..87399bdb61970 100644 --- a/databases/mysql80-client/distinfo +++ b/databases/mysql80-client/distinfo @@ -7,9 +7,9 @@ Size (mysql-8.0.16.tar.gz) = 146811037 bytes SHA1 (patch-CMakeLists.txt) = e94533a9b7d7b0c07b73811030762352249568b8 SHA1 (patch-client_CMakeLists.txt) = 98a2739a2769f906db8b559a25f601cd99cd45ca SHA1 (patch-cmake_boost.cmake) = ab788a9a2fa89845a497d38fede8b7796977de27 -SHA1 (patch-cmake_build__configurations_compiler__options.cmake) = 35be3c51e6bf33ca18c4c65eddbbdcb083789ddf SHA1 (patch-include_CMakeLists.txt) = 71c9d658ad4ab3c6cc542aeaf2d2801da9e4168a SHA1 (patch-libmysql_CMakeLists.txt) = e79cf661e478d6634761da79196eeca43a6608d5 +SHA1 (patch-plugin_group__replication_libmysqlgcs_rpcgen.cmake) = 6c53ee586f493b46631d4f9682f29457b4daaeae SHA1 (patch-router_CMakeLists.txt) = 38093f5d156f5d94da65c95b003b66b8913ffa12 SHA1 (patch-scripts_CMakeLists.txt) = 48184c5b2c98a2ba724d0b29fdd2a3253cab4846 SHA1 (patch-sql_resourcegroups_platform_thread__attrs__api__solaris.cc) = 10039638c4fff9347f53466118f94466ebf12e5c diff --git a/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake b/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake deleted file mode 100644 index dbfddfa957e97..0000000000000 --- a/databases/mysql80-client/patches/patch-cmake_build__configurations_compiler__options.cmake +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD$ - ---- cmake/build_configurations/compiler_options.cmake.orig 2019-04-13 11:46:31.000000000 +0000 -+++ cmake/build_configurations/compiler_options.cmake -@@ -88,7 +88,7 @@ IF(UNIX) - # Solaris flags - IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") - # Link mysqld with mtmalloc on Solaris 10 and later -- SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "") -+ #SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "") - - IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") - SET(SUNPRO_FLAGS "") diff --git a/databases/mysql80-client/patches/patch-plugin_group__replication_libmysqlgcs_rpcgen.cmake b/databases/mysql80-client/patches/patch-plugin_group__replication_libmysqlgcs_rpcgen.cmake new file mode 100644 index 0000000000000..301fce1e3d6b5 --- /dev/null +++ b/databases/mysql80-client/patches/patch-plugin_group__replication_libmysqlgcs_rpcgen.cmake @@ -0,0 +1,15 @@ +$NetBSD$ + +Use pre-generated headers on SmartOS. + +--- plugin/group_replication/libmysqlgcs/rpcgen.cmake.orig 2019-04-13 11:46:31.000000000 +0000 ++++ plugin/group_replication/libmysqlgcs/rpcgen.cmake +@@ -71,7 +71,7 @@ FOREACH(X xcom_vp) + SET (x_vanilla_h ${XCOM_BASEDIR}/${X}.h.gen) + SET (x_vanilla_c ${XCOM_BASEDIR}/${X}_xdr.c.gen) + +- IF(WIN32) ++ IF(WIN32 OR USE_PREGEN_RPC) + # on windows system's there is no rpcgen, thence copy + # the files in the source directory + ADD_CUSTOM_COMMAND(OUTPUT ${x_gen_h} ${x_gen_c} ${x_tmp_plat_h} diff --git a/databases/mysql80-server/Makefile b/databases/mysql80-server/Makefile index da74ca18b91fd..f2f8fb13fbecc 100644 --- a/databases/mysql80-server/Makefile +++ b/databases/mysql80-server/Makefile @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.20 2019/02/05 20:19:55 adam Exp $ PKGNAME= ${DISTNAME:S/-/-server-/} -COMMENT= A free SQL database (server) +COMMENT= MySQL database server CONFLICTS= mysql3-server-[0-9]* @@ -11,6 +11,14 @@ CMAKE_ARGS+= -DINSTALL_INFODIR=${PKGINFODIR} CMAKE_ARGS+= -DINSTALL_MYSQLTESTDIR="" CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER=ON +.include "../../mk/bsd.prefs.mk" + +.if ${OS_VARIANT} == "SmartOS" +CMAKE_ARGS+= -DUSE_PREGEN_RPC=1 +.else +CMAKE_ARGS+= -DUSE_PREGEN_RPC=0 +.endif + PTHREAD_OPTS+= require PKG_GROUPS= ${MYSQL_GROUP} From 4be22011aa75c65cddae26e235dc5948cbd21d8b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Sat, 27 Jul 2019 01:01:20 +0100 Subject: [PATCH 90/92] Update 'joyent' submodule. --- joyent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joyent b/joyent index 53e5b20fd4c6e..5114bee8ab5b0 160000 --- a/joyent +++ b/joyent @@ -1 +1 @@ -Subproject commit 53e5b20fd4c6e9aba5b801744a69df9948484053 +Subproject commit 5114bee8ab5b04bcefd383611977162c872ab5cd From b357107579e4a60599cb598eb72ec107716e83ef Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 8 Aug 2019 12:43:57 +0100 Subject: [PATCH 91/92] Backport erlang fix from CVS. --- lang/erlang/distinfo | 3 ++- lang/erlang/patches/patch-erts_aclocal.m4 | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lang/erlang/patches/patch-erts_aclocal.m4 diff --git a/lang/erlang/distinfo b/lang/erlang/distinfo index a0657b750040d..68f4a71e2d787 100644 --- a/lang/erlang/distinfo +++ b/lang/erlang/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.74 2019/08/01 11:43:00 nia Exp $ +$NetBSD: distinfo,v 1.75 2019/08/08 11:42:23 jperkin Exp $ SHA1 (erlang/OTP-22.0.7.tar.gz) = 6d011f6814d08ae2bce0055a203f85ab7930e915 RMD160 (erlang/OTP-22.0.7.tar.gz) = 1719401953c5ed5870336a3d5bb3019f0a30020f @@ -6,6 +6,7 @@ SHA512 (erlang/OTP-22.0.7.tar.gz) = cf84cc20b97ed46f9ab3c7f1d77bcf6254ac3ebbb5c1 Size (erlang/OTP-22.0.7.tar.gz) = 54814307 bytes SHA1 (patch-ab) = 5f1602f3a49c05fd4c45884a7cd6be8d3f287ac3 SHA1 (patch-ay) = f5f1accdb11e404ba4779b056228431e3080e4cd +SHA1 (patch-erts_aclocal.m4) = 3812a0feda06eb7c6ff02b5ac7125284ad5df2cb SHA1 (patch-erts_emulator_drivers_common_inet__drv.c) = e34674aea2fa5092b5215944cb5639738df647bb SHA1 (patch-erts_emulator_nifs_common_net__nif.c) = a4507a72aa43ef337715add257971c6422d0b9cb SHA1 (patch-erts_emulator_sys_unix_sys__uds.c) = a165f977221acc8aba2ef30ca23d149a10af060a diff --git a/lang/erlang/patches/patch-erts_aclocal.m4 b/lang/erlang/patches/patch-erts_aclocal.m4 new file mode 100644 index 0000000000000..a0160e5316d86 --- /dev/null +++ b/lang/erlang/patches/patch-erts_aclocal.m4 @@ -0,0 +1,15 @@ +$NetBSD: patch-erts_aclocal.m4,v 1.1 2019/08/08 11:42:23 jperkin Exp $ + +SunOS needs -shared via the GCC driver, not -G. + +--- erts/aclocal.m4.orig 2019-07-10 16:05:15.000000000 +0000 ++++ erts/aclocal.m4 +@@ -2983,7 +2983,7 @@ case $host_os in + DED_LD_FLAG_RUNTIME_LIBRARY_PATH= + ;; + solaris2*|sysv4*) +- DED_LDFLAGS="-G" ++ DED_LDFLAGS="-shared" + if test X${enable_m64_build} = Xyes; then + DED_LDFLAGS="-64 $DED_LDFLAGS" + fi From 103bd32f3155b5cc0b9f22386f65236595cad706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Chr=C3=A9tien?= Date: Fri, 30 Aug 2019 12:14:35 +0000 Subject: [PATCH 92/92] Update HAproxy's Makefile Linux new target name --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 8ec2b2010af5c..787bc0fa80690 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -51,7 +51,7 @@ TARGET= linux24e TARGET= linux24 . endif . else -TARGET= linux2628 +TARGET= linux-glibc . endif .else TARGET= generic