From owner-svn-ports-head@freebsd.org Mon Sep 9 20:36:11 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9128EE0773; Mon, 9 Sep 2019 20:36:11 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46S0LM3MBXz4cGs; Mon, 9 Sep 2019 20:36:11 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39E251B2E0; Mon, 9 Sep 2019 20:36:11 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89KaBhc097209; Mon, 9 Sep 2019 20:36:11 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89KaBTm097208; Mon, 9 Sep 2019 20:36:11 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201909092036.x89KaBTm097208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 9 Sep 2019 20:36:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r511702 - head/audio/linux-c7-alsa-plugins-oss X-SVN-Group: ports-head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/audio/linux-c7-alsa-plugins-oss X-SVN-Commit-Revision: 511702 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 20:36:11 -0000 Author: tijl Date: Mon Sep 9 20:36:10 2019 New Revision: 511702 URL: https://svnweb.freebsd.org/changeset/ports/511702 Log: - Make the port safe to build as root. [1] Given an absolute /path Linux programs first try to access /compat/linux/path before trying /path. That means mkdir -p ${STAGEDIR} will always create /compat/linux${STAGEDIR} when run as root and echo > /dev/null will create /compat/linux/dev/null as a regular file. Fix this by running configure with FreeBSD /bin/sh and build/install using FreeBSD gmake. PATH is set to /compat/linux/usr/bin and MKDIR_P to /bin/mkdir -p so all commands except mkdir are still Linux programs. - Add USES=libtool:build because libtoolize is needed. [2] - Add USES=pkgconfig. - Remove -DFREEBSD_OSS_BUFSZ_P2 because it breaks some games. [3] - Replace -nostdinc -isystem ... with --sysroot=${LINUXBASE}. [3] - Include bsd.port.options.mk to get ARCH. [3] PR: 240043 Reported by: VVD [1] Reported by: Giacomo Olgeni [2] Reported by: Alex S [3] Modified: head/audio/linux-c7-alsa-plugins-oss/Makefile Modified: head/audio/linux-c7-alsa-plugins-oss/Makefile ============================================================================== --- head/audio/linux-c7-alsa-plugins-oss/Makefile Mon Sep 9 20:34:54 2019 (r511701) +++ head/audio/linux-c7-alsa-plugins-oss/Makefile Mon Sep 9 20:36:10 2019 (r511702) @@ -4,7 +4,7 @@ PORTNAME= alsa-plugins PORTVERSION= 1.1.6 DISTVERSIONSUFFIX= -1.el7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= audio linux MASTER_SITES= CENTOS_LINUX MASTER_SITE_SUBDIR= centos/${LINUX_DIST_VER}/os/Source/SPackages/ \ @@ -19,10 +19,9 @@ COMMENT= OSS plugin for ALSA (Linux CentOS ${LINUX_DIS LICENSE= LGPL21+ -USES= autoreconf:build linux:c7 +USES= autoreconf:build gmake libtool:build linux:c7 pkgconfig USE_LDCONFIG= yes -USE_LINUX= alsalib:build,run alsa-lib-devel:build devtools:build \ - make:build +USE_LINUX= alsalib:build,run alsa-lib-devel:build devtools:build USE_LINUX_PREFIX=yes RPM_PATCHES= alsa-plugins-1.1.6-post.patch \ @@ -31,13 +30,8 @@ CONFIG_ARGS= --disable-static --disable-mix --disable- --disable-arcamav --disable-jack --disable-pulseaudio \ --disable-samplerate --disable-libav --disable-a52 \ --disable-lavrate --disable-speexdsp --with-speex=no -CFLAGS+= -DFREEBSD_OSS -DFREEBSD_OSS_USE_IO_PTR -DFREEBSD_OSS_BUFSZ_P2 -CFLAGS_amd64= -nostdinc -isystem \ - ${LINUXBASE}/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include \ - -isystem /usr/include -CFLAGS_i386= -nostdinc -isystem \ - ${LINUXBASE}/usr/lib/gcc/i686-redhat-linux/4.8.5/include \ - -isystem /usr/include +CPPFLAGS+= -DFREEBSD_OSS -DFREEBSD_OSS_USE_IO_PTR +CFLAGS+= --sysroot=${LINUXBASE} COMPAT32_CFLAGS_amd64= -m32 LIBDIR_amd64= /usr/lib64 LIBDIR_i386= /usr/lib @@ -48,6 +42,8 @@ CONFLICTS= linux-c6-${PORTNAME}${PKGNAMESUFFIX}-[0-9]* DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr PLIST= ${PKGDIR}/pkg-plist.${ARCH} +.include + post-extract: .if !empty(COMPAT32_CFLAGS_${ARCH}) @${MKDIR} ${WRKDIR}/32 @@ -58,6 +54,8 @@ post-extract: ${PORTNAME}-${PORTVERSION}.tar.bz2 ${EXTRACT_AFTER_ARGS}) do-patch: + @${REINPLACE_CMD} 's/mkdir -p/$$(MKDIR_P)/' \ + ${WRKDIR}/alsa-plugins-1.1.6-post.patch .for p in ${RPM_PATCHES} .if !empty(COMPAT32_CFLAGS_${ARCH}) @${PATCH} -d ${WRKSRC32} --forward --quiet -E -p1 < ${WRKDIR}/${p} @@ -74,28 +72,38 @@ do-patch: do-configure: .if !empty(COMPAT32_CFLAGS_${ARCH}) @(cd ${WRKSRC32} && ${AUTORECONF} -f -i && ${SETENV} \ + PATH=${LINUXBASE}/usr/bin ./configure CPPFLAGS="${CPPFLAGS}" \ + CFLAGS="${CFLAGS} ${COMPAT32_CFLAGS_${ARCH}}" \ + LDFLAGS="${LDFLAGS}" MAKE="${LOCALBASE}/bin/gmake" \ + MKDIR_P="${MKDIR}" PKG_CONFIG="${LOCALBASE}/bin/pkgconf" \ PKG_CONFIG_PATH=${LINUXBASE}/usr/lib/pkgconfig \ - ${LINUXBASE}/bin/sh ./configure \ - CFLAGS="${CFLAGS} ${COMPAT32_CFLAGS_${ARCH}}" ${CONFIG_ARGS}) + ${CONFIG_ARGS}) .endif @(cd ${WRKSRC} && ${AUTORECONF} -f -i && ${SETENV} \ + PATH=${LINUXBASE}/usr/bin ./configure CPPFLAGS="${CPPFLAGS}" \ + CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \ + MAKE="${LOCALBASE}/bin/gmake" MKDIR_P="${MKDIR}" \ + PKG_CONFIG="${LOCALBASE}/bin/pkgconf" \ PKG_CONFIG_PATH=${LINUXBASE}${LIBDIR_${ARCH}}/pkgconfig \ - ${LINUXBASE}/bin/sh ./configure --libdir ${LIBDIR_${ARCH}} \ - CFLAGS="${CFLAGS}" ${CONFIG_ARGS}) + --libdir ${LIBDIR_${ARCH}} ${CONFIG_ARGS}) do-build: .if !empty(COMPAT32_CFLAGS_${ARCH}) - @(cd ${WRKSRC32} && ${LINUXBASE}/usr/bin/make) + @(cd ${WRKSRC32} && ${SETENV} PATH=${LINUXBASE}/usr/bin \ + ${LOCALBASE}/bin/gmake) .endif - @(cd ${WRKSRC} && ${LINUXBASE}/usr/bin/make) + @(cd ${WRKSRC} && ${SETENV} PATH=${LINUXBASE}/usr/bin \ + ${LOCALBASE}/bin/gmake) do-install: .if !empty(COMPAT32_CFLAGS_${ARCH}) - @(cd ${WRKSRC32} && ${LINUXBASE}/usr/bin/make install-strip \ + @(cd ${WRKSRC32} && ${SETENV} PATH=${LINUXBASE}/usr/bin \ + ${LOCALBASE}/bin/gmake install-strip \ DESTDIR=${STAGEDIR}${LINUXBASE}) ${RM} -r ${STAGEDIR}${LINUXBASE}/usr/lib/alsa-lib/*.la .endif - @(cd ${WRKSRC} && ${LINUXBASE}/usr/bin/make install-strip \ + @(cd ${WRKSRC} && ${SETENV} PATH=${LINUXBASE}/usr/bin \ + ${LOCALBASE}/bin/gmake install-strip \ DESTDIR=${STAGEDIR}${LINUXBASE}) ${RM} -r ${STAGEDIR}${LINUXBASE}${LIBDIR_${ARCH}}/alsa-lib/*.la ${RM} -r ${STAGEDIR}${LINUXBASE}/etc ${STAGEDIR}${LINUXBASE}/usr/share