Changeset 99528


Ignore:
Timestamp:
Nov 8, 2012, 3:02:15 PM (11 years ago)
Author:
michaelld@…
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.

Location:
trunk/dports/science/uhd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/science/uhd/Portfile

    r99486 r99528  
    99maintainers         michaelld openmaintainer
    1010description         Universal Hardware Driver for Ettus Research products
    11 long_description    ${description}
    1211license             GPL-3+
    1312
     
    1918if {${subport} == ${name}} {
    2019
     20    long_description ${description}: \
     21Provides the release version, which is typically updated every month or so.
     22
    2123    version         003_005_000
    2224    distname        release_${version}
     
    2729                    rmd160  2736897c26823b20be6f7ec7ee89b0bccbe5fb63
    2830
     31    # temporary patch to image downloader to separate download and
     32    # install directories; will be fixed in upcoming release.
     33
     34    patchfiles      patch-image-download.diff
     35
    2936}
    3037
    3138subport uhd-devel {
     39
     40    long_description ${description}: \
     41Provides the GIT master version, which is typically updated every few days to week.
    3242
    3343    version         003_005_000_git
     
    3848    conflicts       uhd
    3949    livecheck.type  none
     50
     51    # temporary patch to image downloader to separate download and
     52    # install directories; will be fixed in upcoming commit.
     53
     54    patchfiles      patch-image-download.diff
    4055
    4156}
     
    4964build.dir           ${workpath}/build
    5065
    51 # patch image downloader to separate download and install directories
    52 
    53 patchfiles           patch-image-download.diff
    54 
    5566# set last configure argument to the reletive path
    5667# to the top-level cmake source
     
    5869configure.post_args ../${worksrcdir}/host
    5970
    60 # explicitly set configure args -D cmake flags to get MacPorts' curses
     71# explicitly set configure args -D cmake flags to get MacPorts'
     72# curses; these are used by some variants, but they don't hurt.
    6173
    6274configure.args-append \
     
    7385
    7486post-destroot {
    75     system "${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --download-location=${destroot}${prefix}/share/uhd --install-location=${destroot}${prefix}/share/uhd/images"
     87    system "${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --install-location=${destroot}${prefix}/share/uhd/images"
    7688}
    7789
  • trunk/dports/science/uhd/files/patch-image-download.diff

    r99486 r99528  
    1 --- host/utils/uhd_images_downloader.py.in.orig 2012-11-06 21:42:35.000000000 -0500
    2 +++ host/utils/uhd_images_downloader.py.in      2012-11-06 21:58:25.000000000 -0500
    3 @@ -28,18 +28,31 @@
     1--- host/utils/uhd_images_downloader.py.in.orig
     2+++ host/utils/uhd_images_downloader.py.in
     3@@ -16,11 +16,13 @@
     4 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     5 #
     6 
     7+import atexit
     8 from optparse import OptionParser
     9 import os
     10 import os.path
     11 import shutil
     12 import sys
     13+import tempfile
     14 import urllib2
     15 import zipfile
     16 
     17@@ -28,18 +30,24 @@ if __name__ == "__main__":
    418 
    519     #Command line options
    620     parser = OptionParser()
    721-    parser.add_option("--download-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd/images", help="Set custom download location for images, [default=%default]")
    8 +    parser.add_option("--download-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd", help="Set custom download location for images, [default=%default]")
    922+    parser.add_option("--install-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd/images", help="Set custom install location for images, [default=%default]")
    1023     parser.add_option("--buffer-size", type="int", default=8192, help="Set download buffer size, [default=%default]",)
     
    1427     images_src = "@UHD_IMAGES_DOWNLOAD_SRC@"
    1528     filename = images_src.split("/")[-1]
     29-   
    1630+
    17 +    #Configuring download destination
    18 +    if options.download_location != "":
    19 +        download_dir = options.download_location
    20 +    else:
    21 +        download_dir = "@CMAKE_INSTALL_PREFIX@/share/uhd/tmp"
    22      
    23 +    #create download_dir if it does not exist
    24 +    if not os.path.exists(download_dir):
    25 +        os.mkdir (download_dir)
     31+    #Create temporary directory
     32+    download_dir = tempfile.mkdtemp()
     33+    atexit.register(lambda: shutil.rmtree(download_dir))
    2634+
    27 +    #make sure we download into the correct directory
    28 +    os.chdir (download_dir)
     35+    #Make sure we download into the correct directory
     36+    os.chdir(download_dir)
    2937+
    3038     #Configuring image destination
Note: See TracChangeset for help on using the changeset viewer.