Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add swig acquire #12697

Closed
wants to merge 4 commits into from
Closed

[vcpkg] Add swig acquire #12697

wants to merge 4 commits into from

Conversation

marekr
Copy link
Contributor

@marekr marekr commented Aug 2, 2020

SWIG is a interface compiler that allows binding C and C++ to scripting languages like Python, Ruby, Tcl and others. It's purely a compile-time tool to generate the bindings agaisnt your code.

I have a future port that will use this however, even end-user applications may find it handy to just vcpkg_find_package_acquire_swig for windows instead of needing a separate system install.

@Neumann-A
Copy link
Contributor

also included in #11208

@MVoz
Copy link
Contributor

MVoz commented Aug 2, 2020

add SWIG_VERSION ?

  elseif(VAR MATCHES "SWIG")
    set(PROGNAME swig)
    set(SWIG_VERSION "4.0.2")
    set(PATHS "${DOWNLOADS}/tools/swig/swigwin-${SWIG_VERSION}")${SWIG_VERSION}
    set(URL 
      "https://jaist.dl.sourceforge.net/project/swig/swigwin/swigwin-${SWIG_VERSION}/swigwin-${SWIG_VERSION}.zip"
      "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${SWIG_VERSION}/swigwin-${SWIG_VERSION}.zip/download"
    )
    set(ARCHIVE "swigwin-${SWIG_VERSION}.zip")
    set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)

@marekr
Copy link
Contributor Author

marekr commented Aug 2, 2020

add SWIG_VERSION ?

  elseif(VAR MATCHES "SWIG")
    set(PROGNAME swig)
    set(SWIG_VERSION "4.0.2")
    set(PATHS "${DOWNLOADS}/tools/swig/swigwin-${SWIG_VERSION}")${SWIG_VERSION}
    set(URL 
      "https://jaist.dl.sourceforge.net/project/swig/swigwin/swigwin-${SWIG_VERSION}/swigwin-${SWIG_VERSION}.zip"
      "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${SWIG_VERSION}/swigwin-${SWIG_VERSION}.zip/download"
    )
    set(ARCHIVE "swigwin-${SWIG_VERSION}.zip")
    set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)

Yea actually that'll be better, done

Comment on lines 349 to 354
elseif(VAR MATCHES "SWIG")
set(PROGNAME swig)
set(PATHS ${DOWNLOADS}/tools/swig/swigwin-4.0.2)
set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.0.2/swigwin-4.0.2.zip/download")
set(ARCHIVE "swigwin-4.0.2.zip")
set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)
Copy link
Contributor

@Neumann-A Neumann-A Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elseif(VAR MATCHES "SWIG")
set(PROGNAME swig)
set(PATHS ${DOWNLOADS}/tools/swig/swigwin-4.0.2)
set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.0.2/swigwin-4.0.2.zip/download")
set(ARCHIVE "swigwin-4.0.2.zip")
set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)
elseif(VAR MATCHES "SWIG")
set(VERSION 4.0.2)
set(PROGNAME swig)
if(CMAKE_HOST_WIN32)
set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download")
set(ARCHIVE "swigwin-${VERSION}.zip")
set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)
set(SUBDIR "swigwin-${VERSION}")
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}")
else()
set(_vfa_SUPPORTED TRUE)
set(URL https://sourceforge.net/projects/swig/files/swig/swig-${VERSION}/swig-${VERSION}.tar.gz/download)
set(ARCHIVE "swig-${VERSION}.tar.gz")
set(HASH 05e7da70ce6d9a733b96c0bcfa3c1b82765bd859f48c74759bbf4bb1467acb1809caa310cba5e2b3280cd704fca249eaa0624821dffae1d2a75097c7f55d14ed)
set(SUBDIR "swig-${VERSION}")
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}")
endif()
set(SOURCEFORGE_ARGS
REPO swig
FILENAME "${ARCHIVE}"
SHA512 "${HASH}"
NO_REMOVE_ONE_LEVEL
WORKING_DIRECTORY "${DOWNLOADS}/tools/swig"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with the #not used path?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test SWIG+ITK for the python bindings or it was using swig provided by the system somehow. Cannot remember anymore. Removed the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't apply your changes as its apparently out of date

@MVoz
Copy link
Contributor

MVoz commented Aug 2, 2020

@BillyONeal

Remove-Item : Cannot remove item D:\downloads\tools\msys2\msys64\usr\bin\msys-2.0.dll: Access to the path

'msys-2.0.dll' is denied.
At C:\agent\_work\1\s\scripts\azure-pipelines\windows\initialize-environment.ps1:46 char:5

@MVoz
Copy link
Contributor

MVoz commented Aug 2, 2020

@Neumann-A

?


   if(CMAKE_HOST_WIN32)
...
       set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}")
...

...\vcpkg\downloads\tools\swig\swigwin-4.0.2\swigwin-4.0.2\swig.exe

enough of this, why so many extra nested folders?
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}")

...\vcpkg\downloads\tools\swig\swigwin-4.0.2

@Neumann-A
Copy link
Contributor

Please fix it if you know how and where. It the strange zip extraction which creates the subfolders. Paths is just a hint where to find it.

@MVoz
Copy link
Contributor

MVoz commented Aug 2, 2020

   if(CMAKE_HOST_WIN32)
...
       set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}")
...

@JackBoosY JackBoosY added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Aug 3, 2020
@Neumann-A
Copy link
Contributor

Can be closed ITK PR was merged.

@marekr marekr closed this Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants