libsdl_ttf: add .zip download sources on Windows (#2615)

* libsdl_ttf: add .zip download sources on Windows

sdl_ttf cannot be installed without using precompiled.

I think xmake should disable symlink extraction (there's the same problem with sfml)

```
  => download https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-2.20.2.tar.gz .. failed
C:\Program Files\xmake\winenv\bin\7z x -y SDL2_ttf-2.20.2.tar.gz -oC:\Users\lynix\AppData\Local\Temp\.xmake\230918\_B21627892EB948108F44065483A74B70.tar

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 13161592 bytes (13 MiB)

Extracting archive: SDL2_ttf-2.20.2.tar.gz
--
Path = SDL2_ttf-2.20.2.tar.gz
Type = gzip
Headers Size = 10

Everything is Ok

Size:       42510336
Compressed: 13161592
C:\Program Files\xmake\winenv\bin\7z x -y C:\Users\lynix\AppData\Local\Temp\.xmake\230918\_B21627892EB948108F44065483A74B70.tar\SDL2_ttf-2.20.2.tar -osource.tmp

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 42510336 bytes (41 MiB)

Extracting archive: C:\Users\lynix\AppData\Local\Temp\.xmake\230918\_B21627892EB948108F44065483A74B70.tar\SDL2_ttf-2.20.2.tar
--
Path = C:\Users\lynix\AppData\Local\Temp\.xmake\230918\_B21627892EB948108F44065483A74B70.tar\SDL2_ttf-2.20.2.tar
Type = tar
Physical Size = 42510336
Headers Size = 800768
Code Page = UTF-8

ERROR: Can not create symbolic link : Le client ne dispose pas d'un privilège nécessaire. : source.tmp\SDL2_ttf-2.20.2\Xcode\macOS\SDL2.framework\Resources
ERROR: Can not create symbolic link : Le client ne dispose pas d'un privilège nécessaire. : source.tmp\SDL2_ttf-2.20.2\Xcode\macOS\SDL2.framework\Headers
ERROR: Can not create symbolic link : Le client ne dispose pas d'un privilège nécessaire. : source.tmp\SDL2_ttf-2.20.2\Xcode\macOS\SDL2.framework\SDL2
ERROR: Can not create symbolic link : Le client ne dispose pas d'un privilège nécessaire. : source.tmp\SDL2_ttf-2.20.2\Xcode\macOS\SDL2.framework\Versions\Current

Sub items Errors: 4

Archives with Errors: 1

Sub items Errors: 4
tar -xf C:\Users\lynix\AppData\Local\Temp\.xmake\230918\_B21627892EB948108F44065483A74B70.tar\SDL2_ttf-2.20.2.tar
SDL2_ttf-2.20.2/Xcode/macOS/SDL2.framework/Resources: Can't create '\\\\?\\C:\\Users\\lynix\\AppData\\Local\\.xmake\\cache\\packages\\2309\\l\\libsdl_ttf\\2.20.2\\source.tmp\\SDL2_ttf-2.20.2\\Xcode\\macOS\\SDL2.framework\\Resources'
SDL2_ttf-2.20.2/Xcode/macOS/SDL2.framework/Headers: Can't create '\\\\?\\C:\\Users\\lynix\\AppData\\Local\\.xmake\\cache\\packages\\2309\\l\\libsdl_ttf\\2.20.2\\source.tmp\\SDL2_ttf-2.20.2\\Xcode\\macOS\\SDL2.framework\\Headers'
SDL2_ttf-2.20.2/Xcode/macOS/SDL2.framework/SDL2: Can't create '\\\\?\\C:\\Users\\lynix\\AppData\\Local\\.xmake\\cache\\packages\\2309\\l\\libsdl_ttf\\2.20.2\\source.tmp\\SDL2_ttf-2.20.2\\Xcode\\macOS\\SDL2.framework\\SDL2'
SDL2_ttf-2.20.2/Xcode/macOS/SDL2.framework/Versions/Current: Can't create '\\\\?\\C:\\Users\\lynix\\AppData\\Local\\.xmake\\cache\\packages\\2309\\l\\libsdl_ttf\\2.20.2\\source.tmp\\SDL2_ttf-2.20.2\\Xcode\\macOS\\SDL2.framework\\Versions\\Current'
tar: Error exit delayed from previous errors.
error: ...modules\private\action\require\impl\actions\download.lua:213: cannot extract SDL2_ttf-2.20.2.tar.gz, maybe missing extractor or invalid package file!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:921]:
    [...modules\private\action\require\impl\actions\download.lua:213]: in function '_download'
    [...modules\private\action\require\impl\actions\download.lua:325]:

  => download https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.20.2.tar.gz .. failed

we can also download these packages manually:
  - https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-2.20.2.tar.gz
  - https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.20.2.tar.gz
to the local search directories:
  - libsdl_ttf-2.20.2.tar.gz, SDL2_ttf-2.20.2.tar.gz
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error: @programdir\modules\private\async\runjobs.lua:256: ...modules\private\action\require\impl\actions\download.lua:378:
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:921]:
    [...modules\private\action\require\impl\actions\download.lua:378]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...modules\private\action\require\impl\actions\download.lua:298]:
    [...modules\private\action\require\impl\install_packages.lua:472]: in function 'jobfunc'
    [@programdir\modules\private\async\runjobs.lua:232]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:921: in function 'os.raiselevel'
        (...tail calls...)
        @programdir\modules\private\async\runjobs.lua:256: in field 'catch'
        @programdir\core\sandbox\modules\try.lua:123: in global 'try'
        @programdir\modules\private\async\runjobs.lua:218: in upvalue 'cotask'
        @programdir\core\base\scheduler.lua:404: in function <@programdir\core\base\scheduler.lua:397>
```

* Update xmake.lua
pull/2616/merge
Jérôme Leclercq 2 years ago committed by GitHub
parent 1d0134075b
commit ac79ccde7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      packages/l/libsdl_ttf/xmake.lua

@ -11,11 +11,19 @@ package("libsdl_ttf")
add_extsources("brew::sdl2_ttf")
end
add_urls("https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$(version).tar.gz",
"https://github.com/libsdl-org/SDL_ttf/releases/download/release-$(version)/SDL2_ttf-$(version).tar.gz")
add_versions("2.20.0", "874680232b72839555a558b48d71666b562e280f379e673b6f0c7445ea3b9b8a")
add_versions("2.20.1", "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57")
add_versions("2.20.2", "9dc71ed93487521b107a2c4a9ca6bf43fb62f6bddd5c26b055e6b91418a22053")
if is_plat("windows", "mingw") then
add_urls("https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$(version).zip",
"https://github.com/libsdl-org/SDL_ttf/releases/download/release-$(version)/SDL2_ttf-$(version).zip")
add_versions("2.20.0", "04e94fc5ecac3475ab35c1d5cf52650df691867e7e4befcc861bf982a747111a")
add_versions("2.20.1", "18d81ab399c8e39adababe8918691830ba6e0d6448e5baa141ee0ddf87ede2dc")
add_versions("2.20.2", "aa6256bfcffd8381a75b3a2a2384ac12109b5b148e72722a19b0ede54c4051dc")
else
add_urls("https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$(version).tar.gz",
"https://github.com/libsdl-org/SDL_ttf/releases/download/release-$(version)/SDL2_ttf-$(version).tar.gz")
add_versions("2.20.0", "874680232b72839555a558b48d71666b562e280f379e673b6f0c7445ea3b9b8a")
add_versions("2.20.1", "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57")
add_versions("2.20.2", "9dc71ed93487521b107a2c4a9ca6bf43fb62f6bddd5c26b055e6b91418a22053")
end
add_patches(">=2.20.0 <=2.20.1", path.join(os.scriptdir(), "patches", "2.20.1", "cmakelists.patch"), "fe04ada62d9ed70029c0efb3c04bfec22fc7596bd6b73a567beb964e61ebd82c")

Loading…
Cancel
Save