[99528] trunk/dports/science/uhd

michaelld at macports.org michaelld at macports.org
Thu Nov 8 07:02:15 PST 2012


Revision: 99528
          http://trac.macports.org//changeset/99528
Author:   michaelld at macports.org
Date:     2012-11-08 07:02:15 -0800 (Thu, 08 Nov 2012)
Log Message:
-----------
uhd and uhd-devel : change image downloader patch to match forthcoming commit; no rev-bump since this does not change the actual installed files.  Other minor port tweaks, too.

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

Modified: trunk/dports/science/uhd/Portfile
===================================================================
--- trunk/dports/science/uhd/Portfile	2012-11-08 14:30:05 UTC (rev 99527)
+++ trunk/dports/science/uhd/Portfile	2012-11-08 15:02:15 UTC (rev 99528)
@@ -8,7 +8,6 @@
 categories          science
 maintainers         michaelld openmaintainer
 description         Universal Hardware Driver for Ettus Research products
-long_description    ${description}
 license             GPL-3+
 
 homepage            https://ettus-apps.sourcerepo.com/redmine/ettus/projects/uhd/wiki
@@ -18,6 +17,9 @@
 
 if {${subport} == ${name}} {
 
+    long_description ${description}: \
+Provides the release version, which is typically updated every month or so.
+
     version         003_005_000
     distname        release_${version}
     worksrcdir      UHD-Mirror-${distname}
@@ -26,10 +28,18 @@
     checksums       sha1   b0277c1fa72ac4f818d39d0830d5a42d8b059395 \
                     rmd160  2736897c26823b20be6f7ec7ee89b0bccbe5fb63
 
+    # temporary patch to image downloader to separate download and
+    # install directories; will be fixed in upcoming release.
+
+    patchfiles      patch-image-download.diff
+
 }
 
 subport uhd-devel {
 
+    long_description ${description}: \
+Provides the GIT master version, which is typically updated every few days to week.
+
     version         003_005_000_git
     fetch.type      git
     git.url         https://github.com/EttusResearch/UHD-Mirror.git
@@ -38,6 +48,11 @@
     conflicts       uhd
     livecheck.type  none
 
+    # temporary patch to image downloader to separate download and
+    # install directories; will be fixed in upcoming commit.
+
+    patchfiles      patch-image-download.diff
+
 }
 
 depends_lib-append	port:boost
@@ -48,16 +63,13 @@
 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
 
 configure.post_args ../${worksrcdir}/host
 
-# explicitly set configure args -D cmake flags to get MacPorts' curses
+# explicitly set configure args -D cmake flags to get MacPorts'
+# curses; these are used by some variants, but they don't hurt.
 
 configure.args-append \
     -DCURSES_CURSES_H_PATH=${prefix}/include \
@@ -72,7 +84,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 --install-location=${destroot}${prefix}/share/uhd/images"
+    system "${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --install-location=${destroot}${prefix}/share/uhd/images"
 }
 
 # set Python variants

Modified: trunk/dports/science/uhd/files/patch-image-download.diff
===================================================================
--- trunk/dports/science/uhd/files/patch-image-download.diff	2012-11-08 14:30:05 UTC (rev 99527)
+++ trunk/dports/science/uhd/files/patch-image-download.diff	2012-11-08 15:02:15 UTC (rev 99528)
@@ -1,11 +1,24 @@
---- 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 @@
+--- host/utils/uhd_images_downloader.py.in.orig
++++ host/utils/uhd_images_downloader.py.in
+@@ -16,11 +16,13 @@
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
  
++import atexit
+ from optparse import OptionParser
+ import os
+ import os.path
+ import shutil
+ import sys
++import tempfile
+ import urllib2
+ import zipfile
+ 
+@@ -28,18 +30,24 @@ if __name__ == "__main__":
+ 
      #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()
@@ -13,19 +26,14 @@
      #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)
++    #Create temporary directory
++    download_dir = tempfile.mkdtemp()
++    atexit.register(lambda: shutil.rmtree(download_dir))
 +
-+    #make sure we download into the correct directory
-+    os.chdir (download_dir)
++    #Make sure we download into the correct directory
++    os.chdir(download_dir)
 +
      #Configuring image destination
 -    cmake_install_prefix = "@CMAKE_INSTALL_PREFIX@"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121108/b3215757/attachment.html>


More information about the macports-changes mailing list