From owner-freebsd-ports@FreeBSD.ORG Thu Aug 1 14:24:58 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9991CD6 for ; Thu, 1 Aug 2013 14:24:58 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA78425FC for ; Thu, 1 Aug 2013 14:24:58 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id o19so3757534qap.13 for ; Thu, 01 Aug 2013 07:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cWQJ5atJwHAPM/cnzsTLsJxsibL+Umb17ttMP2BPqXw=; b=KlokiVtlSuu/9cO6Tkhlw1qUnm6wEX+ZamJWRkqG+aaXEbcvX3Zs7kjYQw5S4VXZOG b1scgqDwuRUK2p527sfFJHKPLCTrCs9YKZ66JNjeoU9rVYkiqZ0EWasu8yD6VUlpi0K9 8JpSCSgvjtMWXVfYSgZi/HIcGpAOlX7Tlu4Tm0w1uWbHwRQjrJ0+YsK9Bwc+fWhMzgPP wTfjbPVPTSPnZ0W80LvC4ED2m5EJn2E0q3hHJvRtx4fLcRqrOm0VnX+wa74+A39UTi2V TWXI/N3rDOIJFXD9RypsoJ3iee3AUBn8RD6wlbMzOGAgB58TBXjzfnju9IarHVboz5aC mHpw== MIME-Version: 1.0 X-Received: by 10.49.50.198 with SMTP id e6mr2405881qeo.76.1375367092266; Thu, 01 Aug 2013 07:24:52 -0700 (PDT) Received: by 10.224.78.194 with HTTP; Thu, 1 Aug 2013 07:24:52 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Aug 2013 17:24:52 +0300 Message-ID: Subject: Re: Idea for Mk/Uses snippet From: Kimmo Paasiala To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 14:24:59 -0000 On Thu, Aug 1, 2013 at 2:59 PM, Kimmo Paasiala wrote: > On Thu, Aug 1, 2013 at 2:03 PM, Kimmo Paasiala wrote: >> There are quite a few ports that require system sources to be present >> at /usr/src. >> >> Would it make sense to create Mk/Uses snippet (for example named as >> Mk/Uses/system-sources) that checks for let's say /usr/src/Makefile >> and throws an error if the file is not present? >> >> A port that requires the system sources to be present (for example >> sysutils/lsof) could then just say: >> >> USES= ... system-sources .. >> >> What do you think? >> >> -Kimmo > > Something as simple as this: > > .if !defined(_INCLUDE_USES_SYSTEM_SOURCES_MK) > _INCLUDE_USES_SYSTEM_SOURCES_MK= yes > > > .if !exists(${SRC_BASE}/Makefile) > IGNORE= This port requires the system sources installed at ${SRC_BASE} > .endif > > .endif > > Is there still a need to check for kernel sources separately? I would > imagine that everyone checks out the whole src tree now. > > -Kimmo Ok, I hadn't read the porter's handbook before I wrote the above and the handbook suggests that kernel sources should be checked as: .if !exists(${SRC_BASE}/sys/Makefile) IGNORE= requires kernel sources to be installed .endif Do ports actually depend on the full system sources or is it just the kernel sources part under ${SRC_BASE}/sys ? If it's only the kernelt this could still be turned into Mk/Uses/kernel-sources.mk snippet to avoid repeating the above for every port that needs the kernel sources. -Kimmo