Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --- pkgsrc/lang/erlang/Makefile 2016/07/09 06:38:24 1.76 +++ pkgsrc/lang/erlang/Makefile 2022/06/28 11:34:10 1.109 @@ -1,69 +1,62 @@ -# $NetBSD: Makefile,v 1.76 2016/07/09 06:38:24 wiz Exp $ +# $NetBSD: Makefile,v 1.109 2022/06/28 11:34:10 wiz Exp $ -DISTNAME= otp_src_${DIST_VERSION_MAJOR}.${DIST_VERSION_MINOR} -PKGNAME= ${DISTNAME:S/otp_src_/erlang-/} -PKGREVISION= 1 -CATEGORIES= lang -MASTER_SITES= http://www.erlang.org/download/ - -MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= http://www.erlang.org/ -COMMENT= Concurrent functional programming language -LICENSE= apache-2.0 +DISTNAME= erlang-${DIST_VERSION_MAJOR}.${DIST_VERSION_MINOR}${!empty(DIST_VERSION_PATCH):?.:}${DIST_VERSION_PATCH} +PKGNAME= ${DISTNAME:S/OTP-/erlang-/} +PKGREVISION= 2 +CATEGORIES= lang +MASTER_SITES= ${MASTER_SITE_GITHUB:=erlang/} +GITHUB_PROJECT= otp +GITHUB_TAG= OTP-${PKGVERSION_NOREV} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://www.erlang.org/ +COMMENT= Concurrent functional programming language +LICENSE= apache-2.0 + +EXTRACT_USING= bsdtar + +WRKSRC= ${WRKDIR}/otp-${GITHUB_TAG} +GNU_CONFIGURE= yes +USE_TOOLS+= autoconf awk gmake perl:run flex + +# "This run-time was supposed be compiled with all code below 2Gb, +# but the instruction 'allocate_tt' is located at 00000001c586f34c." +MKPIE_SUPPORTED= no -DIST_SUBDIR= erlang +.include "../../mk/bsd.prefs.mk" + +.if !empty(MACHINE_ARCH:M*armv6*) || !empty(MACHINE_ARCH:M*armv7*) +MAKE_FLAGS+= ARCH=arm +.endif -GNU_CONFIGURE= yes USE_GNU_CONFIGURE_HOST= ${USE_CROSS_COMPILE} OVERRIDE_DIRDEPTH= 4 -USE_TOOLS+= gmake perl:run flex CONFIGURE_ARGS+= --with-ssl=${BUILDLINK_PREFIX.openssl} PTHREAD_OPTS+= require native CONFIGURE_ARGS+= --enable-threads -.include "../../mk/bsd.prefs.mk" - -# have gcc without the necessary atomic ops? -.if !empty(MACHINE_PLATFORM:MNetBSD-[56].*) - -# a machine without native ethread implementation? -.if empty(MACHINE_PLATFORM:M*i386) &&\ - empty(MACHINE_PLATFORM:M*sparc) &&\ - empty(MACHINE_PLATFORM:M*sparc64) &&\ - empty(MACHINE_PLATFORM:M*powerpc) &&\ - empty(MACHINE_PLATFORM:M*x86_64) - -CONFIGURE_ARGS+= --disable-native-ethr-impls\ - --disable-smp-require-native-atomics - -.endif -.endif - MAKE_ENV+= DESTDIR=${DESTDIR} REPLACE_INTERPRETER+= escript REPLACE.escript.old= .*escript REPLACE.escript.new= ${PREFIX}/bin/escript -REPLACE_FILES.escript= \ - lib/diameter/bin/diameterc \ - lib/erl_docgen/priv/bin/codeline_preprocessing.escript \ - lib/erl_docgen/priv/bin/xml_from_edoc.escript \ - lib/reltool/examples/display_args \ - lib/reltool/examples/mnesia_core_dump_viewer \ - lib/snmp/bin/snmpc \ - lib/snmp/src/compile/snmpc.src +REPLACE_FILES.escript+= lib/diameter/bin/diameterc +REPLACE_FILES.escript+= lib/erl_docgen/priv/bin/codeline_preprocessing.escript +REPLACE_FILES.escript+= lib/erl_docgen/priv/bin/xml_from_edoc.escript +REPLACE_FILES.escript+= lib/reltool/examples/display_args +REPLACE_FILES.escript+= lib/reltool/examples/mnesia_core_dump_viewer +REPLACE_FILES.escript+= lib/snmp/src/compile/snmpc.src SUBST_CLASSES+= target -SUBST_STAGE.target= post-patch +SUBST_STAGE.target= pre-configure SUBST_FILES.target= make/target.mk SUBST_SED.target= -e "s|=.*config.guess)|= ${MACHINE_GNU_PLATFORM}|" SUBST_MESSAGE.target= Fixing target name. TEST_TARGET= tests TEST_MAKE_FLAGS= ERL_TOP=${WRKSRC} -REPLACE_PERL+= make/make_emakefile SMF_NAME= epmd @@ -76,9 +69,13 @@ CONFIGURE_ARGS.DragonFly+= --disable-sct CONFIGURE_ARGS+= --enable-kernel-poll .endif +CHECK_RELRO_SKIP+= lib/erlang/lib/megaco-${VERSION.megaco}/priv/lib/megaco_flex_scanner_drv.so +CHECK_RELRO_SKIP+= lib/erlang/lib/megaco-${VERSION.megaco}/priv/lib/megaco_flex_scanner_drv_mt.so + .include "options.mk" -.include "Makefile.versions" +pre-configure: + cd ${WRKSRC} && ./otp_build autoconf ### ### Ensure this gets rebuilt. @@ -86,9 +83,24 @@ CONFIGURE_ARGS+= --enable-kernel-poll pre-build: ${RUN} ${RM} -f ${WRKSRC}/lib/stdlib/ebin/dets_v9.beam +### +### Generate a list of module versions. +### +.PHONY: versions +versions: do-extract + @${ECHO} "# \$$NetBSD\$$" > ${.CURDIR}/versions.mk + @${ECHO} "# Do not edit, regenerate using 'make versions'" >> ${.CURDIR}/versions.mk + ${AWK} -F: '/OTP-${PKGVERSION_NOREV} :/{print $$2}' ${WRKSRC}/otp_versions.table | \ + ${SED} -e 's/# //g' -e 's/-/ /g' \ + -e 's,^ ,_VERSIONS= ,' \ + -e 's, *$$,,' \ + >> ${.CURDIR}/versions.mk + post-install: chmod -R go-w ${DESTDIR}${PREFIX}/lib/erlang/lib +.include "Makefile.versions" + .include "../../security/openssl/buildlink3.mk" .include "../../mk/termcap.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk"