[99486] trunk/dports/science/uhd

michaelld at macports.org michaelld at macports.org
Wed Nov 7 07:01:05 PST 2012


Revision: 99486
          http://trac.macports.org//changeset/99486
Author:   michaelld at macports.org
Date:     2012-11-07 07:01:05 -0800 (Wed, 07 Nov 2012)
Log Message:
-----------
uhd :
* fix images downloader
* add uhd-devel subport for latest GIT master

Modified Paths:
--------------
    trunk/dports/science/uhd/Portfile

Added Paths:
-----------
    trunk/dports/science/uhd/files/
    trunk/dports/science/uhd/files/patch-image-download.diff

Modified: trunk/dports/science/uhd/Portfile
===================================================================
--- trunk/dports/science/uhd/Portfile	2012-11-07 13:59:45 UTC (rev 99485)
+++ trunk/dports/science/uhd/Portfile	2012-11-07 15:01:05 UTC (rev 99486)
@@ -3,13 +3,8 @@
 
 PortSystem          1.0
 PortGroup           cmake 1.0
-PortGroup           github 1.0
 
-github.setup        EttusResearch UHD-Mirror 003_005_000 release_
-
-# override name from github PortGroup
 name                uhd
-
 categories          science
 maintainers         michaelld openmaintainer
 description         Universal Hardware Driver for Ettus Research products
@@ -19,11 +14,32 @@
 homepage            https://ettus-apps.sourcerepo.com/redmine/ettus/projects/uhd/wiki
 platforms           darwin
 
-checksums           sha1	efaeb888d9f2f7c9f219d140b3c924f93155d72c \
-                    rmd160	458367c42ba02219183f74ecfa4dc56c2fd290db
+dist_subdir         uhd
 
-worksrcdir          ${name}-${version}
+if {${subport} == ${name}} {
 
+    version         003_005_000
+    distname        release_${version}
+    worksrcdir      UHD-Mirror-${distname}
+    master_sites    https://github.com/EttusResearch/UHD-Mirror/archive
+    conflicts       uhd-devel
+    checksums       sha1   b0277c1fa72ac4f818d39d0830d5a42d8b059395 \
+                    rmd160  2736897c26823b20be6f7ec7ee89b0bccbe5fb63
+
+}
+
+subport uhd-devel {
+
+    version         003_005_000_git
+    fetch.type      git
+    git.url         https://github.com/EttusResearch/UHD-Mirror.git
+    git.branch      79a26e96676d7260f492728ba61b237a402df926
+    worksrcdir      UHD-Mirror-release-${version}
+    conflicts       uhd
+    livecheck.type  none
+
+}
+
 depends_lib-append	port:boost
 
 # do VPATH build
@@ -32,6 +48,10 @@
 configure.dir       ${workpath}/build
 build.dir           ${workpath}/build
 
+# patch image downloader to separate download and install directories
+
+patchfiles           patch-image-download.diff
+
 # set last configure argument to the reletive path
 # to the top-level cmake source
 
@@ -52,7 +72,7 @@
 # so that they are also tracked by MacPorts
 
 post-destroot {
-    system "${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --download-location=${destroot}${prefix}/share/uhd/images"
+    system "${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --download-location=${destroot}${prefix}/share/uhd --install-location=${destroot}${prefix}/share/uhd/images"
 }
 
 # set Python variants

Added: trunk/dports/science/uhd/files/patch-image-download.diff
===================================================================
--- trunk/dports/science/uhd/files/patch-image-download.diff	                        (rev 0)
+++ trunk/dports/science/uhd/files/patch-image-download.diff	2012-11-07 15:01:05 UTC (rev 99486)
@@ -0,0 +1,38 @@
+--- host/utils/uhd_images_downloader.py.in.orig	2012-11-06 21:42:35.000000000 -0500
++++ host/utils/uhd_images_downloader.py.in	2012-11-06 21:58:25.000000000 -0500
+@@ -28,18 +28,31 @@
+ 
+     #Command line options
+     parser = OptionParser()
+-    parser.add_option("--download-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd/images", help="Set custom download location for images, [default=%default]")
++    parser.add_option("--download-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd", help="Set custom download location for images, [default=%default]")
++    parser.add_option("--install-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd/images", help="Set custom install location for images, [default=%default]")
+     parser.add_option("--buffer-size", type="int", default=8192, help="Set download buffer size, [default=%default]",)
+     (options, args) = parser.parse_args()
+     
+     #Configuring image download info
+     images_src = "@UHD_IMAGES_DOWNLOAD_SRC@"
+     filename = images_src.split("/")[-1]
++
++    #Configuring download destination
++    if options.download_location != "":
++        download_dir = options.download_location
++    else:
++        download_dir = "@CMAKE_INSTALL_PREFIX@/share/uhd/tmp"
+     
++    #create download_dir if it does not exist
++    if not os.path.exists(download_dir):
++        os.mkdir (download_dir)
++
++    #make sure we download into the correct directory
++    os.chdir (download_dir)
++
+     #Configuring image destination
+-    cmake_install_prefix = "@CMAKE_INSTALL_PREFIX@"
+-    if options.download_location != "":
+-        images_dir = options.download_location
++    if options.install_location != "":
++        images_dir = options.install_location
+     else:
+         images_dir = "@CMAKE_INSTALL_PREFIX@/share/uhd/images"
+     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121107/e9ff75de/attachment.html>


More information about the macports-changes mailing list