From owner-freebsd-ports@FreeBSD.ORG Tue Jul 1 22:50:01 2014 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 ESMTPS id 94D9D24F; Tue, 1 Jul 2014 22:50:01 +0000 (UTC) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61802287B; Tue, 1 Jul 2014 22:50:01 +0000 (UTC) Received: by mail-pa0-f42.google.com with SMTP id lj1so11413640pab.1 for ; Tue, 01 Jul 2014 15:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Ct2b1588hEJw40S7fNZNWGG0//vHrrR7zcQMl0htAXM=; b=L9C5YkYAPVGPn+AImtXz+8CePSxJd0/PDTxr0LpJ5j+vsd0b5Bv7M+UkwBQRQ61Ulz PWg3gG80FTOez5OEJ6PiZ2kmLHWhjPhZiW69iFMNJpLE9lS2o2SR9cH4gKBIszynIuHm tASjgQmQfYUppMcMhksqtbGZZnZcsAjeFkYrODlzl6PtoJHywkJdkrsuaFfBSi6DGymX FMR1pGvVpL7oKkdGKGmluiKjJJqV91cJZD3xqUx4qoWp9qsJz4KuWE9Mnmt6ej3MGe5n 03yuVZgZbDUoZ/zGix//Fkv8RkcytssQyTTkUWTZMxmHN8kgbU+MJb//JibTLvAxPrMD 7vxg== X-Received: by 10.68.164.4 with SMTP id ym4mr65444790pbb.53.1404255000799; Tue, 01 Jul 2014 15:50:00 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b00:1150:8648:fc49:e3e7? (2001-44b8-31ae-7b00-1150-8648-fc49-e3e7.static.ipv6.internode.on.net. [2001:44b8:31ae:7b00:1150:8648:fc49:e3e7]) by mx.google.com with ESMTPSA id wp3sm34230713pbc.67.2014.07.01.15.49.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 15:50:00 -0700 (PDT) Sender: Kubilay Kocak Message-ID: <53B33B12.8030005@FreeBSD.org> Date: Wed, 02 Jul 2014 08:49:54 +1000 From: Kubilay Kocak Reply-To: koobs@FreeBSD.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: CeDeROM , freebsd-ports , freebsd-hackers@freebsd.org Subject: Re: port - python dependencies and github master References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 22:50:01 -0000 On 1/07/2014 11:56 PM, CeDeROM wrote: > Hello there :-) > > I am writing a Makefile to a Python based port that gets the source > code from GitHub. Two questions: > > 1. How to change PORTVERSION / GH_COMMIT based on user choice / > option? One value for PORTVERSION seems fine but to change it to > master does not work.. You very probably don't want to do this. PORTVERSION needs to be static, in the sense that it can't be conditional. This is because PORTVERSION plus a few other variables is how the ports framework derives DISTFILES, who's checksums must remain consistent unless changed/updated by the maintainer (see distinfo file) > 2. Is the way to check python modules dependency correct? > > PORTNAME= cura > PORTVERSION= 14.06 > #STABLEREL= 14.06 > CATEGORIES= cad Add the 'python' category as a secondary category to Python ports > MAINTAINER= blah@blah > COMMENT= Cura is a complete and open slicing solution for > RepRap 3D printers. Don't include the package/software name or indefinite articles (A/An) in COMMENT. Also strip the trailing full stop (period). For more detail, see: http://www2.au.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#makefile-comment portlint(8) will also help here. > > OPTIONS_SINGLE= BTYPE > OPTIONS_SINGLE_BTYPE= RELEASE DEVEL > OPTIONS_SUB= yes > RELEASE_DESC= Build latest stable release from github (${PORTVERSION}) > DEVEL_DESC= Build latest development snapshot from github master > OPTIONS_DEFAULT= RELEASE > > .include > > #.if ${PORT_OPTIONS:MRELEASE} > #PORTVERSION= ${STABLEREL} > #.endif > > .if ${PORT_OPTIONS:MDEVEL} > PORTVERSION= master > #STABLEREL= master > .endif > > #PORTVERSION= ${STABLEREL} > > USE_PYTHON= yes You at least want USE_PYDISTUTILS=yes here, and maybe PYDISTUTILS_AUTOPLIST=yes also. See /usr/ports/Mk/bsd.python.mk for more information. > RUN_DEPENDS+= First assignment of {RUN,BUILD}_DEPENDS should be = not += > ${PYTHONPREFIX_SITELIBDIR}/OpenGL:${PORTSDIR}/graphics/py-opengl \ > ${PYTHONPREFIX_SITELIBDIR}/numpy:${PORTSDIR}/math/py-numpy \ > > ${PYTHONPREFIX_SITELIBDIR}/setuptools:${PORTSDIR}/devel/py-setuptools > \ > ${PYTHONPREFIX_SITELIBDIR}/serial:${PORTSDIR}/comms/py-serial > BUILD_DEPENDS+= git:${PORTSDIR}/devel/git If you're not depending on a binary (like the git line above), the simplest way is to depend on the package names. Eg: ${PYTHON_PKGNAMEPREFIX}setuptools>[0|]:${PORTSDIR}/category/ The following section of the Porters Handbook describes dependencies very well: http://www2.au.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#makefile-depend portlint(8) is also your friend here, and will tell you about a few things if you don't get it quite right, first time. > USE_GITHUB= yes > GH_ACCOUNT= daid > GH_COMMIT= ${PORTVERSION} If you need any porting help, we have a few IRC channels available for you: 1) #freebsd-ports - freenode 2) #freebsd-python - freenode 3) #bsdports - Efnet -- koobs