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

[Libexif] update download location #7344

Merged
merged 4 commits into from
Jul 22, 2019
Merged

[Libexif] update download location #7344

merged 4 commits into from
Jul 22, 2019

Conversation

contre
Copy link
Contributor

@contre contre commented Jul 20, 2019

CI is failing due to the download linked provided in the portfile changing

@MVoz
Copy link
Contributor

MVoz commented Jul 20, 2019

@contre
Copy link
Contributor Author

contre commented Jul 20, 2019

My personal preference would be to actually update the entire portfile to point at github instead since the project has moved there but I'm simply providing this fix because it caused CI to fail on another of my PRs. See https://libexif.github.io/

I'm not sure what that would entail, however, as I do not use this library and don't know what is required for it to be built.

@MVoz
Copy link
Contributor

MVoz commented Jul 20, 2019

vcpkg_download_distfile(ARCHIVE
    URLS "https://github.com/libexif/libexif/archive/e50f382aef6c006889602b2bbb03cf0634318f2b.zip"
    FILENAME "libexif-master.zip"
    SHA512 2658fed1a6994a641ef7c7a02cf1d9a92dda2ccc7a729690a029a42c6bf1d7d2171cd4da1b7a54c85ca61609896f36cdb714f6253aeb1c4c6a2f299c68398feb
)

vcpkg_extract_source_archive_ex(
    OUT_SOURCE_PATH SOURCE_PATH
    ARCHIVE ${ARCHIVE}
)

delete in CMakeLists.txt libexif/_stdint.h

test x64 windows dynamic

@@ -1,4 +1,4 @@
Source: libexif
Version: 0.6.21-1
Version: 0.6.21-2
Homepage: https://sourceforge.net/projects/libexif/
Copy link
Contributor

Choose a reason for hiding this comment

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

The new homepage: https://libexif.github.io/

Copy link
Contributor

@myd7349 myd7349 left a comment

Choose a reason for hiding this comment

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

diff --git a/ports/libexif/CONTROL b/ports/libexif/CONTROL
index d99eb31b..e37d0960 100644
--- a/ports/libexif/CONTROL
+++ b/ports/libexif/CONTROL
@@ -1,4 +1,4 @@
 Source: libexif
-Version: 0.6.21-1
-Homepage: https://sourceforge.net/projects/libexif/
+Version: 0.6.21-2
+Homepage: https://libexif.github.io/
 Description: a library for parsing, editing, and saving EXIF data
diff --git a/ports/libexif/portfile.cmake b/ports/libexif/portfile.cmake
index 0442d8c1..e348cbf0 100644
--- a/ports/libexif/portfile.cmake
+++ b/ports/libexif/portfile.cmake
@@ -4,15 +4,13 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
     message(FATAL_ERROR "libexif currently only supports being built for desktop")
 endif()
 
-set(LIBEXIF_VERSION 0.6.21)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libexif-${LIBEXIF_VERSION})
-
-vcpkg_download_distfile(ARCHIVE
-    URLS "https://freefr.dl.sourceforge.net/project/libexif/libexif/${LIBEXIF_VERSION}/libexif-${LIBEXIF_VERSION}.tar.bz2"
-    FILENAME "libexif-${LIBEXIF_VERSION}.tar.bz2"
-    SHA512 4e0fe2abe85d1c95b41cb3abe1f6333dc3a9eb69dba106a674a78d74a4d5b9c5a19647118fa1cc2d72b98a29853394f1519eda9e2889eb28d3be26b21c7cfc35
+vcpkg_from_github(
+    OUT_SOURCE_PATH SOURCE_PATH
+    REPO libexif/libexif
+    REF libexif-0_6_21-release
+    SHA512 aecba54eb9c8b4ce29d11985a547074b381d72027b563c7aef865852b661a6f18a258c748fca6b16198344f4a86568b658071ac95cc1d332f576c6160e1f257d
+    HEAD_REF master
 )
-vcpkg_extract_source_archive(${ARCHIVE})
 
 file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
 file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.cmake DESTINATION ${SOURCE_PATH})

@myd7349
Copy link
Contributor

myd7349 commented Jul 21, 2019

Create a file _stdint.h, and the file contents:

#include <stdint.h>

and add this line to portfile.cmake:

file(COPY ${CMAKE_CURRENT_LIST_DIR}/_stdint.h      DESTINATION ${SOURCE_PATH}/libexif)

I think this should make things work out.

@myd7349
Copy link
Contributor

myd7349 commented Jul 21, 2019

vcpkg_download_distfile(ARCHIVE
    URLS "https://github.com/libexif/libexif/archive/e50f382aef6c006889602b2bbb03cf0634318f2b.zip"
    FILENAME "libexif-master.zip"
    SHA512 2658fed1a6994a641ef7c7a02cf1d9a92dda2ccc7a729690a029a42c6bf1d7d2171cd4da1b7a54c85ca61609896f36cdb714f6253aeb1c4c6a2f299c68398feb
)

vcpkg_extract_source_archive_ex(
    OUT_SOURCE_PATH SOURCE_PATH
    ARCHIVE ${ARCHIVE}
)

delete in CMakeLists.txt libexif/_stdint.h

test x64 windows dynamic

It seems that _stdint.h is referenced in this file: https://sourcegraph.com/github.com/libexif/libexif/-/blob/libexif/exif-utils.h#L32

@contre
Copy link
Contributor Author

contre commented Jul 21, 2019

While not ideal, I agree that that is probably the easiest path forward.

I’ve not done much with package creation for vcpkg but I feel like when wrapping something like this where it is based on autotools that it should be different then just throwing in a CMakeLists.txt. I don’t know autotools that well either but it looks like they have setup their configure scripts to handle determining if you have stdint.h or not and creating that _ file during that process.

@vicroms
Copy link
Member

vicroms commented Jul 22, 2019

Thanks @contre for the PR, and @voskrese + @myd7349 for the reviews!

@vicroms vicroms merged commit a97f42c into microsoft:master Jul 22, 2019
@vicroms vicroms self-assigned this Jul 22, 2019
@contre contre deleted the libexif branch August 13, 2019 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants