diff --git a/Mk/Uses/xorg.mk b/Mk/Uses/xorg.mk index ecb5b6d46af5..f6fad5cd9a77 100644 --- a/Mk/Uses/xorg.mk +++ b/Mk/Uses/xorg.mk @@ -1,158 +1,157 @@ # Originally from bsd.xorg.mk -# Created by: Florent Thoumie # # Feature: xorg # Usage: USES=xorg # USE_XORG= # # Not specifying USE_XORG with USES=xorg is an error. # # Components can be found in the XORG_MODULES list below. # # # If you feel something is missing from the list, please let us know. # # MAINTAINER: x11@FreeBSD.org .if !defined(_INCLUDE_USES_XORG_MK) _INCLUDE_USES_XORG_MK= yes _USES_POST+= xorg .endif # Set up things after bsd.port.post.mk. # This way ports can add things to USE_XORG even after bsd.port.pre.mk is # included. .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_XORG_POST_MK) _INCLUDE_USES_XORG_POST_MK= yes . if !empty(xorg_ARGS) IGNORE= USES=xorg takes no arguments . endif . if !defined(USE_XORG) IGNORE= need to specify xorg modules with USE_XORG . endif # List of xorg modules XORG_MODULES= dmx \ fontenc \ fontutil \ ice \ libfs \ pciaccess \ pixman \ sm \ x11 \ xau \ xaw \ xaw6 \ xaw7 \ xbitmaps \ xcb \ xcomposite \ xcursor \ xdamage \ xdmcp \ xext \ xfixes \ xfont \ xfont2 \ xft \ xi \ xinerama \ xkbfile \ xmu \ xmuu \ xorg-macros \ xorg-server \ xorgproto \ xpm \ xpresent \ xrandr \ xrender \ xres \ xscrnsaver \ xshmfence \ xt \ xtrans \ xtst \ xv \ xvmc \ xxf86dga \ xxf86vm # Register all xorg .pc files here. # foo_LIB_PC_DEPENDS means it should go to BUILD_DEPENDS *and* RUN_DEPENDS. dmx_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/dmx.pc:x11/libdmx fontenc_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/fontenc.pc:x11-fonts/libfontenc fontutil_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util ice_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/ice.pc:x11/libICE libfs_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/libfs.pc:x11-fonts/libFS pciaccess_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/pciaccess.pc:devel/libpciaccess pixman_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/pixman-1.pc:x11/pixman sm_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/sm.pc:x11/libSM x11_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/x11.pc:x11/libX11 xau_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xau.pc:x11/libXau xaw_LIB_PC_DEPENDS= ${xaw7_LIB_PC_DEPENDS} xaw6_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xaw6.pc:x11-toolkits/libXaw xaw7_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xaw7.pc:x11-toolkits/libXaw xbitmaps_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xbitmaps.pc:x11/xbitmaps xcb_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xcb.pc:x11/libxcb xcomposite_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xcomposite.pc:x11/libXcomposite xcursor_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xcursor.pc:x11/libXcursor xdamage_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xdamage.pc:x11/libXdamage xdmcp_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xdmcp.pc:x11/libXdmcp xext_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xext.pc:x11/libXext xfixes_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xfixes.pc:x11/libXfixes xfont_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xfont.pc:x11-fonts/libXfont xfont2_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xfont2.pc:x11-fonts/libXfont2 xft_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xft.pc:x11-fonts/libXft xi_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xi.pc:x11/libXi xinerama_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xinerama.pc:x11/libXinerama xkbfile_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xkbfile.pc:x11/libxkbfile xmu_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xmu.pc:x11-toolkits/libXmu xmuu_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xmuu.pc:x11-toolkits/libXmu xorg-macros_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xorg-macros.pc:devel/xorg-macros xorg-server_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xorg-server.pc:x11-servers/xorg-server xorgproto_BUILD_DEPENDS= xorgproto>=0:x11/xorgproto xp_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xp.pc:x11/libXp xpm_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xpm.pc:x11/libXpm xpresent_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xpresent.pc:x11/libXpresent xrandr_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xrandr.pc:x11/libXrandr xrender_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xrender.pc:x11/libXrender xres_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xres.pc:x11/libXres xscrnsaver_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xscrnsaver.pc:x11/libXScrnSaver xt_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xt.pc:x11-toolkits/libXt xshmfence_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xshmfence.pc:x11/libxshmfence xtrans_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xtrans.pc:x11/xtrans xtst_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xtst.pc:x11/libXtst xv_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xv.pc:x11/libXv xvmc_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xvmc.pc:x11/libXvMC xxf86dga_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xxf86dga.pc:x11/libXxf86dga xxf86misc_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xxf86misc.pc:x11/libXxf86misc xxf86vm_LIB_PC_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/xxf86vm.pc:x11/libXxf86vm # Add explicit X options to avoid problems with false positives in configure . if defined(GNU_CONFIGURE) CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include . endif . for _module in ${USE_XORG:M*\:both:C/\:.*//g} . if ${XORG_MODULES:M${_module}} == "" IGNORE= requires unknown xorg module (${_module}) . endif RUN_DEPENDS+= ${${_module}_BUILD_DEPENDS} . endfor . for _module in ${USE_XORG:C/\:both$//g} . if ${XORG_MODULES:M${_module}} == "" IGNORE= requires unknown xorg module (${_module}) . endif LIB_PC_DEPENDS+=${${_module}_LIB_PC_DEPENDS} BUILD_DEPENDS+= ${${_module}_BUILD_DEPENDS} . endfor RUN_DEPENDS+= ${LIB_PC_DEPENDS} BUILD_DEPENDS+= ${LIB_PC_DEPENDS} .endif diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk index 221a04e4b8f2..acc019e64912 100644 --- a/Mk/bsd.commands.mk +++ b/Mk/bsd.commands.mk @@ -1,131 +1,130 @@ # bsd.commands.mk - Common commands used within the ports infrastructure # -# Created by: Gabor Kovesdan # # DO NOT COMMIT CHANGES TO THIS FILE BY YOURSELF, EVEN IF YOU DID NOT GET # A RESPONSE FROM THE MAINTAINER(S) WITHIN A REASONABLE TIMEFRAME! ALL # UNAUTHORISED CHANGES WILL BE UNCONDITIONALLY REVERTED! # COMMANDS_Include_MAINTAINER= portmgr@FreeBSD.org .if !defined(_COMMANDSMKINCLUDED) _COMMANDSMKINCLUDED= yes AWK?= /usr/bin/awk BASENAME?= /usr/bin/basename BRANDELF?= /usr/bin/brandelf BSDMAKE?= /usr/bin/make BZCAT?= /usr/bin/bzcat BZIP2_CMD?= /usr/bin/bzip2 CAT?= /bin/cat CHGRP?= /usr/bin/chgrp CHMOD?= /bin/chmod CHOWN?= /usr/sbin/chown CHROOT?= /usr/sbin/chroot COMM?= /usr/bin/comm CP?= /bin/cp CPIO?= /usr/bin/cpio CUT?= /usr/bin/cut DC?= /usr/bin/dc DIALOG?= /usr/bin/dialog DIALOG4PORTS?= ${LOCALBASE}/bin/dialog4ports DIFF?= /usr/bin/diff DIRNAME?= /usr/bin/dirname EGREP?= /usr/bin/egrep ELFCTL?= /usr/bin/elfctl EXPR?= /bin/expr FALSE?= false # Shell builtin FILE?= /usr/bin/file FIND?= /usr/bin/find FLEX?= /usr/bin/flex FMT?= /usr/bin/fmt FMT_80?= ${FMT} 75 79 GMAKE?= gmake GREP?= /usr/bin/grep GUNZIP_CMD?= /usr/bin/gunzip -f GZCAT?= /usr/bin/gzcat GZIP?= -9 GZIP_CMD?= /usr/bin/gzip -nf ${GZIP} HEAD?= /usr/bin/head ID?= /usr/bin/id IDENT?= /usr/bin/ident JOT?= /usr/bin/jot LDCONFIG?= /sbin/ldconfig LHA_CMD?= ${LOCALBASE}/bin/lha LN?= /bin/ln LS?= /bin/ls MKDIR?= /bin/mkdir -p MKTEMP?= /usr/bin/mktemp MOUNT?= /sbin/mount MOUNT_DEVFS?= ${MOUNT} -t devfs devfs # XXX: this is a work-around for an obscure bug where # mount -t nullfs returns zero status on errors within # a make target MOUNT_NULLFS?= /sbin/mount_nullfs MV?= /bin/mv OBJCOPY?= /usr/bin/objcopy OBJDUMP?= /usr/bin/objdump PASTE?= /usr/bin/paste PAX?= /bin/pax PRINTF?= /usr/bin/printf PS_CMD?= /bin/ps PW?= /usr/sbin/pw READELF?= /usr/bin/readelf REALPATH?= /bin/realpath RLN?= ${INSTALL} -l rs RM?= /bin/rm -f RMDIR?= /bin/rmdir SED?= /usr/bin/sed SETENV?= /usr/bin/env SH?= /bin/sh SORT?= /usr/bin/sort STRIP_CMD?= /usr/bin/strip STAT?= /usr/bin/stat # Command to run commands as privileged user # Example: "/usr/local/bin/sudo -E sh -c" to use "sudo" instead of "su" SU_CMD?= /usr/bin/su root -c SYSCTL?= /sbin/sysctl TAIL?= /usr/bin/tail TEST?= test # Shell builtin TR?= /usr/bin/tr TRUE?= true # Shell builtin UMOUNT?= /sbin/umount UNAME?= /usr/bin/uname UNMAKESELF_CMD?= ${LOCALBASE}/bin/unmakeself UNZIP_CMD?= ${LOCALBASE}/bin/unzip UNZIP_NATIVE_CMD?= /usr/bin/unzip WHICH?= /usr/bin/which XARGS?= /usr/bin/xargs XMKMF?= ${LOCALBASE}/bin/xmkmf YACC?= /usr/bin/yacc XZ?= -Mmax XZCAT= /usr/bin/xzcat ${XZ} XZ_CMD?= /usr/bin/xz ${XZ} MD5?= /sbin/md5 SHA256?= /sbin/sha256 SOELIM?= /usr/bin/soelim # ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo", # or "true" if the make flag -s is given. Use ECHO_CMD where you mean # the echo command. ECHO_CMD?= echo # Shell builtin # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO_CMD} .elif !defined(_PKGTOOLSDEFINED) _PKGTOOLSDEFINED= yes PKG_BIN?= ${LOCALBASE}/sbin/pkg-static PKG_REGISTER?= ${PKG_BIN} register PKG_DELETE?= ${PKG_BIN} delete -y PKG_INFO?= ${PKG_BIN} info -g PKG_VERSION?= ${PKG_BIN} version PKG_CREATE?= ${PKG_BIN} create PKG_ADD?= ${PKG_BIN} add PKG_QUERY?= ${PKG_BIN} query .endif diff --git a/Mk/bsd.destdir.mk b/Mk/bsd.destdir.mk index df69f7e68a88..8d50da7a7f58 100644 --- a/Mk/bsd.destdir.mk +++ b/Mk/bsd.destdir.mk @@ -1,220 +1,219 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # bsd.destdir.mk - Support for chrooted installation # -# Created by: Gabor Kovesdan # # Please make sure all changes to this file are passed through the maintainer. DESTDIR_Include_MAINTAINER= portmgr@FreeBSD.org # # The target order is always: pre-chroot do-chroot post-chroot # # pre-chroot # - You can use this for special preparation work, that # want to do before chrooting into the destination # environment and doing the real build. At default # this target is empty. # # do-chroot # - This is the main target for doing the chrooted # operations. It mounts the ports tree and devfs into # the destination environment and starts make(1) # by calling chroot(1). # # post-chroot # - This target runs chrooted just after chroot(1) was # called. You can use this for special preparation # work for the chrooted build if necessary. At # default, this target is empty. # # DESTDIR_ENV_LIST # - Contains names of the variables in host environ(7), # which should be imported into the chrooted environ # along with their values. # Default: empty. # # DESTDIR_MOUNT_LIST # - Contains the directories to mount into the # destination. This is to make PORTSDIR, DISTDIR, etc. # available in the destination environment. Three # forms of entries are allowed: # VAR # - Mounts the path contained by VAR into # a temporary directory and sets VAR to that # directory in the destination environ(7). # VAR:HOST_PATH # - Mounts HOST_PATH to a a temporary directory # and sets VAR to that directory in the # destination environ(7). # VAR:HOST_PATH:DEST_PATH # - Mounts HOST_PATH to DEST_PATH and sets VAR # to DEST_PATH in the destination environ(7). # Default: PORTSDIR DISTDIR # # You can use something like this in host /etc/make.conf to # customize per-chroot environment: # .if ${DESTDIR}=/foo/bar # PREFIX=/opt # CFLAGS=-O3 -pipe # DESTDIR_ENV_LIST=PREFIX CFLAGS # .endif # .if !defined(_DESTDIRMKINCLUDED) _DESTDIRMKINCLUDED= yes . if defined(WITH_DESTDIR_DEBUG) DEBUG_MSG= ${ECHO_MSG} "DEBUG:" . else DEBUG_MSG= ${TRUE} . endif DESTDIR_ENV_LIST?= DESTDIR_ENV= CHROOTED=yes PATH=${PATH} TERM=${TERM} . for _var in ${DESTDIR_ENV_LIST:NDESTDIR:NCHROOTED:NPORTSDIR} DESTDIR_ENV+= ${_var}="${${_var}}" . endfor # Processing DESTDIR_MOUNT_LIST into something more machine-readable # VAR:HOST_PATH:DEST_PATH # VAR -> VAR:${VAR}:TMP # VAR:HOST_PATH -> VAR:HOST_PATH:TMP DESTDIR_MOUNT_LIST?= PORTSDIR DISTDIR _DESTDIR_MOUNT_LIST= . for _entry in ${DESTDIR_MOUNT_LIST} __entry=${_entry} . if ${__entry:M*\:*\:*} _DESTDIR_MOUNT_LIST+= ${_entry} . elif ${__entry:M*\:*} _DESTDIR_MOUNT_LIST+= ${_entry}:___temp___ . else . if defined(${_entry}) && !empty(${_entry}) _DESTDIR_MOUNT_LIST+= ${_entry}:${${_entry}}:___temp___ . endif . endif . endfor .MAIN: all . for _target in ${.TARGETS} ${_target}: pre-chroot do-chroot @${TRUE} . endfor . if !target(pre-chroot) pre-chroot: @${TRUE} . endif . if !target(do-chroot) do-chroot: @if [ ! -d ${DESTDIR} ]; then \ ${ECHO_MSG} "===> Directory ${DESTDIR} does not exist"; \ ${ECHO_MSG} "===> Please set DESTDIR to a valid jail environment."; \ exit 1; \ fi; \ _destdir=`${REALPATH} ${DESTDIR}`; \ _mounted_entries_list=""; \ _created_mountpoints_list=""; \ _var_path_list=""; \ ${ECHO_MSG} "===> Creating some important subdirectories"; \ for _dir in tmp dev; do \ [ -d $${_destdir}/$${_dir} ] || \ if ${MKDIR} $${_destdir}/$${_dir}; then \ ${ECHO_MSG} "===> /$${_dir} subdirectory has been successfully created"; \ _created_mountpoints_list="$${_destdir}/$${_dir} $${_created_mountpoints_list}"; \ else \ ${ECHO_MSG} "===> /$${_dir} subdirectory could not be created"; \ exit 2; \ fi; \ done; \ ${DEBUG_MSG} "_DESTDIR_MOUNT_LIST=${_DESTDIR_MOUNT_LIST}"; \ for _entry in ${_DESTDIR_MOUNT_LIST}; do \ ${DEBUG_MSG} "Processing $${_entry}"; \ _mount_var=$${_entry%%:*}; \ _tp=$${_entry#*:}; \ _host_path=`${REALPATH} $${_tp%:*}`; \ _dest_path=$${_entry##*:}; \ _full_dest_path=`${REALPATH} -q $${_destdir}/$${_dest_path} || :`; \ _entry_was_created=0; \ _entry_should_mount=0; \ ${DEBUG_MSG} "$${_mount_var}:$${_host_path}:$${_full_dest_path}"; \ if [ "$${_dest_path}" = "___temp___" ]; then \ ${DEBUG_MSG} "Creating temporary mount point"; \ if _full_dest_path=`${MKTEMP} -d $${_destdir}/tmp/mountpoint.XXXXXX`; then \ ${DEBUG_MSG} "Temporary mount point $${_full_dest_path} created successfully"; \ _entry_was_created=1; \ _entry_should_mount=1; \ _dest_path=$${_full_dest_path#$${_destdir}}; \ _created_mountpoints_list="$${_full_dest_path} $${_created_mountpoints_list}"; \ else \ ${ECHO_MSG} "===> Failed to create temporary mount point"; \ exit 9; \ fi; \ else \ ${DEBUG_MSG} "Checking if already mounted"; \ if ${MOUNT}|${GREP} -qs "^$${_host_path} on $${_full_dest_path} ("; then \ ${DEBUG_MSG} "$${_host_path} is already mounted on $${_full_dest_path}"; \ _var_path_list="$${_var_path_list} $${_mount_var}=$${_dest_path}"; \ else \ ${DEBUG_MSG} "$${_host_path} is not mounted on $${_full_dest_path}"; \ _entry_should_mount=1; \ fi; \ fi; \ [ -d $${_full_dest_path} ] || \ if ${MKDIR} $${_full_dest_path}; then \ ${DEBUG_MSG} "Mount point $${_full_dest_path} created"; \ _entry_was_created=1; \ _created_mountpoints_list="$${_created_mountpoints_list} ${_full_dest_path}"; \ else \ ${ECHO_MSG} "===> Mount point $${_full_dest_path} could not be created"; \ exit 7; \ fi; \ [ "$${_entry_should_mount}" = "0" ] || \ if ${MOUNT_NULLFS} $${_host_path} $${_full_dest_path}; then \ ${DEBUG_MSG} "Directory $${_host_path} mounted"; \ _mounted_entries_list="$${_full_dest_path} $${_mounted_entries_list}"; \ _var_path_list="$${_var_path_list} $${_mount_var}=$${_dest_path}"; \ else \ ${ECHO_MSG} "===> Dir $${_host_path} could not be mounted"; \ [ "$${_entry_was_created}" = "0" ] || \ ${RMDIR} $${_full_dest_path} || ${TRUE}; \ exit 8; \ fi; \ done; \ ${DEBUG_MSG} "Handling devfs separately"; \ _full_dest_path=$${_destdir}/dev; \ ${MOUNT}|${GREP} -qs "^devfs on $${_full_dest_path} (" || \ if ${MOUNT_DEVFS} $${_full_dest_path}; then \ ${DEBUG_MSG} "devfs mounted"; \ _mounted_entries_list="$${_full_dest_path} $${_mounted_entries_list}"; \ else \ ${ECHO_MSG} "===> devfs could not be mounted"; \ [ -n "$${_created_mountpoints_list%%* $${_destdir}/dev *}" ] || \ ${RMDIR} $${_destdir}/dev || ${TRUE}; \ exit 9; \ fi; \ _var_path_list="$${_var_path_list} DEVFS=/dev"; \ ${DEBUG_MSG} "Things we mounted: $${_mounted_entries_list}"; \ ${DEBUG_MSG} "Things we created: $${_created_mountpoints_list}"; \ ${DEBUG_MSG} "_var_path_list: $${_var_path_list}"; \ ${ECHO_MSG} "===> Starting chrooted make in ${DESTDIR}..."; \ export $${_var_path_list}; \ ${CHROOT} $${_destdir} ${SH} -c "\ cd $${PORTSDIR}${.CURDIR:S|^${PORTSDIR}||}; \ ${SETENV} -i ${DESTDIR_ENV} $${_var_path_list} ${MAKE} ${.TARGETS}" && \ { status=$$?; ${ECHO_MSG} "===> Chrooted make in ${DESTDIR} succeeded"; } || \ { status=$$?; ${ECHO_MSG} "===> Chrooted make in ${DESTDIR} failed"; }; \ ${ECHO_MSG} "===> Cleaning up..."; \ for _entry in $${_mounted_entries_list}; do \ ${UMOUNT} -f $${_entry} || ${TRUE}; \ done; \ for _entry in $${_created_mountpoints_list}; do \ ${RMDIR} $${_entry} || ${TRUE}; \ done; \ exit $$status . endif # !target(do-chroot) .endif # !defined(_DESTDIRMKINCLUDED) diff --git a/Mk/bsd.gcc.mk b/Mk/bsd.gcc.mk index 02ec65cc7557..3c292dc97282 100644 --- a/Mk/bsd.gcc.mk +++ b/Mk/bsd.gcc.mk @@ -1,163 +1,162 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # bsd.gcc.mk - Support for smarter USE_GCC usage. # -# Created by: Edwin Groothuis # # To request the use of a current version of GCC, specify USE_GCC=yes in # your port/system configuration. This is the preferred use of USE_GCC. # It uses the canonical version of GCC defined in bsd.default-versions.mk. # # If your port needs a specific (minimum) version of GCC, you can easily # specify that with a USE_GCC= statement. Unless absolutely necessary # do so by specifying USE_GCC=X+ which requests at least GCC version X. # To request a specific version omit the trailing + sign. # # Optionally comma-separated arguments follow the version specifier. # Currently we support: # build ... which adds GCC as a build dependency (BUILD_DEPENDS) only. # # If no arguments are specified, GCC is added as both a build dependency # and a run time dependency. # # # Examples: # USE_GCC= yes # port requires a current version of GCC # # as defined in bsd.default-versions.mk. # USE_GCC= 11+ # port requires GCC 11 or later. # USE_GCC= 9 # port requires GCC 9. # USE_GCC= yes:build # port requires a current version of GCC at # # build time only. # USE_GCC= 10:build # port requires GCC 10 at build time only. # USE_GCC= 11+:build # port requires GCC 11 or later at build # # time only. # # If you are wondering what your port exactly does, use "make test-gcc" # to see some debugging. GCC_Include_MAINTAINER= gerald@FreeBSD.org # All GCC versions supported by this framework. # # When updating this, keep Mk/bsd.default-versions.mk in sync. GCCVERSIONS= 4.8 8 9 10 11 12 13 # No configurable parts below this. #################################### # # Split arguments .if defined(USE_GCC) __USE_GCC:= ${USE_GCC:C/\:.*//} _USE_GCC_ARGS:= ${USE_GCC:C/^[^\:]*(\:|\$)//:S/,/ /g} USE_GCC= ${__USE_GCC} .endif .if ${_USE_GCC_ARGS:Mbuild} _USE_GCC_ARGS:= ${_USE_GCC_ARGS:Nbuild} .else _USE_GCC_RUN_DEPENDS= yes .endif .if !empty(_USE_GCC_ARGS) IGNORE= bad target specification in USE_GCC; only "build" is supported .endif .if defined(USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) # Handle USE_GCC=yes. . if ${USE_GCC} == yes USE_GCC= ${GCC_DEFAULT}+ . endif # See if we can use a later version or exclusively the one specified. _USE_GCC:= ${USE_GCC:S/+//} . if ${USE_GCC} != ${_USE_GCC} _GCC_ORLATER:= true . endif # See whether we have the specific version requested installed already # and save that into _GCC_FOUND. In parallel, check if USE_GCC refers # to a valid version to begin with. . for v in ${GCCVERSIONS} . if ${_USE_GCC} == ${v} _GCCVERSION_OKAY= true . if exists(${LOCALBASE}/bin/gcc${v:S/.//}) _GCC_FOUND:= ${_USE_GCC} . endif . endif . endfor . if !defined(_GCCVERSION_OKAY) IGNORE= Unknown version of GCC specified (USE_GCC=${USE_GCC}) . endif # If the GCC package defined in USE_GCC does not exist, but a later # version is allowed (for example 8+), go and use the default. . if defined(_GCC_ORLATER) . if !defined(_GCC_FOUND) && ${_USE_GCC} < ${GCC_DEFAULT} _USE_GCC:= ${GCC_DEFAULT} . endif . endif # defined(_GCC_ORLATER) # A concrete version has been selected. Set proper ports dependencies, # CC, CXX, CPP, and flags. V:= ${_USE_GCC:S/.//} . if ${V} == 13 _GCC_PORT:= gcc${V}-devel . else _GCC_PORT:= gcc${V} . endif CC:= gcc${V} CXX:= g++${V} CPP:= cpp${V} _GCC_RUNTIME:= ${LOCALBASE}/lib/gcc${V} . if ${PORTNAME} == gcc # We don't want the rpath stuff while building GCC itself # so we do not set the FLAGS as done in the else part. # When building a GCC, we want the target libraries to be used and not the # host GCC libraries. . else CFLAGS+= -Wl,-rpath=${_GCC_RUNTIME} CXXFLAGS+= -Wl,-rpath=${_GCC_RUNTIME} LDFLAGS+= -Wl,-rpath=${_GCC_RUNTIME} -L${_GCC_RUNTIME} . endif .undef V # Now filter unsupported flags for CC and CXX. CFLAGS:= ${CFLAGS:N-mretpoline} CXXFLAGS:= ${CXXFLAGS:N-mretpoline} . if defined(_GCC_PORT) BUILD_DEPENDS+= ${CC}:lang/${_GCC_PORT} . if defined(_USE_GCC_RUN_DEPENDS) RUN_DEPENDS+= ${CC}:lang/${_GCC_PORT} . endif # GCC ports already depend on binutils; make sure whatever we build # leverages this as well. USE_BINUTILS= yes . endif .endif # defined(_USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) test-gcc: @echo USE_GCC=${USE_GCC} .if defined(IGNORE) @echo "IGNORE: ${IGNORE}" .else . if defined(USE_GCC) . if defined(_GCC_ORLATER) @echo Port can use later versions. . else @echo Port cannot use later versions. . endif @echo Using GCC version ${_USE_GCC} . endif @echo CC=${CC} - CXX=${CXX} - CPP=${CPP} @echo CFLAGS=\"${CFLAGS}\" @echo CXXFLAGS=\"${CXXFLAGS}\" @echo LDFLAGS=\"${LDFLAGS}\" @echo "BUILD_DEPENDS=${BUILD_DEPENDS}" @echo "RUN_DEPENDS=${RUN_DEPENDS}" .endif diff --git a/Mk/bsd.java.mk b/Mk/bsd.java.mk index bab851824ad7..52125a7f016c 100644 --- a/Mk/bsd.java.mk +++ b/Mk/bsd.java.mk @@ -1,475 +1,474 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # bsd.java.mk - Support for Java-based ports. # -# Created by: Ernst de Haan # # For FreeBSD committers: # Please send all suggested changes to the maintainer instead of committing # them yourself. # .if !defined(Java_Include) Java_Include= bsd.java.mk Java_Include_MAINTAINER= java@FreeBSD.org #------------------------------------------------------------------------------- # Variables that each port can define: # # USE_JAVA Should be defined to the remaining variables to have any # effect # # JAVA_VERSION List of space-separated suitable java versions for the # port. An optional "+" allows you to specify a range of # versions. (allowed values: 7[+] 8[+] 11[+] 17[+] 18[+]) # # JAVA_OS List of space-separated suitable JDK port operating systems # for the port. (allowed values: native linux) # # JAVA_VENDOR List of space-separated suitable JDK port vendors for the # port. (allowed values: openjdk oracle) # # JAVA_BUILD When set, it means that the selected JDK port should be # added to build dependencies for the port. # # JAVA_EXTRACT This variable works exactly the same as JAVA_BUILD but # regarding extract dependencies. # # JAVA_RUN This variable works exactly the same as JAVA_BUILD but # regarding run dependencies. # # USE_ANT Should be defined when the port uses Apache Ant. Ant is thus # considered to be the sub-make command. When no 'do-build' # target is defined by the port, a default one will be set # that simply runs Ant according to MAKE_ENV, MAKE_ARGS and # ALL_TARGET. Read the documentation in bsd.port.mk for more # information. # #------------------------------------------------------------------------------- # Variables defined for the port: # # JAVA_PORT The name of the JDK port. (e.g. 'java/openjdk8') # # JAVA_PORT_VERSION The version of the JDK port. (e.g. '8') # # JAVA_PORT_OS The operating system used by the JDK port. (e.g. 'linux') # # JAVA_PORT_VENDOR The vendor of the JDK port. (e.g. 'openjdk') # # JAVA_PORT_OS_DESCRIPTION Description of the operating system used by the # JDK port. (e.g. 'Linux') # # JAVA_PORT_VENDOR_DESCRIPTION Description of the vendor of the JDK port. # (e.g. 'OpenJDK BSD Porting Team') # # JAVA_HOME Path to the installation directory of the JDK. (e.g. # '/usr/local/openjdk8') # # JAVAC Path to the Java compiler to use. (e.g. # '/usr/local/openjdk8/bin/javac' or '/usr/local/bin/javac') # # JAR Path to the JAR tool to use. (e.g. # '/usr/local/openjdk8/bin/jar' or '/usr/local/bin/fastjar') # # APPLETVIEWER Path to the appletviewer utility. (e.g. # '/usr/local/linux-jdk1.8.0/bin/appletviewer') # # JAVA Path to the java executable. Use this for executing Java # programs. (e.g. '/usr/local/openjdk8/bin/java') # # JAVADOC Path to the javadoc utility program. # # JAVAH Path to the javah program. # # JAVAP Path to the javap program. # # JAVA_KEYTOOL Path to the keytool utility program. # # JAVA_N2A Path to the native2ascii tool. # # JAVA_POLICYTOOL Path to the policytool program. # # JAVA_SERIALVER Path to the serialver utility program. # # RMIC Path to the RMI stub/skeleton generator, rmic. # # RMIREGISTRY Path to the RMI registry program, rmiregistry. # # RMID Path to the RMI daemon program. # # JAVA_CLASSES Path to the archive that contains the JDK class files. On # most JDKs, this is ${JAVA_HOME}/jre/lib/rt.jar. # # JAVASHAREDIR The base directory for all shared Java resources. # # JAVAJARDIR The directory where a port should install JAR files. # # JAVALIBDIR The directory where JAR files installed by other ports # are located. # #------------------------------------------------------------------------------- # Porter's hints # # To retrieve the Major version number from JAVA_PORT_VERSION (e.g. "1.8"): # -> ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/} # #------------------------------------------------------------------------------- # There are the following stages: # # Stage 1: Define constants # Stage 2: Determine which JDK ports are installed and which JDK ports are # suitable # Stage 3: Decide the exact JDK to use (or install) # Stage 4: Add any dependencies if necessary # Stage 5: Define all settings for the port to use # . if defined(USE_JAVA) . if !defined(JAVA_VERSION) && empty(USE_JAVA:C/[0-9]*[\.]*[0-9]*[+]*//) JAVA_VERSION=${USE_JAVA} . endif #------------------------------------------------------------------------------- # Stage 1: Define constants # # System-global directories # NB: If the value of JAVALIBDIR is altered here it must also be altered # in java/javavmwrapper/Makefile. JAVASHAREDIR?= ${PREFIX}/share/java JAVAJARDIR?= ${JAVASHAREDIR}/classes JAVALIBDIR?= ${LOCALBASE}/share/java/classes # Add appropriate substitutions to PLIST_SUB and LIST_SUB PLIST_SUB+= JAVASHAREDIR="${JAVASHAREDIR:S,^${PREFIX}/,,}" \ JAVAJARDIR="${JAVAJARDIR:S,^${PREFIX}/,,}" SUB_LIST+= JAVASHAREDIR="${JAVASHAREDIR}" \ JAVAJARDIR="${JAVAJARDIR}" \ JAVALIBDIR="${JAVALIBDIR}" . if defined(JAVA_VERSION) SUB_LIST+= JAVA_VERSION="${JAVA_VERSION}" . endif . if defined(JAVA_VENDOR) SUB_LIST+= JAVA_VENDOR="${JAVA_VENDOR}" . endif . if defined(JAVA_OS) SUB_LIST+= JAVA_OS="${JAVA_OS}" . endif # The complete list of Java versions, os and vendors supported. __JAVA_VERSION_LIST= 7 8 11 17 18 _JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/} _JAVA_OS_LIST= native linux _JAVA_VENDOR_LIST= openjdk oracle # Set all meta-information about JDK ports: # port location, corresponding JAVA_HOME, JDK version, OS, vendor _JAVA_PORT_NATIVE_OPENJDK_JDK_7_INFO= PORT=java/openjdk7 HOME=${LOCALBASE}/openjdk7 \ VERSION=7 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_8_INFO= PORT=java/openjdk8 HOME=${LOCALBASE}/openjdk8 \ VERSION=8 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_11_INFO= PORT=java/openjdk11 HOME=${LOCALBASE}/openjdk11 \ VERSION=11 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_17_INFO= PORT=java/openjdk17 HOME=${LOCALBASE}/openjdk17 \ VERSION=17 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_18_INFO= PORT=java/openjdk18 HOME=${LOCALBASE}/openjdk18 \ VERSION=18 OS=native VENDOR=openjdk _JAVA_PORT_LINUX_ORACLE_JDK_8_INFO= PORT=java/linux-oracle-jdk18 HOME=${LOCALBASE}/linux-oracle-jdk1.8.0 \ VERSION=8 OS=linux VENDOR=oracle # Verbose description for each VENDOR _JAVA_VENDOR_openjdk= "OpenJDK BSD Porting Team" _JAVA_VENDOR_oracle= Oracle # Verbose description for each OS _JAVA_OS_native= Native _JAVA_OS_linux= Linux # List all JDK ports in order of preference __JAVA_PORTS_ALL= \ JAVA_PORT_NATIVE_OPENJDK_JDK_8 \ JAVA_PORT_NATIVE_OPENJDK_JDK_11 \ JAVA_PORT_NATIVE_OPENJDK_JDK_17 \ JAVA_PORT_NATIVE_OPENJDK_JDK_18 \ JAVA_PORT_NATIVE_OPENJDK_JDK_7 \ JAVA_PORT_LINUX_ORACLE_JDK_8 _JAVA_PORTS_ALL= ${JAVA_PREFERRED_PORTS} \ JAVA_PORT_NATIVE_OPENJDK_JDK_${JAVA_DEFAULT} \ ${__JAVA_PORTS_ALL} # Set the name of the file that indicates that a JDK is indeed installed, as a # relative path within the JAVA_HOME directory. _JDK_FILE=bin/javac #------------------------------------------------------------------------------- # Stage 2: Determine which JDK ports are suitable and which JDK ports are # suitable # # From here, the port is using bsd.java.mk v2.0 # Error checking: defined JAVA_{HOME,PORT,PORT_VERSION,PORT_VENDOR,PORT_OS} . for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS . if defined(${variable}) check-makevars:: @${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing." .undef ${variable} . endif . endfor # Error checking: JAVA_VERSION . if defined(JAVA_VERSION) . if !defined(_JAVA_VERSION_LIST_REGEXP) _JAVA_VERSION_LIST_REGEXP= ${_JAVA_VERSION_LIST:C/\+/\\+/:ts|} . endif check-makevars:: @( test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}")) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE}) . endif # Error checking: JAVA_VENDOR . if defined(JAVA_VENDOR) . if !defined(_JAVA_VENDOR_LIST_REGEXP) _JAVA_VENDOR_LIST_REGEXP= ${_JAVA_VENDOR_LIST:ts|} . endif check-makevars:: @( test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" )) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}"; \ ${FALSE}) . endif # Error checking: JAVA_OS . if defined(JAVA_OS) . if !defined(_JAVA_OS_LIST_REGEXP) _JAVA_OS_LIST_REGEXP= ${_JAVA_OS_LIST:ts|} . endif check-makevars:: @( test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}")) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}"; \ ${FALSE}) . endif # Set default values for JAVA_BUILD and JAVA_RUN # When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre # (unless NO_BUILD is set) . if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN) . if !defined(NO_BUILD) JAVA_BUILD= jdk . endif JAVA_RUN= jre . endif # JDK dependency setting . undef _JAVA_PORTS_INSTALLED . undef _JAVA_PORTS_POSSIBLE . if defined(JAVA_VERSION) _JAVA_VERSION= ${JAVA_VERSION:S/^1.7+/1.7 1.8+/:S/^1.8+/1.8 11+/:S/^1.7/7/:S/^1.8/8/:S/^7+/7 8+/:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 18+/:S/^18+/18/} . else _JAVA_VERSION= ${__JAVA_VERSION_LIST} . endif . if defined(JAVA_OS) _JAVA_OS= ${JAVA_OS} . else _JAVA_OS= ${_JAVA_OS_LIST} . endif . if defined(JAVA_VENDOR) _JAVA_VENDOR= ${JAVA_VENDOR} . else _JAVA_VENDOR= ${_JAVA_VENDOR_LIST} . endif . for A_JAVA_PORT in ${_JAVA_PORTS_ALL} A_JAVA_PORT_INFO:= ${A_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} A_JAVA_PORT_HOME= ${A_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} A_JAVA_PORT_VERSION= ${A_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} A_JAVA_PORT_OS= ${A_JAVA_PORT_INFO:MOS=*:S,OS=,,} A_JAVA_PORT_VENDOR= ${A_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} . if !defined(_JAVA_PORTS_INSTALLED) && exists(${A_JAVA_PORT_HOME}/${_JDK_FILE}) __JAVA_PORTS_INSTALLED+= ${A_JAVA_PORT} . endif # Because variables inside for loops are special (directly replaced as strings), # we are allowed to use them inside modifiers, where normally ${FOO:M${BAR}} is # not allowed. # . for ver in ${A_JAVA_PORT_VERSION} . for os in ${A_JAVA_PORT_OS} . for vendor in ${A_JAVA_PORT_VENDOR} . if ${_JAVA_VERSION:M${ver}} && ${_JAVA_OS:M${os}} && ${_JAVA_VENDOR:M${vendor}} __JAVA_PORTS_POSSIBLE+= ${A_JAVA_PORT} . endif . endfor . endfor . endfor . endfor . if !defined(_JAVA_PORTS_INSTALLED) _JAVA_PORTS_INSTALLED= ${__JAVA_PORTS_INSTALLED:C/ [ ]+/ /g} . endif _JAVA_PORTS_POSSIBLE= ${__JAVA_PORTS_POSSIBLE:C/ [ ]+/ /g} #------------------------------------------------------------------------------- # Stage 3: Decide the exact JDK to use (or install) # # Find an installed JDK port that matches the requirements of the port . undef _JAVA_PORTS_INSTALLED_POSSIBLE . for A_JAVA_PORT in ${_JAVA_PORTS_POSSIBLE} __JAVA_PORTS_INSTALLED_POSSIBLE+= ${_JAVA_PORTS_INSTALLED:M${A_JAVA_PORT}} . endfor _JAVA_PORTS_INSTALLED_POSSIBLE= ${__JAVA_PORTS_INSTALLED_POSSIBLE:C/[ ]+//g} . if ${_JAVA_PORTS_INSTALLED_POSSIBLE} != "" . for i in ${_JAVA_PORTS_INSTALLED_POSSIBLE} . if !defined(_JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit) _JAVA_PORT= $i _JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit= 1 . endif . endfor # If no installed JDK port fits, then pick one from the list of possible ones . else . for i in ${_JAVA_PORTS_POSSIBLE} . if !defined(_JAVA_PORTS_POSSIBLE_shortcircuit) _JAVA_PORT= $i _JAVA_PORTS_POSSIBLE_shortcircuit= 1 . endif . endfor . endif _JAVA_PORT_INFO:= ${_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} JAVA_PORT= ${_JAVA_PORT_INFO:MPORT=*:S,PORT=,,} JAVA_HOME= ${_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} JAVA_PORT_VERSION= ${_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} JAVA_PORT_OS= ${_JAVA_PORT_INFO:MOS=*:S,OS=,,} JAVA_PORT_VENDOR= ${_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} JAVA_PORT_VENDOR_DESCRIPTION:= ${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/} JAVA_PORT_OS_DESCRIPTION:= ${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/} #------------------------------------------------------------------------------- # Stage 4: Add any dependencies if necessary # # Ant Support: USE_ANT --> JAVA_BUILD=jdk . if defined(USE_ANT) JAVA_BUILD= jdk . endif # Add the JDK port to the dependencies DEPEND_JAVA= ${JAVA}:${JAVA_PORT} . if defined(JAVA_EXTRACT) EXTRACT_DEPENDS+= ${DEPEND_JAVA} . endif . if defined(JAVA_BUILD) . if defined(NO_BUILD) check-makevars:: @${ECHO_CMD} "${PKGNAME}: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time."; @${FALSE} . endif BUILD_DEPENDS+= ${DEPEND_JAVA} . endif . if defined(JAVA_RUN) RUN_DEPENDS+= ${DEPEND_JAVA} . endif # Ant support: default do-build target . if defined(USE_ANT) DESTDIRNAME?= -Dfreebsd.ports.destdir ANT?= ${LOCALBASE}/bin/ant MAKE_ENV+= JAVA_HOME=${JAVA_HOME} BUILD_DEPENDS+= ${ANT}:devel/apache-ant ALL_TARGET?= . if !target(do-build) do-build: @(cd ${BUILD_WRKSRC}; \ ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) . endif . if !target(do-test) && defined(TEST_TARGET) TEST_DEPENDS+= ${DEPEND_JAVA} TEST_DEPENDS+= ${ANT}:devel/apache-ant do-test: @(cd ${TEST_WRKSRC}; \ ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) . endif . endif #----------------------------------------------------------------------------- # Stage 5: Define all settings for the port to use # # At this stage both JAVA_HOME and JAVA_PORT are definitely given a value. # # Define the location of the Java compiler. # Only define JAVAC if a JDK is needed . undef JAVAC # Then test if a JAVAC has to be set (JAVA_BUILD==jdk) . if defined(JAVA_BUILD) . if (${JAVA_BUILD:tu} == "JDK") && !defined(JAVAC) JAVAC?= ${JAVA_HOME}/bin/javac . endif . endif # Define the location of some more executables. APPLETVIEWER?= ${JAVA_HOME}/bin/appletviewer JAR?= ${JAVA_HOME}/bin/jar JAVA?= ${JAVA_HOME}/bin/java JAVADOC?= ${JAVA_HOME}/bin/javadoc JAVAH?= ${JAVA_HOME}/bin/javah JAVAP?= ${JAVA_HOME}/bin/javap JAVA_N2A?= ${JAVA_HOME}/bin/native2ascii JAVA_SERIALVER?=${JAVA_HOME}/bin/serialver RMIC?= ${JAVA_HOME}/bin/rmic RMIREGISTRY?= ${JAVA_HOME}/bin/rmiregistry JAVA_KEYTOOL?= ${JAVA_HOME}/bin/keytool JAVA_POLICYTOOL?= ${JAVA_HOME}/bin/policytool RMID?= ${JAVA_HOME}/bin/rmid # Set the location of the ZIP or JAR file with all standard Java classes. JAVA_CLASSES= ${JAVA_HOME}/jre/lib/rt.jar #------------------------------------------------------------------------------- # Additional Java support # Debug target # Use it to check Java dependency while porting java-debug: @${ECHO_CMD} "# User specified parameters:" @${ECHO_CMD} "JAVA_VERSION= ${JAVA_VERSION} (${_JAVA_VERSION})" @${ECHO_CMD} "JAVA_OS= ${JAVA_OS} (${_JAVA_OS})" @${ECHO_CMD} "JAVA_VENDOR= ${JAVA_VENDOR} (${_JAVA_VENDOR})" @${ECHO_CMD} "JAVA_BUILD= ${JAVA_BUILD}" @${ECHO_CMD} "JAVA_RUN= ${JAVA_RUN}" @${ECHO_CMD} "JAVA_EXTRACT= ${JAVA_EXTRACT}" @${ECHO_CMD} "JAVA_DEFAULT= ${JAVA_DEFAULT}" @${ECHO_CMD} @${ECHO_CMD} "# JDK port dependency selection process:" @${ECHO_CMD} "_JAVA_PORTS_POSSIBLE= ${_JAVA_PORTS_POSSIBLE}" @${ECHO_CMD} "_JAVA_PORTS_INSTALLED= ${_JAVA_PORTS_INSTALLED}" @${ECHO_CMD} "_JAVA_PORTS_INSTALLED_POSSIBLE= ${_JAVA_PORTS_INSTALLED_POSSIBLE}" @${ECHO_CMD} "_JAVA_PORT= ${_JAVA_PORT}" @${ECHO_CMD} "_JAVA_PORT_INFO= ${_JAVA_PORT_INFO:S/\t/ /}" @${ECHO_CMD} @${ECHO_CMD} "# Selected JDK port:" @${ECHO_CMD} "JAVA_PORT= ${JAVA_PORT}" @${ECHO_CMD} "JAVA_HOME= ${JAVA_HOME}" @${ECHO_CMD} "JAVA_PORT_VERSION= ${JAVA_PORT_VERSION}" @${ECHO_CMD} "JAVA_PORT_OS= ${JAVA_PORT_OS} (${JAVA_PORT_OS_DESCRIPTION})" @${ECHO_CMD} "JAVA_PORT_VENDOR= ${JAVA_PORT_VENDOR} (${JAVA_PORT_VENDOR_DESCRIPTION})" @${ECHO_CMD} @${ECHO_CMD} "# Additional variables:" @${ECHO_CMD} "JAVAC= ${JAVAC}" @${ECHO_CMD} "JAVA_CLASSES= ${JAVA_CLASSES}" . endif .endif diff --git a/Mk/bsd.licenses.db.mk b/Mk/bsd.licenses.db.mk index 82aed96f3e9c..674c72d7eabc 100644 --- a/Mk/bsd.licenses.db.mk +++ b/Mk/bsd.licenses.db.mk @@ -1,427 +1,426 @@ #-*- tab-width: 4; -*- # ex:ts=4 # ** Please run changes to this file by eadler@ first ** Licenses_db_Include_MAINTAINER= portmgr@FreeBSD.org # # bsd.licenses.db.mk - License database for bsd.licenses.mk # -# Created by: Alejandro Pulver # # Please view me with 4 column tabs! # # The canonical source of license names and short-name identifiers: # - SPDX License List # https://spdx.org/licenses/ # # See also: # - Copyfree Licenses # http://copyfree.org/standard/licenses # - Wikipedia (article "Comparison of Free Software Licenses") # http://en.wikipedia.org/wiki/Comparison_of_free_software_licences # # Probably will be automatically incorporated from FOSSology's software. # # IMPORTANT: as this file is going to be included by most ports, we may # consider having licenses here only as "tags" as most of them will be free, # to remove some loops and additional variables here. This will not affect the # rest of bsd.licenses.mk, and anyways restricted licenses that aren't used by # many ports should be defined in each one's Makefile. # XXX Start of editable section # License definitions # # _LICENSE_LIST - List of defined licenses # _LICENSE_LIST_GROUPS - List of defined license groups # _LICENSE_LIST= BSL CDDL CPAL-1.0 ClArtistic EPL GFDL GMGPL \ ISCL MIT NCSA ODbL OFL10 OFL11 OWL OpenSSL PD PSFL PostgreSQL \ RUBY UNLICENSE WTFPL1 WTFPL ZLIB ZPL21 # GNU family _LICENSE_LIST+= AGPLv3 GPLv1 GPLv2 GPLv3 GPLv3RLE LGPL20 LGPL21 LGPL3 _LICENSE_LIST+= AGPLv3+ GPLv1+ GPLv2+ GPLv3+ GPLv3RLE+ LGPL20+ LGPL21+ \ LGPL3+ # BSD family _LICENSE_LIST+= BSD BSD0CLAUSE BSD2CLAUSE BSD3CLAUSE BSD4CLAUSE # LaTeX family _LICENSE_LIST+= LPPL10 LPPL11 LPPL12 LPPL13 LPPL13a LPPL13b LPPL13c # Apache family _LICENSE_LIST+= APACHE10 APACHE11 APACHE20 # Artistic family _LICENSE_LIST+= ART10 ARTPERL10 ART20 # PHP family _LICENSE_LIST+= PHP202 PHP30 PHP301 # Creative Commons family _LICENSE_LIST+= CC0-1.0 \ CC-BY-1.0 CC-BY-2.0 CC-BY-2.5 CC-BY-3.0 CC-BY-4.0 \ CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0 CC-BY-ND-4.0 \ CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5 CC-BY-NC-3.0 CC-BY-NC-4.0 \ CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0 CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-ND-4.0 \ CC-BY-NC-SA-1.0 CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0 CC-BY-NC-SA-4.0 \ CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.5 CC-BY-SA-3.0 CC-BY-SA-4.0 # MPL family _LICENSE_LIST+= MPL10 MPL11 MPL20 # Others _LICENSE_LIST+= NONE # List of groups (only names must be present) _LICENSE_NAME_FSF= Free Software Foundation Approved _LICENSE_NAME_GPL= GPL Compatible _LICENSE_NAME_OSI= OSI Approved _LICENSE_NAME_COPYFREE= Complies with Copyfree Standard Definition _LICENSE_NAME_FONTS= Font licenses # Default permissions for licenses here, if not defined _LICENSE_PERMS_DEFAULT= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept # Properties of license "xxx" (similar to port variables, but single) # # _LICENSE_NAME_xxx - Full name/description of license/group # _LICENSE_PERMS_xxx - Permissions (if not defined defaults to # ${_LICENSE_PERMS_DEFAULT}. # _LICENSE_GROUPS_xxx - Groups (optional) # # Notes: # - General permissions from groups are added to each license, if not defined. # _LICENSE_NAME_AGPLv3= GNU Affero General Public License version 3 _LICENSE_GROUPS_AGPLv3= FSF GPL OSI # Note that though plus is allowed in a variable (and this license) name it # needs an extra space before following equals sign for them not to be parsed # as a single += operator _LICENSE_NAME_AGPLv3+ = ${_LICENSE_NAME_AGPLv3} (or later) _LICENSE_GROUPS_AGPLv3+ = ${_LICENSE_GROUPS_AGPLv3} _LICENSE_NAME_APACHE10= Apache License 1.0 _LICENSE_GROUPS_APACHE10= FSF _LICENSE_NAME_APACHE11= Apache License 1.1 _LICENSE_GROUPS_APACHE11= FSF OSI _LICENSE_NAME_APACHE20= Apache License 2.0 _LICENSE_GROUPS_APACHE20= FSF OSI _LICENSE_NAME_ART10= Artistic License version 1.0 _LICENSE_GROUPS_ART10= OSI _LICENSE_NAME_ARTPERL10=Artistic License (perl) version 1.0 _LICENSE_GROUPS_ARTPERL10= OSI _LICENSE_NAME_ART20= Artistic License version 2.0 _LICENSE_GROUPS_ART20= FSF GPL OSI _LICENSE_NAME_BSD= BSD license Generic Version (deprecated) _LICENSE_GROUPS_BSD= FSF OSI COPYFREE _LICENSE_NAME_BSD0CLAUSE= BSD Zero Clause License _LICENSE_GROUPS_BSD0CLAUSE= OSI _LICENSE_NAME_BSD2CLAUSE= BSD 2-clause "Simplified" License _LICENSE_GROUPS_BSD2CLAUSE= FSF OSI COPYFREE _LICENSE_NAME_BSD3CLAUSE= BSD 3-clause "New" or "Revised" License _LICENSE_GROUPS_BSD3CLAUSE= FSF OSI COPYFREE _LICENSE_NAME_BSD4CLAUSE= BSD 4-clause "Original" or "Old" License _LICENSE_GROUPS_BSD4CLAUSE= FSF _LICENSE_NAME_BSL= Boost Software License _LICENSE_GROUPS_BSL= FSF OSI COPYFREE _LICENSE_NAME_CC0-1.0= Creative Commons Zero v1.0 Universal _LICENSE_GROUPS_CC0-1.0= FSF GPL COPYFREE _LICENSE_NAME_CC-BY-1.0= Creative Commons Attribution 1.0 _LICENSE_GROUPS_CC-BY-1.0= # empty _LICENSE_NAME_CC-BY-2.0= Creative Commons Attribution 2.0 _LICENSE_GROUPS_CC-BY-2.0= # empty _LICENSE_NAME_CC-BY-2.5= Creative Commons Attribution 2.5 _LICENSE_GROUPS_CC-BY-2.5= # empty _LICENSE_NAME_CC-BY-3.0= Creative Commons Attribution 3.0 _LICENSE_GROUPS_CC-BY-3.0= # empty _LICENSE_NAME_CC-BY-4.0= Creative Commons Attribution 4.0 _LICENSE_GROUPS_CC-BY-4.0= # empty _LICENSE_NAME_CC-BY-ND-1.0= Creative Commons Attribution No Derivatives 1.0 _LICENSE_GROUPS_CC-BY-ND-1.0= # empty _LICENSE_NAME_CC-BY-ND-2.0= Creative Commons Attribution No Derivatives 2.0 _LICENSE_GROUPS_CC-BY-ND-2.0= # empty _LICENSE_NAME_CC-BY-ND-2.5= Creative Commons Attribution No Derivatives 2.5 _LICENSE_GROUPS_CC-BY-ND-2.5= # empty _LICENSE_NAME_CC-BY-ND-3.0= Creative Commons Attribution No Derivatives 3.0 _LICENSE_GROUPS_CC-BY-ND-3.0= # empty _LICENSE_NAME_CC-BY-ND-4.0= Creative Commons Attribution No Derivatives 4.0 _LICENSE_GROUPS_CC-BY-ND-4.0= # empty _LICENSE_NAME_CC-BY-NC-1.0= Creative Commons Attribution Non Commercial 1.0 _LICENSE_GROUPS_CC-BY-NC-1.0= # empty _LICENSE_PERMS_CC-BY-NC-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-2.0= Creative Commons Attribution Non Commercial 2.0 _LICENSE_GROUPS_CC-BY-NC-2.0= # empty _LICENSE_PERMS_CC-BY-NC-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-2.5= Creative Commons Attribution Non Commercial 2.5 _LICENSE_GROUPS_CC-BY-NC-2.5= # empty _LICENSE_PERMS_CC-BY-NC-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-3.0= Creative Commons Attribution Non Commercial 3.0 _LICENSE_GROUPS_CC-BY-NC-3.0= # empty _LICENSE_PERMS_CC-BY-NC-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-4.0= Creative Commons Attribution Non Commercial 4.0 _LICENSE_GROUPS_CC-BY-NC-4.0= # empty _LICENSE_PERMS_CC-BY-NC-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-1.0= Creative Commons Attribution Non Commercial No Derivatives 1.0 _LICENSE_GROUPS_CC-BY-NC-ND-1.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-2.0= Creative Commons Attribution Non Commercial No Derivatives 2.0 _LICENSE_GROUPS_CC-BY-NC-ND-2.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-2.5= Creative Commons Attribution Non Commercial No Derivatives 2.5 _LICENSE_GROUPS_CC-BY-NC-ND-2.5= # empty _LICENSE_PERMS_CC-BY-NC-ND-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-3.0= Creative Commons Attribution Non Commercial No Derivatives 3.0 _LICENSE_GROUPS_CC-BY-NC-ND-3.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-4.0= Creative Commons Attribution Non Commercial No Derivatives 4.0 _LICENSE_GROUPS_CC-BY-NC-ND-4.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-1.0= Creative Commons Attribution Non Commercial Share Alike 1.0 _LICENSE_GROUPS_CC-BY-NC-SA-1.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-2.0= Creative Commons Attribution Non Commercial Share Alike 2.0 _LICENSE_GROUPS_CC-BY-NC-SA-2.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-2.5= Creative Commons Attribution Non Commercial Share Alike 2.5 _LICENSE_GROUPS_CC-BY-NC-SA-2.5= # empty _LICENSE_PERMS_CC-BY-NC-SA-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-3.0= Creative Commons Attribution Non Commercial Share Alike 3.0 _LICENSE_GROUPS_CC-BY-NC-SA-3.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-4.0= Creative Commons Attribution Non Commercial Share Alike 4.0 _LICENSE_GROUPS_CC-BY-NC-SA-4.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-SA-1.0= Creative Commons Attribution Share Alike 1.0 _LICENSE_GROUPS_CC-BY-SA-1.0= # empty _LICENSE_NAME_CC-BY-SA-2.0= Creative Commons Attribution Share Alike 2.0 _LICENSE_GROUPS_CC-BY-SA-2.0= # empty _LICENSE_NAME_CC-BY-SA-2.5= Creative Commons Attribution Share Alike 2.5 _LICENSE_GROUPS_CC-BY-SA-2.5= # empty _LICENSE_NAME_CC-BY-SA-3.0= Creative Commons Attribution Share Alike 3.0 _LICENSE_GROUPS_CC-BY-SA-3.0= # empty _LICENSE_NAME_CC-BY-SA-4.0= Creative Commons Attribution Share Alike 4.0 _LICENSE_GROUPS_CC-BY-SA-4.0= # empty _LICENSE_NAME_CDDL= Common Development and Distribution License _LICENSE_GROUPS_CDDL= FSF OSI _LICENSE_NAME_ClArtistic= Clarified Artistic License _LICENSE_GROUPS_ClArtistic= FSF GPL OSI _LICENSE_NAME_CPAL-1.0= Common Public Attribution License _LICENSE_GROUPS_CPAL-1.0= FSF OSI _LICENSE_NAME_EPL= Eclipse Public License _LICENSE_GROUPS_EPL= FSF OSI _LICENSE_NAME_GFDL= GNU Free Documentation License _LICENSE_GROUPS_GFDL= FSF _LICENSE_NAME_GMGPL= GNAT Modified General Public License _LICENSE_GROUPS_GMGPL= FSF GPL OSI _LICENSE_NAME_GPLv1= GNU General Public License version 1 _LICENSE_GROUPS_GPLv1= FSF GPL OSI _LICENSE_NAME_GPLv1+ = ${_LICENSE_NAME_GPLv1} (or later) _LICENSE_GROUPS_GPLv1+ = ${_LICENSE_GROUPS_GPLv1} _LICENSE_NAME_GPLv2= GNU General Public License version 2 _LICENSE_GROUPS_GPLv2= FSF GPL OSI _LICENSE_NAME_GPLv2+ = ${_LICENSE_NAME_GPLv2} (or later) _LICENSE_GROUPS_GPLv2+ = ${_LICENSE_GROUPS_GPLv2} _LICENSE_NAME_GPLv3= GNU General Public License version 3 _LICENSE_GROUPS_GPLv3= FSF GPL OSI _LICENSE_NAME_GPLv3+ = ${_LICENSE_NAME_GPLv3} (or later) _LICENSE_GROUPS_GPLv3+ = ${_LICENSE_GROUPS_GPLv3} _LICENSE_NAME_GPLv3RLE= GNU GPL version 3 Runtime Library Exception _LICENSE_GROUPS_GPLv3RLE= FSF GPL OSI _LICENSE_NAME_GPLv3RLE+ = ${_LICENSE_NAME_GPLv3RLE} (or later) _LICENSE_GROUPS_GPLv3RLE+ = ${_LICENSE_GROUPS_GPLv3RLE} _LICENSE_NAME_ISCL= Internet Systems Consortium License _LICENSE_GROUPS_ISCL= FSF GPL OSI COPYFREE _LICENSE_NAME_LGPL20= GNU Library General Public License version 2.0 _LICENSE_GROUPS_LGPL20= FSF GPL OSI _LICENSE_NAME_LGPL20+ = ${_LICENSE_NAME_LGPL20} (or later) _LICENSE_GROUPS_LGPL20+ = ${_LICENSE_GROUPS_LGPL20} _LICENSE_NAME_LGPL21= GNU Lesser General Public License version 2.1 _LICENSE_GROUPS_LGPL21= FSF GPL OSI _LICENSE_NAME_LGPL21+ = ${_LICENSE_NAME_LGPL21} (or later) _LICENSE_GROUPS_LGPL21+ = ${_LICENSE_GROUPS_LGPL21} _LICENSE_NAME_LGPL3= GNU Lesser General Public License version 3 _LICENSE_GROUPS_LGPL3= FSF GPL OSI _LICENSE_NAME_LGPL3+ = ${_LICENSE_NAME_LGPL3} (or later) _LICENSE_GROUPS_LGPL3+ = ${_LICENSE_GROUPS_LGPL3} _LICENSE_NAME_LPPL10= LaTeX Project Public License version 1.0 _LICENSE_GROUPS_LPPL10= FSF OSI _LICENSE_PERMS_LPPL10= dist-mirror dist-sell _LICENSE_NAME_LPPL11= LaTeX Project Public License version 1.1 _LICENSE_GROUPS_LPPL11= FSF OSI _LICENSE_PERMS_LPPL11= dist-mirror dist-sell _LICENSE_NAME_LPPL12= LaTeX Project Public License version 1.2 _LICENSE_GROUPS_LPPL12= FSF OSI _LICENSE_PERMS_LPPL12= dist-mirror dist-sell _LICENSE_NAME_LPPL13= LaTeX Project Public License version 1.3 _LICENSE_GROUPS_LPPL13= FSF OSI _LICENSE_PERMS_LPPL13= dist-mirror dist-sell _LICENSE_NAME_LPPL13a= LaTeX Project Public License version 1.3a _LICENSE_GROUPS_LPPL13a= FSF OSI _LICENSE_PERMS_LPPL13a= dist-mirror dist-sell _LICENSE_NAME_LPPL13b= LaTeX Project Public License version 1.3b _LICENSE_GROUPS_LPPL13b= FSF OSI _LICENSE_PERMS_LPPL13b= dist-mirror dist-sell _LICENSE_NAME_LPPL13c= LaTeX Project Public License version 1.3c _LICENSE_GROUPS_LPPL13c= FSF OSI _LICENSE_PERMS_LPPL13c= dist-mirror dist-sell _LICENSE_NAME_MIT= MIT license / X11 license _LICENSE_GROUPS_MIT= COPYFREE FSF GPL OSI _LICENSE_NAME_MPL10= Mozilla Public License version 1.0 _LICENSE_GROUPS_MPL10= FSF OSI _LICENSE_NAME_MPL11= Mozilla Public License version 1.1 _LICENSE_GROUPS_MPL11= FSF OSI _LICENSE_NAME_MPL20= Mozilla Public License version 2.0 _LICENSE_GROUPS_MPL20= FSF OSI _LICENSE_NAME_NCSA= University of Illinois/NCSA Open Source License _LICENSE_GROUPS_NCSA= COPYFREE FSF GPL OSI _LICENSE_NAME_ODbL= Open Database License _LICENSE_NAME_OFL10= SIL Open Font License version 1.0 (http://scripts.sil.org/OFL) _LICENSE_GROUPS_OFL10= FONTS _LICENSE_NAME_OFL11= SIL Open Font License version 1.1 (http://scripts.sil.org/OFL) _LICENSE_GROUPS_OFL11= FONTS _LICENSE_NAME_OpenSSL= OpenSSL License _LICENSE_GROUPS_OpenSSL= FSF _LICENSE_NAME_OWL= Open Works License (owl.apotheon.org) _LICENSE_GROUPS_OWL= COPYFREE _LICENSE_NAME_PostgreSQL= PostgreSQL Licence _LICENSE_GROUPS_PostgreSQL= FSF GPL OSI COPYFREE _LICENSE_NAME_PD= Public Domain _LICENSE_GROUPS_PD= GPL COPYFREE _LICENSE_NAME_PHP202= PHP License version 2.02 _LICENSE_GROUPS_PHP202= FSF OSI _LICENSE_NAME_PHP30= PHP License version 3.0 _LICENSE_GROUPS_PHP30= FSF OSI _LICENSE_NAME_PHP301= PHP License version 3.01 _LICENSE_GROUPS_PHP301= FSF OSI _LICENSE_NAME_PSFL= Python Software Foundation License _LICENSE_GROUPS_PSFL= FSF GPL OSI _LICENSE_NAME_RUBY= Ruby License _LICENSE_GROUPS_RUBY= FSF _LICENSE_NAME_NONE= No license specified _LICENSE_GROUPS_NONE= # empty _LICENSE_PERMS_NONE= none _LICENSE_NAME_UNLICENSE= The Unlicense _LICENSE_GROUPS_UNLICENSE= COPYFREE FSF GPL _LICENSE_NAME_WTFPL1= Do What the Fuck You Want To Public License version 1 _LICENSE_GROUPS_WTFPL1= GPL FSF COPYFREE _LICENSE_NAME_WTFPL= Do What the Fuck You Want To Public License version 2 _LICENSE_GROUPS_WTFPL= GPL FSF COPYFREE _LICENSE_NAME_ZLIB= zlib License _LICENSE_GROUPS_ZLIB= GPL FSF OSI _LICENSE_NAME_ZPL21= Zope Public License version 2.1 _LICENSE_GROUPS_ZPL21= GPL OSI # Set default permissions if not defined .for lic in ${_LICENSE_LIST} . if !defined(_LICENSE_PERMS_${lic}) _LICENSE_PERMS_${lic}= ${_LICENSE_PERMS_DEFAULT} . endif .endfor diff --git a/Mk/bsd.licenses.mk b/Mk/bsd.licenses.mk index 94137816cd86..f9332996207b 100644 --- a/Mk/bsd.licenses.mk +++ b/Mk/bsd.licenses.mk @@ -1,815 +1,814 @@ #-*- tab-width: 4; -*- # ex:ts=4 # ** Please run changes to this file by eadler@ first ** Licenses_Include_MAINTAINER= portmgr@FreeBSD.org # # bsd.licenses.mk - License auditing framework. # -# Created by: Alejandro Pulver # # Please view me with 4 column tabs! # # TODO: # - Bring back save and checksum with new dialog interface (only offers to do # so if ran by root, otherwise silently remove the options). Also only allow # saving per-port options (known or unknown), and only when accepted. # - Add custom restriction targets for better integration (now some files are # removed from FTP if restricted for CDROM for example, as the old # behavior). # The following cases are not considered: # # - Redistribution of modified distfiles, because is never done. # - Creating binaries from modified sources, because packages almost always # contain modifications to the source, cannot be autodetected (i.e. # patch-* in ${FILESDIR}, post-* targets, etc), and these licenses tend to # have more restrictions anyways. # # Integration with target sequences # # _SANITY_SEQ+= check-license (after check-vulnerable) # _PATCH_SEQ+= ask-license (before any other targets) # _INSTALL_SUSEQ+= install-license (after install-desktop-entries) # # The 'check-license' target will determine if the license was accepted, # rejected or has to be asked later to the user in 'ask-license' (by then # licenses should be extracted). The 'install-license' target installs the # applications' licenses, a general package license mentioning them, and a # restriction report (to be used by ports, scripts and similar tools). # Variables provided to the ports system and users in general, to modify the # behavior of the framework # # DISABLE_LICENSES - Disable license auditing framework completely. # NO_LICENSES_INSTALL - Do not install catalog, report and licenses. # NO_LICENSES_DIALOGS - Disable interactive menus for asking licenses. #NO_LICENSES_INSTALL= yes #NO_LICENSES_DIALOGS= yes # Variables provided to users (can be passed to make or set in /etc/make.conf) # # LICENSES_ACCEPTED - Accepted licenses. # LICENSES_REJECTED - Rejected licenses. # LICENSES_GROUPS_ACCEPTED - Accepted license groups. # LICENSES_GROUPS_REJECTED - Rejected license groups. # LICENSES_ASK - Require explicit user approval for all licenses not # present in previous variables (for example, stock # accepted licenses will ask confirmation). # # Variables provided to ports # # LICENSE - Code of license (short name). # LICENSE_PERMS - Permissions; use "none" if empty. # LICENSE_GROUPS - Groups the license belongs. # LICENSE_NAME - Full license name (for the reports). # LICENSE_FILE - Full path to license (or use LICENSE_TEXT). # LICENSE_TEXT - Text to use as a license, useful when referencing to # another place if it's not in the distfile. # LICENSE_DISTFILES - Name of licensed files (defaults to ${_DISTFILES}). # LICENSE_COMB - Set to "dual" or "multi", for OR/AND behavior # (defaults to "single" if undefined, the common case) # # The following cases are supported after defining LICENSE: # # Case 1: license defined in the framework (aka "known"). # # In this case the only allowed variables to set are LICENSE_FILE and # LICENSE_DISTFILES. The rest are managed by the framework and are not allowed # to change. # # Case 2: license only known by the port (aka "unknown"). # # In this case LICENSE_{PERMS,NAME} are mandatory, in addition to # either LICENSE_FILE or LICENSE_TEXT. Optional variable is # LICENSE_GROUPS. # # Available components for LICENSE_PERMS: # dist-mirror - Redistribution of distfile is permitted # (like FTP mirroring; port is not RESTRICTED). # dist-sell - Selling of distfile, e.g. on CD-ROM is permitted # (port does not need to set NO_CDROM). # pkg-mirror - Free redistribution of package is permitted # (like FTP upload; port does not set NO_PACKAGE). # pkg-sell - Selling of package is permitted, e.g. on CD-ROM. # auto-accept - License is accepted by default, without presented # agreement, unless the user defines LICENSES_ASK. # # Notes about permissions: # - Permissions use a default-deny policy (e.g. not setting "dist-mirror" # means it is automatically excluded). # - Components can be negated by prefixing them with "no-" (like # "no-pkg-sell"). # - In case a component is present and also excluded (i.e. no-dist-sell and # dist-sell together in LICENSE_PERMS), it will be excluded. # - XXX Currently there is no point in "no-" prefixes, as permissions are not # inherited from groups. Maybe it looks more clear that way than leaving the # variable empty? # # Dual/multiple licenses: # # If LICENSE_COMB is set to "dual", then LICENSE can (must, actually) have # more than one component. After that each license "lic" in LICENSE falls in # previous cases (known or unknown), but their variables are prefixed by # _LICENSE_ and suffixed by _lic. The main license name, perms and groups will # be set automatically (following appropiate logic). The idea is that any # license from LICENSE can be chosen to use the package. # # The case when LICENSE_COMB is set to "multi" is similar. But the idea is # that all of the licenses in LICENSE must be agreed to use the package. # .if defined(_POSTMKINCLUDED) && !defined(BEFOREPORTMK) . if defined(LICENSE) # Include known licenses from database .include "${PORTSDIR}/Mk/bsd.licenses.db.mk" # Lists of variables and valid components # # _LICENSE_LIST_PERMS - Valid permission components # _LICENSE_LIST_PORT_VARS - License variables defined by the port _LICENSE_LIST_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept none _LICENSE_LIST_PORT_VARS= PERMS NAME GROUPS # Path variables # # _LICENSE_DIR - Directory to install licenses # _LICENSE_STORE - Store for known license files # _LICENSE_CATALOG - License catalog (make include file) to be created (dst) # _LICENSE_CATALOG_TMP - Same as above, but in WRKDIR (src) # _LICENSE_REPORT - License summary, shows licenses and how they are combined (dst) # _LICENSE_REPORT_TMP - Same as above, but in WRKDIR (src) # _LICENSE_COOKIE - Set when license is accepted, it is not present in # bsd.port.mk to avoid creating LICENSE_{REQ,SEQ} for a # few more targets only. _LICENSE_DIR?= ${PREFIX}/share/licenses/${PKGNAME} _LICENSE_STORE?= ${PORTSDIR}/Templates/Licenses _LICENSE_CATALOG?= ${_LICENSE_DIR}/catalog.mk _LICENSE_CATALOG_TMP?= ${WRKDIR}/.license-catalog.mk _LICENSE_REPORT?= ${_LICENSE_DIR}/LICENSE _LICENSE_REPORT_TMP?= ${WRKDIR}/.license-report _LICENSE_COOKIE?= ${WRKDIR}/.license_done.${PORTNAME}.${PREFIX:S/\//_/g} # Defaults (never overriden for now) # # _LICENSE - Copy of LICENSE (for now) # _LICENSE_COMB - Copy of LICENSE_COMB (but "single" instead of empty) _LICENSE?= ${LICENSE} . if !defined(LICENSE_COMB) _LICENSE_COMB= single . else _LICENSE_COMB= ${LICENSE_COMB} . endif # Check if single or dual/multiple license # # Make sure LICENSE_COMB is only used with more than one license. . if ${_LICENSE_COMB} != "single" && ${_LICENSE_COMB} != "dual" && ${_LICENSE_COMB} != "multi" _LICENSE_ERROR?= invalid value for LICENSE_COMB: "${_LICENSE_COMB}" (should be "single", "dual" or "multi") . endif . for lic in ${_LICENSE} . if defined(_LICENSE_DEFINED) . if ${_LICENSE_COMB} == "single" _LICENSE_ERROR?= multiple licenses in LICENSE, but LICENSE_COMB is set to "single" (or undefined) . else _LICENSE_MULTI= yes . endif . else _LICENSE_DEFINED= yes . endif . endfor . if ${_LICENSE_COMB} != "single" && !defined(_LICENSE_MULTI) _LICENSE_ERROR?= single license in LICENSE, but LICENSE_COMB is set to "${_LICENSE_COMB}" (requires more than one) . endif . if !defined(_LICENSE_DEFINED) _LICENSE_ERROR?= no licenses present in LICENSE (empty string) . endif .undef _LICENSE_DEFINED .undef _LICENSE_MULTI # Evaluate port license groups and permissions # # Available values for _LICENSE_TYPE: # # Case 1: "known" (license info taken from internal database) # Case 2: "unknown" (LICENSE is not known, and info taken from port) # # Make sure required variables are defined, and remove conflicting (positive # and negative) duplicated components. . if ${_LICENSE_COMB} == "single" # Defaults to empty _LICENSE_GROUPS?= # # Start . for lic in ${_LICENSE} . if ${_LICENSE_LIST:M${lic}} != "" # Case 1: license defined in the framework. _LICENSE_TYPE= known . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}) _LICENSE_ERROR?= redefining LICENSE_${var} is not allowed for known licenses, to define a custom license try another LICENSE name like ${_LICENSE}-variant . endif . if !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= ERROR: missing _LICENSE_${var}_${lic} in bsd.licenses.db.mk . else _LICENSE_${var}= ${_LICENSE_${var}_${lic}} . endif . endfor # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE) . if !defined(LICENSE_TEXT) . if exists(${_LICENSE_STORE}/${lic}) _LICENSE_FILE= ${_LICENSE_STORE}/${lic} . else # No license file in /usr/ports/Templates/Licenses _LICENSE_TEXT= The license: ${_LICENSE} (${_LICENSE_NAME}) is standard, please read from the web. _LICENSE_FILE= ${WRKDIR}/${lic} . endif . else _LICENSE_ERROR?= defining LICENSE_TEXT is not allowed for known licenses . endif . else _LICENSE_FILE= ${LICENSE_FILE} . endif . else # Case 2: license only known by the port. _LICENSE_TYPE= unknown . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}) _LICENSE_${var}= ${LICENSE_${var}} . elif !defined(_LICENSE_${var}) _LICENSE_ERROR?= for unknown licenses, defining LICENSE_${var} is mandatory (otherwise use a known LICENSE) . endif . endfor # Check LICENSE_PERMS for invalid, ambiguous and duplicate components __LICENSE_PERMS:= # . for comp in ${_LICENSE_PERMS} . if ${_LICENSE_LIST_PERMS:M${comp:C/^no-//}} == "" _LICENSE_ERROR?= invalid LICENSE_PERMS component "${comp}" . elif ${__LICENSE_PERMS:M${comp}} == "" && \ ${_LICENSE_PERMS:Mno-${comp:C/^no-//}} == "" __LICENSE_PERMS+= ${comp} . endif . endfor _LICENSE_PERMS:= ${__LICENSE_PERMS} . undef __LICENSE_PERMS # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE) . if !defined(LICENSE_TEXT) _LICENSE_ERROR?= either LICENSE_FILE or LICENSE_TEXT must be defined . else _LICENSE_TEXT= ${LICENSE_TEXT} _LICENSE_FILE= ${WRKDIR}/${lic} . endif . else _LICENSE_FILE= ${LICENSE_FILE} . endif . endif # Only one is allowed . if defined(LICENSE_FILE) && defined(LICENSE_TEXT) _LICENSE_ERROR?= defining both LICENSE_FILE and LICENSE_TEXT is not allowed . endif # Distfiles . if !defined(LICENSE_DISTFILES) _LICENSE_DISTFILES= ${_DISTFILES} . else _LICENSE_DISTFILES= ${LICENSE_DISTFILES} . endif . endfor . else . if defined(LICENSE_FILE) . for lic in ${_LICENSE} LICENSE_FILE_${lic}?= ${LICENSE_FILE} . endfor . endif . for lic in ${_LICENSE} # Defaults to empty _LICENSE_GROUPS_${lic}?=# . if ${_LICENSE_LIST:M${lic}} != "" # Case 1: license defined in the framework. _LICENSE_TYPE_${lic}= known . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}_${lic}) _LICENSE_ERROR?= redefining LICENSE_${var}_${lic} is not allowed for known licenses, to define a custom license try another LICENSE name for ${lic} like ${lic}-variant . endif . if !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= ERROR: missing _LICENSE_${var}_${lic} in bsd.licenses.db.mk . endif . endfor # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE_${lic}) . if !defined(LICENSE_TEXT_${lic}) . if exists(${_LICENSE_STORE}/${lic}) _LICENSE_FILE_${lic}= ${_LICENSE_STORE}/${lic} . else # No license file in /usr/ports/Templates/Licenses _LICENSE_TEXT_${lic}= The license: ${lic} (${_LICENSE_NAME_${lic}}) is standard, please read from the web. _LICENSE_FILE_${lic}= ${WRKDIR}/${lic} . endif . else _LICENSE_ERROR?= defining LICENSE_TEXT_${lic} is not allowed for known licenses . endif . else _LICENSE_FILE_${lic}= ${LICENSE_FILE_${lic}} . endif . else # Case 2: license only known by the port. _LICENSE_TYPE_${lic}= unknown . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}_${lic}) _LICENSE_${var}_${lic}= ${LICENSE_${var}_${lic}} . elif !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= for unknown licenses, defining LICENSE_${var}_${lic} is mandatory (otherwise use a known LICENSE) . endif . endfor # Check LICENSE_PERMS for invalid, ambiguous and duplicate components __LICENSE_PERMS:= # . for comp in ${_LICENSE_PERMS_${lic}} . if ${_LICENSE_LIST_PERMS:M${comp:C/^no-//}} == "" _LICENSE_ERROR?= invalid LICENSE_PERMS_${var} component "${comp}" . elif ${__LICENSE_PERMS:M${comp}} == "" && \ ${_LICENSE_PERMS_${lic}:Mno-${comp:C/^no-//}} == "" __LICENSE_PERMS+= ${comp} . endif . endfor _LICENSE_PERMS_${lic}:= ${__LICENSE_PERMS} . undef __LICENSE_PERMS # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE_${lic}) . if !defined(LICENSE_TEXT_${lic}) _LICENSE_ERROR?= either LICENSE_FILE_${lic} or LICENSE_TEXT_${lic} must be defined . else _LICENSE_TEXT_${lic}= ${LICENSE_TEXT_${lic}} _LICENSE_FILE_${lic}= ${WRKDIR}/${lic} . endif . else _LICENSE_FILE_${lic}= ${LICENSE_FILE_${lic}} . endif . endif # Only one is allowed . if defined(LICENSE_FILE_${lic}) && defined(LICENSE_TEXT_${lic}) _LICENSE_ERROR?= defining both LICENSE_FILE_${lic} and LICENSE_TEXT_${lic}is not allowed . endif # Distfiles . if !defined(LICENSE_DISTFILES_${lic}) _LICENSE_DISTFILES_${lic}= ${_DISTFILES} . else _LICENSE_DISTFILES_${lic}= ${LICENSE_DISTFILES_${lic}} . endif . endfor . endif # Check if the user agrees with the license # Make sure these are defined LICENSES_ACCEPTED?= # LICENSES_REJECTED?= # LICENSES_GROUPS_ACCEPTED?= # LICENSES_GROUPS_REJECTED?= # # Evaluate per-license status . if ${_LICENSE_COMB} == "single" . for lic in ${_LICENSE} . if ${LICENSES_REJECTED:M${lic}} != "" _LICENSE_STATUS?= rejected . endif . for group in ${_LICENSE_GROUPS} . if ${LICENSES_GROUPS_REJECTED:M${group}} != "" _LICENSE_STATUS?= rejected . endif . if ${LICENSES_GROUPS_ACCEPTED:M${group}} != "" _LICENSE_STATUS?= accepted . endif . endfor . if ${LICENSES_ACCEPTED:M${lic}} != "" _LICENSE_STATUS?= accepted . endif . if ${_LICENSE_PERMS:Mauto-accept} != "" && !defined(LICENSES_ASK) _LICENSE_STATUS?= accepted . endif _LICENSE_STATUS?= ask . endfor . else . for lic in ${_LICENSE} . if ${LICENSES_REJECTED:M${lic}} != "" _LICENSE_STATUS_${lic}?= rejected . endif . for group in ${_LICENSE_GROUPS_${lic}} . if ${LICENSES_GROUPS_REJECTED:M${group}} != "" _LICENSE_STATUS_${lic}?= rejected . endif . if ${LICENSES_GROUPS_ACCEPTED:M${group}} != "" _LICENSE_STATUS_${lic}?= accepted . endif . endfor . if ${LICENSES_ACCEPTED:M${lic}} != "" _LICENSE_STATUS_${lic}?= accepted . endif . if ${_LICENSE_PERMS_${lic}:Mauto-accept} != "" && !defined(LICENSES_ASK) _LICENSE_STATUS_${lic}?= accepted . endif _LICENSE_STATUS_${lic}?= ask . endfor . endif # Evaluate general status . if ${_LICENSE_COMB} == "dual" . for lic in ${_LICENSE} . if ${_LICENSE_STATUS_${lic}} == "accepted" _LICENSE_STATUS= accepted . elif ${_LICENSE_STATUS_${lic}} == "ask" _LICENSE_STATUS?= ask _LICENSE_TO_ASK+= ${lic} . endif _LICENSE_STATUS?= rejected . endfor . elif ${_LICENSE_COMB} == "multi" . for lic in ${_LICENSE} . if ${_LICENSE_STATUS_${lic}} == "rejected" _LICENSE_STATUS= rejected . elif ${_LICENSE_STATUS_${lic}} == "ask" _LICENSE_STATUS?= ask _LICENSE_TO_ASK+= ${lic} . endif . endfor _LICENSE_STATUS?= accepted . endif # For dual/multi licenses, after processing all sub-licenses, the following # must be determined: _LICENSE_NAME, _LICENSE_PERMS and _LICENSE_GROUPS. . if ${_LICENSE_COMB} == "dual" _LICENSE_NAME= Dual (any of): ${_LICENSE} # Calculate least restrictive permissions (union) _LICENSE_PERMS:= # . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_PERMS} . if ${_LICENSE_PERMS_${lic}:M${comp}} != "" && \ ${_LICENSE_PERMS:M${comp}} == "" _LICENSE_PERMS+= ${comp} . endif . endfor . endfor # Calculate least restrictive groups (union) _LICENSE_GROUPS:= # . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_GROUPS} . if ${_LICENSE_GROUPS_${lic}:M${comp}} != "" && \ ${_LICENSE_GROUPS:M${comp}} == "" _LICENSE_GROUPS+= ${comp} . endif . endfor . endfor . elif ${_LICENSE_COMB} == "multi" _LICENSE_NAME= Multiple (all of): ${_LICENSE} # Calculate most restrictive permissions (intersection) _LICENSE_PERMS:= ${_LICENSE_LIST_PERMS} . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_PERMS} . if ${_LICENSE_PERMS_${lic}:M${comp}} == "" _LICENSE_PERMS:= ${_LICENSE_PERMS:N${comp}} . endif . endfor . endfor # Calculate most restrictive groups (intersection) _LICENSE_GROUPS:= ${_LICENSE_LIST_GROUPS} . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_GROUPS} . if ${_LICENSE_GROUPS_${lic}:M${comp}} == "" _LICENSE_GROUPS:= ${_LICENSE_GROUPS:N${comp}} . endif . endfor . endfor . endif # Prepare information for asking license to the user . if ${_LICENSE_STATUS} == "ask" && ${_LICENSE_COMB} != "single" _LICENSE_ASK_DATA!= mktemp -ut portslicense . endif # Calculate restrictions and set RESTRICTED_FILES when # appropiate, together with cleaning targets. # # XXX For multiple licenses restricted distfiles are always removed from both # CDROM and FTP, but the current framework supports separating them (would # require better/new delete-package and delete-distfiles targets) . if ${_LICENSE_PERMS:Mpkg-mirror} == "" _LICENSE_RESTRICTED+= delete-package . elif ${_LICENSE_PERMS:Mpkg-sell} == "" _LICENSE_CDROM+= delete-package . endif . if ${_LICENSE_COMB} == "multi" . for lic in ${_LICENSE} . if ${_LICENSE_PERMS_${lic}:Mdist-mirror} == "" || ${_LICENSE_PERMS_${lic}:Mdist-sell} == "" RESTRICTED_FILES+= ${_LICENSE_DISTFILES_${lic}} . endif . endfor . if defined(RESTRICTED_FILES) RESTRICTED_FILES+= ${_PATCHFILES} _LICENSE_RESTRICTED+= delete-distfiles _LICENSE_CDROM+= delete-distfiles . endif . else . if ${_LICENSE_PERMS:Mdist-mirror} == "" _LICENSE_RESTRICTED+= delete-distfiles RESTRICTED_FILES= ${_PATCHFILES} ${_DISTFILES} . elif ${_LICENSE_PERMS:Mdist-sell} == "" _LICENSE_CDROM+= delete-distfiles RESTRICTED_FILES= ${_PATCHFILES} ${_DISTFILES} . endif . endif . if defined(_LICENSE_RESTRICTED) # _LICENSE_RESTRICTED contains 'delete-distfiles' and 'delete-package' if # needed with RESTRICTED_FILES filled from above. clean-restricted: ${_LICENSE_RESTRICTED} clean-restricted-list: ${_LICENSE_RESTRICTED:C/$/-list/} . else clean-restricted: clean-restricted-list: . endif . if defined(_LICENSE_CDROM) clean-for-cdrom: ${_LICENSE_CDROM} clean-for-cdrom-list: ${_LICENSE_CDROM:C/$/-list/} . else clean-for-cdrom: clean-for-cdrom-list: . endif # Check variables are correctly defined and print status up to here . if ${_LICENSE_STATUS} == "ask" && defined(BATCH) IGNORE= License ${_LICENSE} needs confirmation, but BATCH is defined . endif # This should probably be incrementally done while parsing all the license # possibilities. debug-license: check-license . if ${_LICENSE_PERMS:Mdist-mirror} @${ECHO_MSG} "===> License allows mirroring distribution files" . else @${ECHO_MSG} "===> License does not allow mirroring distribution files" . endif . if ${_LICENSE_PERMS:Mdist-sell} @${ECHO_MSG} "===> License allows selling distribution files" . else @${ECHO_MSG} "===> License does not allow selling distribution files" . endif . if ${_LICENSE_PERMS:Mpkg-mirror} @${ECHO_MSG} "===> License allows mirroring pre-built packages" . else @${ECHO_MSG} "===> License does not allow mirroring pre-build packages" . endif . if ${_LICENSE_PERMS:Mpkg-sell} @${ECHO_MSG} "===> License allows selling pre-build packages" . else @${ECHO_MSG} "===> License does not allow selling pre-build packages" . endif . if ${_LICENSE_PERMS:Mauto-accept} @${ECHO_MSG} "===> License allows being auto-accepted" . else @${ECHO_MSG} "===> License requires manual intervention by the user to accept its terms" . endif check-license: . if defined(_LICENSE_ERROR) @${ECHO_MSG} "===> License not correctly defined: ${_LICENSE_ERROR}" @exit 1 . endif . if ${_LICENSE_STATUS} == "rejected" @${ECHO_MSG} "===> License ${_LICENSE} rejected by the user" @${ECHO_MSG} @${ECHO_MSG} "If you want to install this port make sure the following license(s) are not present in LICENSES_REJECTED, either in make arguments or /etc/make.conf: ${_LICENSE}. Also check LICENSES_GROUPS_REJECTED in case they contain a group this license(s) belong to." | ${FMT} @${ECHO_MSG} @exit 1 . elif ${_LICENSE_STATUS} == "accepted" @${ECHO_MSG} "===> License ${_LICENSE} accepted by the user" . elif ${_LICENSE_STATUS} == "ask" @${ECHO_MSG} "===> License ${_LICENSE} needs confirmation, will ask later" . endif # Display, ask and save preference if requested ask-license: ${_LICENSE_COOKIE} ${_LICENSE_COOKIE}: # Make sure all required license files exist . if ${_LICENSE_COMB} == "single" . if !defined(LICENSE_FILE) && defined(_LICENSE_TEXT) @test -f ${_LICENSE_FILE} || ${ECHO_CMD} "${_LICENSE_TEXT}" | ${FMT} > ${_LICENSE_FILE} . endif @test -f ${_LICENSE_FILE} || \ (${ECHO_MSG} "===> Missing license file for ${_LICENSE} in ${_LICENSE_FILE}"; exit 1) . else . for lic in ${_LICENSE} . if !defined(LICENSE_FILE_${lic}) && defined(_LICENSE_TEXT_${lic}) @test -f ${_LICENSE_FILE_${lic}} || ${ECHO_CMD} "${_LICENSE_TEXT_${lic}}" | ${FMT} > ${_LICENSE_FILE_${lic}} . endif @test -f ${_LICENSE_FILE_${lic}} || \ (${ECHO_MSG} "===> Missing license file for ${lic} in ${_LICENSE_FILE_${lic}}"; exit 1) . endfor . endif . if ${_LICENSE_STATUS} == "ask" . if !defined(NO_LICENSES_DIALOGS) # Dialog interface . if ${_LICENSE_COMB} == "single" @${DIALOG} --title "License for ${PKGNAME} (${_LICENSE})" \ --yes-label Accept --no-label Reject --yesno \ "$$(${CAT} ${_LICENSE_FILE})" 21 76 . elif ${_LICENSE_COMB} == "dual" @${RM} ${_LICENSE_ASK_DATA} . for lic in ${_LICENSE_TO_ASK} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} . endfor @menu_cmd="${DIALOG} --hline \"This port requires you to accept at least one license\" --menu \"License for ${PKGNAME} (dual)\" 21 70 15"; \ trap '${RM} $$tmpfile' EXIT INT TERM; \ tmpfile=$$(mktemp -t portlicenses); \ for lic in ${_LICENSE_TO_ASK}; do \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\" USE_$${lic} \"Accept the license $${lic}\""; \ done; \ menu_cmd="$${menu_cmd} REJECT \"Reject the licenses (all)\""; \ while true; do \ ${SH} -c "$${menu_cmd} 2>\"$${tmpfile}\""; \ result=$$(${CAT} "$${tmpfile}"); \ case $${result} in \ REJECT) exit 1;; \ VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \ file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \ ${DIALOG} --textbox "$${file}" 21 75 ;; \ USE_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^USE_//'); \ ${ECHO_CMD} $${name} > ${_LICENSE_COOKIE}; \ break ;; \ esac; \ done . elif ${_LICENSE_COMB} == "multi" @${RM} ${_LICENSE_ASK_DATA} . for lic in ${_LICENSE_TO_ASK} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} . endfor @menu_cmd="${DIALOG} --hline \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \ trap '${RM} $$tmpfile' EXIT INT TERM; \ tmpfile=$$(mktemp -t portlicenses); \ for lic in ${_LICENSE_TO_ASK}; do \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\""; \ done; \ menu_cmd="$${menu_cmd} ACCEPT \"Accept the licenses (all)\" REJECT \"Reject the licenses (all)\""; \ while true; do \ ${SH} -c "$${menu_cmd} 2>\"$${tmpfile}\""; \ result=$$(${CAT} "$${tmpfile}"); \ case $${result} in \ ACCEPT) break ;; \ REJECT) exit 1 ;; \ VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \ file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \ ${DIALOG} --textbox "$${file}" 21 75 ;; \ esac; \ done . endif . else # Text interface @${ECHO_MSG} . if ${_LICENSE_COMB} == "single" @${ECHO_MSG} "To install the port you must agree to the license: ${_LICENSE} (${_LICENSE_NAME})." | ${FMT} @${ECHO_MSG} @${ECHO_MSG} "You can view the license at ${_LICENSE_FILE:S/${WRKDIR}\//${WRKDIR:T}\//}." . elif ${_LICENSE_COMB} == "dual" @${ECHO_MSG} "To install the port you must agree to any of the following licenses:" . elif ${_LICENSE_COMB} == "multi" @${ECHO_MSG} "To install the port you must agree to all of the following licenses:" . endif @${ECHO_MSG} . if ${_LICENSE_COMB} != "single" . for lic in ${_LICENSE_TO_ASK} . if defined(WRKDIRPREFIX) @${ECHO_MSG} "- ${lic} (${_LICENSE_NAME_${lic}}), available at ${_LICENSE_FILE_${lic}}" . else @${ECHO_MSG} "- ${lic} (${_LICENSE_NAME_${lic}}), available at ${_LICENSE_FILE_${lic}:S/${WRKDIR}\//${WRKDIR:T}\//}" . endif . endfor @${ECHO_MSG} . endif @${ECHO_MSG} "If you agree with the corresponding license(s), add them to LICENSES_ACCEPTED either in make arguments or /etc/make.conf." | ${FMT} @${ECHO_MSG} @exit 1 . endif @${RM} ${_LICENSE_ASK_DATA} . endif # Create report and catalog . if !defined(NO_LICENSES_INSTALL) @${RM} ${_LICENSE_CATALOG_TMP} ${_LICENSE_REPORT_TMP} . if ${_LICENSE_COMB} == "single" # Catalog . for var in _LICENSE _LICENSE_NAME _LICENSE_PERMS _LICENSE_GROUPS _LICENSE_DISTFILES @${ECHO_CMD} "${var}=${${var}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor # Report @${ECHO_CMD} "This package has a single license: ${_LICENSE} (${_LICENSE_NAME})." > ${_LICENSE_REPORT_TMP} . else # Catalog . for var in _LICENSE _LICENSE_COMB _LICENSE_NAME _LICENSE_PERMS _LICENSE_GROUPS @${ECHO_CMD} "${var}=${${var}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor . if ${_LICENSE_COMB} == "dual" && ${_LICENSE_STATUS} == "ask" @${SED} -e 's/^/_LICENSE_SELECTED=/' ${_LICENSE_COOKIE} >> ${_LICENSE_CATALOG_TMP} . endif . for lic in ${_LICENSE} . for var in NAME PERMS GROUPS DISTFILES @${ECHO_CMD} "_LICENSE_${var}_${lic} =${_LICENSE_${var}_${lic}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor . endfor # Report . if ${_LICENSE_COMB} == "dual" @${ECHO_CMD} "This package has dual licenses (any of):" >> ${_LICENSE_REPORT_TMP} . elif ${_LICENSE_COMB} == "multi" @${ECHO_CMD} "This package has multiple licenses (all of):" >> ${_LICENSE_REPORT_TMP} . endif . for lic in ${_LICENSE} @${ECHO_CMD} "- ${lic} (${_LICENSE_NAME_${lic}})" >> ${_LICENSE_REPORT_TMP} . endfor . endif . endif # Cookie (done here) @${TOUCH} ${_LICENSE_COOKIE} # Package list entries, and installation . if !defined(NO_LICENSES_INSTALL) PLIST_FILES+= ${_LICENSE_CATALOG} \ ${_LICENSE_REPORT} . if ${_LICENSE_COMB} == "single" PLIST_FILES+= ${_LICENSE_DIR}/${_LICENSE} . else . for lic in ${_LICENSE} . if defined(_LICENSE_FILE_${lic}) PLIST_FILES+= ${_LICENSE_DIR}/${lic} . endif . endfor . endif install-license: @${MKDIR} ${STAGEDIR}${_LICENSE_DIR} @${INSTALL_DATA} ${_LICENSE_CATALOG_TMP} ${STAGEDIR}${_LICENSE_CATALOG} @${INSTALL_DATA} ${_LICENSE_REPORT_TMP} ${STAGEDIR}${_LICENSE_REPORT} . if ${_LICENSE_COMB} == "single" @${INSTALL_DATA} ${_LICENSE_FILE} ${STAGEDIR}${_LICENSE_DIR}/${_LICENSE} . else . for lic in ${_LICENSE} @${INSTALL_DATA} ${_LICENSE_FILE_${lic}} ${STAGEDIR}${_LICENSE_DIR}/${lic} . endfor . endif . endif . else # !LICENSE debug-license: . if defined(LICENSE_VERBOSE) @${ECHO_MSG} "===> License debug empty, port has not defined LICENSE" . endif check-license: . if defined(LICENSE_VERBOSE) @${ECHO_MSG} "===> License check disabled, port has not defined LICENSE" . endif . endif # LICENSE .endif diff --git a/Mk/bsd.local.mk b/Mk/bsd.local.mk index 468442a19428..3a3c544d6380 100644 --- a/Mk/bsd.local.mk +++ b/Mk/bsd.local.mk @@ -1,25 +1,24 @@ # bsd.local.mk - Sandbox for local modification to ports framework. # -# Created by: Mark Linimon .if !defined(_POSTMKINCLUDED) && !defined(Local_Pre_Include) Local_Pre_Include= bsd.local.mk # # Here is where any code that needs to run at bsd.port.pre.mk inclusion # time should live. # .endif # !defined(_POSTMKINCLUDED) && !defined(Local_Pre_Include) .if defined(_POSTMKINCLUDED) && !defined(Local_Post_Include) Local_Post_Include= bsd.local.mk # # here is where any code that needs to run at bsd.port.post.mk inclusion # time should live. # .endif # defined(_POSTMKINCLUDED) && !defined(Local_Post_Include) diff --git a/Mk/bsd.port.options.mk b/Mk/bsd.port.options.mk index af8e56dbb69a..41adf6065366 100644 --- a/Mk/bsd.port.options.mk +++ b/Mk/bsd.port.options.mk @@ -1,20 +1,19 @@ # bsd.port.options.mk - Allow OPTIONS to determine dependencies # # usage: # # .include "bsd.port.options.mk" # # .include "bsd.port.pre.mk" # # .include "bsd.port.post.mk" # -# Created by: Shaun Amott OPTIONS_Include_MAINTAINER= portmgr@FreeBSD.org USEOPTIONSMK= yes INOPTIONSMK= yes .include "bsd.port.mk" .undef INOPTIONSMK diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk index dc71aa3bf1ad..47a0eb78fead 100644 --- a/Mk/bsd.ruby.mk +++ b/Mk/bsd.ruby.mk @@ -1,352 +1,351 @@ # bsd.ruby.mk - Utility definitions for Ruby related ports. # -# Created by: Akinori MUSHA .if !defined(Ruby_Include) Ruby_Include= bsd.ruby.mk Ruby_Include_MAINTAINER= ruby@FreeBSD.org # # [variables that a user may define] # # RUBY_VER - (See below) # RUBY_DEFAULT_VER - Set to (e.g.) "2.7" if you want to refer to "ruby27" # just as "ruby". # RUBY_ARCH - (See below) # # [variables that each port can define] # # RUBY - Set to full path of ruby. If you set this, the values # of the following variables are automatically obtained # from the ruby executable: RUBY_VER, RUBY_VERSION, # RUBY_ARCH, RUBY_LIBDIR, RUBY_ARCHLIBDIR, # RUBY_SITELIBDIR, and RUBY_SITEARCHLIBDIR. # RUBY_VER - Set to the alternative short version of ruby in the # form of `x.y' (see below for current value). # USE_RUBY - Says that the port uses ruby for building and running. # RUBY_NO_BUILD_DEPENDS - Says that the port should not build-depend on ruby. # RUBY_NO_RUN_DEPENDS - Says that the port should not run-depend on ruby. # USE_RUBY_EXTCONF - Says that the port uses extconf.rb to configure. # Implies USE_RUBY. # RUBY_EXTCONF - Set to the alternative name of extconf.rb # (default: extconf.rb). # RUBY_EXTCONF_SUBDIRS - Set to list of subdirectories, if multiple modules # are included. # USE_RUBY_SETUP - Says that the port uses setup.rb to configure and # build. # RUBY_SETUP - Set to the alternative name of setup.rb # (default: setup.rb). # USE_RUBYGEMS - Do not use this -- instead USES=gem # # [variables that each port should not (re)define] # # RUBY_PKGNAMEPREFIX - Common PKGNAMEPREFIX for ruby ports # (default: ruby${RUBY_SUFFIX}-) # RUBY_VERSION - Full version of ruby without preview/beta suffix in # the form of `x.y.z' (see below for current value). # RUBY_VERSION_CODE - Integer version of RUBY_VERSION in the form of # `xyz'. # RUBY_DISTVERSION - DISTVERSION for the standard ruby ports (ruby, # ruby-gdbm, etc.). # RUBY_PORTVERSION - PORTVERSION for the standard ruby ports (ruby, # ruby-gdbm, etc.). # RUBY_PORTREVISION - PORTREVISION for the standard ruby ports. # RUBY_PORTEPOCH - PORTEPOCH for the standard ruby ports. # RUBY_DISTNAME - DISTNAME for the standard ruby ports, i.e. the # basename of the ruby distribution tarball. # RUBY_PATCHFILES - PATCHFILES for the standard ruby ports, i.e. the # basename of the ruby distribution tarball. # RUBY_WRKSRC - WRKSRC for the ruby port. # MASTER_SITE_SUBDIR_RUBY - MASTER_SITE_SUBDIR for the ruby distfiles. # # RUBY_SHLIBVER - Major version of libruby (see below for current # value). # RUBY_ARCH - Set to target architecture name. # (e.g. i386-freebsd7) # RUBY_SUFFIX - Suffix for ruby binaries and directories # (${RUBY_VER:S/.//}). # RUBY_WITHOUT_SUFFIX - Always ${LOCALBASE}/bin/ruby. # RUBY_WITH_SUFFIX - Always ${RUBY_WITHOUT_SUFFIX}${RUBY_SUFFIX}. # # RUBY_MODNAME - Set to the module name (default: ${PORTNAME}). # # RUBY_BASE_PORT - Port path of base ruby without PORTSDIR, without # suffix except version. # RUBY_PORT - Port path of ruby without PORTSDIR. # # DEPEND_RUBY - BUILD_DEPENDS/RUN_DEPENDS entry for ruby. # # RUBY_LIBDIR - Installation path for architecture independent # libraries. # RUBY_ARCHLIBDIR - Installation path for architecture dependent # libraries. # RUBY_SITELIBDIR - Installation path for site architecture independent # libraries. # RUBY_SITEARCHLIBDIR - Installation path for site architecture dependent # libraries. # RUBY_DOCDIR - Installation path for documents. # RUBY_EXAMPLESDIR - Installation path for examples. # RUBY_RIDIR - Installation path for site architecture independent ri # documents. # RUBY_SITERIDIR - Installation path for site architecture dependent ri # documents. # RUBY_MODDOCDIR - Installation path for the module's documents. # RUBY_MODEXAMPLESDIR - Installation path for the module's examples. # . if defined(RUBY_DEFAULT_VER) WARNING+= "RUBY_DEFAULT_VER is defined, consider using DEFAULT_VERSIONS=ruby=${RUBY_DEFAULT_VER} instead" . endif RUBY_DEFAULT_VER?= ${RUBY_DEFAULT} RUBY_VER?= ${RUBY_DEFAULT_VER} . if defined(RUBY) . if !exists(${RUBY}) IGNORE= cannot install: you set the variable RUBY to "${RUBY}", but it does not seem to exist. Please specify an already installed ruby executable . endif _RUBY_TEST!= ${RUBY} -e 'begin; require "rbconfig"; puts "ok" ; rescue LoadError; puts "error"; end' . if !empty(_RUBY_TEST) && ${_RUBY_TEST} != "ok" IGNORE= cannot install: you set the variable RUBY to "${RUBY}", but it failed to include rbconfig. Please specify a properly installed ruby executable . endif _RUBY_CONFIG= ${RUBY} -r rbconfig -e 'C = RbConfig::CONFIG' -e RUBY_VERSION!= ${_RUBY_CONFIG} 'puts C["ruby_version"]' RUBY_SUFFIX?= # empty RUBY_ARCH!= ${_RUBY_CONFIG} 'puts C["target"]' _RUBY_SYSLIBDIR!= ${_RUBY_CONFIG} 'puts C["libdir"]' _RUBY_SITEDIR!= ${_RUBY_CONFIG} 'puts C["sitedir"]' _RUBY_VENDORDIR!= ${_RUBY_CONFIG} 'puts C["vendordir"]' . else RUBY?= ${LOCALBASE}/bin/ruby${RUBY_SUFFIX} . if defined(RUBY_VER) # When adding a version, please keep the comment in # Mk/bsd.default-versions.mk in sync. . if ${RUBY_VER} == 2.7 # # Ruby 2.7 # RUBY_DISTVERSION= 2.7.6 RUBY_PORTREVISION= 2 RUBY_PORTEPOCH= 1 . elif ${RUBY_VER} == 3.0 # # Ruby 3.0 # RUBY_DISTVERSION= 3.0.4 RUBY_PORTREVISION= 2 RUBY_PORTEPOCH= 1 . elif ${RUBY_VER} == 3.1 # # Ruby 3.1 # RUBY_DISTVERSION= 3.1.2 RUBY_PORTREVISION= 1 RUBY_PORTEPOCH= 1 . elif ${RUBY_VER} == 3.2 # # Ruby 3.2 # RUBY_DISTVERSION= 3.2.0-preview1 RUBY_PORTREVISION= 2 RUBY_PORTEPOCH= 1 # When adding a version, please keep the comment in # Mk/bsd.default-versions.mk in sync. . else # # Other versions # IGNORE= Only ruby 2.7, 3.0, 3.1 and 3.2 are supported _INVALID_RUBY_VER= 1 . endif RUBY_VERSION= ${RUBY_DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/} . endif # defined(RUBY_VER) . if !defined(_INVALID_RUBY_VER) RUBY27?= "@comment " RUBY30?= "@comment " RUBY31?= "@comment " RUBY32?= "@comment " . if defined(BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}) . if ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} == "yes" BROKEN= does not build with Ruby ${RUBY_VER} . else BROKEN= ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} . endif . endif RUBY_WRKSRC= ${WRKDIR}/ruby-${RUBY_DISTVERSION} RUBY_CONFIGURE_ARGS+= --with-rubyhdrdir="${PREFIX}/include/ruby-${RUBY_VER}/" \ --with-rubylibprefix="${PREFIX}/lib/ruby" \ --docdir="${RUBY_DOCDIR}" \ --with-soname=ruby${RUBY_SUFFIX} CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL:C/\..*//} RUBY_ARCH?= ${ARCH}-${OPSYS:tl}${OSREL:C/\..*//} _RUBY_SYSLIBDIR?= ${PREFIX}/lib _RUBY_SITEDIR?= ${_RUBY_SYSLIBDIR}/ruby/site_ruby _RUBY_VENDORDIR?= ${_RUBY_SYSLIBDIR}/ruby/vendor_ruby . endif . endif # defined(RUBY) . if !defined(_INVALID_RUBY_VER) RUBY_DEFAULT_SUFFIX?= ${RUBY_DEFAULT_VER:S/.//} RUBY_PORTVERSION?= ${RUBY_DISTVERSION:tl:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g} MASTER_SITE_SUBDIR_RUBY?= ${RUBY_VER} RUBY_DISTNAME?= ruby-${RUBY_DISTVERSION} RUBY_WRKSRC?= ${WRKDIR}/${RUBY_DISTNAME} RUBY_RELVERSION_CODE?= ${RUBY_RELVERSION:S/.//g} RUBY_VERSION_CODE?= ${RUBY_VERSION:S/.//g} RUBY_VER= ${RUBY_VERSION:C/([[:digit:]]+\.[[:digit:]]+).*/\1/} RUBY_SUFFIX= ${RUBY_VER:S/.//} RUBY_WITHOUT_SUFFIX?= ${LOCALBASE}/bin/ruby RUBY_WITH_SUFFIX?= ${RUBY_WITHOUT_SUFFIX}${RUBY_SUFFIX} RUBY_PKGNAMEPREFIX?= ruby${RUBY_SUFFIX}- RUBY_SHLIBVER?= ${RUBY_VER:S/.//} RUBY_CONFIGURE_ARGS+= --program-prefix="" . if ${RUBY_VER} != ${RUBY_DEFAULT_VER} DEPENDS_ARGS+= RUBY_VER=${RUBY_VER} . endif RUBY_CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}" RUBY_MODNAME?= ${PORTNAME} # Ports RUBY_BASE_PORT?= lang/ruby${RUBY_VER:S/.//} RUBY_PORT?= ${RUBY_BASE_PORT} # Depends DEPEND_RUBY?= ${RUBY}:${RUBY_PORT} # Directories RUBY_LIBDIR?= ${_RUBY_SYSLIBDIR}/ruby/${RUBY_VER} RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH} RUBY_SITELIBDIR?= ${_RUBY_SITEDIR}/${RUBY_VER} RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH} RUBY_VENDORLIBDIR?= ${_RUBY_VENDORDIR}/${RUBY_VER} RUBY_VENDORARCHLIBDIR?= ${RUBY_VENDORLIBDIR}/${RUBY_ARCH} RUBY_DOCDIR?= ${PREFIX}/share/doc/ruby${RUBY_SUFFIX} RUBY_EXAMPLESDIR?= ${PREFIX}/share/examples/ruby${RUBY_SUFFIX} RUBY_RIDIR?= ${PREFIX}/share/ri/${RUBY_VER}/system RUBY_SITERIDIR?= ${PREFIX}/share/ri/${RUBY_VER}/site RUBY_MODDOCDIR?= ${RUBY_DOCDIR}/${RUBY_MODNAME} RUBY_MODEXAMPLESDIR?= ${RUBY_EXAMPLESDIR}/${RUBY_MODNAME} # PLIST PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \ RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \ RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \ RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \ RUBY_VENDORLIBDIR="${RUBY_VENDORLIBDIR}" \ RUBY_VENDORARCHLIBDIR="${RUBY_VENDORARCHLIBDIR}" \ RUBY_MODDOCDIR="${RUBY_MODDOCDIR}" \ RUBY_MODEXAMPLESDIR="${RUBY_MODEXAMPLESDIR}" \ RUBY_DOCDIR="${RUBY_DOCDIR}" \ RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \ RUBY_RIDIR="${RUBY_RIDIR}" \ RUBY_SITERIDIR="${RUBY_SITERIDIR}" PLIST_SUB+= ${PLIST_RUBY_DIRS:C,DIR="(${LOCALBASE}|${PREFIX})/,DIR=",} \ RUBY_VERSION="${RUBY_VERSION}" \ RUBY_VER="${RUBY_VER}" \ RUBY_SHLIBVER="${RUBY_SHLIBVER}" \ RUBY_ARCH="${RUBY_ARCH}" \ RUBY_SUFFIX="${RUBY_SUFFIX}" \ RUBY_DEFAULT_SUFFIX="${RUBY_DEFAULT_SUFFIX}" . if ${PORT_OPTIONS:MDEBUG} RUBY_FLAGS+= -d . endif # # extconf.rb support # . if defined(USE_RUBY_EXTCONF) USE_RUBY= yes RUBY_EXTCONF?= extconf.rb CONFIGURE_ARGS+= --with-opt-dir="${LOCALBASE}" CONFIGURE_ENV+= RB_USER_INSTALL=yes do-configure: ruby-extconf-configure ruby-extconf-configure: . if defined(RUBY_EXTCONF_SUBDIRS) . for d in ${RUBY_EXTCONF_SUBDIRS} @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure" @cd ${CONFIGURE_WRKSRC}/${d}; \ ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} . endfor . else @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure" @cd ${CONFIGURE_WRKSRC}; \ ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} . endif . endif # # setup.rb support # . if defined(USE_RUBY_SETUP) RUBY_SETUP?= setup.rb do-configure: ruby-setup-configure ruby-setup-configure: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure" @cd ${BUILD_WRKSRC}; \ ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} config ${CONFIGURE_ARGS} do-build: ruby-setup-build ruby-setup-build: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to build" @cd ${BUILD_WRKSRC}; \ ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} setup do-install: ruby-setup-install ruby-setup-install: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to install" @cd ${INSTALL_WRKSRC}; \ ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} install --prefix=${STAGEDIR} . endif . if defined(USE_RUBY) . if !defined(RUBY_NO_BUILD_DEPENDS) EXTRACT_DEPENDS+= ${DEPEND_RUBY} PATCH_DEPENDS+= ${DEPEND_RUBY} BUILD_DEPENDS+= ${DEPEND_RUBY} . endif . if !defined(RUBY_NO_RUN_DEPENDS) RUN_DEPENDS+= ${DEPEND_RUBY} . endif . endif . endif # _INVALID_RUBY_VER .endif diff --git a/Mk/bsd.wx.mk b/Mk/bsd.wx.mk index 9269867d22fe..5831385fe61f 100644 --- a/Mk/bsd.wx.mk +++ b/Mk/bsd.wx.mk @@ -1,518 +1,517 @@ # bsd.wx.mk - Support for wxWidgets based ports. # -# Created by: Alejandro Pulver # # The following variables can be defined in a port that uses the wxWidgets # library, contributed libraries, WxPython and/or more wxWidgets related # components (with run and/or build dependencies). It can be used after and/or # before bsd.port.pre.mk, but Python components will only work if Python # variables (e.g. USE_PYTHON) are defined before it (this is a bsd.python.mk # limitation), at least it is manually included. # # USE_WX - Set to the list of wxWidgets versions that can be used by # the port. The syntax allows the following elements: # - Single version (e.g. "3.0"). # - Range of versions (e.g. "2.8-3.0"). Must be ascending. # - Partial range: single version and upper (e.g. "2.8+"). # - Partial range: single version and lower (e.g. "-2.8"). # Multiple elements can be specified separated by spaces. # USE_WX_NOT - Set to the list of wxWidgets versions that can't be used by # the port. In other words, it removes some versions from # USE_WX. If the latter is not defined, it will have the value # of all the possible versions. The syntax is like USE_WX. # WX_COMPS - Set to the list of wxWidgets components the port uses. # Several components can be specified separated by spaces. By # default it will have the value of "wx". Suffixes in the form # ":xxx" may be added to the components to determine the # dependency type. # The available components are: # wx - The wxWidgets library. # contrib - The wxWidgets contributed libraries. # python - The wxWidgets API for Python. # The available dependency types are: # build - Requires component for building. # lib - Requires component for building and running. # run - Requires component for running. # If no suffix is present then "run" will be used for "python" # and "lib" for others. # WX_CONF_ARGS - Set to "absolute" or "relative" if the port needs configure # arguments in addition to the WX_CONFIG environment variable. # It determines the type of parameters that have to be passed # to the configure script. In the first case it adds # "--with-wx-config=${WX_CONFIG}" (absolute path of # WX_CONFIG), and in second one "--with-wx=${LOCALBASE}" plus # "--with-wx-config=${WX_CONFIG:T} (prefix and name). # WX_PREMK - Define to determine version and define WX_CONFIG/WX_VERSION # after (in case the port needs to manually # run the script). # WANT_WX - Set to "yes" or a valid single version (no ranges, etc). # In both cases it will detect the installed wxWidgets # components and add them to the variable HAVE_WX. If a # version is selected, HAVE_WX will contain a list of # components in the other case it will contain a list of # "component-version" pairs (e.g. wx-2.8, contrib-2.8, etc). # It has to be used before bsd.port.pre.mk. # WANT_WX_VER - Set to the preferred wxWidgets version for the port. It must # be present in USE_WX or missing in USE_WX_NOT. This is # overridden by the user variable WITH_WX_VER if set. It can # contain multiple versions in order of preference (last ones # are tried first). # WANT_WXGTK_VER - Set to the preferred GTK+ version, "2" or "3", "3" being # the default (only applicable to wxWidgets 3.0 for now). # # The following variables are intended for the user and can be defined in # make.conf. # WITH_WX_VER - Define to the list of preferred versions in reverse order. # # The following variables are defined by this file, to be read from the port. # WX_CONFIG - The path to the wx-config program (with different name). # WXRC_CMD - The path to the wxrc program (with different name). # WX_VERSION - The wxWidgets version that is going to be used. # HAVE_WX - The list of wxWidgets components installed, if WANT_WX was # defined. The components will have version suffix if it was # set to "yes". # # Examples: # - A port that needs wxWidgets 2.8 and contributed libraries # USE_WX= 2.8 # WX_COMPS= wx contrib # - A port that needs WxPython 2.8 for running. # USE_PYTHON= yes # USE_WX= 2.8 # WX_COMPS= python:run # - A port that needs WxPython 2.8 or 3.0 for building. # USE_PYTHON= yes # USE_WX= 2.8 3.0 # WX_COMPS= python:build # - A port that needs wxWidgets version 2.8 or higher and contributed # libraries. # USE_WX= 2.8+ # WX_COMPS= wx contrib # - A port that needs wxWidgets of any version other than 2.8. # USE_WX_NOT= 2.8 # WX_Include_MAINTAINER= ports@FreeBSD.org # # Global definitions. # .if !defined(_WX_Definitions_Done) _WX_Definitions_Done= yes # # Common variables: # _WX_COMPS_ALL - List of valid components. # _WX_DEP_TYPES_ALL - List of valid dependency types. # _WX_VERS_ALL - List of supported versions. # _WX_VERS_UC_ALL - List of Unicode capable versions. # _WX_VERS_LISTS - Reverse lists preference order. # _WX_COMPS_ALL= wx contrib python _WX_DEP_TYPES_ALL= build lib run _WX_VERS_ALL= 2.8 3.0 3.1 _WX_VERS_UC_ALL= 2.8 3.0 3.1 _WX_VERS_SKIP= 3.0 3.1 _WX_VERS_LISTS= WANT_WX_VER WITH_WX_VER _WX_VER_INSTALLED # # Variables used to determine what is needed: # _WX_PORT_comp_ver - Port directory. # _WX_LIB_comp_ver - Name of the shared library (optional). # _WX_SHVER_comp_ver - Shared library version (optional). # _WX_FILE_comp_ver - File installed by that component. # _WX_DEPTYPE_comp_ver - Default dependency type (optional). # # wxgtk 2.8 _WX_PORT_wx_2.8= x11-toolkits/wxgtk28 _WX_LIB_wx_2.8= wx_base${_WX_UC}-2.8 _WX_PORT_contrib_2.8= x11-toolkits/wxgtk28-contrib _WX_LIB_contrib_2.8= wx_gtk2${_WX_UC}_fl-2.8 # wxgtk 3.0 _WX_PORT_wx_3.0= x11-toolkits/wxgtk30@${_GTKFLAVOR} _WX_LIB_wx_3.0= wx_baseu-3.0 _WX_PORT_python_3.1= x11-toolkits/py-wxPython4@${PY_FLAVOR} _WX_FILE_python_3.1= ${PYTHON_SITELIBDIR}/wx/__init__.py # wxgtk 3.1 _WX_PORT_wx_3.1= x11-toolkits/wxgtk31 _WX_LIB_wx_3.1= wx_baseu-3.1 # Set _WX_SHVER_comp_ver to 0 and _WX_FILE_comp_ver for libs appropriately. # Set _WX_DEPTYPE_comp_ver for "python" to "run", and others to "lib". . for comp in ${_WX_COMPS_ALL} _WX_COMP= ${comp} . for ver in ${_WX_VERS_ALL} . if defined(_WX_LIB_${comp}_${ver}) _WX_SHVER_${comp}_${ver}= 0 _WX_FILE_${comp}_${ver}= ${LOCALBASE}/lib/lib${_WX_LIB_${comp}_${ver}}.so.${_WX_SHVER_${comp}_${ver}} . endif . if ${_WX_COMP} == "python" _WX_DEPTYPE_${comp}_${ver}= run . else _WX_DEPTYPE_${comp}_${ver}= lib . endif . endfor . endfor .endif # !_WX_Defined_Done # # Check if we are going to determine the version. # .if !defined(_WX_Version_Done) && (defined(_POSTMKINCLUDED) || \ (defined(WX_PREMK) && defined(BEFOREPORTMK) && \ (defined(USE_WX) || defined(USE_WX_NOT)))) _WX_Need_Version= yes .endif # # Check for present components. # # Requested by the user. .if defined(WANT_WX) && defined(BEFOREPORTMK) _WANT_WX= ${WANT_WX} .endif # Used for autodetection of installed versions. .if defined(_WX_Need_Version) _WANT_WX= yes .endif .if defined(_WANT_WX) # These variables are reprocessed later so they won't affect other parts. _WX_VER_FINAL= ${_WX_VERS_UC_ALL} _WX_UC= u _WX_PYSUFX= -unicode # Fill _HAVE_WX with the installed components. . undef _HAVE_WX . for __WANT_WX in ${_WANT_WX} # Check if _WANT_WX contains more than one word. . if defined(_HAVE_WX) IGNORE?= selected multiple values for WANT_WX: ${_WANT_WX} . endif _HAVE_WX= # # Check for all versions. . if ${_WANT_WX:tl} == "yes" . for comp in ${_WX_COMPS_ALL} . for ver in ${_WX_VER_FINAL} _WX_COMP= _WX_FILE_${comp}_${ver} . if defined(${_WX_COMP}) && exists(${${_WX_COMP}}) _HAVE_WX+= ${comp}-${ver} . endif . endfor . endfor # Check for a specific version. . elif ${_WX_VERS_ALL:M${__WANT_WX}} . for comp in ${_WX_COMPS_ALL} . if exists(${_WX_FILE_${comp}_${__WANT_WX}}) _HAVE_WX+= ${comp} . endif . endfor . else IGNORE?= selected an invalid value for WANT_WX: ${__WANT_WX} . endif . endfor .endif # _WANT_WX # Requested by the user. .if defined(WANT_WX) && defined(BEFOREPORTMK) HAVE_WX:= ${_HAVE_WX} .endif # Used for autodetection of installed versions. .if defined(_WX_Need_Version) _WX_VER_INSTALLED:= ${_HAVE_WX:Mwx-*:S/wx-//} .endif # # Select wxWidgets version. # .if defined(_WX_Need_Version) _WX_Version_Done= yes # # Basic component parsing (ignores dependency types). # # The variables used are: # _WX_COMP - Component part. # _WX_COMPS_FINAL - Final list of components. # # Detect duplicated components. _WX_COMPS_FINAL= # . for comp in ${WX_COMPS} _WX_COMP= ${comp:C/:([[:alpha:]]+)$//} . for __WX_COMP in ${_WX_COMP} . if ${_WX_COMPS_ALL:M${__WX_COMP}} == "" IGNORE?= selected an invalid wxWidgets component: ${__WX_COMP} . endif . endfor . for newcomp in ${_WX_COMP} . if ${_WX_COMPS_FINAL:M${newcomp}} == "" && !defined(IGNORE) _WX_COMPS_FINAL+= ${newcomp} . endif . endfor . endfor # Set defaults (if one isn't present). USE_WX?= ${_WX_VERS_ALL} USE_WX_NOT?= # # # Make lists of valid and invalid versions. # # The following variables are used: # _WX_VER_CHECK - If the version is a single one, express in a range. # _WX_VER_MIN - Lower version of the range. # _WX_VER_MAX - Higher version of the range. # _WX_VER_LIST - List of requested versions. # _WX_VER_NOT_LIST - List of disallowed versions. # _WX_VER_MERGED - List of requested version without disallowed ones. # . for list in VER VER_NOT _WX_${list}_LIST= # . for ver in ${USE_WX${list:C/VER//}} _WX_VER_CHECK:= ${ver:C/^([[:digit:]]+(\.[[:digit:]]+)*)$/\1-\1/} _WX_VER_MIN:= ${_WX_VER_CHECK:C/([[:digit:]]+(\.[[:digit:]]+)*)[-+].*/\1/} _WX_VER_MAX:= ${_WX_VER_CHECK:C/.*-([[:digit:]]+(\.[[:digit:]]+)*)/\1/} # Minimum version not specified. . if ${_WX_VER_MIN} == ${_WX_VER_CHECK} . undef _WX_VER_MIN . for v in ${_WX_VERS_ALL} . if ${_WX_VER_CHECK:C/[-+]//} == ${v} || ${_WX_VERS_SKIP:M${v}} == "" _WX_VER_MIN?= ${v} . endif . endfor . endif # Maximum version not specified. . if ${_WX_VER_MAX} == ${_WX_VER_CHECK} . for v in ${_WX_VERS_ALL} . if ${_WX_VER_CHECK:C/[-+]//} == ${v} || ${_WX_VERS_SKIP:M${v}} == "" _WX_VER_MAX= ${v} . endif . endfor . endif # Expand versions and add valid ones to each list. . for v in ${_WX_VERS_ALL} . if ${_WX_VER_MIN} <= ${v} && ${_WX_VER_MAX} >= ${v} && \ ${_WX_${list}_LIST:M${v}} == "" _WX_${list}_LIST+= ${v} . endif . endfor . endfor . endfor # Merge the lists into a single list of valid versions. _WX_VER_MERGED= # . for ver in ${_WX_VER_LIST} . if ${_WX_VER_NOT_LIST:M${ver}} == "" _WX_VER_MERGED+= ${ver} . endif . endfor # Check for a null version. . if empty(_WX_VER_MERGED) IGNORE?= selected a null or invalid wxWidgets version . endif # Avoid versions which have unavailable components. . for ver in ${_WX_VER_MERGED} . for comp in ${_WX_COMPS_FINAL} . if !defined(_WX_PORT_${comp}_${ver}) _WX_WRONG_COMPS+= ${comp} _WX_WRONG_VERS+= ${ver} _WX_VER_MERGED:= ${_WX_VER_MERGED:N${ver}} . endif . endfor . endfor . if empty(_WX_VER_MERGED) IGNORE?= selected wxWidgets versions (${_WX_WRONG_VERS}) which do not have the selected components (${_WX_WRONG_COMPS}) . endif # # Unicode support. # # Create a list of capable versions. _WX_VER_UC= # . for ver in ${_WX_VER_MERGED} . if ${_WX_VERS_UC_ALL:M${ver}} != "" _WX_VER_UC+= ${ver} . endif . endfor # Set Unicode variables. _WX_VER_FINAL= ${_WX_VER_UC} _WX_UC= u _WX_PYSUFX= -unicode # Remove unusable installed versions. . for ver in ${_WX_VER_INSTALLED} . if ${_WX_VER_FINAL:M${ver}} == "" _WX_VER_INSTALLED:= ${_WX_VER_INSTALLED:N${ver}} . endif . endfor # # Choose final version. # # # Check for the following (in order): # 1) WITH_WX_VER - User preference. # 2) WANT_WX_VER - Port preference. # 3) _WX_VER_INSTALLED - Installed versions. # 4) _WX_VER_FINAL - Available versions. . for list in _WX_VER_FINAL ${_WX_VERS_LISTS} . if defined(${list}) . for ver in ${${list}} . if ${_WX_VER_FINAL:M${ver}} != "" _WX_VER= ${ver} . endif . endfor . endif . endfor # # Set variables. # . if ${_WX_VER} == 3.1 _GTKVER= 3 . elif ${_WX_VER} == 3.0 _GTKVER= ${WANT_WXGTK_VER:U3} _GTKFLAVOR= gtk${_GTKVER} . else _GTKVER= 2 . endif WX_CONFIG?= ${LOCALBASE}/bin/wxgtk${_GTKVER}${_WX_UC}-${_WX_VER}-config WXRC_CMD?= ${LOCALBASE}/bin/wxrc-gtk${_GTKVER}${_WX_UC}-${_WX_VER} WX_VERSION?= ${_WX_VER} .endif # _WX_Need_Version # # Process components list and add dependencies, variables, etc. # .if defined(_POSTMKINCLUDED) # # Component parsing. # # The variables used are: # _WX_COMP - Component part. # _WX_DEP_TYPE - Dependency type part. # _WX_COMP_NEW - Component + dependency type. # _WX_COMPS_FINAL - Final list of components with dependency types. # # Default components. WX_COMPS?= wx # Detect invalid and duplicated components. _WX_COMPS_FINAL= # . for comp in ${WX_COMPS} _WX_COMP= ${comp:C/:([[:alpha:]]+)$//} . if ${_WX_COMP} == ${comp} _WX_DEP_TYPE= ${_WX_DEPTYPE_${comp}_${_WX_VER}} . else _WX_DEP_TYPE= ${comp:C/.+:([[:alpha:]]+)$/\1/} . endif _WX_COMP_NEW= ${_WX_COMP}_${_WX_DEP_TYPE} . for __WX_COMP in ${_WX_COMP} . if ${_WX_COMPS_ALL:M${__WX_COMP}} == "" IGNORE?= selected an invalid wxWidgets component: ${__WX_COMP} . endif . endfor . for __WX_DEP_TYPE in ${_WX_DEP_TYPE} . if ${_WX_DEP_TYPES_ALL:M${__WX_DEP_TYPE}} == "" IGNORE?= selected an invalid wxWidgets dependency type: ${__WX_DEP_TYPE} . endif . endfor . if !defined(_WX_PORT_${_WX_COMP}_${_WX_VER}) IGNORE?= selected a wxWidgets component (${_WX_COMP}) which is not available for the selected version (${_WX_VER}) . endif . for newcomp in ${_WX_COMP_NEW} . if ${_WX_COMPS_FINAL:M${newcomp}} == "" && !defined(IGNORE) _WX_COMPS_FINAL+= ${newcomp} . endif . endfor . endfor # Add dependencies. # # The variable used are: # _WX_COMP - Component part. # _WX_DEP_TYPE - Dependency type part. . for comp in ${_WX_COMPS_FINAL} _WX_COMP= ${comp:C/_([[:alpha:]]+)$//} _WX_DEP_TYPE= ${comp:C/.+_([[:alpha:]]+)$/\1/} # XXX Need a .for loop here so the variable is expanded before the assignment. . for comp_part in ${_WX_COMP} . if ${_WX_DEP_TYPE} == "lib" . if defined(_WX_LIB_${_WX_COMP}_${_WX_VER}) LIB_DEPENDS+= lib${_WX_LIB_${comp_part}_${_WX_VER}}.so:${_WX_PORT_${comp_part}_${_WX_VER}} . else BUILD_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${_WX_PORT_${comp_part}_${_WX_VER}} RUN_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${_WX_PORT_${comp_part}_${_WX_VER}} . endif . else ${_WX_DEP_TYPE:tu}_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${_WX_PORT_${comp_part}_${_WX_VER}} . endif . endfor . endfor # # Set build related variables. # MAKE_ENV+= WX_CONFIG=${WX_CONFIG} CONFIGURE_ENV+= WX_CONFIG=${WX_CONFIG} . if defined(WX_CONF_ARGS) . if ${WX_CONF_ARGS:tl} == "absolute" CONFIGURE_ARGS+= --with-wx-config=${WX_CONFIG} . elif ${WX_CONF_ARGS:tl} == "relative" CONFIGURE_ARGS+= --with-wx=${LOCALBASE} \ --with-wx-config=${WX_CONFIG:T} . else IGNORE?= selected an invalid wxWidgets configure argument type: ${WX_CONF_ARGS} . endif . endif .endif # _POSTMKINCLUDED