From owner-freebsd-ports@FreeBSD.ORG Wed Jul 2 00:11:25 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42D21A27; Wed, 2 Jul 2014 00:11:25 +0000 (UTC) Received: from mail-pd0-x235.google.com (mail-pd0-x235.google.com [IPv6:2607:f8b0:400e:c02::235]) (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 0D70C2F74; Wed, 2 Jul 2014 00:11:25 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id v10so10804140pde.26 for ; Tue, 01 Jul 2014 17:11:24 -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:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+hhNZJs0fDC+rundHFaiY9esk5g5qSuC05RYhk4aSkU=; b=H7/4wRXRQ+ZVYRSGJgjpMd5isvlWF8a9vxR/+5sn1dbaP/gQp+NyTZ2oARBf3OLqwl WjMD7dFRhbPZ07ajeVvPAN4sdZtxCjBdsk6KA9YOIjLGVRHYnSUq5SZgtR0DOGsDAgrf ZczWrXs4HZW1e/cY01fBVHkYUGrq0fM/0kONhjwEHLutWXzay2eMh4+YBHa8YshV0nKo TwZSn0WYjZZ/hWmnJEbr+Gmnnfv3kAg4RzQaqu6f7sFLGDBbasYgVwgMzpaUhkkfa4cu G0ZBsWV0AodnkoAps17W/quWiqPc3jVvLypaZAesDoFAw1NGThf1uk/iUjmaDyzdZBWj Y81Q== X-Received: by 10.68.57.194 with SMTP id k2mr8722831pbq.67.1404259884720; Tue, 01 Jul 2014 17:11:24 -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 kl10sm34419294pbd.20.2014.07.01.17.11.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 17:11:24 -0700 (PDT) Sender: Kubilay Kocak Message-ID: <53B34E27.7090808@FreeBSD.org> Date: Wed, 02 Jul 2014 10:11:19 +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 Subject: Re: port - python dependencies and github master References: <53B33B12.8030005@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-ports 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: Wed, 02 Jul 2014 00:11:25 -0000 On 2/07/2014 9:44 AM, CeDeROM wrote: > Hello Koobs and thank you for your hints!! :-) > > On Wed, Jul 2, 2014 at 12:49 AM, Kubilay Kocak wrote: >>> 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. > > Ugh, thats the problem. I have notcied that :-( At least for the first > time I change the Makefile both RELEASE and DEVEL works, but then it > does not work... just as Makefile was somehow cached and remembers > PORTVERSION even if I change its value it still use the old value or > any numeric value which is found on the Makefile even inside > conditional statement.. strange :-) > > >> 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) > > I would like to make a port to build a package by default, but also I > would like to have option to build a devel package. No additional port > for that is necessary. That would save frequent port updates, just one > smart Makefile that would do the job :-) This seems sensible, but I > have noticed checksum problems here when PORTVERSION is changed on the > fly.. The first question is do you want these ports in the ports tree, or just to keep locally? If you want them in the tree, then a separate py-foo and py-foo-devel is recommended. If not, you may be able to get away with a single port that can build both. That's a more involved discussion that is best done on IRC in real-time, and you'll benefit from more people to talk to who might have different suggestions to achieve what you want > Other question if additional cura-devel port is mandatory - how can I > fetch HEAD and then get the commit number to add to the package name > to distinguish different builds? If PORTVERSION must be static, then > should I add some package suffix that can be based on a dynamic > value/variable? Unfortunately master/head/tip are moving targets and the commit hash changes over time. You can however, pin to a particular commit using the hash as the tag: GH_TAGNAME=${GH_COMMIT} GH_COMMIT= > >>> 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 > > ACK! :-) > > >>> 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). > > ACK! :-) > > >>> 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. > > ACK! :-) > > >>> 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/ > > I know the Porter's Handbook, but there is no information on how to > verify the dependencies on python modules. Using > ${PYTHON_PKGNAMEPREFIX} would search for binaries, which is not the > case. This is why I have "invented" ${PYTHONPREFIX_SITELIBDIR}/OpenGL > which works well and checks if a given python module is available :-) You 'can' check for the existence of files in sitelibdir or site-packages, but you want to consider how robust it is compared to depending on the package instead (${PYTHON_PKGNAMEPREFIX}) With this option, you have the option to use version checks such as >, >=, ==, etc, which you can't with files. This is beneficial in most scenarios. Rule of thumb: Use any of file, dir, executable or package, default to package name, and use the others if and when there is a good reason to. > >> 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 > > Thank you I will connect that way! :-) > > Best regards :-) > Tomek > You're welcome! -- koobs