Changeset 99528
- Timestamp:
- Nov 8, 2012, 3:02:15 PM (11 years ago)
- Location:
- trunk/dports/science/uhd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dports/science/uhd/Portfile
r99486 r99528 9 9 maintainers michaelld openmaintainer 10 10 description Universal Hardware Driver for Ettus Research products 11 long_description ${description}12 11 license GPL-3+ 13 12 … … 19 18 if {${subport} == ${name}} { 20 19 20 long_description ${description}: \ 21 Provides the release version, which is typically updated every month or so. 22 21 23 version 003_005_000 22 24 distname release_${version} … … 27 29 rmd160 2736897c26823b20be6f7ec7ee89b0bccbe5fb63 28 30 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 29 36 } 30 37 31 38 subport uhd-devel { 39 40 long_description ${description}: \ 41 Provides the GIT master version, which is typically updated every few days to week. 32 42 33 43 version 003_005_000_git … … 38 48 conflicts uhd 39 49 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 40 55 41 56 } … … 49 64 build.dir ${workpath}/build 50 65 51 # patch image downloader to separate download and install directories52 53 patchfiles patch-image-download.diff54 55 66 # set last configure argument to the reletive path 56 67 # to the top-level cmake source … … 58 69 configure.post_args ../${worksrcdir}/host 59 70 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. 61 73 62 74 configure.args-append \ … … 73 85 74 86 post-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" 76 88 } 77 89 -
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__": 4 18 5 19 #Command line options 6 20 parser = OptionParser() 7 21 - 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]")9 22 + parser.add_option("--install-location", type="string", default="@CMAKE_INSTALL_PREFIX@/share/uhd/images", help="Set custom install location for images, [default=%default]") 10 23 parser.add_option("--buffer-size", type="int", default=8192, help="Set download buffer size, [default=%default]",) … … 14 27 images_src = "@UHD_IMAGES_DOWNLOAD_SRC@" 15 28 filename = images_src.split("/")[-1] 29 - 16 30 + 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)) 26 34 + 27 + # make sure we download into the correct directory28 + os.chdir 35 + #Make sure we download into the correct directory 36 + os.chdir(download_dir) 29 37 + 30 38 #Configuring image destination
Note: See TracChangeset
for help on using the changeset viewer.